java - Artificial Intelligent patterns in an RTS environment -


this appears popular topic, question rather specific. if has been addressed before, please feel free point me articles.

i'm designing ai game rts (real time strategy). player against ai, acting general, commanding various soldiers in live-time (not turn based) arena. now, other ais i've seen focus on each soldier having it's own ai. i'm looking ai general, directs soldiers towards various goals. eg go there, attack this, this, etc

in turn-based game, easy enough analyse field, , act on it, issuing orders. however, in live-time environment, not case. i've setup delay, every 3 seconds ai re-analyses situation, because don't want happening 60 times second (60fps). there better way deal this?

another issue have ai may see situation needs addressing, , issues "orders" troops "go location x". on next cycle/iteration of ai (after 3 seconds), if soldiers have not yet reached goal, best approach keeping track of orders , seeing completion status? eg: "ai: 20 soldiers need moved position x position z. move now, oh wait, did last time, wait them".

the key points are: - frequency of "analysing" field - keeping track of previous "orders" - ai general overseeing soldiers, , not soldiers themselves

any thoughts?

many or pointers can offer.

j

here's approach:

the ai should independent of frames per second, think approach event-driven algorithm.

so general invest amount of time @ beginning calculate it's long term strategy , transforms atomic commands soldiers (tactics).

now 3 things may happen:

  • a soldier finishes command (by completing it).
  • a soldier sends feedback general (event). events may either generic or specific given command. @ point general updates it's state (knowledge of game) , rethinks it's long term strategy. not have cancel , give command soldier can @ point if long term strategy requires so.
  • the general changes long-term strategy other factor not feedback soldier (timings, dynamic changes on difficulty, game time, actions or score other player...). same applies previous point. general may consider cancelling / assigning new commands soldiers.

note general may think in background thread and/or use spare cpu time between frame , frame.

soldiers must able accomplish atomic commands without involving general @ all. ie: know are, know have go, next step better suits. ie2: know enemy still alive keep shooting until dead , report general (goal completed). ie3: keep shooting live reaches critical value, report general (and keep shooting until given further orders).


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -