ALttP to Ancient Stone Tablets

Go down

ALttP to Ancient Stone Tablets Empty ALttP to Ancient Stone Tablets

Post by ShadowOne333 Tue 13 Feb 2018 - 15:31

Good day, Zeldix community.

Lately I've been thinking and going around the idea of recreating Ancient Stone Tablets by hacking A Link to the Past.

I've been fiddling around with Hyrule Magic and Hex editing stuff.
I have recreated the first dungeon with no issues, however I stumbled upon some issues/questions and wanted to know if someone knows how to do these points.

  1. I tried to move the starting point of the game to the House next to the first dungeon. However I ended up hitting a wall here with Hyrule Magic.
    I tried moving the room IDs and everything but I couldn't get it to work properly.
    Also, is there a way to avoid doing the whole "Rescue Zelda" stuff and start right at that house in particular?
  2. Second thing I wanted to ask, is if someone knows if there is an already existing ASM code to change the weather at random during normal gameplay.
    This is really the only feature that I would like to fully implement from AST.
    Timed events could be dropped to flag-based events (and anything time related other than the weather).

What other stuff am I missing which is in AST and would be hard to get to work on ALttP?
The intro scene is one, but I could rework the Intro scene from ALttP with static images in the sepia-like colours from ALttP and put the text from AST in the intro to make it work as well.

Right now I only want to be able to at least recreate Week 1 of AST, if I can get that to work I might continue with the rest of the weeks.

Any ideas, suggestions or help would be greatly appreciated!
ShadowOne333
ShadowOne333
Witch
Witch

Since : 2016-04-06

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Tue 13 Feb 2018 - 15:48

Count me out, I already dedicated a half lifetime to this game. Wink

Check this out:
https://www.zeldix.net/t703-switch-to-part-2-after-your-uncle-left-the-house
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Puzzledude Tue 13 Feb 2018 - 16:01

Lately I've been thinking and going around the idea of recreating Ancient Stone Tablets by hacking A Link to the Past.
I had a similar idea once, but never made it.

I have recreated the first dungeon with no issues
Nice.

I tried to move the starting point of the game to the House next to the first dungeon. However I ended up hitting a wall here with Hyrule Magic.
Best way to do this is set entrance 01 to that overworld area and remove it from initial area. Of course you can also change the starting room from 260 to where the Sahasrahla is at, but this is a problem because of the srm save, which then also needs to be set to a new room with all starting specification. All doable in HM under starting rooms. You also need a bed on the exact same coordinates in the new room and the uncle sprite to be able to start, unless you hack the beginning mode of the game further. This method might not work though (glitches possible, needs testing), so the best bet is to keep it in room 260 and move the entrance/exit on overworld), than redo the house into where Sahasrahla is. But his hut also seems like a house. Maybe just change the indoor house-pal of room 260 to light-brown to fit his hut/house on the outside (then same edit for srm starting location for the house).

Second thing I wanted to ask, is if someone knows if there is an already existing ASM code to change the weather at random during normal gameplay.
This is really the only feature that I would like to fully implement from AST.
Timed events could be dropped to flag-based events (and anything time related other than the weather).
Not really, you can not recreate the special "storm effects" of AST.

Right now I only want to be able to at least recreate Week 1 of AST, if I can get that to work I might continue with the rest of the weeks.
You can recreate all weeks in one room actually, by bringing in all the dungeons, but the gameplay will be different, since this is ALTTP as a base.

Also, is there a way to avoid doing the whole "Rescue Zelda" stuff and start right at that house in particular?
Yes, it's a hex edit. I have documented this in my large hex file, which should be somewhere under documents on this site. Basically what you need is to start directly with sword and shield, skipping uncle entirely, and thus load the crystal phase of the game (skipping uncle, Zelda rescue and Pendant and Agahnim) to be able to then finish 7 dungeons immediately. And those are then remade into what AST is using. Best option if you ask me. You could also gfx-hack a crystal in stone tablet then.
Puzzledude
Puzzledude

ALttP to Ancient Stone Tablets Image213

Since : 2012-06-20

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by ShadowOne333 Tue 13 Feb 2018 - 16:22

Thank you both Conn and Puzzledude, this will certainly help out to polish the New Game start quite a bit Smile

Puzzledude wrote:Not really, you can not recreate the special "storm effects" of AST.
Oh I'm actually not really trying to recreate it in a 1:1 manner.
I was mainly asking if there is an existing code for ALttP which switches weather effects from ALttP at random.

