Posts for Dacicus


Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Found another error on line 134 of global.bat, this time for the 512kb encode:
%~dp0\programs\avs2pipemod -info encode.avs
should be
%~dp0\programs\avs2pipemod -info %~dp0\encode.avs
This change will probably be necessary on line 175, as well.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
I downloaded the x64 version of the encoding package today, and the included version of avs2pipemod hangs at line 37 of global.bat
"./programs/avs2pipemod" -info encode.avs > "./temp/info.txt"
The problem seems to be the FreeSub call in the subtitles function, since the hang occurs when hd and vb are false but not when hd is true and vb is false. The hang doesn't occur if using the latest version of avs2pipemod that I could find (1.1.1). In case it matters, I just installed AviSynth 2.6.0 today without uninstalling the previous version, which was likely 2.6.0 alpha 2. Also, the for /f calls on lines 38 and 39 of global.bat don't work properly on my system (Win7 Home Premium SP1) unless
./temp/info.txt
is replaced by
%~dp0/temp/info.txt
Everything seems to work properly for the MKV Modern HQ encode if using avs2pipemod 1.1.1 and fixing lines 38 and 39 as above. I'll test the other encode types later.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
TASeditor wrote:
The commenter should be a very good TASer who never [sic] worked on this game before, the only information he should know about the game is from submission texts/game resource pages.
Why do you propose this?
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Did it play back after you pressed the pause hotkey?
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
If it's paused, try pressing the hotkey mapped to the emulator's pause option. If that doesn't work, post the steps you are doing to play back the movie.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Another wacky and entertaining sports game from Technos. The ending even logically leads to an ad for their next game. Yes vote.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
hegyak wrote:
When Snake has to sneak, he isn't too exciting.
I second this, but the other parts made up for it. Yes vote.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
I was under the impression that Clock Tower was supposed to be a horror game. Good job on turning it into a point-and-click adventure with a horror music ending. Yes vote.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Great work on the technical aspects and write-up, but I did not find the actual movie very entertaining. Meh vote.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Here's a WIP that improves the fight with the guardian of the silver thief statue by 200 frames. A simple change in strategy based on runs from speedrun.com that attacks from behind when the guardian drops rather than making it jump to the opposite side of the room right away. There may be room for additional improvement, if anyone wants to give it a try. This is a Lua script I used to help. Another WIP that gets to the second thief guild boss fight. Required a lot of work to fix Kuros's X-subpixel position and maintain all of the frame savings. I also modified some of the movie's metadata to fix the ROM name and authors. WIP that completes the second thief guild. The game now has a resources page. FatRatKnight asked some questions on IRC that led to the discovery of a new trick: You can get to maximum speed more quickly by jumping from a crouching movement. Here's a WIP that saves 9 frames up to the thief 1 guild by implementing the trick; it's not used everywhere because it leads to unfavorable sub-pixel values sometimes. (In case you're wondering, WIP 04 changed some sub-pixel values to sync the previous improvements up to the thief 3 trial). Saved another 9 frames up to the point before fighting the silver thief statue guardian. The movements near the beginning of the thief 1 trial (frames 4300-4400) were done to sync the sub-pixel values and allow pasting of input from the published movie. Since the trial scrolls automatically, anything until the actual boss fight can be replaced without breaking sync. The corridor immediately before the boss fight should allow space to re-sync sub-pixels. Improved the silver thief statue building by 87 frames compared to the previous attempt in WIP 01. Mostly due to a better guardian fight, but there were also some improvements related to the crouch-jump trick. Get the file here. A new glitch was discovered by speedrunner theLimitBreak that despawns the thief guild guardian. An input file that replicates it can be found here. MAJOR UPDATE: Speedrunner xJackieBx discovered a faster Knight 1 skip that's also RTA viable. Video explanation here.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Yes vote. For the reasons stated by others, I also believe that this should obsolete the NTSC version. In case it matters, GoodNES 3.14 calls this ROM Super Mario Bros. (E) (REVA) [!] rather than Super Mario Bros. (E).
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Which version of CamStudio Lossless Codec are you using? Does it happen with other codecs, too?
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Intel(R) Core(TM) i3 CPU  M 330  @ 2.13GHz  2.13 GHz

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko

