Posts for marzojr

marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Hrm. For now, I think I will skip mapping Sky Sanctuary and go straight through to Death Egg. It turns out that those clouds are sprites, and will horribly pollute the map. Further, disabling the sprite layer they are on also disables all monitors and rings, defeating the purpose of the map. It there a way to disable those clouds? Maybe a way to edit the sprites to be totally transparent?
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Here are the maps for Lava Reef 2 (1.62 MiB), Lava Reef Boss (275 KiB, done for completness) and for Hidden Palace (223 KiB). I admittedly did not take as much attention to Lava Reef 2 timed sprites simply because there are too many scattered everywhere and I got a bit lazy.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Lava Reef 1 map is finished.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Warp wrote:
What would a "good enough" solution be good for, when the whole idea to use a bot is to get a frame-perfect solution? For a "good enough" solution you may just as well do it manually as currently and save yourself a huge amount of trouble.
A "good enough" solution would possibly be better than anything a human might come up with, and it might reveal many tricks no one is aware of because the input patterns are too weird/erratic. And these new tricks might be explored (once understood) by someone in an attempt to improve the"good enough" solution. Moreover, given the way genetic algorithms work, you could get a "good solution" within the lifespan of the Universe without requiring MAJOR breakthroughs in computer technology and/or computer science. Consider a console that has 16 "buttons" that can be on or off (considering up/down/left/right to be one such "button" each). That amounts to 2^16 combinations for the first frame if all the buttons are used in the game (by the way: BadPotato *vastly* underestimated the number of combinations in his calculations); this amounts to about 10^289 combinations in 60 frames (1 second). If you could check 1 billion such possibility every second, it would take over 10^272 years to finish them all (that is, to test a single second's worth of input). Also, such a "good enough" solution might also come within 100 frames of theoretical "perfection" if enough generations are run. I further submit that nobody would know how close any such "good enough" solutions are to "perfection" because the "frame-perfect" bot will never finish executing -- unless it gets "lucky" and finds a shortcut from start to end of game in a couple hundred frames among the first few billions of attempts it makes.
Warp wrote:
You could try to use smarter pruning algorithms such as A*[...]
A* is actually not a pruning algorithm, but a search algorithm -- it only discards ("prunes") paths that have been proven to be longer than the best path found yet. A pruning algorithm stops examining a possibility when it is "proven" to be worse than the best found yet. This means it may end up skipping a possibility because the "proof" may not be perfect -- most chess playing programs use pruning algorithms at high depth and supplement it with a brute-force search at a lower depth to make sure it hasn't missed a possibility it would otherwise have eliminated (such as giving away the queen, a rook, a bishop and two knights -- all usually very bad choices -- in order to deliver checkmate). Likewise, for a TAS, taking 10 times as long to complete a stretch of the game might allow you to skip the rest of the level, saving minutes, but it could be pruned because the "best" run found so far takes a lot less time in that same stretch. Thus, using any pruning algorithms means you may not end with "the" best solution, but only another "good enough" solution.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
A better class of "brute force" bots could be designed as an evolutionary algorithm (specifically, a genetic algorithm). This would be painful to code, and possibly highly inefficient when done in Lua, but would still beat the two proposed methods in terms of speed (by several orders of magnitude). However, you wouldn't get "the" perfect solution, just one "good enough". It would also have lots of game-dependent code to check for objectives (but all of the other methods should as well, so no problem here). The idea is to start with input that finishes the game* (or a level of the game, to make this more feasible); this can be from a TAS or from a regular run. You make several copies of this input, making random adjustments ("mutations"**) to each (one of which could be an unaltered version of the original input, but this isn't required). Maybe 100 to 200 children, depending on the size of the input. You then "rank" each of these "children" input according to its "fitness" (e.g., checking if it finishes the level/game or not, if it dies in a "no death as a shortcut" run, if needs less input to finish the level/game, etc.). The best ranked "children" (say, 20 to 40 of them) input "survives" and have "children" of their own (use the same limit as for the first generation: a total of 100 to 200 "children") which have mutations like before. Wash, rinse, repeat until you have input you like. This will still take many weeks, probably months or even years of computation for a "large" game, but it will be billions of times faster than the two methods you propose. See the Wikipedia article for some more information if you are interested in using this. * = Strictly speaking, you can start with a set of completely random input (say, 100 to 200 random movie files) rather than a single "superparent" that finishes the game, but this will add a lot of time until you have any input that finishes the game. ** = Mutations can be: a change, the deletion or the duplication of a range of input. And should have relatively low probability of happening (consider that a movie might have tens of thousands of frames and even a small chance can happen far too often).
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Wow, VGMaps is a little short on Sonic maps compared to you guys now.
The more Sonic-oriented sites are a much better source for Sonic maps than more generic map sites; for example, Sonic Retro has several maps by Upthorn, Stealth and others. I am just completing the S3&K map set of maps that also show sprites. Which reminds me that another map bites the dust*: Sandopolis 1 is done (1.74 MiB). That leaves Lava Reef (1 to 4), Hidden Palace, Sky Sanctuary, Death Egg 1 & 2 and The Doomsday (if it can be mapped at all...). * Although I guess that 'sand' might be more appropriate than 'dust' in this case.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
That did the trick, thanks. Using the twice-hacked ROM, I now have done the Flying Battery maps too: act 1, act 2.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Launch Base 2 map is here (916KiB), already with the hacked monitors. By any chance, is there a similar hack for the big rings? Sure they are fewer and farther apart than monitors, but it would still help.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
upthorn wrote:
The main reason I never did Launch Base, though, was because I couldn't figure out how to deal with the tileswapping for those inside/outside areas in an easy way.
I did it by enabling debug mode, activating it and teleporting inside the inside area in question to swap the tiles. It had the nice additional effect of showing the camera position; it also did not trigger effects such as the bosses. It had the unfortunate effect that I had to do a couple of parts again because the game placed some extraneous rings here and there, but that was easy to spot and fix.
upthorn wrote:
1. Make a copy of your S3K ROM, and open that copy in a hex editor go to 0x01DB50, and replace [...] with [...] to prevent monitors from ever showing static.
Now, that is useful! Thanks, redoing monitors to disable static was a pain.
upthorn wrote:
2. Before dumping maps, enable graphics->layers->sprites->sprites always on top. This will cause rings and monitors and enemies to show even when they would normally be obscured by scenery.
I did that more towards the end (about halfway through), but it didn't make much difference for the top half (and I redid the parts where it did make a difference).
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Uff... it was quite a bit of work*, but I finally managed to get Gens maphack to work as I wanted! The first map is for Launch Base 1: here it is (warning: it is 0.97MB in size). * For those that care: first, there was a scrolling limit bug that had to be fixed (alternatively, a bitmap-size bug, but it was easier to fix as the former) -- X and Y from lines 1833-1834 have to be pre-divided by the ratio (rounding up) or you will be able to scroll too far to the right or bottom for certain scale factors (most of them, actually). I also had to tweak the values of X and Y for Launch Base 1, as large parts of the level were being cut otherwise. The automatic mode was sadly more annoying than useful, so I turned it off (in particular, the changed X and Y values caused it to hang continuously). Then I disabled ring animation to help make the map; but the line in question actually in SonicHackSuite.cpp actually does it wrong, and instead makes the ring rotate extremely quickly (instead of setting the timer to zero -- causing a change every frame -- it should be set to (say) 127 instead). Finally, the pre-divided X and Y values from above forced me to adjust the line that sets the water level for levels without water. Each of these forced me to restart the map, but eventually it was done. I think (hope) that the other maps will be a lot easier now that I have some experience with it.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
New WIP until end of IceCap 2. Act 1 is almost 3 seconds faster and act 2 is 1 frame faster. The act 1 trick came from an unassisted run I found by accident.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
For the S3&K "go super" button: I made a script demonstrating how to make the Super/Hyper transformations (it is here). It is even possible to make a "Turbo Tails" transformation with only the seven chaos emeralds (it is off by default in the script I posted). You are free to incorporate it in your script if you wish.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Well, I now just have to figure out how to force Gens to let me actually scroll to the bottom of the stage -- there are five or six rows of about screen height missing from the bottom because of that, including a good chunk of the bottom route.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Wow. You really weren't kidding when you said the game doesn't like being force scrolled, huh? After a few resets, the game eventually got stuck at lag frames, showing only this: In the end, I was forced to manually reset the 68000 processor so the map hack could continue. Edit: it seems that the map hack has reset along with the 68000 processor, and is back at failing at the same spot: about maybe 3-4 half-screens down from the initial position, after the first (vertical) rotating gray cylinder. This is around the area where the Knuckles cutscene happens, if I am not mistaken. Edit 2: It seems I was wrong and it went all the way through. After going over the level as described, however, hitting 'B' had no effect except if I left capslock on (that is, if I ignored step 20). And now I know why your maps do not have backgrounds too.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Does numlock have any special effects? I am finding that I can't scroll the screen if numlock and capslock are both on, but capslock on and numlock off scrolls automatically (including "correcting" any initial downward scrolls with k) scanning the level from left to right, top to bottom. Moreover, this automatic mode end up resetting the game partway through Launch Base 1 (even if I force Sonic to remain in the center of the screen).
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
OmegaWatcher wrote:
Generally, I wouldn't like skipping maxing ammo in a 100%, but...
Acheron86 wrote:
Let me just thank you for not forcing us to endure 10 minutes of tossing money in a pond to talk to some miserly fairy.
But will the others viewers like it?
To give my two cents: I'd say that, if he upgrades the amount of arrows and bombs at all, he should do it once each just to show it can be done; any more than that would be a waste of time.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
A quick question (probably for Upthorn): how does the Gens maphack work (SONICMAPHACK from hackdefs.h)? I ask because I assume that several maps from the Sonic Center were made by Upthorn with it, but there are several maps still that are not (Launch Base 1 & 2, Flying Battery 1 & 2, Sandopolis 1, Lava Reef 1 & 2, Hidden Palace, Sky Sanctuary and Death Egg 1 & 2), being Stealth's version (which do not have rings and big rings, being less useful for Super/Hyper Sonic planning). I also threw Hidden Palace in the mix just to be complete, it actually makes no real difference in this case. (by the way: in the latest SVN, defining SONICMAPHACK causes a compilation error unless I include the "io.h" file, say at line 1694 of SonicHackSuite.cpp)
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
upthorn wrote:
marzojr wrote:
It is still 45 frames slower than SprintGod's run, though.
Is this including the time spent in special stages?
Sorry, I was unclear: this is comparing the in-game time in IceCap 2 only (the timer stops at 0:41:06 in SprintGod's run, 0:41:51 in my last WIP). If time in special stages is included, I am several minutes slower (the last hit on the boss of IceCap 2 happens in frame 77887 in my run, and in frame 52171 in SprintGod's run; that's a difference of 7:08::36).
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
New WIP up to IceCap 2. Earlier Supersonic + better optimizations along the way mean a full second faster than the previous WIP, at the expense of more time after the act 1 boss to get all 3 monitors. It is still 45 frames slower than SprintGod's run, though.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Knuckles route is quite slower -- for Sonic or Supersonic at least, but Hypersonic would do very well (as might Sonic with a bubble shield, but this is more doubtful). Take the purple launcher I use at around 0:08: I have to take at the very least 3 of them in the bottom route, and it costs time (see this map, by Upthorn). I need to hit it from above with a certain minimum vertical speed in order to propel up enough to reach the higher ground; Knuckles' glide makes that more effective (as would Hypersonic's hyperlaunch, and so might a bubble bounce). After that, a properly timed jump is invariably better than letting the thing launch me. But it costs a lot of time, and this is time spent moving only vertically. Properly optimized, I estimate that this route is, at best, 1 or 2 seconds slower than the current WIP. And for what is worth, I was vastly overestimating the effects of reaching the ledge: I made a try with Hypersonic, using the Hyperlaunch to reach the ledge. It "only" saves about 2 seconds.
FuzZerd wrote:
couldn't you do the boss skip
What boss skip?
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
WIP until end of IceCap 2. I am not happy about this one, but I don't think there is much to be done here. I tried to pick the 3 ring monitors after the act 1 boss, but all attempts failed to get the third monitor out of the ground. It might save some time, but not enough. The lack of lightning shield hurts my start, but it hurts even more at 0:22-0:25: it seems to be impossible for Supersonic to reach the ledge (at least it defied all my tries), and the bottom route is slower. Reaching that ledge would net me at least 3 seconds, possibly 4 or 5; as is, I am 1:45 slower than Sprintgod's run. I don't think that getting the lightning shield back in act 1 is worth it, and it will definitely make Supersonic more likely to show up in act 2.
DDRKhat wrote:
Encode of Carnival Night Zone Act 2 Split-screened with Cam-Hack on the right side.
It is nice to see it in real-time and without all the junk that makes it easier to TAS. But maybe having a dividing line of some sort between the two screens would make it easier in the eyes, though; it is hard to see where one screen ends and the other begins in some points.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
WIP until end of IceCap 1. Supersonic can go no further with the snowboard at the start, so I ditch it: having the snowboard makes all jumps very low, but give high horizontal speed just by touching the ground. By the end (around 1:06), climbing the slope to the right (as Super Knuckles does in Upthorn's run) would have left me without the swing I use in 1:12; spindashing all the way to the right and back gives it back, but it is slower than the WIP (by about 105 frames). Likewise, glitching into Knuckles' route and fighting Knuckles' boss is 130 frames slower (despite the fact that the higher ground makes killing the boss faster).
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Thanks. Here is a 7z-package containing the script and luaimg files. It is intended to be extracted directly into the Gens directory: this should create a "lua" directory with the script in it and a "lua/img" directory filled with "*.luaimg" files. I updated the Pastebin version to point to the same location too (previously, it looked for the "*.luaimg" files in a "luaimg" subdirectory of the Gens directory). Edit: I have updated the script to be accurate down to the frame for speed shoes, invincibility and flight countdowns. The updated version is here (Pastebin, script only) and here (Mediafire, script and images). I updated the link above too. (edit 2: and I fixed the last uploads to actually work)
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Using the sample scripts as models (as well as the script from this thread), I made a Sonic HUD lua script that has loads of relevant and interesting data; here is an example of it in action: The "status icons" between the score/ring/emeralds HUD and Tails' HUD only show for the relevant condition: in this case, a spindash being charged (displaying charge, at 100%), speed shoes (remaining frames), super transformation (remaining frames) and Tails remaining flight time (in frames). Invulnerability time, invincibility time (after being hit, for both players) and Tails' spindash charge are also displayed. The HUDs are only shown in "non-boring" more (using the same definition that Nitsuja used in his script) and Tails (and his status icons) only appear in Sonic + Tails mode (his status icons do if you are playing as Tails). I used the GDlua library to convert several PNGs to the Lua format; the resulting images (which I saved with a "luaimg" extension) must be used alongside the script (and they total 50kB, or 10kB in 7z format). Using this format, GDlua is not needed at all for using the script; but there is the problem or distributing the images. Does anyone know a good place to upload lua-style images? ImageShack doesn't accept them. For what is worth, the HUD script is here; it will not work without the images, though.
Marzo Junior
marzojr
He/Him
Experienced Forum User, Published Author, Experienced player (751)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Kuwaga wrote:
I guess the routes were copied from [URL=http://tasvideos.org/1378S.html]here[/URL].
Aye, it is; I stated as much earlier.
Marzo Junior