• Advertisement
  • entries
  • comments
  • views

Environemnt agents come to the rescue

Sign in to follow this  


In the previous posting ServantOfLord mentioned, that water could be interact with objects like torches. From a technical perspective it comes down to checking masses of objects. In the past I already thought about how to implement such a massive check in a real time game like gnoblins. One thought was, that torches run out of fuel or that plants/mushrooms grow over time and invade parts of the level, that lava destroys the environment and modifies the ground etc.
In fact it is an environment simulation, and a quite large one. A level in goblins could have up to 40.000 passive objects and up-to 4.000.000 mushrooms and plants on the ground. Even if you only utilize 10% of this, it would be 4.000 objects and 400.000 plants.

So, what are the requirements and limits of such a simulation system ?
1. It should not try to update the whole level at once.
2. It should utilize multiple cores.
3. It should not be time-critical, a more relaxed approach would help a lot.
4. The user should be able to choose the update speed of such simulation.
5. The game design should be robust when regarding the speed of the simulation and the out-come of the simulation.

The basic idea I have is to add environment agents, objects which are like any other standard object, but are invisible and static. Each environment agent will grab an area of the level, analyses and modifies it. As every object in gnoblins, each object is able to execute its AI logic concurrently. I utilize this by adding 1 to 100 environment agents (player can choose). More agents will result in faster simulation.

This sounds interesting:
1. A light source is close => grow some plants
2. A water source is close => grow some mushrooms
3. The water level is to high => damage furnitures, turn off torches

But I need to keep in mind, that when running as low as 20 FPS and with only a single environment agent, you would update each tile in the worst
case every 3 1/2 minutes. Okay, with some optimizations (analyse multiple areas per agent, use at least 3 agents), you could bring the update interval down to 10-15 seconds which sounds okay.
Just don't expect that a little drop of water, once it touches a torch, will destroy it instantly. But this is something I can live with.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement