Using spring for a-life/multiagent simulation?
Moderator: Moderators
Using spring for a-life/multiagent simulation?
I'm sure the idea has been kicked around; did anyone ever mess with this? Seems like Spring + LUA (for basic agent scripting) could be useful here. Haven't done any real spring dev though, so I dunno.
Re: Using spring for a-life/multiagent simulation?
I have no experience of such, but it definetly sounds awesome.
Re: Using spring for a-life/multiagent simulation?
Sounds like something that would benefit world builder immenseley if not as an open library for mapmakers and game devs
Re: Using spring for a-life/multiagent simulation?
lack of multithreading support would be a disadvantage; could be worked around via custom skirmish AI, though.
Re: Using spring for a-life/multiagent simulation?
depends on the level of complexity required, for a prototype I dont think multithreading is required
Re: Using spring for a-life/multiagent simulation?
I imagine con vehs automatically making mexes and flashes that are guarding them stand in FRONT of them, not behind.
Re: Using spring for a-life/multiagent simulation?
All fine and dandy until you come to the pitfall of how do you define the front and back programmatically?danuker wrote:I imagine con vehs automatically making mexes and flashes that are guarding them stand in FRONT of them, not behind.
Re: Using spring for a-life/multiagent simulation?
I would define front as the location nearest to the enemy base.
The enemy base is an average of all buildings (if there are any) or of units, or manually overridden.
Or maybe the furthest from the ally base.
But that's the point of a-life, to figure that out, right?
I might be thinking about too complicated algorithms.
The enemy base is an average of all buildings (if there are any) or of units, or manually overridden.
Or maybe the furthest from the ally base.
But that's the point of a-life, to figure that out, right?
I might be thinking about too complicated algorithms.
Re: Using spring for a-life/multiagent simulation?
Too many flaws, such as what if your surrounded in a ffa? Or what if your mex is on the front and theres enemies tot eh north and south and a big base tot he west? Obv youd defend north n south not west because thats the biggest threat.
What once seemed like a simple solution quickly spirals out of control and complexity =p
Instead of averaging the buildings and units, weight the units on a threatmap, where threat is adjusted for proximity. Then average out the map to find the position based on the weights. Much better algorithm. Still not perfect though.
What once seemed like a simple solution quickly spirals out of control and complexity =p
Instead of averaging the buildings and units, weight the units on a threatmap, where threat is adjusted for proximity. Then average out the map to find the position based on the weights. Much better algorithm. Still not perfect though.
Re: Using spring for a-life/multiagent simulation?
Cool! If the unit has been seen, also take its firepower/health into account.
Would be awesome to have the units auto-intercept incoming radar blips.
On more features, I guess that would turn out into an entire AI, letting the player just watch.
Would be awesome to have the units auto-intercept incoming radar blips.
On more features, I guess that would turn out into an entire AI, letting the player just watch.
Re: Using spring for a-life/multiagent simulation?
What defines a-life/multiagent simulation? Is it some sort of AI that works on unit level and not team level? Considering the level of control over units that was had by AI's dll for years, and by Lua AI more recently, I don't see what would make Dragon45's idea impossible.Dragon45 wrote:I'm sure the idea has been kicked around; did anyone ever mess with this? Seems like Spring + LUA (for basic agent scripting) could be useful here. Haven't done any real spring dev though, so I dunno.
Re: Using spring for a-life/multiagent simulation?
- 1. write a skirmish AI and name it "Agent"
2. make it able to send/receive messages to/from other instances of itself
3. define a performance measure that it should optimize
4. have it coordinate its actions with other Agents via message exchange
5. ???
6. profit from your MAS!
Last edited by Kloot on 04 Mar 2009, 22:18, edited 1 time in total.
Re: Using spring for a-life/multiagent simulation?
It's possible, it could be hard to develop - Depends how far you want to go with it, on the plus side you have a lot done for you, but at the same time you have to get to know springs insides quite well.
An Alife simulation is very trial an error getting behaviours correct, so you'd prob have to produce your own custom UIs to manipulate variables for both development and the final product, else it would take ages to develop what with having to restart spring all the time, visualising the data could be hard, maybe make something with lua, logging data you want is probably quite easy. A very good feature of spring would be the replay feature.
Performance could be an issue though, anything modelling >2-300 agents could have some issues
An Alife simulation is very trial an error getting behaviours correct, so you'd prob have to produce your own custom UIs to manipulate variables for both development and the final product, else it would take ages to develop what with having to restart spring all the time, visualising the data could be hard, maybe make something with lua, logging data you want is probably quite easy. A very good feature of spring would be the replay feature.
Performance could be an issue though, anything modelling >2-300 agents could have some issues
Re: Using spring for a-life/multiagent simulation?
Spring is already a multi-agent simulation. Intermingle 100 flashes, 100 brawlers, 100 slashers, randomly put half of them on opposing teams. Move the brawlers away slowly to one side, set them all to Fire At Will. Watch the fun.
Spring is one of the best/most robust OSS multi-agent engine in existence. It beats some *2D* a-life engines for speed and scale for equal number of entities given the complexity of each agent.
It also has very thorough logging and scripting capabilities.
Few thoughts - Pathfinding is extremely intensive. For sim purposes, how hard to rip out current pathfinder and replace with some stupid algorithm if i can say "all units move in a 50x50 grid only"
Well known is that graphics is intensive; toning down or replacing current graphics engine with some sprite based shit is not easy because of lack of modularity in engine.
Finally, distributed computing - suppose funky thing i did with setup "magic zones" - galactic gate; an agent is moved into a completely different independent simulation (or gene bank)? via such a "zone"; scatter multiple zones in the maps. Script zones in LUA, add message passing between persistent servers running this sim so that they can transfer agents amongst each other in vastly different environments (or same?).
Suddenly distributed computing capabilities which again few other sims have.
Spring is one of the best/most robust OSS multi-agent engine in existence. It beats some *2D* a-life engines for speed and scale for equal number of entities given the complexity of each agent.
It also has very thorough logging and scripting capabilities.
Few thoughts - Pathfinding is extremely intensive. For sim purposes, how hard to rip out current pathfinder and replace with some stupid algorithm if i can say "all units move in a 50x50 grid only"
Well known is that graphics is intensive; toning down or replacing current graphics engine with some sprite based shit is not easy because of lack of modularity in engine.
Finally, distributed computing - suppose funky thing i did with setup "magic zones" - galactic gate; an agent is moved into a completely different independent simulation (or gene bank)? via such a "zone"; scatter multiple zones in the maps. Script zones in LUA, add message passing between persistent servers running this sim so that they can transfer agents amongst each other in vastly different environments (or same?).
Suddenly distributed computing capabilities which again few other sims have.
Last edited by Dragon45 on 05 Mar 2009, 03:40, edited 1 time in total.
Re: Using spring for a-life/multiagent simulation?
i am too damn tired for funk branstaorm
want time to do this, want clone self one half do this shit
want time to do this, want clone self one half do this shit
Re: Using spring for a-life/multiagent simulation?
That scenario isn't a multi-agent sim, there's barely any autonomy and you're controlling their movements lol. Multiple AIs each with a single unit would work as an example of a spring multi-agent system.Dragon45 wrote:Spring is already a multi-agent simulation. Intermingle 100 flashes, 100 brawlers, 100 slashers, randomly put half of them on opposing teams. Move the brawlers away slowly to one side, set them all to Fire At Will. Watch the fun.
You can't say this without having an actual multi-agent/Alife sim implemented. Most units in spring have a very limited view and spend the majority of the time with few units within their view to actually interact with, only collision detection with friendlies and turret position + maybe basic movement with an enemy on the screen. Even then, not much is done with the turret - with many enemies on the screen surrounding a unit the turret usually gets confused and spends most of its time moving rather than shooting.Dragon45 wrote: Spring is one of the best/most robust OSS multi-agent engine in existence. It beats some *2D* a-life engines for speed and scale for equal number of entities given the complexity of each agent.
Start making units more aware of their surroundings and give them some complex behaviours and suddenly your CPU is dead.
Dragon45 wrote: Few thoughts - Pathfinding is extremely intensive. For sim purposes, how hard to rip out current pathfinder and replace with some stupid algorithm if i can say "all units move in a 50x50 grid only"
Pathfinding is useful, don't know why you'd rip it out, I think planes use a more simplified pathfinding, maybe use plane movement.
Dragon45 wrote: Well known is that graphics is intensive; toning down or replacing current graphics engine with some sprite based shit is not easy because of lack of modularity in engine.
Custom maps and models, quickly eliminate this problem. The limits are going to be CPU based though, changing the graphics won't do anything as most graphics cards are pretty powerful anyway. Just don't have water/shadows.
I vaguely see what you're saying, would be interesting to see something like this but it would likely be easier to add this to your own custom sim than it would be for spring. Issues would be how do you make unit A on the edge of zone A on server A be aware of units B, C and D on the edge of zone B on server B and vice versa. FOV would be overlapping between zones of different servers which is a difficult problem.Dragon45 wrote: Finally, distributed computing - suppose funky thing i did with setup "magic zones" - galactic gate; an agent is moved into a completely different independent simulation (or gene bank)? via such a "zone"; scatter multiple zones in the maps. Script zones in LUA, add message passing between persistent servers running this sim so that they can transfer agents amongst each other in vastly different environments (or same?).
Suddenly distributed computing capabilities which again few other sims have.
Re: Using spring for a-life/multiagent simulation?
They're far more expensive than anything else, when you factor in the rest of their sim code.I think planes use a more simplified pathfinding, maybe use plane movement.
They have "AIs", but they're extremely simplistic and specialized. The good news is that you could just do it in Lua, and I suspect that if you don't make them make decisions very often, it'll work just fine.Multiple AIs each with a single unit would work as an example of a spring multi-agent system.
Only in *As. In P.U.R.E., units see a lot further, and often have to deal with crowds. And yes, that's CPU-intensive.Most units in spring have a very limited view and spend the majority of the time with few units within their view to actually interact with, only collision detection with friendlies and turret position + maybe basic movement with an enemy on the screen.
It's not like you have to build some custom blitting engine, when OpenGL is already hardware-accelerated and is going to be faster than whatever you'd hack together anyhow.Well known is that graphics is intensive; toning down or replacing current graphics engine with some sprite based shit is not easy because of lack of modularity in engine.
I mean... use point sprites against a black quad, don't draw the map at all. It's about as cheap as any other method, and it's already there in the engine, or could be added as a special case, if you don't even want the minimal Lua overhead for doing that part via Lua (which is probably smart, since that's a non-frame-bound activity). You could probably gut the part that sends the geometry to the fragment program and just draw a colored quad right there. Since the other extant sections would be dealing with tricounts of zero, it's not like they eat up a lot of CPU anyhow. Not hard.
Overall, I'm less skeptical about this idea than I was about the proposal to make a Spore clone, but I think that Spring's mainly un-suitable for serious purposes in that genre, and you vastly overestimate its efficiency.
If you just want to work on self-directing agents, do it in Lua- that's something I'm actually interested in, but have no time to develop atm. It's not terribly hard, to build simple behaviors- the challenge is coming up with the relationships between items- "this is food", "this is a scary predator", etc., and make it all come together- not a minor task. I'd be more than happy if somebody ever implemented basic flocking algorithms and other basics of sim, though, to better-regulate "herds" of animals in a context like World Builder, and built group-signaling code that told "herds" to initiate common behaviors ("now it's time for all of us to spread out and munch some grass", etc.) where I'd like to see organic stuff moving around in a way that at least looked purposeful.
Re: Using spring for a-life/multiagent simulation?
No FOV; no awareness. Just straight transportation/mpsouledge wrote:I vaguely see what you're saying, would be interesting to see something like this but it would likely be easier to add this to your own custom sim than it would be for spring. Issues would be how do you make unit A on the edge of zone A on server A be aware of units B, C and D on the edge of zone B on server B and vice versa. FOV would be overlapping between zones of different servers which is a difficult problem.
Re: Using spring for a-life/multiagent simulation?
argh - what's missing in the LUA for this to happen? i thought most of these primitives were already in place.
Re: Using spring for a-life/multiagent simulation?
Port JADE into the java ai module for spring.