Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#785 closed defect (fixed)

[PATCH] Implement variable game speed

Reported by: Wolter Hellmund Owned by: historic_bruno
Priority: Nice to Have Milestone: Alpha 14
Component: Core engine Keywords: patch
Cc: adrian_adam_@… Patch:

Description (last modified by historic_bruno)

There should be a game speed option for single and multiplayer games.

Attachments (4)

gamespeed.diff (5.3 KB) - added by smarlowe 7 years ago.
gamesetup.diff (8.2 KB) - added by Adrian 7 years ago.
gamespeed-minimal-03182013.patch (18.6 KB) - added by historic_bruno 7 years ago.
gamespeed-03152013.patch (38.4 KB) - added by historic_bruno 7 years ago.
WIP patch with multiplayer voting, etc.

Download all attachments as: .zip

Change History (32)

comment:1 Changed 9 years ago by historic_bruno

You can set simulation speed now, although there's no obvious control for it. (If you want to test, open the script console using the ` key, and type in Engine.SetSimRate(1.0), only replace 1.0 with the rate multiplier you want. We could probably add a game speed control to the GUI with a few options like "slow", "normal" and "high".

comment:2 Changed 9 years ago by historic_bruno

Keywords: simple added
Priority: Should HaveNice to Have

comment:3 Changed 9 years ago by Wolter Hellmund

Oh this is great, if the function is already implemented in the game engine, then the job is more than half-way done. Great to know this!

comment:4 Changed 9 years ago by Joe

Owner: set to Joe
Status: newassigned

Currently have this largely implemented, still need to test it some more though.

It won't work with multiplayer games as of yet. The default options I've added are "Slow" which runs at half of the normal game speed, "Normal" which.. runs at normal speed, and "Fast" which runs at 1.5x the normal game speed, depending on how noticeable it is I might change the values some more.

comment:5 Changed 8 years ago by fabio

It also should have a "pause" option which can still set orders to units.

comment:6 in reply to:  4 Changed 8 years ago by historic_bruno

Replying to Joe:

Currently have this largely implemented, still need to test it some more though.

It won't work with multiplayer games as of yet. The default options I've added are "Slow" which runs at half of the normal game speed, "Normal" which.. runs at normal speed, and "Fast" which runs at 1.5x the normal game speed, depending on how noticeable it is I might change the values some more.

Hello, any progress on this? :)

comment:7 Changed 8 years ago by Jonathan Waller

Description: modified (diff)

A comment about multiplayer, we need to make sure players are working at the same speed. I like the way that the Total War series implements this by making the game run as fast as the slowest chosen speed, so if Alice sets 2x speed and Bob sets 1.5x speed the game runs at 1.5x speed. A similar system could be used to slow the game down with preference always being given to the speed closest to standard speed.

comment:8 Changed 8 years ago by historic_bruno

Owner: Joe deleted
Status: assignednew

comment:9 Changed 7 years ago by smarlowe

Keywords: review added
Milestone: BacklogAlpha 12
Summary: Implement variable game speed[PATCH] Implement variable game speed

Added an option to set game speed to slow (0.5) or fast (1.5) before game launch.
For multiplayer, only the host should be able to set the speed.
And I separated the game speed dropbox slightly from the map-related ones above it. It doesn't look too weird, does it?

Changed 7 years ago by smarlowe

Attachment: gamespeed.diff added

comment:10 Changed 7 years ago by historic_bruno

Keywords: patch added

comment:11 Changed 7 years ago by fabio

I think it would be changeable only after game launch - it starts always at 1.0x and can be modified while playing. What about it?

comment:12 in reply to:  11 Changed 7 years ago by historic_bruno

Replying to fabio:

I think it would be changeable only after game launch - it starts always at 1.0x and can be modified while playing. What about it?

I think a global option would be best, but since we don't have persistent options yet or a place to show them, a match setup option will work for now. There should also be in-game controls or hotkeys for changing speed.

comment:13 Changed 7 years ago by fabio

My point was that having it in game is much more useful since one is expected to speed up the game only at certain time, e.g. when you are sending waves of army to a distant enemy base, while slowing it down when planning your city. Having it in game make it useless before the game start (and also fills the GUI) since you can just change it just after the start.

comment:14 Changed 7 years ago by historic_bruno

I don't agree that it's useless, for one thing it's a setting to agree upon before multiplayer matches. Even in single player matches I think most people have a speed they're most comfortable with, newer players will want slower games but more experienced players will want faster games. Leaving something like that as only a hotkey or in-game setting would be annoying.

