I've begun looking into setting up the multiplayer component of the server. I've been looking at the FFXI private server "DarkStar Project" to get an idea how to implement it since this is my first foray into MMO server design. It seems they are doing basically what I am when it comes to packet handling, so understanding how they managed the player instance helps.

The first issue I came across is the zones themselves; FFXI was split into many zones like FFXIV ARR was. On top of that, each zone transfer was actually a disconnect/connect (this could be to the same server) allowing for multiple servers hosting different zones. With FFXIV, the zones (yes, there are zones) seem to be all one thing, and as known; are gigantic. Also, from looking at the sniffed transfer between Black Shroud and Thanalan, there is no disconnect/connect. So one server is handling all zones. That doesn't seem right, but maybe I am missing something.

Now, DSP seems to give the FFXI client all actors/entities in the zone all the time. This isn't too bad due to the zone sizes they are dealing with, but would be killer with FFXIV. For example, all actors in Black Shroud would include all npcs/players in Gridania, and all npcs/players in North, East, South, and West Black Shroud! So I designed a simple filtering system.

I subdivide each zone into a grid based on a min/max value and a grid size. Each cell holds a list of actors in that one cell. As a player (or any actor) moves across the grid, I add/remove them from the cells they cross over. This way, I can just request all actors in their cell and the adjacent ones, adding/removing/updating the actors in their instance as things change. I don't know how well this would work in a 500 player situation but as a temporary measure to get things working, it seems to be sufficient! On top of that I added a bunch of helper methods in the actor class for generating all the necessary packets to spawn them (or change a specific attribute).

I didn't get a chance to test real time movement between actors because I didn't have a second installation of 1.0 to test with. However I didn't implement removing an actor from the zone on disconnect so I was able to switch characters and see the previous one where I logged off at! Since actor movement is very simple, I am pretty sure it will work when I get a chance to test it.

Here is an example of what I mean. "Test Test" was disconnected at that position, so when I logged in as "Localhost Character", I could see him standing there! Oh yeah, emotes implemented.

undefined