Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Help with Dark AI attacking

Author
Message
DarkJohn20
15
Years of Service
User Offline
Joined: 11th Apr 2009
Location:
Posted: 13th Sep 2009 00:30
I have DarkAI and I wanted to make some sort of large scale battle. I do not need any help with much as I have been learning it for a couple of days.

The only problem I have run into is how to make everyone attack.

I have looked at the examples and demos, one which shows beams which I think represent bullets. I did not understand this method so I was wondering if anybody could explain their way on how to do it.

My goal is to have everybody start with x health, perhaps stored in an array, and have enemies be able to hurt eachother.

If more info is needed please ask.

Thank you
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 16th Sep 2009 18:51
Dark AI can be used to make so many different varieties of game that there is no specific attack command.

you use the commands in the application to determine if an attack can be performed and then use your own code to make the attack. EG. In a shoot em up, you use Dark AI to identify an characters targets, get distance, move them to cover, check they can see etc. If all the paramaters are right, then you would run a "shoot" function for that character.

I'd advise you write your AI in states, storing each character's state in an array.
use a separate function for finding targets and keep it out of the AI states. I have a you tube video somewhere showing DAI to create massive gunfights and zombie battles...

I want robotic legs.
feiting shadow
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 18th Sep 2009 22:02
hah, I love your tags Butter.

I'm gonna look for that engine that let you write that gunfight. That's amazing and has huge minigame capability! Is it open?

Signed
------
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 19th Sep 2009 03:56
I have to add one thing, there is a memory leak in the command giving the Entity's action in string formats making them unusable, that is the "Ai Get Entity Action$" command.

Try add this to your code if you use the "Ai Get Entity Action$" command:


Maxes out the memory in seconds and crashes the program.

"Ai Get Entity State$" seems o.k though.

Regards
DarkJohn20
15
Years of Service
User Offline
Joined: 11th Apr 2009
Location:
Posted: 26th Sep 2009 18:45
Butter, I guess what I meant was could you give a little example on how to do that. I don't necessarily need a demo program, but just a little example.
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 6th Oct 2009 11:36
Quote: "I'm gonna look for that engine that let you write that gunfight. That's amazing and has huge minigame capability! Is it open?"

LOL, sure it's open.... its DBP.


Quote: "Try add this to your code if you use the "Ai Get Entity Action$" command:

for i = 0 o 1000
Action$ = Ai Get Entity Action$( EntityID )
next

Maxes out the memory in seconds and crashes the program.

"Ai Get Entity State$" seems o.k though."

The entity action doesn't change every single update though, you probably only need to call it every now and again, so obviously calling it 1000 times every update is going to screw things up.

DarkJohn20
Hey dude, sorry for the long time to reply, I forgot I posted here. I will try and dig out the source code for the stuff in that video, it's very very messy but the AI should be cool.

I want robotic legs.
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 7th Oct 2009 04:02
Quote: "you probably only need to call it every now and again, so obviously calling it 1000 times every update is going to screw things up."


Some misunderstanding, you don't have to call it 1000 times a loop

I mean regardless of how you use the command it will cause a memory leak.
To show the memory leak you can call the command 1000 times a frame so it runs out of memory faster just to illustrate the bug.

If you call "AI Get Entity Action$" every frame you will loose memory at a rate of aprox. one megabyte / second, your program will eventually eat up all memory and crash.
I recommend not using it at all.

Regards
DarkJohn20
15
Years of Service
User Offline
Joined: 11th Apr 2009
Location:
Posted: 9th Oct 2009 04:00
Thanks Butter, I forgot about this thread as well as I have been doing so many other things. I'll work on those until you have an example handy!

Login to post a reply

Server time is: 2024-11-24 17:46:28
Your offset time is: 2024-11-24 17:46:28