31. Juli 2011

Necessary Boat Enhancements

Previously, upon zoning with a boat the passengers relative location on the boat would be calculated server side - so that on the next zonin the passenger could be put near the location the boat was. This was not very accurate and there were two problems associated with this method. The first one is that passengers could fall into water upon zoning right next to the boat, because the server side coordinates and the client side coordinates do not match perfectly (due different time intervals on position updates). The next issue was, that boats have to wait after zoning in for the passengers to zone too. But what would happen when the player disconnected or the boat already moved? They would also fall into the water.

Also you shouldnt camp while on the boat because it would put you at the exact same spot in the ocean you logged out.

Now i knew it was possible to retrieve the correct relative position of the client on the boat somehow - because if you remember - when you camped/zoned on the boat - the exact same spot where you zoned would be memorized somehow.

After tinkering a bit and searching for some unknown values in the playerprofile it dawned on me - that the position is already in the normal x,y,z coordinate fields. However while on a boat - these values are no longer absolute for the zone, but relative to the boat. That means if we save these values and sent them to the client upon zoning in - he would calculate where the boat is and put us on the correct spot.

For this to work we also needed to signal the client that the player was previously on the boat - i already figured this out last year, but there was still the issue when the boat was not in the zone the client tries to login to, that the client would sent a request to ask where the boat currently is. So i had to extend the logic to ask the worldserver in what zone the requested boat is, then sent the correct opcode (i call it boat locate answer, which is also the same when you tell the client the boat you are on is now zoning) so that the client will try to zone into the new zone.

So to sumarize, the boats are now more fail proof - you should generally be put at the exact spot on the boat (on or within the boat doesn't matter) when you zone or camp/login again - it is not possible anymore to fall into water - even if for some reason we cannot find the boat in any zone, you will be teleported to the zones safe coordinates (these are mostly the boat footbridges in each zone). Also you can simply logout in one zone when you are on the boat, and when the boat is in another zone on login, you will be automatically transfered to that zone (so roleplay wise, you slept on the boat all the times =).

Now i can go back to the easier task and finishing the boat routes for the Kunark boats.

16. Juli 2011


My current field of work is, if you followed our site for the last few month, boats. I'd like to finish the basic travel methods in EQ - i started with getting the zone points and intra zone teleporters working - so that all means available for travel are finished.

The roadmap states that boats are implemented "99%" (synthetic number), this is from a technical point of view - true. Taz implemented the boat routes in 2009, but only added the erudin<->qeynos boats.

So my first task at hand was understanding how the system works and how you add additional routes - i documented the process to make it easier for others to follow.

Basically, to add a new route you dont have to touch the server code - hence 99% complete status. What you need is the meta data - these are basically command files in text format. One for the world server which is the main controller of a boat.

In the world command files, you tell the boat where to spawn, to teleport passengers, how long to wait at certain places etc. There are no coordinates here yet, except for spawning. The coordinates for travel are in the zone command files, each boat has a command file for each zone it travels too - these include travel points, rotation and boat group checks. A boat group is, when one vessel needs to wait for another because they meet inbetween (think erudin).

Now the world command tells the zone server, travel your route from 1 to 20, the zone server looks into the zone command file, and does all steps from 1 to 20 for this boat, e.g. either constantly move or rotate, or check a group. After its finished moving, it signals the world server im done with what i had todo - than the world server does the next step in the world command file, e.g. wait for 60s because we reached a stop, then proceed with route from 21 to 40 or similar.

I also added some admin commands to make testing the boats easier, i.e. i can now jump to desintations with the boat while in a zone - so i would not have to wait 15min in oot to reach the zone line.

There where no manual zoning points in classic, you could not swim to another zone - because only people on a boat would have triggered a zone - we have a similar concept.

When the boat reaches the final step in a zone, it will transport itself and all the people to the new zone (a simple teleport to specific coordinates), after that the boat currently waits a certain amount of time at the teleport location to make sure everybody made it to the other side (zoning back in the days was longer for some people).

The last part is actually not needed, because i figured once out, that the client is able to automatically teleport the player to where the boat currently is. So even if the boat started moving again, the player would be teleported there. I will implement this sooner or later - this is needed anyway when a player disconnects or logs out while on a boat (you dont want to fall into the water swimming 10.000 /locs in one direction =p)