Jump to content
  • Advertisement
mysteriousmonkey29

Multiplayer networking for modded open source game?

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!