EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bots (https://www.eqemulator.org/forums/forumdisplay.php?f=676)
-   -   Bot positioning (https://www.eqemulator.org/forums/showthread.php?t=34993)

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/a...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

Quote:

Originally Posted by Furniture (Post 244183)
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
Code:

                        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

Code:

                                        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

Code:

                        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.../mob.cpp#L2580

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


But, you could probably add some additional checks..maybe something like:
Code:

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.


All times are GMT -4. The time now is 07:15 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.