comment:15 Changed 7 years ago by Erik Johansson

Yeah, while an in-game setting is a good thing to have, we need to have some way of setting it before the game starts, especially for multiplayer, but it's useful for singleplayer as well.

comment:16 Changed 7 years ago by Raymond

My favorite is:

gameSpeeds.list = ["Slow", "Normal", "Fast", "Very Fast"]; gameSpeeds.list_data = [0.5, 1.0, 1.5, 2.0];

This settings should be for Single and Multiplayer games.

Or is it possible to adjust the game speed directly in the game (in multiplayer games only adjustable for the host!)?

Last edited 7 years ago by Raymond (previous) (diff)

comment:17 Changed 7 years ago by Kieran P

Keywords: review removed
Milestone: Alpha 12Alpha 13

Pushing to Alpha 13. Before this can be committed, it needs to have a pre-game setting for multiplayer and needs to sync that speed value to all players in the game, not just locally.

Changed 7 years ago by Adrian

Attachment: gamesetup.diff added

comment:18 Changed 7 years ago by Adrian

I add diffrent Game Speed ("Slow", "Normal", "Fast", "Faster"). I test the diffrent GameSpeed? in Multiplayersession with my laptop and Desktop PC. I dont know if the arrangment of the GameSpeed? Button there is ok. I also dont know if the diffrent GameSpeed? are good with the Value of [0.5, 1.0, 1.5, 2.0]. Im most comfortable with 1.5. 0.5 is realy slow.

comment:19 in reply to:  description Changed 7 years ago by Adrian

Cc: adrian_adam_@… added
Keywords: review added
Last edited 7 years ago by Adrian (previous) (diff)

comment:20 Changed 7 years ago by O.Davoodi

It is better to do add this to the option box (where population cap and such are located. You can make the box bigger if needed). The game screen shouldn't be messed up in 1024x768. And there is a problem. in gamesetup.xml line 109: <object size="100%-425 363 100%-325 55" name="mapTypeSelectionTooltip"> should be: <object size="100%-425 363 100%-325 455" name="mapTypeSelectionTooltip"> Size is actually :left, top, right, bottom

comment:21 Changed 7 years ago by historic_bruno

Keywords: review removed
Owner: set to historic_bruno
Status: newassigned

comment:22 Changed 7 years ago by historic_bruno

I've taken a different approach to implement this. It's not really enough to handle it in game setup UI because that won't account for saved games, rejoining multiplayer games, or possible autostart support. Instead I added it to game attributes, so all players receive the setting, regardless of how they enter the game. The option in match setup is working well, now it's a matter of adding it in-game.

We discussed some approaches including possible UI designs today in IRC: http://irclogs.wildfiregames.com/2013-02-27-QuakeNet-%230ad-dev.log beginning at 23:14. The trickiest part is multiplayer: who gets to choose the game speed?

comment:23 Changed 7 years ago by historic_bruno

Keywords: simple removed

So after spending time making game speed controllable during multiplayer games, I've decided it's too messy and still leaves too many "what ifs". It requires modifying network messages and server-client interactions and I'd rather not do that, for a feature that almost nobody is likely to use. 90% of the work has been handling that case. So game speed will be a pre-game setting for single and multiplayer games, and controllable during single player games as well. I will try to upload a WIP patch with the network stuff for anyone who might be interested in that.

comment:24 Changed 7 years ago by Kieran P

Milestone: Alpha 13Alpha 14

Changed 7 years ago by historic_bruno

comment:25 Changed 7 years ago by historic_bruno

Description: modified (diff)
Keywords: review added

Attaching patch that adds game speed option to match setup as well as in-game control for single players games. There may be some conflicts with trunk that need to be resolved, since the patch is a few weeks old. I will work on it again after A13 is released.

comment:26 Changed 7 years ago by ben

Resolution: fixed
Status: assignedclosed

In 13340:

Adds game speed option to match setup, adds in-game control for single player games, fixes #785.
Refactors some GUI utility functions.

comment:27 Changed 7 years ago by historic_bruno

Keywords: review removed

Changed 7 years ago by historic_bruno

Attachment: gamespeed-03152013.patch added

WIP patch with multiplayer voting, etc.

comment:28 Changed 7 years ago by historic_bruno

Attached patch with multiplayer voting, uses network messages to synchronize game speed. Not implemented for the above reasons but may be useful to someone in the future.

Note: See TracTickets for help on using tickets.