Wandering groups

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Wandering groups

Post by John Adams » Sun Aug 10, 2008 8:17 pm

Sorry, I know I have this posted somewhere else but cannot find it :( so I apologize if it's repetative.
But here's a possible solution to the "wandering hordes" like guards or patrols.
What if we bound an "invisible" object, tiny and pass-through, to the MoveToLocation scripts - then anyone associated with that NPC group simply follows that invisible man in formation?

Code: Select all

   [1]         [2]
        [inv]
   [3]         [4]
or something along those lines...

paulgh
Retired
Posts: 51
Joined: Sun Jul 27, 2008 8:48 pm

Post by paulgh » Sun Aug 10, 2008 9:42 pm

Is it possible to just select one member as the leader, and have the others follow it? In a quick test on live, I observed the following:
Hailed leader of a Qeynos guard patrol.
He stopped, but the others continued momentarily.
The others stopped after they had moved beyond a certain distance.
When the leader started up again, the others stayed in place momentarily, then headed after the leader.
So here is an idea. The leader follows the path. If the others can move, they attempt to move on the same heading as the leader, adjusting speed to maintain minimum and maximum distances.
What do you think?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Aug 11, 2008 6:30 am

You are right, you hail the lead NPC and they all seem to stop... but if you hail a follower, the others keep going. I guess the concept is the same, though I was looking for that entity to hold "the balloon strings" to all the others in the group. If you also notice on live, the followers tend to fumble around back and forth sometimes finding their formation position.
However it is done, "formation" is probably the solution. Not so important today, just something to consider for post-Beta or something.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Sep 12, 2008 6:09 pm

After literally staring at strolling guards in Live, I am concluding that there definitely is a "pilot" NPC, and the rest are merely tethered somehow. Take a 4-some of guards walking along. The lead guy walks along his route normally, while the other three around him bumble around, twist and swagger to find their footing or position or speed up to catch up if they lag behind.
I think we have a good idea how it works on live... now to figure out how to get our strolling groups to behave the same.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 12, 2008 6:11 pm

I can do this, just not sure what priority this would be in.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Sep 12, 2008 6:17 pm

Not high, I am just posting new findings.
Although, for the complete immersive feeling... ;)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Wed Nov 26, 2008 1:45 pm

I may have a solution to the "Follow the leader" business. Based on all the other feedback and hours of observation, tell me what you think of this.
Create a new LUA function called (for instance) MovementLoopAddFollow(NPC, SpawnGroup_ID, offset_x, offset_y, offset_z, speed, delay)
In this, tell the NPC to follow "SpawnGroup_ID" (since the leader *could* be a placeholder spawn) at an offset of x,y,z. Keep the standard speed and delay, in case you want to add more realism to their movements. The follower will pause if hailed, take care of business with whomever hailed it, then it will sprint back into formation behind the leader of the group at it's designated offset.
I think that will emulate the live functionality enough. Any thoughts?
As for priority; none. Just getting ideas on the table for when it's time. Or maybe someone else can pick up and code this LUA function ;)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Wandering groups

Post by John Adams » Sat Feb 28, 2009 1:55 pm

I apparently lose track of the thousands of posts asking LE for everything under the sun, so I will attempt to do better at searching before posting again. :) Here is an old topic where we briefly talked about how best to implement "group" spawns following each other.

Since Scatman has gotten his hands dirty with LUA function writing, I thought I would ask him if he had any ideas on how to implement something like this. See LE's notes below.
LethalEncounter wrote:
John Adams wrote: For "packs" of NPCs (as I mentioned above) that move together - guards, enemy patrols, etc - could it be made easier to assign them a single script, and they just walk along together in formation based on their destination coords? Rather than give each and every NPC in formation movement commands...
I can see the need for group movement in the LUA code, but instead of adding a complex table to the database we handle it solely from the LUA scripts? IE instead of MovementLoopAddLocation(NPC, x, y, z, speed, delay), have a function called GroupMovementLoopAddLocation(Group Name, x, y, z, speed, delay). Group Name could be any string you wanted to describe the group and would make it a lot easier to keep track of rather than a group number. Have this function called from 1 script as many times as you would like for the locations. Then call a function called GroupMovementAddNPC(Group Name, NPC, x_offset, z_offset) for each NPC that comprises the group. The offsets would be the values added (or subtracted) from the x and z coords to keep them close to each other without overlapping.
So for the 'head' NPC's script:

Code: Select all

function spawn(NPC)
	GroupMovementLoopAddLocation("Queen Island Guards", 22.19, -6.86, 183.95, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 30.76, -6.33, 196.28, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 20.70, -6.85, 206.43, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", -.90, -5.47, 212.14, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 2.35, -4.73, 196.93, 2, 5)
	GroupMovementAddNPC("Queen Island Guards", NPC, 0, 0)
end
For other NPCs in the same group:

Code: Select all

function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, 2, 2)
end
function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, -2, -2)
end
function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, 2, 0)
end
If someone has a better idea, let me know.
What do you think, Scatman?

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Wandering groups

Post by Scatman » Sat Feb 28, 2009 2:45 pm

Sure, but we might need a separate function, or parameter, to specify the leader. Because depending on which spawn gets spawned first, the leader may change.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Wandering groups

Post by Scatman » Sat Feb 28, 2009 4:00 pm

It's been getting longer and longer since I actively played EQ2, so does anyone remember exactly how groups work? What if the "leader" dies but the others do not? Do they keep moving without the leader? Or do they stop and wait for the leader to spawn? For some reason I remember the spawn party not respawning until every spawn associated with the party is dead. For example, a group of 4 spawns could be slimmed down to 2 (a player kills 2, then dies), and the remaining 2 stay spawned until they are killed.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Wandering groups

Post by John Adams » Sat Feb 28, 2009 4:23 pm

Scat, I was not trying to get you to develop the spawn "parties" concept, just the LUA for tying wanderers to a single leader somehow ;), just in case you thought I was going for the other.


Any of my experiences with "grouped" spawns is, you attack one, they all attack you. If you die in the process, the remainder run back to their spawn/wander path. Sara tells me that, since she is an expert at getting her ass handed to her by groups of mobs, that they do not immediately respawn the ones you killed, but the respawn is much faster than other mobs in the area usually. So perhaps if it is a partial kill, the respawn timer is somehow manipulated.

I'm sure someone has a dev post up their sleeve they'll link here and solve the mystery. But that is just one players perspective... cuz rarely do you Revive next to the place you were slain, and the run back can be long enough to not really see what's happening.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Wandering groups

Post by Scatman » Sat Feb 28, 2009 4:48 pm

Ya I know you werent. Even if you were, I'd laugh at you, shrug, and point to LE, because I wouldn't even know where to start with that :P But I do think the party movement loops would be closely related to spawn parties, so I was just trying to get a general understanding of how they worked on live.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Wandering groups

Post by John Adams » Sat Feb 28, 2009 6:07 pm

When we both have time, we can log into Guk and go get our asses beat down. One of us stay behind to watch what the spawns do. :)

I vote that you die, while I live.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Wandering groups

Post by Scatman » Sat Feb 28, 2009 6:52 pm

Fine, but only because I'm not a halfling. If I were a Halfling that'd be impossible since Halflings nevahhh die.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest