Opened 13 years ago

Closed 11 years ago

Last modified 11 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 12 years ago.
gamesetup.diff (8.2 KB ) - added by Adrian 11 years ago.
gamespeed-minimal-03182013.patch (18.6 KB ) - added by historic_bruno 11 years ago.
gamespeed-03152013.patch (38.4 KB ) - added by historic_bruno 11 years ago.
WIP patch with multiplayer voting, etc.

Download all attachments as: .zip

Change History (32)

comment:1 by historic_bruno, 13 years ago

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 by historic_bruno, 13 years ago

Keywords: simple added
Priority: Should HaveNice to Have

comment:3 by Wolter Hellmund, 13 years ago

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 by Joe, 13 years ago

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 by fabio, 13 years ago

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

in reply to:  4 comment:6 by historic_bruno, 12 years ago

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 by Jonathan Waller, 12 years ago

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 by historic_bruno, 12 years ago

Owner: Joe removed
Status: assignednew

comment:9 by smarlowe, 12 years ago

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?

by smarlowe, 12 years ago

Attachment: gamespeed.diff added

comment:10 by historic_bruno, 12 years ago

Keywords: patch added

comment:11 by fabio, 12 years ago

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?

in reply to:  11 comment:12 by historic_bruno, 12 years ago

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 by fabio, 12 years ago

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 by historic_bruno, 12 years ago

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 by Erik Johansson, 12 years ago

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 by Raymond, 11 years ago

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 11 years ago by Raymond (previous) (diff)

comment:17 by Kieran P, 11 years ago

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.

by Adrian, 11 years ago

Attachment: gamesetup.diff added

comment:18 by Adrian, 11 years ago

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.

in reply to:  description comment:19 by Adrian, 11 years ago

Cc: adrian_adam_@… added
Keywords: review added

Replying to wolterh:

Compared to many other RTS games, the units in 0 a.d. have a very slow movement speed. Some users may like this, others naturally won't. To satisfy all, I think there should be a speed multiplier, so that people can play at their preferred rhythm.

Version 0, edited 11 years ago by Adrian (next)

comment:20 by O.Davoodi, 11 years ago

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 by historic_bruno, 11 years ago

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

comment:22 by historic_bruno, 11 years ago

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 by historic_bruno, 11 years ago

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 by Kieran P, 11 years ago

Milestone: Alpha 13Alpha 14

by historic_bruno, 11 years ago

comment:25 by historic_bruno, 11 years ago

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 by ben, 11 years ago

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 by historic_bruno, 11 years ago

Keywords: review removed

by historic_bruno, 11 years ago

Attachment: gamespeed-03152013.patch added

WIP patch with multiplayer voting, etc.

comment:28 by historic_bruno, 11 years ago

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.