Skip to main content
gamedev.net
🔒 Locked

AI Continuity

Started by Yanroy Nov 7, 2000 at 12:24 PM 1 replies 650+ views
Original Post
Yanroy
Yanroy
I have discovered a (potential) problem with my AI. Despite the fact that I have not written most of it yet, how do I make it decide on one course of action and stick to it? It is called every frame, so what is to stop it from sending out an attack party, which changes the AI inputs, which causes it to reconsider and call back the attack force, which makes it go back to square one and send it out again.... Even if it doesn''t get caught in a loop like this, it may end up attacking one structure, and because the enemies retaliate, it attacks a different one, so it never actually kills anything. My game is a normal top-down RTS in space (kinda like a 2D homeworld ) --------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor
MikeD
MikeD
It''s all in the heuristics.
You''ve got some heuristics right and they tell each AI agent what to do when they''re running around the gaming world. If you''ve got a set of heuristics to decide what the individual should do in a situation based on their current health, their stats and the objects around they could attack then you really shouldn''t be weighting them so that an individual thinks "I''m well hard with health 100%, I can attack that castle on my own. Ouch, I got hit and I''m now on 90% health, I best run away".
This just isn''t a sensible heuristic for an agent to have.
Make sure they pick targets they can overcome alone or as part of an army and make sure they''re targets that they think they can take with x% less health. Also, if you don''t wan''t an agent to change it''s mind you can either make them update their ''general'' decision making state every x seconds rather than each frame (which, let''s face it, is unnecessary) or you could put a minimum limit on health they have to lose before they can change their mind about attacking.

Just give them simple criteria for what they can attack in a given state, a delay before they can reasses the situation again and limit the circumstances before they can change their minds.

You could even, though everyone seems against it, let them run battles against themselves and adjust the heuristics towards an optimal solution using GA''s.

That help or hinder? ;-)

Mike
bishop_pass
bishop_pass
Do what people do. They evaluate their own actions. How many times have you caught yourself waffling back and forth on a decision and then realized it was silly and you were accomplishing nothing?

Your agent needs to be aware of what it did two seconds ago. In general, if an agent keeps changing its mind, it must be because either it has insufficient information, in which case it should stand back and take the cautious route, or it should create a goal to obtain more information to better solve the problem.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.