For example let's say that after some time, you get the foggy effect of Lost Woods, or the rain from the starting sequence, and so on. That's what I meant mostly.

Just to be sure, puzzledude, is this the documentation you are referring to?
https://www.zeldix.net/t17-vital-hex-addresses

One other thing, what do you guys use to modify the Title Screen of ALttP?
I find HM's TS editor to be a pain to use.
ShadowOne333
ShadowOne333
Witch
Witch

Since : 2016-04-06

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Tue 13 Feb 2018 - 16:42

I hope you realize that your project will require LOTS of additional asm. If you do not have some or somebody collaborating with you, I'd suggest to drop it...

You could implement time related events by using my hack enabling the clock, e.g. merged with Euclid 24 item menu
https://www.zeldix.net/t387-24-item-menu-and-additional-hacks-like-shovel-time-counter-for-this-menu
Or the all in:
https://www.zeldix.net/f43-the-all-in-patch
You only need to.hook it and enable stuff at specific times.

Hacking the overlay (fog,rain) was never really approached in a single hack but it should be implementing some ram addresses, nothing big. Parallel worlds e.g. uses the rain overlay (or fog) as snow for the complete ice world.
You may want to study mon's logs:
https://www.zeldix.net/t143-disassembly-zelda-docs
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Puzzledude Tue 13 Feb 2018 - 19:42

For example let's say that after some time, you get the foggy effect of Lost Woods, or the rain from the starting sequence, and so on. That's what I meant mostly.
This unfortunately is not happening. You will see that every area which has an overlay initially (like Lake in the dark world) is a pain to edit. What you are describing is overlay change based on timer. Not even if it would not be based on timer, it would still be close to impossible. I know you like those overlays in AST, however the time needed for original authors to do this had to be immense.

One other thing, what do you guys use to modify the Title Screen of ALttP?
I find HM's TS editor to be a pain to use.
GFX is edited with the gfx editor while decompressed into the bin file, and then recompressed back. While the title screen is edited with HM, ie filling the title with elements. PALs also edited with HM under pal (but you have to know which colour it is exactly). This is quite advanced.

But as you can see it works: completely new title screens were made for Parallel Worlds and also for Gates of Time, aside the main ZELDA title which was not edited purposefully.

Just to be sure, puzzledude, is this the documentation you are referring to?
https://www.zeldix.net/t17-vital-hex-addresses
Here's the complete thing.

http://textuploader.com/dhfhu

Here you go to "Ideal custom start".
Puzzledude
Puzzledude

ALttP to Ancient Stone Tablets Image213

Since : 2012-06-20

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Wed 14 Feb 2018 - 5:16

It indeed appears a bit complex to get the overworld rainy and such. I think it is only possible if you are entering the overworld from indoors and not just like that.

Involved is:
$02/AFFC AF C5 F3 7E LDA $7EF3C5[$7E:F3C5] Check the part, here beginning for rain overlay

If you e.g., nop out
$02/B006 B0 03 BCS $03 [$B00B]
by editing: pc 0x13006: b0 03 -> ea ea
you have the rain overlay loaded everywhere (but not animated)
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by ShadowOne333 Wed 14 Feb 2018 - 16:42

I managed to change the starting place from the House to Sahasrahla's place. Had to fiddle around a little bit with the exit and the position of objects in the room, but got it working and it now drops me near the first dungeon.

One thing I noticed though is that doesn't matter if I change the blockset, the game always loads the default blockset for the starting room when starting a fresh new game, but after reentering the room, it does use the correct blockset. The palette is always loaded properly here, even when starting a new game.

It's not that problematic, I have yet to try out if starting from the pendant phase changes this (since I just wanted to see if I could drop out of the place in the location t hand).

Additionally, I also changed the starting hearts from 3 to 4, added the Ocarina, Bottle with Golden Bee and the Catching Net as default items upon starting a new game, and changed the default price of the Flipper to 300 as in AST.

I will continue editing dungeon 1 and see if I can get it to start the game normally, finish the dungeon and then start heading to dungeon 2 as a starting PoC.
ShadowOne333
ShadowOne333
Witch
Witch

Since : 2016-04-06

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Tue 27 Feb 2018 - 6:29

I found this asm by chance in SePH's Conker asm stuff. I didn't try it, but maybe it helps to get rain at specific places:

Code:

by stsb77 ---let's make some rain!!



; variables
; 7EE00E - Rain Activator
; 7EE00D - Rain Deactivator (overridden if rain is activated before the deactivation occurs)
; 7EE00C - Activates the overlay animations and nonimmediate rain things
; 7EE00F - Activates thunder and indoor ambience (can be set at the same time as the Rain Activator)
; 7EE001 - Minutes in the time sequence script
; 7EE000 - Hours in the time sequence script
; 7EE00B - used to prevent my script from warping if rain is active, 0 allow rain disallow warp, 1 disallow rain allow warp

;this is my loader for turning the rain on and off
org $208100 ; executed on dungoen load (replaced an LDA $7EF3C5 which is read before we return)
Rain:
   lda $7EE00E
   bne .On
   lda $7EE00D
   bne .Off
   bra Rain_End
Rain_On:
   lda #$01
   sta $7EE00F
   sta $7EE00C
   lda #$00
   sta $7EE00E
   bra Rain_End
Rain_Off:
   lda #$00
   sta $7EE00F
   sta $7EE00C
   sta $7EE00D
   bra Rain_End
Rain_End:
   lda #$00
   sta $7EE00E
   sta $7EE00D
   lda $7EF3C5
   rtl

org $208200 ; these are executed every frame
RainOnTime:
   lda $7EE001
   cmp #$1E
   bne .End
   lda $7EE000
   cmp #$01
   bne .End
   lda $7EE00B
   bne .End
   lda #$01
   sta $7EE00E
   sta $7EE00F
RainOnTime_End:
   rtl

org $208300 ; these are executed every frame
RainOffTime:
   lda $7EE001
   cmp #$1E
   bne .End
   lda $7EE000
   cmp #$03
   bne .End
   lda #$01
   sta $7EE00D
RainOffTime_End:
   rtl

org $20C000 ; moved this function to expanded space to change it, don't think i needed to though :(
   LDA $8A
   CMP #$70
   BEQ BRANCH_EVIL_SWAMP
   LDA $7EE00F
   Beq BRANCH_SKIPMOVEMENT
BRANCH_EVIL_SWAMP:
   LDA $7EF2F0 ; If misery mire has been opened already, we’re done
   AND #$20
   BNE BRANCH_SKIPMOVEMENT
   LDA $1A ; Check the frame counter.
   CMP #$03 ; On the third frame do a flash of lightning.
   BEQ BRANCH_LIGHTNING
   CMP #$05
   BEQ BRANCH_NORMAL_LIGHT
   CMP #$24 ; On the #$24-th frame cue the thunder.
   BEQ BRANCH_THUNDER
   CMP #$2C ; On the #$2C-th frame bring the light back to normal.
   BEQ BRANCH_NORMAL_LIGHT
   CMP #$58 ; On the #$58-th frame cue the lightning
   BEQ BRANCH_LIGHTNING
   CMP #$5A ; On the #$5A-th frame
   BNE BRANCH_MOVEOVERLAY
BRANCH_NORMAL_LIGHT:
   LDA #$72 ; Keep the screen semi-dark.
   BRA BRANCH_SETBRIGHTNESS
BRANCH_THUNDER:
   LDX #$36
   STX $012E ; Play the thunder sound when outdoors.
BRANCH_LIGHTNING:
   LDA #$32 ; Make the screen flash with lightning.
BRANCH_SETBRIGHTNESS:
   STA $9A
BRANCH_MOVEOVERLAY:
   LDA $1A ; if the first two bits are set, do nothing
   AND #$03
   BNE BRANCH_SKIPMOVEMENT
   LDA $0494 ; otherwise start moving some rain
   INC
   AND #$03
   STA $0494
   TAX
   LDA $E1
   CLC
   ADC $02A46D, X
; $01246D IN ROM
   STA $E1
   LDA $E7
   CLC
   ADC $02A471, X
; $012471
   STA $E7
BRANCH_SKIPMOVEMENT:
   RTL

org $02A4CD ; rain animating overlays, thunder lightning, darkness (can do immediate)
   jsl $20C000
   bra $59
org $02AC12 ; load overlays OW to OW
   lda $7EE00C
   nop #2
   beq $03
org $02AFFC ; load overlays dungeon to OW
   lda $7EE00C
   nop #06
   beq $03