Vector   Block   Result   Duration
12         3     correct  630.97ms
13         3     correct  1015.28ms
14         3     correct  1964.16ms
15         3     correct  3939.34ms
16         3     correct  7806.96ms
12         4     correct  1066.68ms
13         4     correct  2101.06ms
14         4     correct  4190.41ms
15         4     correct  8265.11ms
16         4     correct  27654.40ms
12         5     correct  4955.88ms
13         5     correct  9852.83ms
14         5     correct  19690.40ms
15         5     correct  39390.54ms
16         5     correct  78973.15ms
Status: Done.
I'm assuming that higher durations are worse?
Current Projects: TAS: Wizards & Warriors III.
Post subject: RNG and clouds
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
This is what appears to be the code for the game's RNG at RAM addresses $000D through $000F:
$CF5E:A5 0D     LDA $000D
$CF60:29 48     AND #$48
$CF62:69 38     ADC #$38
$CF64:0A        ASL
$CF65:0A        ASL
$CF66:26 0F     ROL $000F
$CF68:26 0E     ROL $000E
$CF6A:E6 0D     INC $000D
$CF6C:A5 0D     LDA $000D
$CF6E:65 04     ADC $0004
$CF70:65 05     ADC $0005
$CF72:65 10     ADC $0010
$CF74:65 11     ADC $0011
$CF76:65 12     ADC $0012
$CF78:65 14     ADC $0014
$CF7A:69 0D     ADC #$0D
$CF7C:85 0D     STA $000D
Using FCEUX 2.2.3, I set write breakpoints on $000D through $000F with the condition P<#CF66 || P>#CF7C and played the latest published movie. The only other time those addresses were written was when they were loaded with 0 upon console reset, so I'm pretty confident that we have all the variables necessary to manipulate the RNG. $0004 stores the currently pressed buttons as bits for as long as they are pressed, while $0005 does the same thing but only for the first two frames when a button is pressed. The bit order--most to least significant--is A, B, Select, Start, Up, Down, Left, Right. $0010 through $0012 form a three-byte counter that increases by one each frame, with $0010 the least significant byte and $0012 the most significant byte. The counter seems to restart from zero each time you enter a door. $0014 is another counter that loops upward from 0 to 7 and then resets. It increases by one each frame but pauses when the screen is black, such as during transitions between areas after entering a door. When the camera X-coordinate gets within 0x40 of the previously mentioned (0x0502, 0x00FE) spawn coordinate, $04B9 starts counting downward from 0. It doesn't seem like you can get outside the acceptable range of camera Y-coordinates in the small space by the first wizard guild, thankfully. $04B9 pauses if camera X > 0x0542, however, and restarts from 0 every time camera X <= 0x0542. $04B9 decreases by one every two frames. When it reaches 0 during the countdown, an enemy cloud may spawn. Each cloud has another timer that starts at 0 and counts up by one every two frames. So far, I've seen these timers stored in $04BB and $04BC. Other addresses may be possible if you can get three or more clouds active at once. This leads to:
$8372:FE A8 04  INC $04A8,X  ; This is the cloud's timer
$8375:BD A8 04  LDA $04A8,X
$8378:C9 80     CMP #$80
$837A:D0 3C     BNE $83B8    ; Value must be 0x80
$837C:A5 0D     LDA $000D    ; One of the RNG values
$837E:4A        LSR
$837F:90 37     BCC $83B8    ; Branch if bit 0 was not set
$8381:A5 85     LDA $0085    ; Current costume type
$8383:C9 03     CMP #$03     ; Check if wizard
$8385:F0 38     BEQ $83BF    ; Branch if wizard, attack otherwise
So the cloud only attacks when:
  • Its timer is 0x80,
  • The least significant bit of $000D is set, and
  • Current costume is not wizard.
This means that it will take about 768 frames (2 * 256 for $04B9 + 2 * 128 for $04BB or $04BC) to spawn a cloud and get it into an attacking state. The good thing is that the way those counters work gives us time to manipulate the RNG into favorable states. It takes at least 3179 frames to get the knight costume, 433 frames to get the statue and 2746 to complete the trial (estimated using frame numbers for the first completely black screens when entering/leaving doors into the appropriate rooms), so we can save around 2400 frames by skipping it. We still have to get the crown jewel from the princess in the Palace, however, so we can't skip that area altogether. The location at which the cloud spawns is determined by some combination of RNG address $000F (primarily), RNG address $000E (in some cases), the camera X- and Y-coordinates, and Kuros's X- and Y-coordinates. The entire code is long, so I'll just post the results of my analysis. If you want to verify it, set an execution breakpoint at $D7BE. The subroutine starts there and goes through the RTS at $D857. Some helpful info:
  • $02EE,Y and $0308,Y are the low and high bytes of the cloud's X-coordinate, respectively.
  • $033C,Y and $0356,Y are the low and high bytes of the cloud's Y-coordinate, respectively.
  • $00B4 and $00B5 seem to always be 0x07 in the part of the UnderWorld where we're doing the glitch.
Bits 1 and 2 of $000F are tested to determine different X and Y spawn locations.
Bit 1 set, Bit 2 set:
 Cloud X = Camera X - 0x20
 Cloud Y = ($000E AND 0x7F) - 0x40 + Kuros Y

Bit 1 set, Bit 2 clear:
 Cloud X = Camera X + 0x120
 Cloud Y = ($000E AND 0x7F) - 0x40 + Kuros Y

Bit 1 clear, Bit 2 set:
 Cloud X = ($000F AND 0x3F) - 0x20 + Kuros X
 Cloud Y = Camera Y - 0x30

Bit 1 clear, Bit 2 clear:
 Cloud X = ($000F AND 0x3F) - 0x20 + Kuros X
 Cloud Y = Camera Y + 0xD0
It is important to note that the code actually discards any overflow after calculating the low byte of Cloud Y when bit 1 is set; the high byte is set directly to the high byte of Kuros's Y-coordinate. The Bit 1 clear, Bit 2 set case is useless for our purposes. When leaving the wizard guild, the camera coordinates are set to (0x052A, 0x0000). I have not found a way to get the Y-coordinate greater than 0x30 without scrolling the X-coordinate beyond 0x0542, which will reset the $04B9 counter. So the cloud gets spawned at some Y-coordinate with high byte 0xFF and immediately gets despawned. I think that one of the bit 2 clear cases should be our target. We can spawn the cloud to the right of and below Kuros, which will make it attack in a diagonal direction that makes Kuros clip up and left through the wall.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
The recent discoveries by QoNe (see here) motivated me to take a look at this game again. I found the enemy spawn data for the castle, town, and dungeons. A list of enemy types starts at ROM addresses 0x20BED, 0x20CF8, and 0x20E0F, respectively. The actual spawn locations immediately precede those lists and start at 0x20B84, 0x20CA4, and 0x20DB8, respectively. The format is three bytes per enemy. The first byte has the lowest 8 bits of the X-coordinate. The third byte has the lowest 8 bits of the Y-coordinate. The second byte has the highest 4 bits of each, with format yyyyxxxx. What this shows is that the green cloud head protecting the majority of the dungeons spawns at coordinate (0x05EB, 0x00CB). Glancing through the spawn addresses shows that the closest enemy spawn is probably at (0x0502, 0x00FE). I think that the camera X-coordinate has to be within 0x40 of the enemy's X-coordinate to trigger the spawn. This is based on tests with the beehive that gets bypassed in the town in the TAS. It spawns at (0x04FA, 0x02F4). The jump that's used to bypass it places the camera Y-coordinate at 0x02F5, but it only works if the camera X-coordinate is 0x053B or higher. If you jump too high and bring the camera Y-coordinate to 0x02F4 or less, then the beehive spawns. Camera X-coordinate is 2 bytes starting at RAM 0x0079, and camera Y-coordinate is 2 bytes starting at RAM 0x007B. I started an address set with some useful addresses here. The addresses for the thief bosses refer to the bosses you fight at the end of each trial. The attack state indicates if the boss is attacking, resting, or lunging backwards to dodge your attack. Value 0x71 is the backwards lunge for all three. Preliminary trace logging indicates that the code leading to that state is different depending on whether you're attacking from a standing position or ducking position. The counters indicate how much time the boss will spend in the current state; they decrease by 1 every 2 frames. There's plenty of work yet to be done, including:
  • Further clarification of criteria for enemies to spawn
  • Determine what causes the thief bosses to lunge backwards
EDIT: Further investigation shows the following code as pertinent for determining the lunging state of the thief 1 boss:
$BA5F:A5 16     LDA $0016   ; $0016 was set to X-distance between Kuros and boss earlier
$BA61:C9 2D     CMP #$2D
$BA63:B0 32     BCS $BA97   ; Distance must be less than 0x2D (45)
$BA65:AD D8 03  LDA $03D8   ; Kuros status
$BA68:C9 12     CMP #$12    ; is 0x12 if B button pressed (attacking)
$BA6A:D0 1A     BNE $BA86
$BA6C:AD 26 04  LDA $0426   ; Another Kuros status address that depends on what other buttons are pressed
$BA6F:29 7F     AND #$7F    ; 1 if none, 2 if up, 3 if up + forward
$BA71:C9 05     CMP #$05    ; 4 if forward, 5 if down + forward, 6 if down
$BA73:90 04     BCC $BA79   ; must be < 5
$BA79:C9 03     CMP #$03
$BA7B:90 11     BCC $BA8E   ; and >= 3
$BA7D:A9 71     LDA #$71    ; This is the value we want for the boss to lunge backwards
$BA7F:9D 40 04  STA $0440,X ; Set the boss attack state
So the boss will lunge backwards if Kuros is within an X-distance of 45 and attacking with the up + foward or the forward button(s) pressed. Forward is right in this case. Further testing shows that this does not speed up the fight, probably because of the long invincibility time of the boss. The current implementation of the thief 1 boss fight may be as optimized as possible. This is part of the code that determines when the thief 2 and 3 bosses lunge backwards:
$8D80:A5 B6     LDA $00B6    ; Check room number
$8D82:C9 62     CMP #$62
$8D84:F0 36     BEQ $8DBC    ; Must not be 0x62 (thief 1 trial)
$8D86:B9 40 04  LDA $0440,Y  ; Check boss attack state
$8D89:C9 97     CMP #$97
$8D8B:D0 0F     BNE $8D9C    ; Must be 0x97 (resting)
$8D8D:86 25     STX $0025
$8D8F:BE 26 04  LDX $0426,Y  ; Retrieve value of X from $043C
$8D92:A9 28     LDA #$28
$8D94:9D 70 03  STA $0370,X  ; Set counter for attack state
$8D97:A9 71     LDA #$71
$8D99:9D 40 04  STA $0440,X  ; Set attack state
I have not figured out the position criteria yet. The important part of the above code is that the boss has to be in its resting state, which occurs infrequently. Unfortunately, the boss continues its current attack pattern after a backwards lunge and does not go back into a resting state, so it does not seem possible to lock it into the backwards lunge state and avoid damage. It does go into a resting state briefly while attacking on the left side of the screen, which allows you to interrupt part of its attack pattern. This movie demonstrates such an interruption. And this movie uses the trick to improve the currently published thief 2 boss fight by 34 frames. Here is a Lua script to display hitboxes for Kuros's weapons. Another Lua script that shows the relevant hitboxes for the thief trials. Also includes the criteria necessary to trigger the backwards lunge. Note that the important hitbox is the one for the boss's weapon, not for the boss itself.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
QoNe wrote:
Undergrounds wall clip The clip is done by getting yourself stuck between the wall and one of those flying green head monsters. I think the monsters are not supposed to spawn on this area before passing the flashing head, but if you hug the wall next to the wizards guild they will spawn. I'm still not sure what exactly has to happen that the clip succeeds but jumping seems to raise the odds. Also it looks like the monster needs to attack you from a slight angle below you so you get pushed slightly upwards.
Welcome to the board and nice find! Here's a quick movie that demonstrates the glitch and can be used for further analysis.
QoNe wrote:
Malkil glitch ... What this means is that you can actually fire the upwards shot after the dragon fight
I think the best time to do this is while waiting on the ledge for the fourth crown jewel to drop onto you after the dragon dies. This will bring $33D to a value of 0x0F and can be used to trigger the glitch.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
I also think that TASBot would be appropriate as a mascot.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Did you do anything to manipulate where the next cherry spawns? Since the source code is available, you should have the information necessary to do so. Also, it might be helpful to mention that this is Snake 1.0 by Calin Galeriu et al., to avoid confusion with other possible snake homebrews for the GBA.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Try capitalizing up:
Language: Lua

