Day 16 – Regret

I started thinking too hard about how I’d handle different zones and moving between areas and planets and how I’d solve that problem…

And I really got off in the weeds. I mean really off in the weeds. I’m programming individual packets to send to a specific …

Okay, here’s the thing.

Right now, the game has one server, and many clients. The one server is responsible for keeping track of the locations of every player, every NPC, every enemy, doing checks to make sure they can all do the stuff they’re attempting to do, passing data back to the clients… It’s a lot for one server to do.

So how a game like FFXIV does it is this:

You log in. The log in server reaches out to a master server and says “yo boss, this human just logged in. Hang onto their account and character information for as long as they’re logged in.

The master server grabs the character and account info, sees that the character is in Limsa Lominsa and then reaches out to the Limsa Lominsa server and says “Hey, got a new connection for you. Here’s the data for them, go ahead and place them down.”

The limsa lominsa server then takes over, handling all the position tracking, all the checks to make sure you’re doing stuff you’re allowed to do, etc. Then when you leave the area and go to Lower La Noscea, the Limsa Lominsa server reaches back out to the master server and says “Hey this guy’s trying to leave. I checked already and he’s definitely allowed to go to that zone from this zone, so go ahead and put him there.”

Then the Limsa Lominsa server deletes all your information from it’s memory. The master server takes its copy of the information and hands it off the Lower La Noscea server and says “Got a new guy for you, keep track of him” and now the Lower La Noscea server is responsible for keeping track of all your jawns.

This is why specific areas can get overloaded, why sometimes specific zones are over capacity, why sometimes some of them are instanced (multiple servers) and some of them aren’t.

Right now, my game’s server is the master server and the Limsa Lominsa server and the Lower La Noscea server all wrapped into one. Until two days ago, it was the Login server too.

So I need to start splitting things out.

That’s where things get nasty.

By default, Godot’s actually pretty smooth multiplayer solution can only be one thing at a time. It’s either a server or a client.

So think about it like this…. I’m a client, I’m connecting to the Lower La Noscea server. The Lower La Noescea server is a server, doing all the checks and handing data back to me. But sometimes, the Lower La Noscea server is also a client of the master server.

Godot will absolutely not allow that. A server is a server and cannot be a client to another server.

In order to handle that behaviour …….

Sigh.. Yeah, it’s a lot.

I’m probably going to spend a lot of time on this.

I’m learning about TCP and UDP packets. Help.