News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Multiplayer: which way to go?

Started by isidoro, December 17, 2008, 03:16:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

isidoro

When trying "Widelands", an open source clone of "The Settlers", a simulation game, I came across this piece of documentation:
Quote
Parallel Simulation
-------------------
The game logic is supposed to be affected only by the following factors:

  • the pseudo RNG (which is completely determined by the initial seed)
  • the starting conditions
  • the sequence of player commands sent to the Cmd_Queue

As long as the gameplay logic stays the same (no code changes / no changes to conf files), and the above factors remain the same, the outcome must be the same.

This property of the Widelands game logic is extremely important for two reasons:

  • Multiplayer by parallel simulation:
      Every host keeps the complete state of the simulation in memory, and only  player commands are exchanged to keep network traffic low. The properties  above guarantuee that there is no desync.
  • Demo recording
      By creating a savegame followed by a sequence of player commands, it is  possible to create a demo recording of a game (similar to Age of Empires,  for example)

Is it possible/desirable parallel simulation in Simutrans when multiplaying?

VS

#1
Also worth considering: In Wesnoth, RNG also depends on the game data, so that you can't cheat easily - if you change numbers, clients have different RNG and go out of sync.

This could be ensured by less brutal means of course, but it shows possible security element and also a possible pitfall if the player has some addons.

iirc Simutrans has something almost akin to threads. With all the implications this can have on synchronization...?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

vilvoh

Many applicatins, not only games, use that network model. The best thing is that it opens the possibility of record games, something that Hajo & Prissi have confessed is in the TODO list since ages. Btw, how are you going to manage the addons issue in multiplayer? just ignoring the ones that are not common to all players or downloading them from other players before starting the game?

Other thing that may seem obvious but I want to ask, won't be possible to play against players that have different pakset (128pak and 64pak players mixed in the same game), will be?

Escala Real...a blog about Simutrans in Spanish...

jbode

hmmm, the various pak sets will impose significant issues ... I would the suggest to give the pak sets a unique fingerprint (also separating the versions) which can be checked and the network game restricted to those commom paks. A proper fingerprinting would also enable to identify missing or conflicting paks when loading existing games. The Simutrans console could this way tell "pak set xyz is missing and needed to load this game".

Another point is that the network mode must be started before the pak sets are loaded. At the moment the pak sets are loaded during the Simutrans start up

Spike

Quote from: vilvoh on December 17, 2008, 09:54:55 AM
.. won't be possible to play against players that have different pakset (128pak and 64pak players mixed in the same game), will be?

It might be possible - but that means to transfer the PAK data to the player who is missing it.

So I assume the first networked Simutrans versions will require all players, who want to play a game together, to have the same pak sets installed. Even the very same versions of the pak sets.

leopard

the way to get round the pak issue is to have one machine designated the 'master' with the ability for the others to request paks from the master as required. hence everyone gets the same stuff, and one person gets to decide the set. essentially you have one person setting up a scenario and others playing it.

My Simutrans on the apple mac homepage http://www.aleopardstail.com/simutrans/Index.html

prissi

Well, I though just seperating the add-folder from the pak folder. Network games would have to have the pak folder.

However, as any command ist confirmed by the server, and maps are only send from server to client, additional vehciles will not break a game. (Additional building levels would).

VS

Separating addons folder -> 100% support.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

vilvoh

It's the most reasonable way to deal with addons, and would help to install and manage them in a easy way. I support this idea too.

Escala Real...a blog about Simutrans in Spanish...

prissi

If I ever get to release the stable I will work on it.

IgorEliezer

#10
Let me speak a few... but I don't know if I can explain well.

1) If I want to join a netgame, how do I "connect" my Simutrans to host's one. Say, I host a netgame on Internet, how will a player discover me and join me?

What I/we could do is:

a) Join by IP: send him my IP via MP, e-mail or chat, and he joins me by IP, in Simutrans' GUI could have a dialog box with a field where you can type a IP number.

b) Join by public list: we could have a database in simutrans.com where all active netgames are listed. When I host a netgame on Internet, my IP and a server name (e.g. "IgorTekton's server") are sent to a database. Another player who wants to play could open an dialog box that consults that database and a list of active netgames is created in Simutrans' GUI. He merely chooses one netgame from list and clicks on.

IP number  | Server name  | Version
00.00.00   | Join me plz  | 101.0
11.11.11   | Fun server   | 101.0
22.22.22   | Smith server | 101.0

Also, we could have a dynamic page that is updated every time that someone hosts or closes a netgame. This page is buit with data obtained from database. I could open such page, choose a IP and join by IP.

2) About netgame compatibility:

If I have a way of connecting to a netgame (by IP or public list), Simutrans will need to check compatibility between me and hoster upon trying a join.

1. Try connection with server/netgame;
2. If netgame is up and accepting new players, check Simutrans version compatibility;
3. If compatible, check pak compatibility (or missed add-ons);
4. If compatible, go ahead; if no, try to donwload from hoster needed/missed paks in a "Download" folder;
5. If OK, join is acepted, new player is announced in mensage centre and he chooses a player and a name.

About 2: host can set a maximum limit of players and can turn on and off new joins. Depending on host's connection, too much players may cause game lags.

About 4: host can tun on or off and/or limit a maximum size for downloads, once it can cause game lags too.

Ashley

You simply have a "lobby server" which all clients connect to to arrange games, this can incorperate a chatroom and rankings systems, if required. Just about every multiplayer game since forever does this :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

However, please before going overboard, basic functionality must ensured.