0.10.x game.player.cursorposition use triggers desync

This subforum contains all the issues which we already resolved.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14366
Joined: Wed Jun 11, 2014 5:23 am
Contact:

0.10.x game.player.cursorposition use triggers desync

Post 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.
If you want to get ahold of me I'm almost always on Discord.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14366
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

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

Post by cube »

What about a method game.enablenondeterministic() that triggers a big fat warning and disables replays and multiplayer.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

So we just disabled the property (and the zoom), in the public release. (will be applied in 0.11.15).
Post Reply

Return to “Resolved Problems and Bugs”