Networking and servers | Yaki

Dev Diary: The journey (torture) of networking and servers

08-04-2024

Yaki


Multiplayer games is the new modern meta, and i've been focusing on mainly local singleplayer video games, so i thought to myself why not try multiplayer? oh boy what i've gotten myself into

Begining of the project

i actually started this project on an old one i've stopped working on long ago, so i had a baseplate, but man it just caused me issues
since i haven't touched this project for like a year i forgot how it was structured so i had to read every file and figure how it all works all over again, that took me almost an entire day..
this project i pulled from my documents folder was a 2D platformer i created to learn openGL and practice GUI optimization for multiple platforms
once i figured the structure i had to start figuring how i will implement a client connection to a server.
but first you gotta have a server right?

Creating the server

The library i picked for this networking project was ENet, setting up a server with it wasn't really difficult, considering the very limited documentations

Viola! the server is up and running locally, the next step would be connecting to the server through a client, sounds easy right?

Well yeah setting up a client connection was easy, i even built a cool menu to debug server stuff in

But when i thought everything was going smoothly, something had to go wrong!!!

Clients, ghosts, and other spooky stuff

So at this point i was sure i was about to finish the base of the network manager (never think you're about to be done), but this is where i encountered the weirdest issue i've seen.
the client connected alright, well at least that's what it said as you can see down here

but the server didnt react to the connection... no matter what way i tried to establish the server, or the connection the server acted as if a ghost joined!

(also yeah i skipped the part where i port forwarded the server to my domain)