HomeWildfire Games

Allow fast-forwarding of matches with only AI players.
Needs VerificationrP20577

Description

Allow fast-forwarding of matches with only AI players.

Differential Revision: https://code.wildfiregames.com/D595
Refs #4078
Accepted By: Grugnas

Event Timeline

mimo raised a concern with this commit.Feb 3 2018, 12:39 PM
mimo added a subscriber: mimo.
mimo added inline comments.
/ps/trunk/binaries/data/mods/public/gui/session/session.js
494

Are there any good reason to update the speed control when changing observers?
When you put a custom high speed with F9 and have to switch between players, the game should not change that speed and reset it to 1 by itself

This commit now has outstanding concerns.Feb 3 2018, 12:39 PM
Stan added a subscriber: Stan.Mar 19 2019, 10:55 AM

@elexis Does that concern still stand ?

elexis requested verification of this commit.Oct 15 2019, 12:37 PM
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/gui/session/session.js
494

Half of below I wrote when the concern was raised but avoided to submit. The other half added now.

Are there any good reason to update the speed control when changing observers?

Yes man.
There was a good reason to update the speed control when changing the playerID,
the reason was none ofher than to follow the purpose of the "Change perspective" developer overlay feature.
If that option is cheked, then Engine.SetPlayerID is switched and that means that you now became that player, hence the entire UI shall behave accordingly.

I have stated this explicitly:
From the patch upload notice that introduced the line (D595 Diff 4437)

Developer overlay player switching support

From the inline comments specifically for this line:

relevant in case of switching the perspective to observer using the developer overlay

So if you are assigned to player 1, then you shouldn't be able to fast forward to 20x, since those speeds are according to the definition in the json file only allowed to be used when no human players are assigned ("fastForward").
But if you are assigned to observer and there are no players assigned, you can use the fast forward feature.

From the comments:

@mimo I suspect you might want to use this feature

With "you might want to use this feature", it was specifically meant that you as an AI developer can use this feature to fast forward while changing perspective...

  • The design goal of this commit is that singleplayer observers can fast forward and assigned players cannot.

The updateGameSpeedControl call upon init is necessary if the gamesetup chose 0.1, as the engine returned 0.10000000149011612, see rP20160.
The updateGameSpeedControl call upon selectViewPlayer removed in rP21149 was needed in case of enabling the developer overlay and changing oneself to be observer or player.
The updateGameSpeedControl call upon playerFinished is required so that the GUI object provides the fast-forwarding choices if the current player was defeated and only AIs remain. Why wasn't that removed too in rP21149 if its considered bothersome and intrusive?

When you put a custom high speed with F9

  • Since when do we make the GUI compatible to custom code execution? The GUI has its own state in many places. If we would want to account for everything custom that people can type using F9 it would be impossible, also useless.
  • While you haven't stated so, I assume the bothersome aspect was that you have started the game as an assigned player, enabled fast forwarding with F9, and then changed the perspective again. If the intent is to fast forward in the perspective of another player, change the perspective to observer, then disable the "change perspective" player option so that you can view the player in observation mode without actually becoming that player in play mode. You probably just didnt realize that assigning oneself to a playerslot is different than viewing a player in observermode, and that the dropdown changes whether you assign yourself to a player or whether you view the player in observermode.
This commit now requires verification by auditors.Oct 15 2019, 12:37 PM