Page 1 of 1

0.10.x game.player.cursorposition use triggers desync

Posted: Mon Sep 22, 2014 7:07 am
by Rseding91
As the title says: game.player.cursorposition will trigger a desync if used during a replay. cursorposition poles the live cursor position every time it's called and that isn't a fixed position on a replay.

cursorposition, screen2realposition, and real2screenposition look to all be effected - they pole the live cursor/window to get their values and that isn't a fixed position/size during replays.

Re: 0.10.x game.player.cursorposition use triggers desync

Posted: Mon Sep 22, 2014 9:53 am
by kovarex
Yes, these methods were created especially for the trailer and these were not intended to be used anywhere else.

The question is whether to remove these methods completely, or just mark them somehow that they shouldn't be used completely.

Re: 0.10.x game.player.cursorposition use triggers desync

Posted: Mon Sep 22, 2014 12:47 pm
by Rseding91
That's what I thought :) They're quite useful as they are.

How about something like a startup warning that says "WARNING: %Method detected in mod %Modname. This method is not multiplayer/replay compatible; replay disabled." where it's only triggered on addition to a game/oninit similar to how the existing "replay disabled" warning is triggered?

The wiki could also be updated to make note that the method names are not meant for normal use and as such aren't compatible with replays/multiplayer.

Re: 0.10.x game.player.cursorposition use triggers desync

Posted: Mon Sep 22, 2014 1:54 pm
by cube
What about a method game.enablenondeterministic() that triggers a big fat warning and disables replays and multiplayer.

Re: 0.10.x game.player.cursorposition use triggers desync

Posted: Tue Feb 03, 2015 11:31 am
by kovarex
So we just disabled the property (and the zoom), in the public release. (will be applied in 0.11.15).