Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
marzojr wrote:
Talk about coincidences... I was talking to WST on Skype about teaming up to TAS this game a few days ago.
How about this. I asked him why no one TASes 3DBlast exactly 5 days ago! That game's music tracks composed by famous Tetsuyuki Maeda are fantastic.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
marzojr
He/Him
Experienced player (760)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
feos wrote:
How about this. I asked him why no one TASes 3DBlast exactly 5 days ago!
I know; WST mentioned that o me and I replied with "why don't we?", followed by looking into physics and control, scanning threads for TAS information and perusing the disassembly.
Marzo Junior
Joined: 5/9/2005
Posts: 751
Awesome to see people (and so many of you!) looking back into this game; thought it be permanently dead. Wip looks great so far aji; nice work!
aji wrote:
It's going to be tough going forward without a reference like this!
Not sure if this will be useful at all as it was rejected for good reason, but there was a previous submission that could be used as a basic reference. Possibly not much better than nothing, but just so you're aware of its existence.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Paused wrote:
there was a previous submission that could be used as a basic reference.
Pretty much.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
aji
Joined: 11/19/2014
Posts: 4
Location: IRC
Thanks for getting the disassembly, feos! It does have names, just very few of them. Usefully, there are at least IngameRun, RunLevel, and RunSonic labels.
marzojr wrote:
I am interested in helping; if not with outright TASing (because last I checked I still could not use BizHawk in Linux), at least with information. Since I can peruse the disassembly without difficulty, feel free to ask questions and I will try to find answers.
I would love to have your help, marzojr! I know my way around 68000 asm a bit, but as this is my first ever TAS I can definitely use the help, especially from someone with your experience. I don't have any big questions right now. Better visibility into the in-memory structures would certainly be useful, since at some point I want to write a more comprehensive HUD. Something I've learned that might help: at FF11C6 is what appears to be a list of short pointers to on-screen objects, which should make it a lot easier to locate object memory. There's a similar-looking list at FF1124. I haven't figured out what either of them are actually used for yet. The game runs fine (albeit with missing sprites and no collisions, though shadows still show up and objects appear to be receiving updates) with either both lists frozen or just the FF11C6 list frozen, but with just the FF1124 list frozen the game soft locks after a bit. At FF0A08 is a 4-byte value that flips between these two addresses, and according to Sik's notes, FF0A0C is the number of active objects.
Editor, Experienced player (586)
Joined: 10/22/2016
Posts: 581
Location: Argentina
maybe an adaptation for the Sonic hud in this game will be awesome
You can see more TASes on my youtube channel
marzojr
He/Him
Experienced player (760)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
I thought about making a modified version of my HUD for Sonic 3D, yes; but since aji is doing the run in BizHawk, it is unlikely to work — BizHawk is very different from Gens, and lua scripts for one are unlikely to work on the other without a lot of changes. As to why I don't do this translation: I can't really use BizHawk. The stock Windows version does not run under Wine or Mono, the Mono version is useless (it has neither Genesis core nor lua), the Linux version is all but abandoned (and it has neither Genesis core nor Lua). The OSX version does have both, but I doubt it will run on Linux under Darling (it is nowhere near mature enough). So my options are to either get an expensive crap proprietary OS (Windows), a very expensive crap proprietary OS (OSX) or continue using Gens. With that out of the way: here are some addresses that should be useful:
Sonic:
	Base:			$FFC1E6
	X position:
		Pixel:		$FFC1EC (word)
		Subpixel:	$FFC1EE (word)
	Y position:
		Pixel:		$FFC1F0 (word)
		Subpixel:	$FFC1F2 (word)
	Z position:
		Pixel:		$FFC1F4 (word)
		Subpixel:	$FFC1F6 (word)
	X speed:
		Pixel:		$FFC1F8 (word)
		Subpixel:	$FFC1FA (word)
	Y speed:
		Pixel:		$FFC1FC (word)
		Subpixel:	$FFC1FE (word)
	Z speed:
		Pixel:		$FFC200 (word)
		Subpixel:	$FFC202 (word)
	Inertia:
		Pixel:		$FFC204 (word)
		Subpixel:	$FFC206 (word)
	Flags:			$FFC222 (word)
	Angle:			$FFC218 (word)
	Spindash:
		Charge:		$FFC23E (word): 3 = minimum charge, 0 = maximum charge
