Author Topic: [SUG] Infinite Skills hotkey  (Read 146 times)

0 Members and 1 Guest are viewing this topic.

Online WillLem

  • Moderator
  • Posts: 2820
  • Unity isn't sameness, it's togetherness
    • View Profile
[SUG] Infinite Skills hotkey
« on: May 18, 2023, 06:15:54 AM »
I'm attempting to implement a hotkey which sets the skill count of the current level to infinite-of-each (types remain the same).

It's easy enough to make the count change happen (barring a few wierd bugs when backskipping). The real problem I'm having is that it isn't as simple as just "set the skills to infinite, and then change them back later if you want" because if the level provides 5 of something, you set it to infinite and then use 6, what should happen when you press the hotkey again?

I can think of 5 possibilities:

1) Once applied, the skill count stays infinite until the level is restarted. Pressing the hotkey again doesn't change the count again at all. This is easiest to achieve and probably makes the most sense.

2) The count resets to the originally available count. This might seem to make sense, but if a player is already halfway through the level having used an infinite count to get there, then the original count becomes fairly meaningless. They might as well just continue with the infinite count.

3) The count resets to the originally available count, and restarts the level. Better, but might seem a bit jarring.

4) The count resets to the originally available count, minus the skills used, and any minus counts just show as zero. This option is slightly better than the second option, but would be the most difficult to manage code-wise and is fairly pointless seeing as we have a "used skills count" which would be far more useful in this scenario.

5) Keep the count at infinite, and toggle the used skills count on. This one also makes pretty good sense having considered the middle 3 options, but has the potential to be the most confusing.

Option 1 is my favourite. I think that if a user has chosen to switch on infinite skills, they've committed to playing the rest of the level with that option enabled, and so it should remain active until the level is either completed or restarted. The only problem with it is if the player accidentally hits the key without meaning to.

Another complication is replays: ideally, toggling infinite skills should be written into the replay so that any replays used with an infinite count on would make sense to the viewer, and wouldn't be broken by simply watching them without infinite skills.

Also, any levels played with infinite skills on shouldn't count towards level records, for obvious reasons. This would need to be managed as well. I think SLX might just be too complex an engine to deal with a feature like this.

I could do with some feedback on this. Do people think it's worth implementing the feature at all? What would you expect to happen if you pressed the hotkey again? Would you use it if it was there? I'm currently about 70:30 in favour of just chalking it up to "it's a good idea, and fun to do, but probably isn't worth the trouble."
« Last Edit: May 18, 2023, 06:21:05 AM by WillLem »

Online Simon

  • Administrator
  • Posts: 3612
    • View Profile
    • Lix
Re: [SUG] Infinite Skills hotkey
« Reply #1 on: May 18, 2023, 10:53:13 AM »
More possibilities:

101. Erase the extra assignments (those that have become illegal due to the reinstantiated cap from deactivating infinite mode) from the replay, and roll back physics updates to before you used the first extra. This works even when you don't write into the replay the action of making infinite skills. If there exist now-illegal assignments, roll back to before the first illegal assignment.

It's possible to have junk assignments from insert mode. (If you only have 5 platformers available for the whole level and have assigned them all, then go back and insert platformer assignments before they have been ''used," then the future assignments will now fail. The junk assignments are those failing future assignments.) But those are a separate design problem anyway. Might as well still treat the first illegal assignment as to where we roll back, it should be fine.

102. Create one extra savestate on entering the sandbox, and revert to that savestate. Does NL save everything on savestate or does NL still merely bookmark a physics update (= a single number) and call that a savestate?

-- Simon
« Last Edit: May 18, 2023, 11:02:06 AM by Simon »

Offline jkapp76

  • Posts: 223
    • View Profile
Re: [SUG] Infinite Skills hotkey
« Reply #2 on: May 18, 2023, 02:02:22 PM »
I don't know if I'd use this feature much, but I think option 1 seems okay.

Super Lemmini used to have a pretty cool "R" logo that swelled and animated in the right screen corner to let people know you were watching a replay. This was a nice touch. You could adopt this idea and add a different letter "?" to let the viewer know infinite skills is enabled. You could go full modern and add things like "Pause" and "FFWD" too.
« Last Edit: May 18, 2023, 02:39:46 PM by jkapp76 »
...Jeremy Kapp

Online WillLem

  • Moderator
  • Posts: 2820
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Infinite Skills hotkey
« Reply #3 on: May 18, 2023, 06:56:11 PM »
Super Lemmini used to have a pretty cool "R" logo that swelled and animated in the right screen corner to let people know you were watching a replay

Yes, I like that as well. As soon as I can figure out how to draw stuff to the screen in real-time (not as easy as you might think - I'm currently struggling with those Visual SFX you requested!), this will likely replace the current "R" marker on the panel. And yes, a visual cue for "infinite skills mode" (if implemented) would be good as well.



There is in fact way more complexity around the Infinite Skills hotkey than I originally anticipated. For example, if a player beats a level which normally requires at least 1 Miner, but uses infinite skills and therefore doesn't use Miners (because the infinite count allows other skills to be used instead), this gives an inaccurate "Skills You Can't Live Without" reading for that level in the player's records. Not to mention that it would mess with the records in general, due to its potential for allowing otherwise impossible results.
« Last Edit: May 22, 2023, 12:32:17 AM by WillLem »

Online WillLem

  • Moderator
  • Posts: 2820
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG] Infinite Skills hotkey
« Reply #4 on: May 22, 2023, 12:43:38 AM »
Reading back over Simon's comments today:

101. Erase the extra assignments (those that have become illegal due to the reinstantiated cap from deactivating infinite mode) from the replay, and roll back physics updates to before you used the first extra

I like this idea. The infinite skills action needs to be written to the replay for various reasons*, so un-toggling it could just delete that action (and that action only). Then, any legal assignments following it would play out as normal.

*backstepping even once cancels it, presumably because backstepping uses the replay up until that point, also it means replays can be shared with the infinite skills toggle written into them

102. Create one extra savestate on entering the sandbox, and revert to that savestate

I think this could be the answer, the more I think about it.

So, toggling Infinite Skills ON would do the following:

1) Set skills counts to infinity-of-each
2) Write the action into the replay
3) Create a Savestate (S) at that frame
4) Set variable 'InfiniteSkills' to "true"

Whilst 'InfiniteSkills' is "true":

1) No player records are observed
2) The level cannot be "completed", but the player can finish the level
3) We might need a different text in the postview screen prompting the player to try the level again without infinite skills, maybe

Toggling Infinite Skills to OFF does the following:

1) Play resets to Savestate (S)
2) The infinite skills action is deleted from the current replay (all legal actions following this play out as normal)
3) Variable 'InfiniteSkills' is set to "false"