Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  RTS AI  (Read 7040 times)
0 Members and 1 Guest are viewing this topic.
Offline lhkbob

JGO Knight

Medals: 32

« Posted 2008-03-07 20:12:28 »

I have had very little experience in game AI and I've been struggling to come up with a good framework for AI for a real-time strategy game.
So far the best I could do would be to have StimulusProducers and Reactors, where a soldier in the game would be a reactor and would know how to handle various stimuli.  I envisioned UI actions and orders as being a type of StimulusProducer.  It is slightly more complicated than that, but its a little hard to describe everything in my head.

My concern with the above approach is that it would involve too many checks and calculations to generate the stimulus for each soldier, especially if I want to have 500+ units running at the same time.

My goal is to have something that can handle dynamic terrain and to modify the terrain themselves (ie break through glass or doors if they're in a rush to get through), to be able to find realistic cover, and to behave tactically as squads of troops. 

Perhaps these goals are a little far-fetched for the scale I'm interested in, but any ideas, pointers, or links would be much appreciated.


Offline SimonH
« Reply #1 - Posted 2008-03-07 21:34:31 »

Good luck!

Some good AI stuff here.

People make games and games make people
Offline CommanderKeith
« Reply #2 - Posted 2008-03-09 05:09:01 »

Make it multiplayer, then you don't even have to bother with AI!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lhkbob

JGO Knight

Medals: 32

« Reply #3 - Posted 2008-03-10 14:06:36 »

Multiplayer was going to be a large part, but even then I wanted the soldiers to behave semi-intelligently when pathing around.  The tricky thing is that the game is set in an urban environment, so squad behavior is important for troops left alone by the player.  I don't want the ai to do too much for the player, but enough so that the player doesn't have to micro-manage everything.

The website looked interesting but was a little hard to delve into.  When I have more time, I'll check it out in more detail.

Offline JAW

Senior Devvie

Medals: 2

« Reply #4 - Posted 2008-05-09 13:31:45 »

I think it is well possible and not the hardest thing to do. Sure its not easy, but its possible. The problem is knowledge. I've read 3 books about game AI and have some ideas how to do it. But you cannot just type it in a few words. So I will rather tell you, there are ways to do this, but you will have to learn a lot about game ai.

The idea is very good alredy. A stimulus, or trigger, or event, influences the soldiers. One important rule is, that the event makes it self known to all objects in the area of effect, and not that all objects query for events in their sourrounding. But I do not see player actions as a stimulus in that way. The player gives rather high level targets, like attack that enemy, move to that position. The AI must break it down into simple actions like fire a shot or move north 1 field.

Dynamic terrain and pathfinding, finding cover, acting as squad, everything is possible and has a lot of solutions.


I read the first three editions of AI Game Programming Wisdom, and they cover a lot of such stuff. But they arent exactly cheap. Quite some of the articles are also available freely in the web, but you have to find them.

If you have more specific problems or questions I can maybe give a better help.

Offline lhkbob

JGO Knight

Medals: 32

« Reply #5 - Posted 2008-05-12 04:02:01 »

Sorry about the delay.  In the time period between now and my original post, I have done some rethinking of the idea.  My concern with the current one is that it doesn't seem computationally efficient for large groups of soldiers, but here goes the concept:

Instead of stimulus based, it is primarily goal based.  Soldiers have some amount of goals, which could include: complete orders, run in fear, attack spotted enemy, etc.  The goal would delegate to intermediate classes that would handle fulfilling that goal for a particular type of soldier (ie tactics might change if it had different weapons, etc).  Depending on the situation, goals can have multiple soldiers assigned to completing them, in which case the goal would ideally organize them to fulfill it more efficiently.  As soldiers interact with the world, stimulus are generated and can then affect soldiers.  Incoming stimulus have the ability to be ignored, affect variables such as morale, or turn into a new goal (such as when you give an attack move order and soldiers see an enemy, that stimulus creates a kill X goal, and once complete, the move goal returns into affect).

I haven't written any code yet since my game isn't at that stage yet, so this is purely hypothetical.

Pages: [1]
  ignore  |  Print  

EgonOlsen (59 views)
2018-06-10 19:43:48

EgonOlsen (41 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (240 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!