Speed cap is $7FFFF in X and Z (no speed cap on Y). Y speed is subtracted from Y position; X and Z speeds are added. The addresses you mention are interesting, and I will keep then in mind; but it is likely that the collision code is either in Sonic's code or after all objects have run (or, with no luck whatsoever, in another function called by each object) and the lists may be just to speed up collision checking.
Marzo Junior
aji
Joined: 11/19/2014
Posts: 4
Location: IRC
BizHawk's Lua interface is indeed quite different from the one in Gens, and I'm not sure how much of the Sonic HUD code would be reusable without major modifications. For example, I went to write a basic jump predictor and found that apparently BizHawk Lua has no equivalent to gens.emulateframeinvisible(), or even a way to automate frame advance at all since every call to emu.frameadvance() just defers the script. I'll have to write that functionality as a "jump finder" bot instead, it seems. The other option I considered was figuring out how speed is calculated during a jump and doing the prediction that way. I unfortunately wasn't able to figure that out, but I did figure out that the values at FFC204 and FFC206 are the forward and lateral components of Sonic's speed. These values are computed from his angle and X/Z speed, and might only be used for choosing animations and detecting skids. Comicalflop was calling FFC204 "speed" and was optimizing based on that. This does reflect Sonic's speed if he's moving in the same direction he's facing, but if facing a direction other than the one he's moving (such as when turning) the value at FFC204 will be less than Sonic's absolute speed. I spent last night converting some code into C, starting at loc_3510 and going backwards, since I understand C better, and here's the code that computes those values. This is a very short part of sub_2DDE which is called from IngameRun and appears to be the subroutine to update Sonic's motion. (Sonic's base address is loaded into a6 pretty early and not touched for the rest of the subroutine.) By the way, here's the .wch file I've put together so far. It doesn't have a lot you don't have already, but should save a bit of time. (Also, I did manage to save some frames, and now am only 7 frames away from the level timer showing 0:42. Guess I'm not done with GGz1 yet!)
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
BTW, if you see some code in that disassembly that isn't converted from raw data, let me know, I can force conversion to code for such places.
aji wrote:
For example, I went to write a basic jump predictor and found that apparently BizHawk Lua has no equivalent to gens.emulateframeinvisible(), or even a way to automate frame advance at all since every call to emu.frameadvance() just defers the script.
To force advancing a frame you client.unpause() and then client.pause() on the next frame. emulateframeinvisible() can be probably hacked in in some way. I successfully converted this to bizhawk after all.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (98)
Joined: 12/12/2013
Posts: 378
Location: Russia
weeee!!! gonna go fast
aji
Joined: 11/19/2014
Posts: 4
Location: IRC
So last week I did manage to get 0:42 in Green Grove Zone Act 1, by collecting the 2nd flicky in the first part a bit faster: https://www.youtube.com/watch?v=ilZJvY_zRzw I guess I got lucky and the second half of the level synced perfectly, coming in at 42 seconds and 58 frames. I'm fairly confident there's not much room for improvement left. Maybe a frame here or there. 0:41 or less doesn't seem possible with current techniques, but I would love to be proven wrong about that. I'm considering a non-linear approach, using the level select cheat to do each act individually and splicing the input sequences together. I suspect most in-game events are controlled only by the level timer, possibly including randomness. However some levels (like boss fights) don't include any randomness at all, for example Rusty Ruin Act 3, so I could knock those out right away without knowing for sure if desyncs are a risk. I might also do a separate bonus movie of Final Fight this way, since it's not part of an any% run. After all, a good TAS should beat all existing records.
Joined: 5/9/2005
Posts: 751
Didn't think I was too interested in 3D blast, but really excited at seeing this pushed to its limits like it is. Looking great!
Active player (261)
Joined: 12/13/2016
Posts: 352
3D Blast is the first Sonic game I ever played (and the only one I knew about until the last couple of years)... which I was extremely confused to see all these 2D sidescroller Sonic games. I played this game a ton as a kid, and had a lot of difficulty completing it; hope you keep up the good work TASing it!
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
Came across this video earlier which was made by the main coder for the game. He explains that if you're able to create an exception within the game. That is dividing by 0; having too many sprites on the screen; illegal instructions etc, then instead of the game crashing . It would jump to the level select screen. Which was done to get past Sega's quality control, as it would prevent the game from hard crashing. Preventing Sega from sending the game back to the developers to fix. Thus saving time and money. Link to video
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Oh boy. I don't want to turn this topic into a video sharing one, but what Jon keeps doing there is unbelievable. He's going to release a huge patch to Sonic 3D blast. Link to video He has a whole bunch of other unique material there, some related to S3DB.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (98)
Joined: 12/12/2013
Posts: 378
Location: Russia
I don't like only name. If it's director's cut, then it's author should be "director". If it is indeed director's vision of game, then ok. But if it's just ideas of some hacker of original game, it should not confuse people that is is director's vision of game.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (98)
Joined: 12/12/2013
Posts: 378
Location: Russia
feos wrote:
https://en.wikipedia.org/wiki/Jon_Burton
Didn't know, but anyway: 1996 Sonic 3D Blast Programmer
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
Jon released an update to his directors cut Link to video I like how the steering is tighter and how it's easier to maintain your momentum, but most of the other changes dumb down the game too much.
WST
She/Her
Active player (488)
Joined: 10/6/2011
Posts: 1697
Location: RU · ID · AM
That’s his vision of “less frustrating” :)
S3&A [Amy amy%] improvement (with Evil_3D & kaan55) — currently in SPZ2 my TAS channel · If I ever come into your dream, I’ll be riding an eggship :)
Skilled player (1456)
Joined: 11/26/2011
Posts: 656
Location: RU
Not losing rings during having boots... I feel it is completely wrong, it's against Sonic nature. And also not lose all flickies after damage... I am disappointed in this Gameplay Update.
I show you how deep the rabbit hole goes. Current projects: NES: Tetris "fastest 999999" (improvement, with r57shell) Genesis: Adventures of Batman & Robin (with Truncated); Pocahontas; Comix Zone (improvement); Mickey Mania (improvement); RoboCop versus The Terminator (improvement); Gargoyles (with feos)
Editor, Expert player (2088)
Joined: 8/25/2013
Posts: 1200
I think it's a good update. Not every old game needs to be super difficult, and most of the difficulty in the original came down to poor ideas anyway.
effort on the first draft means less effort on any draft thereafter - some loser
ajfirecracker
He/Him
Player (63)
Joined: 10/11/2017
Posts: 32
I spent some time messing around with different RTA-viable things to try and get the level select / crash screen to come up (see Mitjitsu's post above) There's an audio overflow glitch in the sound test menu. To activate it, play a track that doesn't loop (like the music from the intro FMV, 14) then as it ends play the 100 rings one-up music (19). The one-up music will play and when it ends, it plays the previous track - only now that track has ended and it's reading random garbage into the sound engine and making spooky sounds. Unfortunately, this doesn't seem to crash the game and trigger level select, at least not in the sound test menu. Anyway, I tried a few different ways to get the audio overflow to occur in the actual game such as entering the bonus stage while the 100 rings one-up music is playing or playing the 100 rings music as the level track hits the point where it loops. Unfortunately, I was not able to get an overflow, but I speculate that the audio overflow might be a way to trigger the level select menu within the bounds of normal TAS inputs. One thing I didn't have the patience to try was overflowing the ring counter for Knuckles/Tails. They reset the stage when you play the bonus, so as long as the stage has 50+ rings, I think you can keep feeding them rings indefinitely. If they max out at a few bits, perhaps you can crash the game and trigger level select by feeding them 513 or 1025 rings. (You can probably check the size of the variable in memory if you know what you're doing, which I do not)
marzojr
He/Him
Experienced player (760)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
It is not possible to trigger the level select screen with the audio glitch: the entirety of the sound code is executed by the z80 coprocessor running from it's dedicated RAM, and reading ROM banks for track/sfx data and PCM samples. Any crashes are confined to the z80, and do not propagate back to the main cpu, which is required to trigger the level select. S3D uses a 16-bit integer for storing ring count, which means either 32767 or 65535 rings. Which case depends on which class of comparison instructions are used, signed or unsigned; but it does not matter because I think there is a hard cap long before that (but I'd have to check to make sure). I doubt you will find anything on this route, though.
Marzo Junior
Patashu
He/Him
Joined: 10/2/2005
Posts: 4042
Obviously what we need to do is add a 'hit the console' button to the emulator... ;) (I had the level select trigger while I was a kid when I knocked the console by mistake. An amusing easter egg!)
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu