PDA

View Full Version : Bot positioning


Sourdough35
03-05-2012, 06:08 PM
I want to suggest some ways to improve the bots, mostly to do with how they path and position. In general, the bots don't seem to know or care about positioning. If you have multiple bots and send them to attack something, they all just stack onto eachother in the same space and attack. Obviously, this looks funny. I suggest, if possible, giving the bots some awareness of eachothers' space so that they spread out and maybe encircle a mob when attacking, if possible. This is probably a little easier said than done since the bots will have to consider walls and cliffs, but it seems like it would make them more fun to use.

A similar thing happens when you spawn the bots. They default all to the same following distance, so you end up being followed by this freaky mutant composite of x number of bots all occupying the same space. I have macros set up so when they spawn they each take up a different follow distances, but it might also be cool to allow them to take formations when possible, like cluster behind you, line up behind you, form a v, or even try to walk in front of you when possible.

chrsschb
03-05-2012, 08:49 PM
I don't think we need to concern the bot developer(s) with aesthetic concerns. Yeah it would be cool if the bots made a cute circle but what function does it serve? There are many ways to functionally improve the bots and such improvements are a much better way of spending the developer(s)' time.

Sourdough35
03-05-2012, 09:07 PM
I guess I can agree with that.

bad_captain
03-05-2012, 10:50 PM
I did that when spawning bots and it looked very nice, but because it has to find the best z value for each bot, it becomes very expensive for what it was worth, especially when spawning a full raid. If I saved the code I could post it for others, but I don't think it will get put into the svn.

Sourdough35
03-06-2012, 01:04 AM
I didn't really think about it for Raids. I could see how that would be a disaster for smooth gameplay if 70 something bots were trying to keep eachother's positions in mind.

But what about just including it for a small group or two?

bad_captain
03-06-2012, 11:45 AM
Maybe you could check for the number of bots already spawned and only do it for the first 5 or whatever bots. After that though, you'd just have the congealed mass o' bots we currently have.

I'm sure it would run better on an actual server and not my patchwork 8 year old used to be desktop acting as a server. But if you have a few characters with a few bots each, it would add up fast. Especially it they tried to keep their space at all times.

provocating
03-06-2012, 12:28 PM
Bad Captain I would like to see those changes, maybe for just my server. We are limited to 5 bots so it would really not be expensive for us on resources, plus we are low population.

And while I am here, thanks for everything. We are enjoying all of your recent changes.

Sourdough35
03-06-2012, 12:36 PM
I think I also didn't consider that in a public server, potentially every logged in account could have a number of bots. That could also get bad.

I run my own server just by myself, so unless I ran a bot raid, I wouldn't really ever have more than 5 or so bots. That might be of too limited applicability to warrant changing the code, but I thought it would be pretty cool. Maybe it could be something you could enable or disable based on your server settings.

provocating
03-06-2012, 12:59 PM
It is not a big deal either way. I think all of us have a practical approach to EQ. We are used to mobs dropping from the sky, killing something and the body falling below the terrain. You just get used to the quirkiness of it. EQ is not perfect and does not claim to be.

bad_captain
03-06-2012, 01:20 PM
I'll see if I can find the code and add a rule (default to off). Even if I can't find the code, it shouldn't be too hard to duplicate.

bad_captain
03-06-2012, 01:23 PM
But what I did was for spawning only, mostly so I could view and mouse select any bot I wanted. It would need to be updated for movement, as after they moved, they would be clumped up again.

Regardless, I'll see what I can do.

Sourdough35
03-06-2012, 02:56 PM
provocating, I'm probably just getting greedy then. I do like to try and appreciate the impressive work that's already been done when I can.

vintage51
02-18-2014, 08:14 AM
Sourdough35,

I know this is a old post but I was wandering what command you used to set the follow distance for your bots.

Thx

werebat
02-18-2014, 02:26 PM
#bot setfollowdistance xxxx

xxxx being the number you want to set, i find that increments of 1000 work ok for me, adjust as you see fit. make sure you target the bot first

vintage51
02-18-2014, 08:30 PM
Werebat thanks for the reply :)

skyy
10-11-2015, 05:44 AM
Sorry to necro this old thread, but I would be very interested in the code to make bots spread out a little.
And since I am limiting the bots to 5 per person it shouldnt be too heavy a load.

thanks in advance~

provocating
10-11-2015, 10:58 AM
Yeah, not really good to necro an old thread. But to answer your question, the last I remembered it was in a command.

#bot setfollowdistance xxxx

Uleat
10-11-2015, 03:33 PM
For in-group bots, I usually start at 150, then cumulatively add 50 to each bot thereafter.

Not pretty..but, it does give enough spacing to distinguish them by clicking.


If you're using botgroups, each leader will follow you according to the set distance. But, bots in the botgroup will follow based on the distance to their bot group leader.

skyy
10-12-2015, 03:17 PM
not really what i meant, sorry.

