Latest Posts

Topic: build path during pause

TuStudent
Avatar
Topic Opener
Joined: 2015-05-02, 23:30
Posts: 22
Ranking
Pry about Widelands
Posted at: 2019-02-17, 08:28

If I build paths during 0x-Speed (also called pause) I don't see a new set path (build during this pause) from flag to flag. I have to go for some millisecionds to 1x-Speed and then to pause again. Maybe it is that you don't build pathes during pause, but then this feature should not be available at all.

Why building streets during pause:
1. if you think a game is quite tough
2. if you build pathes in your whole empire along the borders, to demolisch military buildings


Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2019-02-17, 09:25

TuStudent wrote:

If I build paths during 0x-Speed (also called pause) I don't see a new set path (build during this pause) from flag to flag. I have to go for some millisecionds to 1x-Speed and then to pause again. Maybe it is that you don't build pathes during pause, but then this feature should not be available at all.

When you build something, you actually emit a request to do so. The request is committed in the following gametime step. This feature is quite important in networking: the the game host timestamps these requests to ensure that all clients see the building happen exactly at same time. Else the game could go out of synchronization. Loss of synchronization is bad, since Widelands networking game transfers relatively small amount of data, and clients recreate the outcome. If there was even small differences in the input, the "butterfly effect" would cause major trouble later on.

Even of you are playing a single player game, same pieces of code are still used => no visible changes unless time flows.

I understand the request, though. Maybe the easiest way forward would be that if a player emits command of this kind, then he would implicitly also request for advancement of game time by one step. At least the amount of work would be small, and probably close-enough tho the original request.


Top Quote
TuStudent
Avatar
Topic Opener
Joined: 2015-05-02, 23:30
Posts: 22
Ranking
Pry about Widelands
Posted at: 2019-02-17, 10:04

Thank you for your fast answer. Is it possible to reduce the gamespeed in single player to 0.1x or 0.5x? If you build many paths/buildings it can be anoying press play and pause all over again, thats the reason why I use pause. Before attacing I build a path with flags at the outermost border (that it does not get black and I can't build anything there) and demolish almost all military buildings, that takes several minutes and I might even see some empty places to build something, and build in advance what will be build during attacing, and thats also a point where I recheck my economy. (Of course you can say that's not the ideal strategy and might be risky to loose land.)

Just out of curiosity, how does multiplayer-games work (regarding "butterfly effect")? Does one computer calculate everything? Every computer calulates the own player? All calculate and agree on the same solution? Is it possible that two computers calculate something differently? What happens if one player looses connection for 1second, will everything be recalculated or merged?


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-02-17, 10:07

I think when the game pauses, it is paused face-grin.png and triggering any request should be prevented.

One reason for my opinion:
When playing mutiplayer and all participants agreed for a pause, e.g. because one player has to go the toilets, the other players have some time to do some things and get some advantage then, while the absence player can't do anything.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1928
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-02-17, 12:40

Is it possible to reduce the gamespeed in single player to 0.1x or 0.5x? If you build many paths/buildings it can be anoying press play and pause all over again, thats the reason why I use pause.

I feel exactly the same way… face-smile.png
It´s only possible to set the gamespeed to a non-integer value with lua (wl.Game().desired_speed = 10 for 0.01 ms/s), but it would be nice to be able to set it like that face-smile.png
I think there was a suggestion some time ago about having PageUp/PageDown change the speed by the factor 2 or ½ instead of adding or subtracting 1; that would also solve this…

Just out of curiosity, how does multiplayer-games work (regarding "butterfly effect")? Does one computer calculate everything? Every computer calulates the own player? All calculate and agree on the same solution?

Every computer calculates the entire game by itself. The communication between computers consists of only the changes a player orders.
If, for example, one computer fails to notice that the construction of a certain building was ordered, then any changes made to that constructionsite later will utterly confuse that machine, because the constructionsite in question doesn´t exist there…

Is it possible that two computers calculate something differently?

In theory, no. In practice, this can happen, and then you get a desync. Frequent desyncs are the main reason why build20 is several months behind schedule face-sad.png

I think when the game pauses, it is paused face-grin.png and triggering any request should be prevented.

