Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : _totaltime allows to do non-deterministic things
New Topic New Poll Post Reply
Poster Message
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon _totaltime allows to do non-deterministic things (+1)  
So as much as I like this entry to the troll contest I must report three bugs:

1. First of all, it is posible to use variable _totaltime as an unpredictable and non-deterministic seed for a random number generator. If ever it should only be allowed to use _totaltime.
2. Moreover _totaltime counts time from the moment player started the game, so if you use undo the time does not go back to the moment the undo happened, so you can undo, make a move and get a completely different result.
3. This is a spoiler for a solution to the entry:
Click here to view the secret text


For these three reasons I suggest doing one of these:
a) Remove _totaltime completely from the game
b) Disallow any hold using _totaltime from being promoted
c) Disallow any hold using _totaltime for gameplay purposes from being promoted
d) Disallow score points and mark the whole hold as not scorable if it uses _totaltime for gameplay purposes

I personally would vote for option A), becuase I don't believe DROD needs this, and requiring Hold Administrators to ensure every promoted hold does not abuse it is just putting additional work on their shoulders. Admittedly RPG is a bit different from regular DROD so it could stay but then we need to standarize its behavior (check bugs #2 and #3) and ensure that no one uses it for evil :)

____________________________
My website | Facebook | Twitter

[Last edited by skell at 02-16-2016 05:09 PM]
02-16-2016 at 05:08 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Mostly agree with #1. We don't have any published holds that currently use it, correct?

Total time is used when right-clicking the player to show total elapsed time. I think it should be kept to show the value here -- but not allowed in scripting.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 02-19-2016 03:08 PM]
02-16-2016 at 08:44 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Note to self: I also need to investigate whether "Total moves" is likewise coded up in a "non-deterministic" way, i.e., its value doesn't "reset" when you undo or restart a room, etc.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 02-19-2016 07:05 PM]
02-19-2016 at 07:04 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Fixed these issues:
* Script inconsistency: The "Total moves" variable wasn't being updated during the course of move replay when restoring game or undoing a turn, only at the end of move replay. Now it can be used correctly in scripting. (rev 226)

(rev 227)
* Should not be allowed to set the "Total moves" variable in a script (only query it)
* Removed use of "Total time" variable in scripts

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 02-20-2016 02:58 PM]
02-20-2016 at 02:28 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
I believe Washed Ashore uses the Total Moves variable for one of the score points, so that might not work anymore. Given that it's due an update anyway, looks like we should change it to use a global script that counts moves instead, by incrementing a variable by 1 each turn.

[Last edited by kieranmillar at 02-20-2016 02:51 PM]
02-20-2016 at 02:50 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
kieranmillar wrote:
I believe Washed Ashore uses the Total Moves variable for one of the score points, so that might not work anymore. Given that it's due an update anyway, looks like we should change it to use a global script that counts moves instead, by incrementing a variable by 1 each turn.
No, this variable should still work. I fixed a bug where this variable wasn't being set quite right when replaying moves for restoring game state or undoing a turn.

Specifically, say you enter a room with 100 total moves made. You take ten more moves in the room, and now the total is 110. Undoing a move does correctly revert "total moves" to 109. However, while the engine transparently replays those nine turns, the "total moves" counter was sticking at 100, and only once all the moves had been replayed was it set to 109. This would cause scripted checks of the variable to think "total moves" is 100 during the replay.

Based on your description, I don't think this would affect the score point in Washed Ashore. It could affect other scripts that use this variable, in inconsistent ways. I don't think anything needs to be changed in Washed Ashore.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-20-2016 at 02:55 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Ah apologies, I misread this:

mrimer wrote: (rev 227)
* Should not be allowed to set the "Total moves" variable in a script

As not being allowed to USE the variable, which is why I thought it would break the hold.
02-20-2016 at 02:57 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Ah, gotcha. I've clarified that line. Yes, the variable may still be queried, but not set.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-20-2016 at 02:58 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (+1)  
In Steam v1.2.5.230 you can read the TotalMoves variable but attempting to change it is ignored. It still shows up in the set var list though.

Trying to even read the _TotalTime variable doesn't work. This variable no longer shows up in the set var and wait until var lists :thumbsup
02-20-2016 at 07:16 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
reyll3
Level: Delver
Avatar
Rank Points: 33
Registered: 01-01-2007
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (+1)  
But that broke my troll hold! Nooooooo.

... And then I realise the rules once more.

May the Random Number Generator rest in peace in all future versions.

____________________________
A cat

[Last edited by reyll3 at 02-21-2016 09:51 AM]
02-21-2016 at 09:26 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
Ah, trolling the trolls :P

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-22-2016 at 01:04 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
reyll3
Level: Delver
Avatar
Rank Points: 33
Registered: 01-01-2007
IP: Logged
icon Re: _totaltime allows to do non-deterministic things (0)  
mrimer wrote:
Ah, trolling the trolls :P

Well, I just made the hold impossible on new versions. I don't think I care much~

____________________________
A cat
02-22-2016 at 01:06 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : _totaltime allows to do non-deterministic things
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.