org $02838C ; indoor ambience (can do immediate)
   lda $7EE00F
   nop #02
   beq $1e
org $02845D ; music routine
   lda $7EE00C
   nop #02
   beq $02
org $0284EA ; outdoor ambience
   lda $7EE00C
   nop #2
   beq $02
org $02C463 ; overworld music routine, modified to use the 'Beginning' music if 7EE00C is not equal to zero (Rain activated)
   PHB
   PHK
   PLB
   REP #$10
   LDA #$02
   STA $00
   LDX #$0000
   LDA $7EE00C
   BNE $25
   LDY #$00C0
   LDA $7EF3C5
   CMP #$03
   BCS $1D
   LDY #$0080
   LDA $7EF359
   CMP #$02
   BCS $12
   LDA #$05
   STA $00
   LDY #$0040
   LDA $7EF3C5
   CMP #$02
   BCS $03
   LDY #$0000
   LDA $C303,Y
   STA $7F5B00,X
   INY
   INX
   CPX #$0040
   BNE $F2
   LDY #$0000
   LDA $C403,Y
   STA $7F5B00,X
   INX
   INY
   CPY #$0060
   BNE $F2
   LDA $00
   STA $7F5B80
   SEP #$10
   PLB
   RTL
org $02C303 ; Overworld beginning music for each OW Screen changes the music to use heavy rain outside of lost woods, and light rain inside
   db $25,$25,$13,$13,$13,$13,$13,$13
   db $25,$25,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13
   db $13,$13,$13,$13,$13,$13,$13,$13

; executed on dungoen load
org $028356 ; replaced an LDA $7EF3C5 which is read before we return
   jsl $208100
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by ShadowOne333 Tue 27 Feb 2018 - 18:13

Oh wow!
That will be of great help down the road for sure.
Thank you so much, Conn. Smile
That code will be really handy.

As for the PoC I'm working on, I was on hiatus about it for like a week and a half because the computer where I had all the files screwed up, so I started working on it again only this Monday, trying to redo what I had so far.

So right now I have two issues in rooms #168 and #170:

* For room #168, the Key door that connects SW and NW have no collision at all, they act as a pass-through door. Also, in this very same room, the Big Key door leads to a crash, while it should lead to Room #152.

* For room #170, I don't know why, but I am having issues with the layers in the NE and South area. The passthrough door acts as a wall, and I am having issues with the upper area in the NE section with the collision between layers.

Note: Header data was moved to 1F8000 using latest HM.

I had both things working on my previous build, but that one got screwed up during the whole PC recovery, and I made that build so long ago that I can't recall what I did to fix those two issues. :/

After that, only thing remaining would be to link room #152 to the Boss Room and that should be Dungeon #1 of AST fully done.


