Posts for philipptr

Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Thanks for the answers!
feos wrote:
Are you sure that game has no sub-pixels?
MESHUGGAH wrote:
As feos mentioned, you forgot to add subpixels in to the calculations.
The 32bit position values include 16 bits of subpixel information. So in order to get the position without subpixel precision you would calculate (0xFFF6D0.L + 0xFFDBB0.L) >> 16. Or you could wait until the game added 0xFFF6D0.L and 0xFFDBB0.L, and then read FFDBB8.W (or shift FFDBB8.L >> 16). Reading what vecna wrote made me realize why the way current emulators work is intended. I hadn't thought about audio mixing or variable vertical-length. I've changed my lua script so that all values are read at the beginning of v-blank, and everything works nice now. I didn't realize you could link lua functions to certain code areas, that's why I didn't try it earlier. So thanks for helping me a) understand why emulators work the way they do and b) understand how to fix my script so that it works the way it is supposed to :)
Post subject: Re: Timing of input/frame advance
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
MESHUGGAH wrote:
It would be a good idea to share at least the name of the game you are talking about. There are many reasons while a specific value doesn't changes each frame.
Okay, I will explain my specific problem (I thought this was a more general thing with emulators, thats why I tried to explain it without mentioning the specific game). The game I tested this with is High Seas Havoc (or Havoc / Captn Lang, depending on the region). It's a basic jump'n'run game. This is the lua script:
state = savestate.create()

gui.register( function ()
	
	havocVX= memory.readlongsigned(0xFFDBCC)        -- Havocs velocity (x)
	camX = memory.readlongunsigned(0xFFF6D0)        -- Camera Position (x)
	havocXonScr = memory.readlongunsigned(0xFFDBB0) -- Havocs Position relative to the camera (x)
	havocX = camX + havocXonScr                     -- Havocs Position (x)
	cpuPC = memory.getregister ("pc")               -- program counter

	savestate.save(state)
	
	  gens.emulateframeinvisible()
	  effectiveVxonScr = (memory.readlongunsigned(0xFFF6D0)+memory.readlongunsigned(0xFFDBB0)) - havocX
	  cpuPC2 = memory.getregister ("pc")
	
	savestate.load(state)
	
	message = string.format("PC: %X, %X", cpuPC,cpuPC2)
	gui.text(10, 42, message, "#FFFF00FF", "black")
	message = string.format("vel:      %10d", havocVX)
	gui.text(10, 58, message, "#FFFF00FF", "black")
	message = string.format("real vel: %10d", effectiveVxonScr)
	gui.text(10, 66, message, "#FFFF00FF", "black")	
	message = string.format("pos:      %10d", havocX)
	gui.text(10, 74, message, "#FFFF00FF", "black")
	
end)
In case you are wondering about why I add the camera position to havocs relative position: This is the same thing the game does (ROM at 0x004AD0):
move.l  (0xFFF6D0).l, d0
add.l   (0xFFDBB0).l, d0
move.l  (0xFFF6D8).l, d1
add.l   (0xFFDBB4).l, d1
move.l  d0, (0xFFDBB8).l
move.l  d1, (0xFFDBBC).l
So with the script I can calculate how far the player has effectively traveled along the x-axis. At least if the game has done the calculations on the position in the time that Gens leaves for the frame advance. I added the display of the program counter to see where the game stops after frame advancing. This is what what I get when running in the first level:
((0xFFF6D0) + (0xFFDBB0)) of next frame
-((0xFFF6D0) + (0xFFDBB0)) of current frame
                                   |
                                   |
(0xFFF6D0) + (0xFFDBB0) --+        |
                          |        |
   (0xFFDBCC) --+         |        |
                |         |        |
