TAS - SuperTux in 18 minutes… maybe less?
8 years ago
France

Hello!

Since some time I’ve been working on a Tool Assisted Speedrun for supertux. I chose to use supertux ability to record and run «demos» for this. I did a modified version of the game which accepts an option «--play-tas», which takes as parameter a folder containing a record file for each level. A record file is a file containing the input for a specific level. You can create one by using «supertux2 --record-demo lvl26.record /usr/share/games/supertux2/levels/world1/26\ -\ The\ Castle\ of\ Nolok.stl» for instance for the castle. (This is under GNU/Linux but you can do that on any system once you figure out where levels are stored). You can use the same command with --play-demo to play a demo file.

So I did a record for each level, and a modified version of the game which plays all this in a full game run. It also output «split()» each time it enters a level and I use this for autosplitting.

Here is a video of the first working version, and it beats the game in 17:49.6 already!

As you can see it’s still far from perfect as I did not optimise most levels yet. The levels that I did work on closely (that means I edited the record file by hand until I felt inputs were perfect) are:

  • Grumbels sense of snow
  • Living in a fridge
  • Castle of Nolok
  • No more mister ice guy (this one can probably be optimised but it’s hard as during a game run tux is big entering the level)

Note that at the beginning of living in a fridge kicking the icecubes may be losing a few frames, but it’s more fun and it’s the kind of frame perfect jump I like to put in a TAS.

So, you can find the TAS here: https://github.com/MCMic/supertux The record for individual levels are in data/TAS/levels/world1/. You can play them individually with a standard supertux2 0.4.0 by using --play-demo command. If you build the modified game you can use the --play-tas option on the whole folder.

So, now we need to create a perfect record file for each level. The idea is to start by recording a near-prefect run using the --record-demo option, and then if needed edit the record file by hand to make it perfect (you need a binary editor for this, and it take time. Format it blocks of 6 bytes representing the 4 directions and 2 action buttons). Note that some levels can be done fullspeed by gamepad and does not need any binary edition. We might want to focus on those first.

So, if you feel like helping, you can spot in the video a level which is badly optimised and record a better run for it. You can then send me the record file. (If you feel like binary editing it to make it perfect, do not hesitate, it’s fun too but it takes time)

Note: Sorry for the video having no sound, since last update my screenrecorder is behaving weirdly if I record sound as well.

France

Oh, Welcome to antartica is optimised as well, forgot to mention it. Never managed to do with the gamepad these final jumps allowing to finish it under 28 seconds ^^

Australia

Not throwing accusations around or anything, but the most recent run you did on welcome to antarctica looked eerily similar to the first level in the TAS.

France

Yes, I finally was able to reproduce the same technique I discovered while doing the TAS :-) But it’s really hard to land on the second green cube. The jump above the last ennemy is easy once you get there, the hard part is before. I often try to do this as I know it’s possible and if you miss the second green cube you can always jump again you don’t die. This was the first time it worked. (As explained in the comment I was not trying to beat this level record I was going for a full run but I messed up the other levels)

France

It’s weird, I got a notification saying namesnipes posted in this thread 6 hours ago but the post is not there…

@namesnipes : would you be able to record what you did on togble road for the TAS?

For Via nostalgica current TAS record is 35:54 and you got 35:53 but you said in the comment you don’t know why. Maybe the TAS loses a few frames on the first jump, not sure…

[EDIT] Oh and I think I will steal your strat on Via nostalgica for the two bouncing snowballs, going above seems safer than going bellow like I do.

Canada

How do you open up that console for supertux?

Australia

I think it's in Linux

France

Yeah it’s my console you see at the beginning of the video, not the one of supertux. There is one in supertux if you launch the developper mode, but’s not that usefull. You can get a big tux or display the hitboxes, stuff like that.

Canada

@MCMic a bit above

I don't really know how to record and play or anything for the TAS (if you can even do that on windows from the github). If you could explain it more I could record the tobgle road and possibly via nostalgic.

Thanks!

France

You need to use the windows console, in my time it was called cmd.exe, not sure if that is still the case. Then you need to find which command launch supertux, I’m expecting something like «supertux», «supertux.exe» or «supertux2.exe». Then you need to know where supertux stores its levels. It seems to be C:\Program Files\SuperTux.

So it should look like : supertux2.exe --record-demo togble.record "C:\Program Files\SuperTux\levels\world1\04 - Tobgle Road.stl"

I made a lot of guesses here so it might not work, please tell me what part fails and with what problem if any.

Canada

Yep, that worked with a bit of tweaking, thanks.

one question:

What happens after you finish the level your recording? it closes and does a recording go anywhere?

I'm not that familiar with this kind of thing so if I sound like I know nothing that's probably why

France

What you enter after --record-demo is the name of the file created, in my example it was «togble.record». So you should have a togble.record file in the folder the console opens. (I guess it should be your personal folder by default).

You can use the same command but with --play-demo to play a demo file. That allows you to check that the recording works. (You can also use this on files from the TAS if you want to play them: https://github.com/MCMic/supertux/tree/release/0.4/data/TAS/levels/world1 ) You always have to provide both the record file and the level file.

Canada

Just woke up and got it all working!

What levels do you want me to record and where do you want me to put them so you can download them?

France

Anywhere I can download them, really ^^ You can use https://framadrop.org/ for instance.

Levels before 23rd airbourne are pretty good already except from Togble road. Starting from 23rd airbourne to the bridge, any level you can do better than the time on the video is good for me (appart from «living in the fridge»). For the path in the clouds, I expect going down is indeed faster, so if you could record what you did it would be great. Is it completely full speed ? And I think ultimately the TAS will also go down on «Ice in the hole», as climbing at the beginning is quite slow.

Canada

I got 4 levels recorded for the tas you can get them here: Edit: Download didn't work for some reason you can find the link down a bit

France

Hum your upload failed somehow, the file is only 4 bytes. I think you tried uploading a folder and it did not work. Can you try either ziping the files together before uploading or uploading them one by one?

On my hand I have optimized Artic Ruins by hand modification and it’s now 47:78. (It was 52 in the record used by the TAS. My record with gamepad is 48:34)

I look forward to integrating you records and see how much seconds were saved total.

Canada

Sorry I didn't check to see if the download worked,

here's an actual working download for my tases in .zip!

https://framadrop.org/r/PLB2w1MF4f#appPvhqoRMGgSzjUUbXmq97uKO/nHbM+lvoESWSplFY=

Ill edit this post if I get anymore, also I will be getting more at spring break

France

Thanks, I’ve pushed them to the git. Except for Via Nostalgica, because I’d like to first try to understand where this save of time is coming from.

On my end I optimized The escape and next I want to work on Stone cold.

France

Hum, I meant In the stars, not Stone cold, I’m not quite good with level names yet.

France

In the end I optimized stone cold which was way more complicated than expected and only saved 2 seconds ^^