Here's the IPS (for unheadered ROM) and saves I am using for Snes9x:
https://www.dropbox.com/s/bv337ydf9zoxx0j/AST-Alpha.zip?dl=0
(I tried to upload the ZIP here but it seems I don't have enough permissions yet)

The save should start in Link's house right after saving Zelda and starting the trip to Dungeon #1, and we should have all of the items that are given to the BS Mascot on Week 1. I haven't worked on the Overworld at all other than the place below the Dungeon 1 area.
Save State 1 is right before getting the Bow (Room 169), and Save State 2 is in Room #170 (this one has the previous build's layout, so you have to reload that room to test the problem).
ShadowOne333
ShadowOne333
Witch
Witch

Since : 2016-04-06

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Tue 27 Feb 2018 - 19:37

I hope you can retrace the asm, it looks complicated, and much free ram is involved (all that $7ee00x stuff is free ram).
The room stuff appears to be HM related, where Puzz is the expert here Smile

As for not being able to upload the zip... strange. All permissions are set to this forum and with another normal test account of mine, I was able to upload. Ah well, you were able to help yourself Very Happy
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Puzzledude Tue 27 Feb 2018 - 20:00

The room stuff appears to be HM related, where Puzz is the expert here
Yes, I took a look at the Rom and it is indeed in the "alpha" state. Basically every room has a problem in which you exceed the number of allowed complex doors, namely 4. You can only have 4 special doors (locked, shutter, bombable etc) and they must be inserted first. After special doors are inserted, only then can you insert regular (type0) doors. This will put special doors first in the hex string - and only then they will work - currently a lot of doors are not first in hex string or there is too much of them.

Also: you can not have 4 chests+ 2 bombable doors + shutter + one locked. This can not be saved by SRM. So do note that ALTTP can not handle this as opposed to AST.

So I haven't even came to rooms 168 and 170 when quick testing. I only came to the first bugged key-door and could fix it, by removing all 4 chests and both bombable walls in that room.

So this is a lot of work to get this dungeon debugged and not something I would do, since I have my own projects.

There is one main problem in the entire dungeon: way too much "complex" elements which can not be saved by the SRM limit.
Puzzledude
Puzzledude

ALttP to Ancient Stone Tablets Image213

Since : 2012-06-20

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Conn Wed 28 Feb 2018 - 11:45

You could maybe make the 3 parts (beginning, first part, second part) to 3 different weeks, but reading Puzz answer, that the room header is apparently more complex than the alttp can handle, the question rises why you want to mimic the game? I mean AST is nearly at 100% done and playable. Sure, there is the week switch thing, but other than that...?
I think it might be a better idea if you are not trying to make a 100% copy of AST but maybe something different, like a mix, means something totally new with elements of both AST and ALTTP - then you'd be not restricted to the fewer possibilities you have with the ALTTP engine, and most likely more people will play your hack (if there is an original, people likely prefer playing the original).
Conn
Conn

ALttP to Ancient Stone Tablets Image212

Since : 2013-06-30

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by ShadowOne333 Wed 28 Feb 2018 - 17:27

@Puzzledude
Oh I see.
I for some reason forgot about the Special Doors going first before the open ones.

As for the complex doors, iirc the guide says it's 8.
Maybe the 4 limitation came afterwards, when many ROMs ended up screwed due to that. Razz
I managed to fix the key door in room 168, but now I am struggling with another one haha. I will see what I can do.


@Conn
Well, the main reason I wanted to attempt this was to try to recreate the whole AST experience into just one sole ROM, to avoid having to rename the SAV/SRM and stuff like that.

It's nitpicky, for sure, but just wanted to see if it could be achievable with what I know and can do.
Though I know for sure there will be some things beyond my grasp, I simply wanted to try and get a PoC out just as a personal thing, but I'll see how far I can go with the PoC at the moment.

Thank you both for your help, it is greatly appreciated.
ShadowOne333
ShadowOne333
Witch
Witch

Since : 2016-04-06

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by Puzzledude Wed 28 Feb 2018 - 19:29

As for the complex doors, iirc the guide says it's 8.
Not really, look at this SRM guide by Math on Napkins.

High Byte-------------Low Byte
d d d d b k ck cr       c c c c q q q q      

c - chest, big key chest, or big key lock.
q - quadrants visited:
k - key or item (such as a 300 rupee gift)
d - door opened (either unlocked, bombed or other means)
r - special rupee tiles, whether they've been obtained or not.
b - boss battle won

It now makes complete sence why certain things are not possible in ALTTP. For indoor saving it only uses 2 bytes for one room:
and thus 16 bits, for one room:

bit1= regular locked door, bombable door/wall, big bombable door/wall (like in skull woods where the entire wall blows up etc). Not sure about the shutter, but from testing it should fall into this category.

So any room has thus 4 bits for this, thus 4 special doors possible and must be inserted first. Only doors type 0 = regular can be put after, another 4, thus up to 8 doors in total per room (not recomended to have more).

Then bit5 boss battle won.
Then bit6 key as sprite or other obtainable sprites.
Bit7= same as 6 or alternatively a chest/big chest/big lock on door/big lock on cell.
Bit8= same as 7.

Next byte is easier: 4 chests and 4 quadrants visited (for map purposes). This means 6 chests are possible at max per room. And if 6 chests, then only 1 sprite key.

From another SRM byte you can also see, the game uses also 2 bytes or 16 bits for dungeon definitions, but 2 are always bugged, thus there can be only 14 but absolute max 16 different dungeons in the game, each having compass, map, big key.

So there is a lot we can learn about ALTTP limitations when you look at the SRM. Unless someone actually hack into SRM saving, which I highly doubt, since this will surely produce bugs.
Puzzledude
Puzzledude

ALttP to Ancient Stone Tablets Image213

Since : 2012-06-20

Back to top Go down

ALttP to Ancient Stone Tablets Empty Re: ALttP to Ancient Stone Tablets

Post by ray Tue 6 Apr 2021 - 19:31

Amazing project!

ray
Newcomer

Since : 2021-04-05

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum