Send players current time as event to all others
Moderator: ickputzdirwech
Send players current time as event to all others
There are reasons, why the current time of the computer the game is running on, cannot be read: It breaks determinism.
But knowing that in the game is useful.
It would be possible, if the current time is an event, just as if the player is clicking an input box and inputs the current time; that would not break the determinism, it is just an event like clicking on an item.
So, that is the suggestion: Send in regular intervals the current time of the hosting computer as an event (typically every minute ). That would help to implement special functions, like timers (which will go wrong, when you relied on the game-time) or other useful things.
For multiplayer and for saved replay-games this means, that everybody knows, how late it is on your computer, which breaks the data-security: For that reason, this function should be off by default, but could be turned on in the options.
But knowing that in the game is useful.
It would be possible, if the current time is an event, just as if the player is clicking an input box and inputs the current time; that would not break the determinism, it is just an event like clicking on an item.
So, that is the suggestion: Send in regular intervals the current time of the hosting computer as an event (typically every minute ). That would help to implement special functions, like timers (which will go wrong, when you relied on the game-time) or other useful things.
For multiplayer and for saved replay-games this means, that everybody knows, how late it is on your computer, which breaks the data-security: For that reason, this function should be off by default, but could be turned on in the options.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Send players current time as event to all others
timers relying on game time would be more accurate than relying on wall clock time, lag delays everything equally
Re: Send players current time as event to all others
That is not correct, because you cannot know, how much FPS you currently have (that information wold be also non-deterministic ). The speed changes, even with very small bases. 60 FPS is normally right, but not always.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Send players current time as event to all others
Ssilk, could you explain why this is necessary?
I can't think of any reason why I should want to know (in-game) the local time for one of the other players. If I really want to know I can just ask them in chat
For timers, I have to agree that game-time sounds like a better option, so for example a mechanism could be - send all players a message to fire a specific event at game-tick n, and then it stays deterministic.
I can't think of any reason why I should want to know (in-game) the local time for one of the other players. If I really want to know I can just ask them in chat
For timers, I have to agree that game-time sounds like a better option, so for example a mechanism could be - send all players a message to fire a specific event at game-tick n, and then it stays deterministic.
Re: Send players current time as event to all others
The problem is, that if I do any action in game it needs to be send to all other clients. Thats in general also true for this.
Well, the simple thought is then, this event could be filtered, so that it is not send to the others. But then it looses the determinism, too, cause there are then events, that are not happening on all clients in the same way.
Well, I'm out here. I mean, there are surely ways to do this without sending, but I don't know, how. Your idea looks like a cool solution of this problem, but it will make a replay also non-deterministic, cause the time when playing is then different to the time, when replayed. And if I use the generated event and save that, we are again at sentence #3 of this post.
Well, I'm out here.
Well, the simple thought is then, this event could be filtered, so that it is not send to the others. But then it looses the determinism, too, cause there are then events, that are not happening on all clients in the same way.
Well, I'm out here. I mean, there are surely ways to do this without sending, but I don't know, how. Your idea looks like a cool solution of this problem, but it will make a replay also non-deterministic, cause the time when playing is then different to the time, when replayed. And if I use the generated event and save that, we are again at sentence #3 of this post.
Well, I'm out here.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Send players current time as event to all others
or save those events in the replay as well (overriding cpu time)ssilk wrote:The problem is, that if I do any action in game it needs to be send to all other clients. Thats in general also true for this.
Well, the simple thought is then, this event could be filtered, so that it is not send to the others. But then it looses the determinism, too, cause there are then events, that are not happening on all clients in the same way.
Well, I'm out here. I mean, there are surely ways to do this without sending, but I don't know, how. Your idea looks like a cool solution of this problem, but it will make a replay also non-deterministic, cause the time when playing is then different to the time, when replayed. And if I use the generated event and save that, we are again at sentence #3 of this post.
Well, I'm out here.
Re: Send players current time as event to all others
I still don't understand why this is needed....
Re: Send players current time as event to all others
Usage: To calculate the true length of playing for example. Or displaying the current time. Or for example, automatically shutting down Factorio, when in server mode...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Send players current time as event to all others
As SillyFly already mentioned: I don't get it. Who needs the current time in-game?
1. Local time
E.g. my chat reads this:
[Player 1]: 12:00 - 01.01.1970
[Player 2]: 18:00 - 01.01.1970.
What information do I get from this? Oh my american friend is in America and I'm in Europe... Fine I already know that.
2. Actual time played
This could be nice if you are a speedrunner or something but I don't think that it matters in normal singleplayer games. I mean if there is a time difference of let's say 5 Minutes. I don't care.
3. Shutting down the server
Sorry my friend but I would never stop my headless server. The real purpose of a client - server system is to let the server run indefinetly. I would rather do this with "cron" (Linux) or "scheduled tasks" (Windows) than let the software decide when to shut down.
1. Local time
E.g. my chat reads this:
[Player 1]: 12:00 - 01.01.1970
[Player 2]: 18:00 - 01.01.1970.
What information do I get from this? Oh my american friend is in America and I'm in Europe... Fine I already know that.
2. Actual time played
This could be nice if you are a speedrunner or something but I don't think that it matters in normal singleplayer games. I mean if there is a time difference of let's say 5 Minutes. I don't care.
3. Shutting down the server
Sorry my friend but I would never stop my headless server. The real purpose of a client - server system is to let the server run indefinetly. I would rather do this with "cron" (Linux) or "scheduled tasks" (Windows) than let the software decide when to shut down.
Re: Send players current time as event to all others
For 'actual time played' for speed-running etc. it would actually be better to use game-time. If your game somehow slowed to 30 fps it shouldn't meet you took twice as much time to complete the game, as all tasks, crafting etc. would be stretched proportionally.
Re: Send players current time as event to all others
The time from player 2 is needed to keep the game deterministic. Deterministic means: All events have to happen on all clients in the same way. Sending time is an event.Bytenex wrote: [Player 1]: 12:00 - 01.01.1970
[Player 2]: 18:00 - 01.01.1970.
I my own real-time into game. But maybe you're right: The usage-cases are limited.What information do I get from this? Oh my american friend is in America and I'm in Europe... Fine I already know that.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Send players current time as event to all others
I think you don't get the definition of deterministic. It means that a world is bound to its rules. E.g. you can't let a ball fall upwards because it is not permitted by physical laws. Same applies to your external time. It doesn't make sense to implement actions based on a rule of an outside system.ssilk wrote:The time from player 2 is needed to keep the game deterministic. Deterministic means: All events have to happen on all clients in the same way. Sending time is an event.Bytenex wrote: [Player 1]: 12:00 - 01.01.1970
[Player 2]: 18:00 - 01.01.1970.
Re: Send players current time as event to all others
Uh. So you need to remove intermediately your mouse and keyboard, when playing! Hurry up, you are injuring the rules of determinism!
Deterministic in this case (Factorio) means of course, that the events, that needs to be triggered from outside are handled in the same way on all instances (clients). That was the reason, why the time-functions where removed - I think 2 years ago - because they are different on each client.
Deterministic in this case (Factorio) means of course, that the events, that needs to be triggered from outside are handled in the same way on all instances (clients). That was the reason, why the time-functions where removed - I think 2 years ago - because they are different on each client.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Send players current time as event to all others
You are right. But still the game-time would be a better indicator to trigger events than an external time. Your headless server (0.12) could handle this. Clients will always be synchronized to his game-state. You also said that these events triggered by the server could be filtered. Yes; but that would be cheating, wouldn't it?ssilk wrote:Uh. So you need to remove intermediately your mouse and keyboard, when playing! Hurry up, you are injuring the rules of determinism!
Deterministic in this case (Factorio) means of course, that the events, that needs to be triggered from outside are handled in the same way on all instances (clients). That was the reason, why the time-functions where removed - I think 2 years ago - because they are different on each client.
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Send players current time as event to all others
Exactly speed runners prefer in-game time if they can get it.sillyfly wrote:For 'actual time played' for speed-running etc. it would actually be better to use game-time. If your game somehow slowed to 30 fps it shouldn't meet you took twice as much time to complete the game, as all tasks, crafting etc. would be stretched proportionally.
Re: Send players current time as event to all others
I move that to won't implement. This suggestion is missing the concrete usage case and only to implement it for speed runners or other questionable stuff and such is not reason enough.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...