Frame    PC     vX      posX  real vX 
  850  457C      0  19398656        0
  851  B3E6      0  19398656        0
  852  457C   8192  19406848    16384
  853  4676  16384  19423232    24576
  854  63C4  24576  19447808    32768
  855  4678  32768  19480576        0
  856  6226  40960  19480576    90112
  857  B1DC  49152  19570688    57344
  858  45BC  57344  19628032    65536
  859  B1B6  65536  19693568    73728
  860  4580  73728  19767296    81920
  861  456A  81920  19849216        0
  862  5930  90112  19849216   188416
  863  4580  98304  20037632   106496
(The real vX looks one frame into the future, thats why the values are offset by 1 frame.) So here it happened twice that the position calculation was not yet done when the cpu was paused: Frame 856 and 862. I am wondering if there is a reason, why the emulator is not halting at the time it triggers the vertical blank interrupt (if it's enabled). I guess synchronizing the calculations to the vertical blank period should be extremely common in 8/16 bit games, so this would create more reliable results when reading values from RAM.
Post subject: Timing of input/frame advance
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I always assumed that when I frame advance in any emulator, it will pause pretty much when the vertical interrupt routine would be called. This would make sense since a whole frame has been rendered at this point, and likely the calculations for the next frame havent started. Lately I've been playing around ith BizHawk and Gens and they both seem to show a different behaviour. This can be a problem if you want to read out RAM values that describe a position of a moving object, since at some frames these values have been updated already, while at others they haven't. The problem I'm having is simplified looking like this: Consider an object moving with the speed of 1:
Frame:  X-Value
   1      1
   2      2
   3      2
   4      4
   5      5
   6      5
   7      7
This is anoying since I can't really trust the values my LUA script tells me. Even further this made me question for what time period the input is valid? If the input I am giving for one frame is not synced to something like v_int, how can I know that I am not giving input for 2 frames instead of one? So my questions are: What is the timing for frame advance concerning the emulation of the main cpu of a console? Is the same timing used for input given by the user? I hope I made my problem understandable. I post it here since it seems like that the behaviour is shared among multiple emulators and not bound to one specific emulator.
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Radiant wrote:
Is it normal for Nicovideo to have lots of text (mostly gibberish) stream over the screen at all times? It's rather annoying.
Did you try the button in the bottom right corner?
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Thanks again :)
Espyo wrote:
You mash the Start button to skip the score tallies. Mistake there. You should check to see what's the first possible frame in which skipping is possible. For instance, imagine you press Start on frames ..., 31, 33, 35, 37, ..., and the first possible instance to skip is on the 32th frame. You only press Start on the 33th, missing one frame. Worst case scenario, all these add up, so... 12 (13? does the final count?) levels, times all the things you skip (level intro, score tally for every score), which is like 4, gives 48 lost frames. (Calculations may be a bit off, but my point still stands) Huh... Looks like you only mash the Start button on the first level.
Ah, seems like I didn't change it. Well this was due to me being a bit confused about the score screen. It turned out to be like this: you have a pretty huge frame-window in which can press start. If you do press start at least once until the end of that window, the scores will apear a bit faster, but the precise timing of the button press does not make any difference. So yeah, it would have been cleaner if I removed the unnecessary button presses ;)
Espyo wrote:
After the first hit on Bernardo, you do a quick up-and-down dance. I think that distracts too much; you should only dance on long, monotonous sections.
Okay.
Espyo wrote:
I guess you could add a small extra bit of entertainment in Burning Hamlet 1. Like try to collect as many jewels as possible along the way, or none at all. Sure beats holding right for the majority of the level. Also, when you're on the platform with the huge blaze very close to you, are you as close to the blaze as possible?
I am pretty sure that I am indeed as close as possible.
Espyo wrote:
I think few high jumps are better than several short jumps when climbing hills in Mt. Chester.
I am mostly doing high jumps, however I think I tested it a few times and it didn't make a difference.
Espyo wrote:
When you take the huge shortcut in Mt. Chester 2, I think you should have jumped to fall on the gap faster. http://tasvideos.org/GameResources/CommonTricks.html#JumpingOffLedges
I know what you mean, and I will test it again (can't do it at the moment), but if my memory serves me correctly, I tried it and the problem was that the first frame at which I was able to jump without hitting the ceiling was already to late in order to be faster than not jumping at all.
Espyo wrote:
You wait to collect the boots on Mt. Bernardo. I'm sure you have an explanation for that. Put it on the submission's comments.
Yep, I am waiting for the platform on the right to flip. Will edit the submission soon.
Espyo wrote:
A bit after the start of Mt. Bernardo 2, you stand on a platform waiting for it to collapse. You duck, but you can only actually go right when there's enough space to fit Havoc while standing up, so that's why you don't go right even though there's some space. But the thing is, wouldn't it be fast to start moving already by doing a roll? I don't think so, but it's worth a check, no?
You are actually right I think. I even did that at anouther point in the same level. But due to strange collision boxes the difference in frames is pretty low. I think its about 3 frames.
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Thanks for the feedback :)
Cooljay wrote:
For starters don't slip off platforms rather jump down to them and manipulate the air to fall to the next one below
I'm not sure I get what you mean. I sometimes run over a gap, land on the edge, and receive some upward push, so that I continue running on the other side of the gap. I checked whether this is slower than jumping and as far as I know it isn't. If you mean something else or there is a special part of the run where you have concerns please tell me.
Cooljay wrote:
you could take more damage to save time. From what I see you do somewhat but very rare.
I mainly use it to reach higher platforms. The problem with using it to advance in the horizontal is that in order for the knockback to push you right you'd have to slow down a lot before touching the enemy, and you have to accelerate from 0 as soon as you hit the ground. Therefore it's only rarely usable. Again, if you see a particular situation where you think this might be of use, feel free to tell me ;)
Cooljay wrote:
Try not to bump into walls, when jumping to the edge of the top.
I think I see what you mean, but I do this on purpose. If I press right when I bump into a wall I gain horizontal momentum. Therefore if I can't advance horizontaly as long as I'm not high enough, I can at least build up horizontal speed, so as soon as I reach the point where I can advance I'm as fast as possible. It doesn't look very smooth, but its fast ;)
Cooljay wrote:
There is points where you suddenly wait for no reason.
Do you mean before each boss? This is unavoidable. as soon as the screen locks at the bossfight, havocs horizontal speed is set to 0. I hope this didn't sound like I thought my run was perfect or anything. I just wanted to reply on the constructive criticism of yours ;)
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Yes I read that, moved nasm, and it works in debug (although the linker problem remains). I dont know why The assembler cant be found when I select the release target..
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Thanks for your answers, was quite busy for a few weeks, but as I've just got VS2008, I thought I might try compiling gens once more. I was able to figure my way around many problems, however I am stuck now: Trying to compile debug:
------ Build started: Project: gens, Configuration: Debug Win32 ------
Linking...
LINK : fatal error LNK1104: cannot open file 'release\mem_M68K.obj'
Trying to compile release:
------ Build started: Project: gens, Configuration: Release Win32 ------
Assembling z80.asm
The System can not find the file specified.
Project : error PRJ0019: A tool returned an error code from "Assembling z80.asm"
Someone got any idea how to fix this?
Post subject: Problems compiling gens 11a
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I will make this short: I am using Visual c++ 6. When I try to compile gens I lack the following files (all needed by pngconf.h): fp.h m68881.h alloc.h I am new to visual c++ (have been using codeblocks before) so I might have set up something wrong. Any tips what I could try/how to get fp.h?
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I dont know if this will help you, but I found out that if you run at full speed, keep pressing down while stoping will make you start running at full speed if you press in the same direction again (you have to keep down until you continue running). (hope you understood what I mean ;) ) This could be helpful if you have to stop to avoid hitting an enemy.
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
while it's not the most intresting TAS around, I would still thumb up if I could for the glitch and the mazes. nice run
Post subject: The Ottifants
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
The Ottifants is a nice platformer where you play a baby ottifant who has to find his father ;) I started a testrun and I pretty like it. What makes it imo intresting to TAS is that you have to collect 50% of the gummy bears in each level to open the exit. I thought about changing the settings to hard which changes the percentage from 50% to 75% but that would make finding a good route extremly hard, and the run might get a bit boring. I found 2 glitches, one in the collision detection which I cant yet abuse, and another one which lets me kill the first boss in much shorter time than you are supposed to. It might be possible to use death as shortcut, since when you die you go back to level begin or the last checkpoint but the collected gummy bears stay. The testrun isn't perfect although I often tried optimising parts with frame advance. I am using Ottifants, The (E) [!]. http://rapidshare.de/files/29491192/philipptr_Ottifants_testrunPrev.bak.gmv.html Btw: In testrun I set the language to english which costs quite some frames (not only one for going down, as it appears to be), and since there is not much text in the game (only menu,levelnames and the end) I wanted to know if you think I could play the final run in german?
Post subject: Zero the kamikaze squirrel
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I know that there's a snes run of it, and although it seems that the versions are very much the same I would like to do a run because either LLCoolDave did make quite some mistakes, or the genesis version is different in terms of how many frames a jump takes/how high you get. I found some things which I could do different and faster on the genesis, than they are in his run. So I wanted to ask if you think I should continue this run, or search for another intresting genesis game.
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
It's done. Well I will post it here since it would get rejected anyway. Hopefully somebody will watch it and give me some critique on my first speedrun :) http://rapidshare.de/files/24059909/High_Seas_Havoc_-_philipptr.zip.html --- - Gens 2.11 Movie 9d - Allow left+right - Aims for fastest time - takes damage to save time - no death High Seas Havoc (U) [!].bin Time: 21:49
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
nfq wrote:
on the 3rd special stage, the mistake is that you bump on that ball.
yes I know, well I tried to avoid it but didn't make it to get faster than this run. So I gave the 4. stage a try, but it seems this one is much harder..
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
Seems like nobody has the game/is intrested. anyways here's a WIP, maybe someones intrested in giving feedback.. I played until the second boss, (the second boss fight is included but obviously that's not how it's going to stay) http://rapidshare.de/files/22799216/High_Seas_Havoc_TAS_philipptr_WIP.zip.html the first levels don't seem to be the most intresting of the game, so let me know if you think that the game is too boring for a TAS..
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I think it was 463 frames faster. btw: how do you plan on going on with this movie: play it through and then hex all the special stages in, or doing it again?
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
:D didnt read the whole thread so I didnt knew about nfq's try ;) gave it a try and made it some frames faster than you, but its still looking far from optimal (then again this stage is very hard to TAS), maybe I will give it another try tomorrow... http://rapidshare.de/files/22657466/3rd_emerald_okay_1_.zip.html (I hope I uploaded the right file O_o)
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I tried to do the first one and got the emerald 264 frames (hope I counted them right :D) earlier, still its unoptimized. http://rapidshare.de/files/22636923/Sonic_the_Hedgehog_all_emeralds_edited.zip.html (used your first level in the movie)
Post subject: High Seas Havoc
Experienced Forum User, Published Author, Player (104)
Joined: 6/7/2006
Posts: 20
I thought about making a TAS on the little known game "High Seas Havoc" for a while now. I picked it because its a game I really enjoy playing and somehow I thought it was good for a first try at speedruns. So if someone knows the game, do you think its a good choice? btw: if someone knows any tricks/things about the game that could help me, it would be nice if you would let me know ;) I already went frame by frame through the intro/menu (didnt change difficult, since expert would take the chance of taking damage for speed and I didnt see any reason in going to the menu just to make the difficult harder but not highest) and recorded the first level. I had recorded the second level + boss too, but it got lost somehow (was loading a wrong savegame while recording I think)