Enemy behavior

I want to fight a lot of enemies at once. Say, 20.

With that many it becomes obvious that OpenBOR's AI is fairly simple and many enemies will walk around the screen following the same paths, sticking together like a mass of sprites.

So what I would like to achieve first is to prevent entities (or rather their body boxes) being able to occupy the same space or pass through another.
Second would be to have enemies and NPC's exhibit some awareness of others and distribute themselves more evenly across the screen. For example, if there are 8 enemies, 4 would try to stay left of the player and 4 right. Or when an enemy picks a new destination, he'll make sure it is not occupied by anyon else. That sort of thing.

Is this achieveable with scripting? If so, can anyone here point me in the right direction?
 
best i could do was to make the AI parameters varied for every entity

@Toranks was able to make them aware of traps and fire.

something like antiwall could make trouble, but my best guess would be to have a script tell the engine to give enemies a "fat value" and some script on enemies look for this value and create a buffer zone accordingly, of course player entities would lack the value...
 
You can script whatever AI you feel like. There are also several native behaviors to play with that can solve bunching if used correctly.

It's also not a problem to give entities physical space. There's even a native space box, but it's set for depreciation and wasn’t supposed to be added at all (the functionality will be handled by a different, more efficient system).

However, that will not work at all like you think it will. Beat em' ep entities don't eskew space because they weren’t smart enough to think of it. They do it because 20 entities on screen unable to pass through each other is completely unworkable from a game mechanic standpoint.

As for AI, I would consult @Bloodbane. He has a lot of experience crafting customized behavior.

DC
 
A script that would scan for all enemy types close to current entity/enemy and would execute a walk anim with velocity to move away.
I have that script to detect how close player is to obstacles and if hes close enough then can execute animation .
Or target script - so you target other enemy and you will force walking so you stand behind the target enemy.
Then You would need another script on top of that to scan if entity is occupying the location where the characters wants to go, if he is - you add like 100 pixels more so he backs off even more.
Its how i would frankenstein it and pick best methods or randomly swap them around .
Its interesting how You want to apply real life behaviour , some stuff will work , some stuff like platforms bumping into each other blocking themselves completely from movement would be a disaster, but other stuff should be interesting to see.
I like how in final fight some enemies are intentionally trying to get behind you to atack from the back. Would be nice in openbor.
 
be nice in openbor.

It's already there, just very subtle due to priority. The default AI has a small chance to designate a "stalker" when 2 or more enemies are on screen. The stalker's pathfinding pattern attempts to get on the far side of the players in relation to other enemies.

The chance is low, and it can switch back to normal behavior as the situation changes. It's not dogmatic like Double Dragon or Golden Axe where they move behind you at all costs. So in most cases you probably never notice it.

Anyway, I don't have any scripts of my own written to force stalking behavior but @Bloodbane's games have a ton. IIRC Utunnel's Golden Axe Remake also has one. Have a look inside those for examples.

DC
 
Back
Top Bottom