Log In  

With the small size that PICO is, it should be possible to load and save state, much like you can do in a NES or SNES emulator.

In NESTOPIA you can even hold the backspace to run the game backwards, useful for getting out of a pit say in Super Mario Bros. But I think rewind may be just a bit more complex than save state.

If you're not familiar with what this is, by pressing F2 or F4 (you configure the keys) in the game, you can SAVE STATE.

By doing so, your game progress right up to there is saved to the pixel ! No need to save your game using a save-spot or even accessing menu options as part of the game.

Loading State is just as easy. You could shut down the game for instance, bring something else up, finally bring back up the original game and before the opening credits have even finished, you can press F4 or Load State and your game is returned exactly back where you left it.

Saving State in Pico means saving all variables, all memory, program line number being run, everything, to a binary file.

Loading State injects all that raw data right back in place again. As mentioned, this is very common in game emulators such as for Nintendo, Super Nintendo, Gameboy, and even Sony Pocket Playstation.

Naturally this would make platformers and other action games easier to play as you could SAVE STATE right at a part of the game where you knew you were safe.

What do you think - or do you think REWIND is possible as well ?

P#54685 2018-08-04 13:57 ( Edited 2018-08-05 03:27)

Trickier than an old console, since we've got up to 2MB of Lua data on a garbage-collected heap, not to mention the Lua machine state, to save.

Possible, of course, just tricky.

P#54690 2018-08-04 17:34 ( Edited 2018-08-04 21:34)

Hi, Felice:

  • Well, let's consider it from a utility standpoint.
-- initializing code
hsc={3,1}

-- lots of time consuming
-- runtime

print(hsc[0]/hsc[1])

How many times have we done this ? The program crashes because of an error, we repair the line where the error occurs but then have to endure all the other code with a total restart to re-run it back to this point.

Save State would help here. You could configure it so optionally any error that occurs will automatically save state right on the line that gave the error.

Fix the error, type RRUN (2-R's) in command mode and the state is loaded, right back where you made the error, and because you fixed it, the program would continue exactly at that same line.

That's one utility view of Load and Save State even if not for the ability to load/save state of any game to assist in actual gameplay.

P#54693 2018-08-04 17:57 ( Edited 2018-08-04 21:57)

It's not so simple. When you repair the error, you're most likely going to change something about the state.

Like, functions are data, for instance. The code inside them isn't dynamic, but if you have fn() defined somewhere, that means there's a global variable 'fn' on the GC heap that points to the actual code. With different code sizes, the internal pointers to all functions will move, so you can't just straight up copy all variables back. You'd have to re-map everything based on name and scope, and I suspect there's a significant chance of screwing that up easily.

Anything can be done, but PICO-8 is clearly a "spare time" project for zep, so you have to consider how much time he's going to be willing to dedicate to something that could be a very deep rabbit hole.

P#54713 2018-08-04 20:56 ( Edited 2018-08-05 00:57)

You could be right, Felice. Even at the earnings in purchases, Pico-8 may not be cost efficient to add something as complex.

I just know that ZSNES and NEStopia have these built-in - and thought it would be nice to consider ...

One thing I wanted to do, not to give all my project ideas in mind, I wanted to make a programming language that is mouse (or finger) access only that does include this ability of load and save state.

The language itself won't be very complex, but will be geared for simplicity in minimal code for maximum effort of the programmer wanted. One important test for it will be to see if a GOLF game, like the NES, can be written in it.

P#54720 2018-08-04 23:27 ( Edited 2018-08-05 06:35)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 23:07:37 | 0.005s | Q:11