Please sign in to access this page

Networking Game

Networking Game

22 devlogs
28h 56m
Created by jimmy

A simplistic multiplayer game written in pure C# and OpenGL with a focus on learning how to do real-time networking.

Timeline

Working on the core gameplay loop - running around looting chests, getting weaponry and slaughtering your friends until you bathe in the remnants of their gutted bodies.
Player controller now collides properly too :3

Okay, chat is now working as it should again! You can send messages between clients (don't mind the mystery crash) and even use weird unicode codepoints like ÅÄÖ or possibly even chinese chars (idk).

Next stop might actually be gameplay (wooo!)

That's not good.

It's ideally maybe at 2 packets behind at most. Uhhh yeah I dunno I need to touch up the system I think.

Update attachment
jimmy jimmy 4 days ago
Managed to resolve this issue with only a couple of code changes. Phew…

Managed to fix some networking issues (it's still incredibly janky). Seems like there's an issue in the reliable packet pipeline that needs to be ironed out, so that's my current todo.

Got the join screen working - it allows you to search the LAN for games and then join 'em.

The networking backend has some issues that I need to iron out, but after that it's just some minor bug fixing, error handling and getting a basic game loop in place (easy enough I say, knowing the pain that will follow)

Finished up the host screen for now - just need to get the Join button working and then I'll have the basics set up :)

jimmy
jimmy
1h 35m 13 days ago

Reworked the main menu (not shown) and added some basic UI for setting up and running a server. Cool, right?

The default display name is polled at random from a file in the assets.

Update attachment
jimmy
jimmy
2h 19m 19 days ago

After some major refactors I decided to add in font rendering powered by the BMFont system (truly amazing for this) - so, here's a WIP main menu. Going to add buttons to host, join and quit. Maybe options too if we're feeling special y'know.

Also yes that is pixelated Comic Sans. It was funny.

Update attachment

Managed to add in player spawn points, it's a wee bit hacky but under the surface it's all managed by just invoking a tp command. There's also some stuff brewing that'll tie it all together in the end!

Worked out some very basic collision logic - still needs to be implemented on the Y-axis (up/down) and there are some issues with what I currently have. Some reading-up on the subject is definitely due soon!

I fixed the rendering issue (doesn't seem like that devlog published??) and got some basic interactive chests up and running in just a couple (10-ish) lines of code! When running 2 players it also syncs player positions better (and chests break so I have to fix that)

Dug around a bit more, and figured out that it is for some reason moving the first N triangles from the previous draw call to the current draw call, where N is the number of triangles in the current draw call...

what

Update attachment

Debugging some really strange glitches in the rendering system that I have no idea how they occurred... Will report back once this is figured out.

Update attachment
jimmy jimmy about 1 month ago
Like genuinely what in the shit is going on???https://imgur.com/a/UgDjGC3

Reworked a large part of the packet system, the code is now a lot cleaner and a lot more powerful (!!)

I still have issues with server-client desync, and I think the solution is to add world sync from the client-side on top of the server-side synchronization.

Update attachment

A lot of work was poured into the game, and now it has proper source-esque console command support (with the same binding system as well), as well as a new OpenGL 4.5 rendering backend that can handle a LOT of sprites at once.

Coolio (some issues with the tilemap tho...?)

Update attachment

We're loading maps from Tiled now! Next up is fixing some issues w/ rendering and getting the basic gameplay loop in place (I'm thinking a fantasy-medieval arena game where you run around with swords and crossbows and kill).

Also, 10h 30 of work time... wow I spend a lot of time coding stuffs.

Update attachment

Multiple players running around! (20% packet loss simulated for testing)
Very happy with how this is going, and I'm hoping to get some basic gameplay in place now. Worth noting that the game does not validate any input data, so it's most likely very to do RCE exploits or just straight up crash the server with bad packets (or a bad packet order)

Woo! Player movement! It's currently a bit laggy since the client does absolutely no prediction at the moment (still need to figure that one part out, but it oughtn't be too hard). Anyhow, let's-a go... or something?
Still needs interpolation. And lag compensation. And a refactor. And a hell of a lot of willpower.

I managed to improve on stuff like packet loss and added back in reliable packets (they're guaranteed to end up at the other end in sequential order). Very nice!

Still have to add in player movement and prediction as it gets choppy as soon as packets are lost, but the foundation is there. I'll also run some multiple-client testing soon-ish™

jimmy jimmy about 2 months ago
(like above) Came to my attention that the video files don’t display properly in some browsers, but they’re just H.264 mkv videos, so they ought to play in most video players.

Now we're talkin'! The red lil' guy is fully networked from client to server. It's a bit choppy since I'm simulating 70% packet loss on world updates and there's absolutely no interpolation in play.

TODO: Interpolation, Prediction, Player Input and better packet loss tracking.

jimmy jimmy about 2 months ago
Came to my attention that the video files don’t display properly in some browsers, but they’re just H.264 mkv videos, so they ought to play in most video players.

Managed to set up Quake-style frame delta generation on top of my own version of Source's edict t (if I understood how edict t works properly). Next up is spawning in entities and sending this data to the client.

Update attachment

We've got a window and server-client connection up and running! Working on networking objects in the background 'fore I get something rendered.

Update attachment