Multiplayer networking for modded open source game?

Started by
9 comments, last by hplus0603 5 years, 1 month ago

Hello, I want to make an RTS game that allows users to write their own AI for units. However, I have limited resources, and am thinking of modding an existing open-source RTS to add this functionality, rather than build my own game from scratch. Or at least at first. This would be a good way to gauge interest and get feedback.

 

It looks like there are a lot of open-source RTS games that fit what I'm looking for, such as 0 AD, Warzone 2100, Glest/Megaglest, etc. And their licensing is very permitting (GNU GPL and CC BY SA), so it looks like I'm welcome to mod their games, and then release my mod wherever I want, as long as I include attribution, and release it also under GPL with the source code included. I was thinking of releasing the mod on either Steam, itcho.io, to gain visibility and to take advantage of their premade features for packaging, delivery, and matchmaking of the game.

 

However, I was looking the matchmaking aspect, and am a little confused. Steam talks about servers here: https://partner.steamgames.com/doc/features/multiplayer/game_servers which says basically that you can use the Steamworks API, but need to provide your own servers, or have the player's computers act as the servers. I'm guessing the latter would probably be impractical given the genre (RTS), but don't have a lot of experience by which to judge.

 

What I'm looking for is something that's not a lot of work to connect people in multiplayer games. I'm happy to pay for servers, even if I don't end up charging anything for the game. I'm not sure what goes into linking servers to steam to allow matchmaking, and how much of it is done for you.

 

I also tried to look into how 0 AD does matchmaking. It looks like it works directly through the game (like the old "multiplayer" option in Age of Empires), but beyond that, I'm not sure.

 

Anyone know more about this sort of thing?

 

Thanks!

Advertisement

RTS-es almost always use one of the players as server. Typically, this is the "hosting" player for a game. I don't see why this would be a problem?

Any server is a computer that runs a program that uses Steamworks, and announces itself to the Steam matchmaking service as accepting game connections. Thus, a hosting player could just announce themselves through matchmaking.

Picking a game that already supports networking would be best, though, because converting a single-player game to a networked game often ends up being "re-implementing all of the simulation and physics logic and main screen modes."

enum Bool { True, False, FileNotFound };

That's good to know; didn't realize. I assumed this would be laggy, and only practical for less graphics-intensive games. Good to hear, as this makes things much simpler.

 

So if I pick a game that already supports networking/matchmaking, all I would have to do is write my user-programability mod, wrap the game in the steam API, and mostly reuse the pre-existing game content and networking?

 

This sounds very doable.

That sounds like it, yes.  "all" you had to do ?

I'll let you in on a little secret: Do you know why most RTS-es have a "Yes, Sir!" acknowledgement animation/sound cue for each command you give? It's long enough to hide the transmission latency to all other players. Thus, by the time the units actually start moving, the command has gone from your computer, to the server, and back out to all players (including back to your own computer.) Typically, the local client actually starts moving units when it gets commands back from the server, and the "local" select/command/animate loop is entirely there to formulate commands to send to the server.

I can't guarantee that all open source RTS-es you find will use this exact mechanism, but it's the "attractor state" RTS network architecture, so I wouldn't be surprised if many do.

enum Bool { True, False, FileNotFound };

Yeah I know it won't be easy, but it at least sounds doable now. Thanks for you help!

 

And that's really interesting! I love all the "yes sir, right away, etc..." in different languages in age of empires (my childhood RTS game). Never knew it served a networking purpose!

Never knew it served a networking purpose!

Those are the best game designs ?

Btw, if you like Age of Empires, here's a very good networking article about that very game: https://www.gamasutra.com/view/feature/131503/1500_archers_on_a_288_network_.php

It's in many ways the first really public description of the RTS lock-step simulation/networking model, and well worth a read!

enum Bool { True, False, FileNotFound };

Wow, this is intense! Really interesting how they run simultaneous simulations with the same inputs rather than have one machine do all the processing and then pass it all to the others.  Are most RTS games done this way, or was it specific to AoE?

 

It also sounds like a nightmare to impliment in either case, so the lesson learned is, don't try to do this myself, haha

Most RTS-es are done this way, because it's such a great match to the genre. It allows tons of units with not too much bandwidth.

The one thing this model doesn't do well is "late joins," and the main cost of this model is having to correctly control for all possible sources of indeterminism. Some people think that this cost is a feature, because record/replay becomes very easy to implement, and good for reproducing bugs! You can just always have recording on in the background, because the total size of the record file will be small.

enum Bool { True, False, FileNotFound };

Another problem would be map hacks and similar. If all hidden information is on the client, it can be revealed much easier.

Yes! This is why RTS-es generally default to "explored map / fog of war."

Although even the fog of war can be pierced by an appropriate network sniffer. Not during competitive events, though ?

A bunch of other cheats become impossible, though, because any attempt to deviate from the rules locally will lead to instant de-sync.

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement