# Crazy ideas time: network playing

**URL:** <https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335>\
**Category:** The Drawing Board\
**Created:** [February 1, 2016, 3:14pm UTC](https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335 "2016-02-01T15:14:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![crutchmaster](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@crutchmaster](https://discourse.cataclysmdda.org/u/crutchmaster)\
**Post date:** [February 1, 2016, 3:14pm UTC](https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335/1 "2016-02-01T15:14:20Z")

</div>

Algorithm next:

1. Server load world.
2. Client(s) connect to server.
3. Server transfer all world data (json | gz)
4. Client (unpack) load data to all structures (overmap, submaps, player, etc)  
Do\_turn
5. Server send “turn” signal to player
6. Player has some seconds to turn. Other players wait or plan actions. If action is planned player turn instantly. If time out then player wait.
7. After turn player send action to server.
8. Server verify action and return changed data (json)
9. Client merge data from json  
10 Goto 6 if moves \> 0
10. Goto 6 for turn next player
11. Turn for zombies etc.
12. Goto 5

Refactoring:

1. Separate ui, action and data logic. Schema:

```auto
| client | | server  
 UI<->Control <- interface -> Data
```

Interface has two work mode - for local playing and remote.  
2. Add state\_id for all structures (for check changes)  
3. Some fixes with serialize interfaces

It is real, but ton of work.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [February 2, 2016, 7:57am UTC](https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335/2 "2016-02-02T07:57:36Z")

</div>

Except for the part where players can trigger activities that take many hours of in-game time to resolve, and the game being basically impossible to play if you only have a few seconds to take your next action.

You could make a multiplayer dda, but by the time you’re done it would either be terrible or only remotely resemble dda. I’d strongly suggest starting from scratch, especially since the game loop isn’t remotely suited for multiplayer, so you’d basically have to throw that out too.

One thing that might be worthwhile would be to build a multiplayer dda-alike that can consume dda json for item and monster definitons.

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [February 2, 2016, 2:28pm UTC](https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335/3 "2016-02-02T14:28:12Z")

</div>

I think a prerequisite to multiplayer CDDA would be a realtime CDDA. It would necessitate turning the current action system on its head, so that the clock drives the game, and the player only gives commands and waits until the actions resolve (i.e. like in Dwarf Fortress). Then you could make headway towards making simultaneous multiplayer work.

If Kerbal Space Program can have multiplayer despite time-warp, I think it’s feasible that CDDA can have it too.

---

<div class="post-metadata">

**Author:** ![Arek\_PL](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Arek\_PL](https://discourse.cataclysmdda.org/u/Arek_PL)\
**Post date:** [February 2, 2016, 4:34pm UTC](https://discourse.cataclysmdda.org/t/crazy-ideas-time-network-playing/11335/4 "2016-02-02T16:34:12Z")

</div>

[spoiler=some useless info]actualy its possible to play cataclysm multiplayer but you cant see other players and can cause desync

2 players go to this same place  
player 1 enter this place first  
player 2 enter this place second  
player 2 loot everything  
player 2 save game  
player 1 save game  
both players go away  
place is still full of loot because player one loaded it first and saved last[/spoiler]

well i think its possible to make multiplayer without changing whole game, of course we talk about small game with friends/fellow survivors not great mmo

turns are speed right?  
so maybe do something like this?:  
server wait for players to input command  
all players input command (if someone do not do anything for [insert time here] he skip his turn  
players and monsters move  
server check if any player or monster have speed higher than 0  
players with speed higher than 0 input commands  
players and monster move  
server give speed to players and monsters  
repeat
