Stop enemies from converging?

aL BeasTie

Well-known member
Is there anyway to stop enemies from converging and overlapping each other?

I need enemies that chase, but if I spawn more than one they always end up converging to the same point and overlapping. 

Is this maybe because I haven't added z value to any bbox's?
 
That's the nature of chase. If you don't want to converge, either you set different speed or give some distance between them.

BTW we are talking same enemies or different ones?
 
Yeah I can kinda help prevent it to a degree by setting different speed and aggression, and mucking around testing different spawn locations.  But it's what I'm trying to avoid.  It takes so much testing and hard to predict what players will actually do/go.

 
Been trying to experiment again and try to get my enemies not to do this so badly...

The best I can get so far is enemies will still converge on the same spot, but with some of these settings they will move a little bit between attacks, so they will attack, move backwards or too the side a bit before attacking again. This gives a small effect of them in groups with less stacking, but I would like to improve it.


- Random speed script helps a bit... (for walk speed)
- limiting enemies attacks using MP costs
- adjusting aggression ( to you find that 'Goldilocks zone' where they still attack)
- aimove, setting chase and wander plus limiting attacks with MP, (even forcing idle anim or other after attacks)


Anyone else have any methods or suggestions?

Really just need to stop enemies just trying to always be on player's x axis. when your busy with one enemy the others could be flanking you, attacking from behind etc.

Another problem is range, you give shooting enemies a range they can attack, they will all line up on the same spot in the exact range, even thou we have min/max range set the AI seems to want to be at this max distance, or run up and shoot you in the face.
 
Coding new walk AI might be a way but that would be complex.

To prevent enemies from converging, it's best to avoid spawning same type of enemies in the first place. Combining enemies who naturally have different walk speed, walk AI and attack range really helps.
 
Been trying to experiment again and try to get my enemies not to do this so badly...

The best I can get so far is enemies will still converge on the same spot, but with some of these settings they will move a little bit between attacks, so they will attack, move backwards or too the side a bit before attacking again. This gives a small effect of them in groups with less stacking, but I would like to improve it.


- Random speed script helps a bit... (for walk speed)
- limiting enemies attacks using MP costs
- adjusting aggression ( to you find that 'Goldilocks zone' where they still attack)
- aimove, setting chase and wander plus limiting attacks with MP, (even forcing idle anim or other after attacks)


Anyone else have any methods or suggestions?

Really just need to stop enemies just trying to always be on player's x axis. when your busy with one enemy the others could be flanking you, attacking from behind etc.

Another problem is range, you give shooting enemies a range they can attack, they will all line up on the same spot in the exact range, even thou we have min/max range set the AI seems to want to be at this max distance, or run up and shoot you in the face.
the best thing would be to have enemies change attributes everytime they are hurt, 'think" or while getting up -
so you will need a good script to change these attributes at random:
AI move combos - make them do chasex or chasez, avoid x or avoid z, combined with normal , wander (as far as i unrestand , Openbor can only give 2 of these to characters
----- example dont know if characters can have avoidx, chasey & wander at the same time
agression - do a range of agrr numbers & have the code choose a value from that range - same with these next
attack trottle
offence
defence
speed

and last, i experimented giving entities ramp/platform atributes, so they don't clump - the best method was using ramp to give these entities a pyramid type shape as much as i could, but it is a pain in the butt to have every animation be a ramp or platform....

well, don't forget to share if you manage to randomize those

warning , - games get really hard - and you have to find a way for wanderers to stay on the screen and not wander off offscreen for too long or too far
-
I was thinking if there was a way to override screen limits (subject_to_screen) but only for wanderer entitities, to give them a buffer off screen of about 50 to 60 pixels (subject_to_screen+100)
 
Yeah changing states after they are knocked down is what I've been doing. Like footclan enemies when knocked down in tmnt will randomly switch weapons or use evasive moves like backflip to get away from you.

In another mod I'm trying to simulate something like a basic action turn based type combat. So you and enemies limited by action points, (just using MP) not just for attacks but also for movements like walking and running. I'm trying to make them always go to this 'thinking' state like you said after performing actions, but I'm finding you get a lot of weird things happen when you limit enemies with MP like this...

It works as you would expect for the player. They have a small amount of MP, walking and running drains MP over time, attacks instantly use 50-100% MP. The MPregen is set to be fairly fast, so it doesn't take that long before you can move or attack again.

But the enemies don't seem to behave as I expected. I just want them to go into an idle animation while they regen mp than they should be allowed to walk or attack again. But I seem to have to mess around with the mp settings a lot more and change the aggression settings to get them acting normally again.

I'm not sure if 'mpset' works properly or is actually intended for enemy types, but it doesn't seem to work the same for them, or MP has issues with enemies
 
@aL BeasTie -
so in that case you also need some script to detect your current MP- inside ondraw script? -- (hjust make sure its checked constantly somehow) if its too low have the character go into an special animation instead of "idle" checking for mp level each frame or every 2 frames - if MP reaches desired level - change ai move combo, speed, etc, etc attributes

this mp check & switch could also be added to walking animation, so the has a change to get away if you get close

maybe this MP "idle charge script" might be all you need , and anim rise or anim pain "switchers" as additional triggers
 
one more thing...

maybe instead of them doing a mp charge animation, have them do a reverse sneaky or defensive walking away - combine this with random reduction of speed on a range from 0 to 18 % and if zero swicth it to Idle mpcharge
 
Back
Top Bottom