I’ve implemented client-server with one player as a server due to lack of funding for the dedicated server, and it works… but games desync almost instantly. I’ll need to figure out proper communication system (probably some kind of sending state at frame X + sending events for N frames), but… that’s work X)
Not to mention there are other things I need to massively improve… sigh
If I recall correctly, the Host controls everything, clients rely on the host’s timing factors, but yeah, a lot to pick up on including that thing with predictive movement…
I’m currently working on this here (https://store.steampowered.com/app/341570) and I’m implementing some kind of ‘team’ mode for the players to keep the group together in between levels… And I ran into the ‘elect a server’ problem lol. Takes me back in time when I studied computer science. So I implemented the Bully Algorithm and a test-suite aso asf…
So I’m essentially stuck with the game right now… should release to get it over with…
The synchronizing thing… Most of the time it’s float-comparisons or random-number-decisions.
I rolled my own float-equals (with a margin epsilon) and a random-number-generator based on simplex-noise with (N-Player) dimensions (tracks) (so the server knows what the next number client x draws will be).
Keeps the server-engine mostly in-sync with the client-engines. Desyncs after 10-20 seconds most of the time. But I send the game-state to synchronize the clients every 5 seconds. So that’s working fine.
DM for chat if you need someone to talk to
lol… Thx, I suppose
It’s an MG (of course) DirectX game. Haven’t built it on OpenGL for quite some time and I think I won’t release it on linux, etc. Some things are windows-hardwired (cursor, cursor clipping…) that are just hard to transfer.
Btw, all the regulars here are welcome to get a free key. Just DM. You’ve all earned at least that much by helping me at least 1000 times in the last years.
Happy to get feedback as well.
Oh. I’m afraid it’s never coming to windows-store.
Maybe if I get my networking-lib production ready some day (code once, run on Steam, Lidgren, Epic, etc… cross-play and so on…). But that may as well never happen.
Oh, nice, congratulations on releasing it on Steam ^^
For me, I decided to go (for now) with the lobby system (for “FPS” lofr), where lobby creator becomes the server. That will change if I ever get to get a dedicated server.
Anyway, I’ve tried to deal with networking by all clients sending the input messages to server, and server broadcasting inputs from each client (and himself) to everyone else, but… when testing it with 2 game instances and connecting via localhost, desync happens almost instantly.
Now I’m working on Settings screen while thinking about what combination of state + event messages would be fit… not to mention dozen other things (tanks falling through ground in certain circumstances, camera lagging on occassions, art being ugly). So much work for solo dev. X)
Yup. Sounds strange, I know. But for multiplayer coop I rely on the Steam-Networking libraries and their servers.
When creating a lobby for instance, you need a dedicated server to perform the NAT punchthrough for you.
So I’m stuck with their implementation until I write a wrapper or implement the other systems as well and separate the users of those platforms… well well… much to do
Hmm, how about just single player as frankly, not bothered about multiplayer I have an XBOX ONE X and never play online, what’s the use lol everyone is a 15 year old angry gamer who has way more time than you…
Casual Play for me… being blind and all.
But keep at it, you are doing something cool there!
I do have Steam, but refuse to spend anymore money on that platform now.
Hmmm. When are you planning to release?
Maybe I should implement the lobby first and host it. Aaaaaagh… I really wanted to finish the game though…
Never enough time… NEVER… just as you said.
If you’d like me to take a look at your code for de-sync causes, my discord is here:
I don’t know. As soon as I get all the improvements done, I guess. I have all the core features working except AI, but none of those is fully usable or fun. X)
So I need to improve:
Driving mechanism so that tank doesn’t fall through the ground
Overall physics so that it’s actually fun
Art, art, art (this I’ll need to comission someone, but I have no idea where to even look)
Network code so that it actually works as intended, and doesn’t desync on 3rd frame, if not even immediatelly
UI so it’s scalable with different resolutions
before I even consider releasing some kind of alpha/beta version on itch.io >.<
Also, thanks for the offer to look into networking code, I might take it on later when I rewrite it into something more usable
Goodness me, go away for a couple of weeks, and boom, 50 new posts, hope everyone is doing well, been a little busy but looking forward to returning to coding again soon.