Environmental AI
by Robson · in Technical Issues · 12/27/2007 (1:04 am) · 8 replies
Merry Xmas and Happy new year to all.
I am new here and this my first post. This question comes out of my mind that need to be address but me can't find any answer. Hopefully, some of you can give me some options or point me to any link.
Question 1
Will it be possible to incorporate AI into the game world and the environment so when conditions (pre-determine) were met, it trigger an event. If so, it's hard to code?
Thank you for taking time to answer.
I am new here and this my first post. This question comes out of my mind that need to be address but me can't find any answer. Hopefully, some of you can give me some options or point me to any link.
Question 1
Will it be possible to incorporate AI into the game world and the environment so when conditions (pre-determine) were met, it trigger an event. If so, it's hard to code?
Thank you for taking time to answer.
#2
In general, you can give any object AI that it can use to act upon stimuli given to it, if that obect processes information. Finite State Machines are good for that sort of thing.
12/27/2007 (6:39 am)
It really depends on the complexity of what you're trying to accomplish. There are the bare minimum events, like Bryce describes, and then there are complex worlds where a lot of processes can feed off of each other, in which case you could spend a lot of time fine-tuning and balancing.In general, you can give any object AI that it can use to act upon stimuli given to it, if that obect processes information. Finite State Machines are good for that sort of thing.
#3
For example:
Event such as landslide can happen when conditions of deforesting is check. Such event (Landslide) can cause damage to landscape (deface) and player (can be damage to properties owned by player) alike. All this happen in a persistent world.
Again, thank you for taking time to read and commend.
12/27/2007 (9:29 pm)
My bad, should have been more specific.For example:
Event such as landslide can happen when conditions of deforesting is check. Such event (Landslide) can cause damage to landscape (deface) and player (can be damage to properties owned by player) alike. All this happen in a persistent world.
Again, thank you for taking time to read and commend.
#4
Thank you for your offering. Were looking at the number of possibility
12/27/2007 (9:37 pm)
@BrYcEThank you for your offering. Were looking at the number of possibility
#5
Basically, how I would look at doing it (and others probably have better ways) would be to keep track of certain areas that are "at risk" and the trees within those areas. When something happens to a tree, decrement the tree population by one. When the population decreases below a certain threshold, then trigger the event.
The event itself could do a few things: The terrain deformation, for sure, but you don't need the graphics to do the damage. The event would kill off some trees (because they would turn into debris at this point, and the graphical representation could use physics to knock them down or change the model to several branches or a broken tree, etc), decrease the tree population more, and cause damage to anyone who was in the path of the destruction. You can handle that with a container search of the area where the landslide would fall, and then sort that result for players and then deal out damage. That way you don't have a trigger sitting out there eating up cycles as it checks people and events as they pass through it.
Once that's all done, then you can reset the system, deactivate the event (if there's no more possibility of slides), or set a timer for the slide to "go away" and reset to how it was before, waiting for the same conditions to be met again.
That's just off the top of my head, so I'm sure others have better ideas on it, but it's a start... Hope it helps.
12/28/2007 (5:56 am)
@Robson: The terrain deformation is a technical hurdle, but one that doesn't have much to do with the math behind doing this.Basically, how I would look at doing it (and others probably have better ways) would be to keep track of certain areas that are "at risk" and the trees within those areas. When something happens to a tree, decrement the tree population by one. When the population decreases below a certain threshold, then trigger the event.
The event itself could do a few things: The terrain deformation, for sure, but you don't need the graphics to do the damage. The event would kill off some trees (because they would turn into debris at this point, and the graphical representation could use physics to knock them down or change the model to several branches or a broken tree, etc), decrease the tree population more, and cause damage to anyone who was in the path of the destruction. You can handle that with a container search of the area where the landslide would fall, and then sort that result for players and then deal out damage. That way you don't have a trigger sitting out there eating up cycles as it checks people and events as they pass through it.
Once that's all done, then you can reset the system, deactivate the event (if there's no more possibility of slides), or set a timer for the slide to "go away" and reset to how it was before, waiting for the same conditions to be met again.
That's just off the top of my head, so I'm sure others have better ideas on it, but it's a start... Hope it helps.
#6
Will all these possible in a pseudo assisted game world where some dungeons, NPCs, forest, minerals are placed in assisted manner?
Again, thank for your reply and have a happy new year.
Also, happy new year to all.
12/30/2007 (6:12 pm)
Thank you for your insideful commend, Ted. This lead me to another question :Will all these possible in a pseudo assisted game world where some dungeons, NPCs, forest, minerals are placed in assisted manner?
Again, thank for your reply and have a happy new year.
Also, happy new year to all.
#7
12/30/2007 (9:18 pm)
@Robson: It shouldn't matter how content gets into the game, as long as you track it in the ways that the game systems can see, and there are ways to balance it out so that those environmental events can actuall transpire (or else there's no point having them there in the first place). If the content is placed by users, then you need to put in place whatever guiding mechanisms would be deemed necessary to protect the balance of the game. If the content is generated, those guiding mechanisms would be internal to the game itself. Hope that makes sense.
#8
12/30/2007 (9:49 pm)
Thank you Ted. Off for new year party. Good day to all
Torque Owner Bryce
Tactical AI Kit
If you mean conditions like being shot at or being damaged, that can also be done easily. Whenever the AI player 'thinks,' it can compare its previous damage from its current damage to decide if it has gone down, and then perform a set of commands. A state machine is not very difficult to program, and usually works best for these purposes. Again, I can give you a hand.
Hope this helps