if (table.Up) then
It looks like you can get the proper names of the buttons by doing something like
Language: Lua

table = movie.getinput(emu.framecount()) print(table)
Obviously, you don't need to do this every frame once you know the names for whatever system you're working with.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
I haven't played this game before, but the movie looked good. Why did you stop at map 8, though? The game continued on to map 9 for me after the movie ended. EDIT:
Spikestuff wrote:
If anyone's gonna ask I'll just answer. The game loops after Map 8 so it goes back to Map 2.
Yes vote, in that case.
Current Projects: TAS: Wizards & Warriors III.
Post subject: Re: YKWIFH?! #1: Slow, Laggy Computers with only 2 GB of RAM!
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
YushiroGowa wrote:
When the lot of us need computers for one reason or another, for gaming or schoolwork/etc.
What type of schoolwork are you doing that is freezing up your computer? It obviously doesn't have the specs to handle your gaming requirements.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
I replaced the entire right wall with empty space (terrain 0x00) until the level of the ladder. You cannot move beyond the right side of the screen.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
This Lua might help find those spawns: http://tasvideos.org/userfiles/info/38688648943863044 You'll want the left edge of the screen to be within the green boxes if you're moving backwards (to the left).
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Exonym wrote:
Dacicus wrote:
This may not be useful in a run, actually. Based on Spikestuff's document, the shortest time to reach a miniboss is stage 5 at about 1500 frames.
Does this include the stages that we did not have a powerup for? For instance, if we got the flame powerup from stage 1 and then just re-entered stage 1 now with the ability to flame dash.
No, that only includes what the teams actually did in the submitted runs. Re-entering stage 1 after getting the flame dash is an idea. In order to save time in stage 6 with the segment skip, however, I estimate that you would have to get through the first segment of stage 1 in 500-600 frames with flame dashing. The second segment is almost entirely falling, so that's capped by the vertical falling speed. EDIT: The first segment of stage 1 is about 2300 pixels long. At 3 pixels per frame with flame dashing, it would still take too long.
Current Projects: TAS: Wizards & Warriors III.
Editor, Experienced Forum User, Published Author, Player (67)
Joined: 6/22/2005
Posts: 1041
Miniboss skip is possible in stage 6, but you have to set up a miniboss state first: http://tasvideos.org/userfiles/info/38617387944859351 EDIT: This may not be useful in a run, actually. Based on Spikestuff's document, the shortest time to reach a miniboss is stage 5 at about 1500 frames. It takes about 1800 frames to reach the stage 6 miniboss without any segment skips. This looks good, but the number of frames lost to screen transitions when entering and leaving a stage to set up the segment skip is over 500. You also have to add the time needed to get the helmet upgrade. So it looks like this will lose time rather than save it. Furthermore, the enemy I used for the skip seemingly cannot spawn during normal gameplay. Its spawn coordinates are (144, 48). Based on my previous tests, the camera needs to reach a Y-coordinate between 80 and 88 to spawn it. However, the transition to the next segment is triggered when the camera Y-coordinate reaches 96, which is lower in the segment than the enemy. There aren't any enemies to spawn in the segment immediately before the miniboss.
Current Projects: TAS: Wizards & Warriors III.