When playing mutiplayer and all participants agreed for a pause, e.g. because one player has to go the toilets, the other players have some time to do some things and get some advantage then, while the absence player can't do anything.

I agree in general. However, being unable to do anything during a pause would mean that one has to do everything at at least 1x speed, which would be too hectic for my liking. If it became possible to set the speed to <0.1x, I´d say +1 to "pause means paused" though…


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2019-02-17, 13:10

Nordfriese wrote:

Every computer calculates the entire game by itself. The communication between computers consists of only the changes a player orders.
If, for example, one computer fails to notice that the construction of a certain building was ordered, then any changes made to that constructionsite later will utterly confuse that machine, because the constructionsite in question doesn´t exist there…

So how does random stuff (combat, mainly) get calculated if both computers do it independently?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1928
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-02-17, 13:17

So how does random stuff (combat, mainly) get calculated if both computers do it independently?

"Random numbers" are generated by a deterministic algorithm that is so complex that the results appear random to humans. But the entire game logic (minus desync causers) is 100% deterministic.


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-02-17, 13:39

TuStudent wrote:

  1. if you build pathes in your whole empire along the borders, to demolisch military buildings

Could you please explain how one could demolish military buildings by building roads? I don't see any possibilty there?

TuStudent wrote:

Is it possible to reduce the gamespeed in single player to 0.1x

Well, you could

  1. start Widelands together with the --auto_speed-command

  2. open a match via LAN/direct IP (not singleplayer)

  3. and press "page down" all the time. (Which is the problem of this solution face-wink.png )

or 0.5x?

  1. start two Widelands windows on your machine at once

  2. open with window 1 a match

  3. join with window 2 the match

  4. start the match (with window 1)

  5. set window 2 to pause

  6. if window 1 runs not at pause speed, the match will run at 0.5x

The problem here is that there will be double calculations, double replays, double autosaves and so on.

What happens if one player looses connection for 1second, will everything be recalculated or merged?

As far as I know you can set the option that syncstreams are written to debug desyncs, they are files which contain all informations about the game in short time intervals. So if there is a desync, the match can continue because it can be loaded from the syncstreams. Correct me please if I'm wrong here...

kaputtnik wrote:

I think when the game pauses, it is paused face-grin.png and triggering any request should be prevented.

One reason for my opinion: When playing mutiplayer and all participants agreed for a pause, e.g. because one player has to go the toilets, the other players have some time to do some things and get some advantage then, while the absence player can't do anything.

+1

or maybe making this optional? It can also be useful that one can place constructionsides while the game is paused.


Wanted to save the world, then I got widetracked

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2019-02-17, 15:38

kaputtnik wrote:

I think when the game pauses, it is paused face-grin.png and triggering any request should be prevented.

Question of taste. As of now, you can do lots of inspections and plannings, and also you can build lots of stuff:

  • Build many buildings.
  • If a flag is already present, you can build a road from there.
  • If a road is already present, you can place flags on it.
  • Tune economy settings, warehouse preferences, productionsite preferences.
  • etc

One reason for my opinion:
When playing mutiplayer and all participants agreed for a pause, e.g. because one player has to go the toilets, the other players have some time to do some things and get some advantage then, while the absence player can't do anything.

In multiplayer, you need to trust a bit. If having a break, the other person can save the game, load it in another instance, with controls of your tribe and inspect your land, to gain competitive advantage. That is more evil that building something, imo. Besides, if game time advances, you have means to notice that pausing has not been honored. Actually, if all commands would cause game time advancement, then all the micromanagement during pause would be revealed too. I would not play WL for money, cheating is far too easy.

Anyway: If we would like to implement "build while paused", advancing the game for one tick would me my way of implementing the feature. I think that it is a sensible request. Even if implemented, this feature could be disabled in multiplayer. The problem would also more or less go away if we replaced the "paused" text with "paused since [timestamp of latest gametime advance, in local wallclock time]".

Edited: 2019-02-17, 15:39

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-02-17, 15:48

teppo wrote:

In multiplayer, you need to trust a bit. If having a break, the other person can save the game, load it in another instance, with controls of your tribe and inspect your land, to gain competitive advantage.

face-sad.png Are there any possibilities to make this impossible?


Wanted to save the world, then I got widetracked

Top Quote