I am looking for a way to not only alter distance but also x/y coordinates by a very small amount to give bots a more natural feel and position when spawned and grouped.

without the user even having to use the followdistance command;

Uleat
10-12-2015, 03:29 PM
More like a formation, then.


I know one of the dev's worked on a formation script (plugins/formation_tools.pl)

But, I don't know if those could be easily adapted for this purpose.


One of the first changes to bots that I'm going to implement is to save the bots follow distance so that it doesn't have to be re-assigned on every spawn.


I've thought about exactly what you're wanting to do..but, haven't developed anything, as yet.

As time allows, I'll see what I can do with this idea.


EDIT: Something like this..but, not so strict: http://ds.heavengames.com/gameinfo/aranna/pix/formstance.gif

skyy
10-12-2015, 03:38 PM
i think it would be highly appreciative by anyone using bots as it just increases the immersion.

also your nice formstance.gif gives me a 403-forbidden, but i can imagine what you tried to show us :)

I was hoping that in the current code there would be a follow function handling coordinates where you could simply tweak a little -- guess my optimism failed me again ;)

Uleat
10-12-2015, 03:52 PM
Oh, wow...

That's a picture of Dungeon Siege's formation bar..they were a little too 'retentive' for my taste though - hence, the not as strict qualifier :D

Furniture
10-12-2015, 03:56 PM
In the past I had the follow command in the source set a random follow distance between X numbers instead of the default value so any time i told them to follow it automatically gave them different distances and it worked very well.

skyy
10-13-2015, 04:26 AM
In the past I had the follow command in the source set a random follow distance between X numbers instead of the default value so any time i told them to follow it automatically gave them different distances and it worked very well.

very nice idea for a quick fix, thanks! :D

would still be awesome if we could manipulate their x/y coords by a small rand factor aswell, i wouldnt even mind a static feel to it -- like a fixed offset by 100 like followdistance just on x/y axis.

Trackye
10-13-2015, 02:23 PM
Out of curiosity...

Uleat you would probably be the best person to answer this.

A rogue backstabs.
There is code allowing the rogue to position itself behind the mob so that backstab is usable.

Lets for the purposes of this example use a clock system so if the mob is on the clock face a rogue has coding to allow it to move to 12 o'clock and attack.

could we implement a check for all other classes too? So that a rogue goes to 12 a ranger goes to 4 a tank class set to taunt and tank goes to 6 else 8 or 2. Something to that effect.

This would cause bots to partially position itself in a group setting


It seems like it would have something to do with this section

if(AImovement_timer->Check()) {
if(!IsMoving() && GetClass() == ROGUE && !BehindMob(GetTarget(), GetX(), GetY())) {
// Move the rogue to behind the mob
float newX = 0;
float newY = 0;
float newZ = 0;
if(PlotPositionAroundTarget(GetTarget(), newX, newY, newZ)) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}
}
else if(!IsMoving() && GetClass() != ROGUE && (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) < GetTarget()->GetSize())) {
// If we are not a rogue trying to backstab, let's try to adjust our melee range so we don't appear to be bunched up
float newX = 0;
float newY = 0;
float newZ = 0;
if(PlotPositionAroundTarget(GetTarget(), newX, newY, newZ, false) && GetArchetype() != ARCHETYPE_CASTER) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}
}


Or
possibly there something to the effect of


float newX = X+(rand, 1 5);
float newY = Y+(rand, 1 5);
float newZ = 0;



I may try to implement this in the format of many if checks for all classes


else if(AImovement_timer->Check()) {
if(!IsMoving() && GetClass() == RANGER && !BehindMob(GetTarget(), GetX(), GetY())) {
// Move the ranger to below coords.
float newX = X+3;
float newY = Y-2;
float newZ = 0;
if(PlotPositionAroundTarget(GetTarget(), newX, newY, newZ)) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}
}


and so on but I would be happy to have another's inputs efforts go into this as well.

best place to throw an idea out and get assistance feedback!

Uleat
10-13-2015, 02:42 PM
Anything is possible :D


Giving value to the coordinate declarations won't work in that case due to this: https://github.com/EQEmu/Server/blob/master/zone/mob.cpp#L2580

Any 'preset' values are overridden with the new ones.


But, you could probably add some additional checks..maybe something like:
if(!IsMoving() && GetClass() != ROGUE && BehindMob(GetTarget(), GetX(), GetY()))
..though, I'm not sure if there is code to move 'around front' of the mob.

The current procedure call in the ROGUE check is for moving 'around back' of a mob.

N0ctrnl
11-24-2015, 04:38 PM
One issue you're definitely going to have here is that all your bots would constantly be bouncing. To illustrate my point, throw 2 rogue bots on a mob. They are constantly a blur changing positions.

I actually took out the get behind calculation for rogues on my server. Manual positioning seems like a small tradeoff for the sheer blender of a DPS machine a rogue turns into with the code in place.

Really, I think there should be a timer on the get behind piece. Then something like you said would also be possible without just having a couple ghosting bots.