(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-05-24 12:01 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Zelda3 - Time + Day/Night system (IPS included) New poll | |
Pages: 1 2 3 4Add to favorites | Next newer thread | Next older thread
User Post
JaSp

Shyguy








Since: 11-18-05
From: Paris, France

Last post: 6286 days
Last view: 6285 days
Posted on 08-22-06 12:56 PM Link | Quote
Hello!
Well, I was bored of hacking SMW so I decided to switch for Zelda3 and I worked quite some hours the last two days to make this : a time system + a day/night handler for Zelda3!
The patch is free to use for your hacks ; currently it just shows the time and cycle through day and night. Everything is explained in the readme, you can ***download the latest version (2.0) pack here***.
Thanks to MathOnNapkins and Euclid's Z3 docs & help, d4s' help, Geiger's Snes9x debugger, Byuu's xkas assembler and FuSoYa's zcompress.

*Updates*
v2.0 : Major improvement Completely rewrite the code. The night effect works on the palettes now, and it works in all situations : layers, mosaic, HDMA warping, sub-areas...
v1.1 : fixed the problem with save & item menus, counter no longer increases when a dialog box is openned.

Screenshots :



Enjoy!
You can apply this patch to an original Zelda3 ROM and play the game through day/night cycling ! (it won't affect any event of the game)
Post here if you have any comment/suggestion/bug you may have encountered.


(edited by JaSp on 09-06-06 01:08 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6287 days
Last view: 6285 days
Posted on 08-22-06 01:17 PM Link | Quote
I think you should make night colors more blue... It would look much better, in my opinion.
Doritokiller

Mole


 





Since: 06-15-06
From: California

Last post: 6428 days
Last view: 6290 days
Posted on 08-22-06 01:49 PM Link | Quote
Just found some bugs.

- When you press Select to go to the save menu, the timer still goes on, although the time in the status bar remains the same until you exit the menu.

- The same thing also goes for the item menu.

- During the exit/enter animation for buildings and such, the timer goes on.

- Time still passes by when you:
a. get a new item
b. read signs
c. talk to people.

-During the intro, when it rains, there's massive darkness outside. It's darker than it should be, since the intro's at night. So there's a night in the night, and a day in the night?

So... Uh... Yeah. That's it. Good job getting the time in there.
JaSp

Shyguy








Since: 11-18-05
From: Paris, France

Last post: 6286 days
Last view: 6285 days
Posted on 08-22-06 02:15 PM Link | Quote
Originally posted by Doritokiller
- When you press Select to go to the save menu, the timer still goes on, although the time in the status bar remains the same until you exit the menu.
- The same thing also goes for the item menu.

I'll try to fix that for the next release. I also noticed that the brightness isn't updated when there is a dialog box...

Originally posted by Doritokiller
- During the exit/enter animation for buildings and such, the timer goes on.
- Time still passes by when you:
a. get a new item
b. read signs
c. talk to people.

Does time stop when you enter a building, talk to someone or read something ?

Originally posted by Doritokiller
-During the intro, when it rains, there's massive darkness outside. It's darker than it should be, since the intro's at night. So there's a night in the night, and a day in the night?

If the overworld is dark, that's because of the clouds (well that's what I've always thought...) ; anyway, this can easily be fixed with Hyrule Magic editing the rain layer, so it's up to the user of the patch.

Originally posted by Stifu
I think you should make night colors more blue... It would look much better, in my opinion.

This would require some more programming; either change the whole palette, or find a way with layer or DMA writes...I'll probably take a look at it once the system is fully fixed.
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6328 days
Last view: 6285 days
Posted on 08-22-06 03:47 PM Link | Quote
Nice. If I convert this to an ASM patch (so I can work with it better), would you mind if I posted it here for everyone to download as well? I've put some thought into what a day/night weather system would be like, but that's far from actually doing anything, good job.

Originally posted by JaSp
Originally posted by Stifu
I think you should make night colors more blue... It would look much better, in my opinion.
This would require some more programming; either change the whole palette, or find a way with layer or DMA writes...I'll probably take a look at it once the system is fully fixed.
Perhaps you could take a look at how Harvest Moon handles this, at least to get an idea of how the palettes transition throughout the day.
JaSp

Shyguy








Since: 11-18-05
From: Paris, France

Last post: 6286 days
Last view: 6285 days
Posted on 08-22-06 04:49 PM Link | Quote
That won't be necessary, I already found how to tint it in blue and am working on it
What do you mean by ASM patch ? Anyway, if it is as it sounds it can't be bad, so yeah, feel free to do it!
d4s

Shyguy








Since: 12-01-05

Last post: 6407 days
Last view: 6305 days
Posted on 08-22-06 05:25 PM Link | Quote
cool stuff.

not trying to badmouth your work or anything, but i think using the brightness register $2100 to simulate a night/day cycle isnt a very good idea.

first, just making the screen darker doesnt actually look like night.
second, the status bar shouldnt fade out at all when its night. it reduces its readability a lot.


a day-night transition that actually looks realistic has to go from bright white to red to blue to black and exclude the status bar.
the easy way would be to use subscreen substraction + a fixed color.
this isnt hard at all, you only have to take into account that the game uses this to do the rain effect in the beginning and in the swamps, so you'll have to calculate your current color based on what the game writes to the bg color.
if you need help, i already hacked a handler for this into z3 2 years ago (not a day/night cycle, but the color addtition/substraction part).

the proper way would be to alter the palettes, but for a game that has so much hardcoded stuff like zelda 3, it would probably take way too much manual fine-tuning to make it feasible.


(edited by d4s on 08-22-06 04:26 PM)
richyawyingtmv

Bouncy


 





Since: 11-18-05
From: England

Last post: 6287 days
Last view: 6285 days
Posted on 08-22-06 05:40 PM Link | Quote
Man, this is awesome - good work.

From this, would there be a way to implement day/time-based events using this system? For example, like those that happen in Majora's Mask? That would be great.

And also, I think maybe its a good thing that time still goes when you're reading signs/talking. Makes it a bit more authentic IMO.


(edited by richyawyingtmv on 08-22-06 04:41 PM)
(edited by richyawyingtmv on 08-22-06 05:01 PM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6285 days
Last view: 6285 days
Posted on 08-22-06 05:50 PM Link | Quote
The last time I designed a time interface, it did a check:

basically, LDA $10. Check if it's value is #$09 or #$07. If it is, increment the timer variable. Otherwise you don't. If you know anything about this game you'd see why.
JaSp

Shyguy








Since: 11-18-05
From: Paris, France

Last post: 6286 days
Last view: 6285 days
Posted on 08-22-06 07:26 PM Link | Quote
MoN: Well actually I don't know much about the game but thanks for this anyway, I think I understood how it works. It will be implemented once I'll get the 'blue night tint' done.

d4s: Actually I don't think that the game uses the subscreen substraction + fixed color for the rain, the screen is darker only because the background of the rain layer is dark grey. Actually, the only scene where it uses the substraction effect is at the very beginning, when Link is asleep. So, copied on this, I've completed the blue tint effect and it works quite well, but I'm having some issues :
- it doesn't work on areas that have layers (mountain, forest...)
- the area with the pyramid uses the same value for $2131 (handled by $9A in the game) as the regular areas; but since I changed the $2131 from #$20 to #$B2 to get the tint working on these areas, the pyramid layer doesn't fit on its area anymore. I found what was causing this and tried to add a small routine to fix it, and it works, but the layer isn't there anymore, we can just see the background color...* I just fixed it, a small error in my code. But $2131 isn't updated and the tint still doesn't work when coming from the pyramid area, and on layer areas. *
Anyway, the way I've done the tint effect is by increasing/decreasing by #$02 the addresses $9C and $9D (related to $2132) so that the fixed color looks progressively dark and blue. It seems that these address have always #$20 and #$40 as values for the overworld areas (except for the light world mountain, where it is slightly different).
I would be more than pleased to know how you managed to handle this!


(edited by JaSp on 08-22-06 06:33 PM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6285 days
Last view: 6285 days
Posted on 08-22-06 09:29 PM Link | Quote
Whenever a text message is brought up, or some event happens, most of the time it is a mode change (change in the state of variable $7E0010). There are some exceptions but not enough to really do further checking. #$0E for example, is text mode, as well as map mode. #$07 and #$09 are dungeon and overworld modes respectively. #$0B is the mode that occurs when you are in a special overworld area, such as the mastersword's hiding place, or zora falls. I forgot to mention that one.
eternaldragonx

Goomba
gtfo


 





Since: 02-18-06

Last post: 6332 days
Last view: 6293 days
Posted on 08-22-06 10:34 PM Link | Quote
maybe sum1 can use this in there zelda hacks that will never be finished
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6328 days
Last view: 6285 days
Posted on 08-22-06 11:44 PM Link | Quote
Originally posted by JaSp
What do you mean by ASM patch ? Anyway, if it is as it sounds it can't be bad, so yeah, feel free to do it!
Ah, what I mean is a patch that can be applied with an assembler such as xkas. Basically it would contain just the disassembly of the specific code you changed/added to create your IPS patch, but would be much more simple for anyone to just go in and edit, and to understand. Here's an example of what I'm talking about. I'd like to convert the IPS into an ASM patch, but I've run into a problem: I planned on using translhextion to compare an unaltered Zelda 3 ROM against one with your patch applied, to find out what code you changed to create the timer and day/night system, but there were 5578 separate areas of difference found between the ROMs. I don't think you intended your IPS patch to contain all of these extra changes, although I haven't yet seen them cause any bugs or glitches. I'm guessing the modified ROM you used to create the patch had a lot of extra, harmless changes that got unintentionally transferred to the IPS; 221 KB seems too large for this sort of IPS patch. That's one of the advantages of ASM patches, you know exactly what they contain.

If you feel like messing with it, I could make this an ASM patch if you shared the hex code you inserted and where you put it.
Euclid



 





Since: 11-17-05
From: Australia
hmm...

Last post: 6291 days
Last view: 6285 days
Posted on 08-23-06 12:38 AM Link | Quote
221kb = half of it is gfx changes.

"the code" starts at $1C/FF30 which is about E8130 in a headered rom.

As for code which jumps there, search for 22 30 FF 1C in the rom, I think i saw one at about 0x3xxxx position

edit: there's probably more code out there, like for drawing the timer on the overlay, they should be somewhere in the 0x3xxxx area as well If i remember correctly.

edit again: is it just me or does the timer stop when you're dashing.


(edited by Euclid on 08-22-06 11:39 PM)
(edited by Euclid on 08-22-06 11:41 PM)
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6328 days
Last view: 6285 days
Posted on 08-23-06 01:21 AM Link | Quote
Thanks Euclid, I'm looking into it. And no, I haven't noticed the timer stopping when I dash, where are you at when it happens?

edit: wait, he may have updated the patch since I last downloaded it.

edit: yeah, time stops when he dashes. That's pretty fast.


(edited by Reshaper256 on 08-23-06 12:22 AM)
(edited by Reshaper256 on 08-23-06 12:28 AM)
Googie

390








Since: 11-22-05
From: Corona Queens New York

Last post: 6287 days
Last view: 6287 days
Posted on 08-23-06 02:03 AM Link | Quote
Wow JaSp, this is pretty cool. Nice work on it.
JaSp

Shyguy








Since: 11-18-05
From: Paris, France

Last post: 6286 days
Last view: 6285 days
Posted on 08-23-06 12:17 PM Link | Quote
Well, it is way more convenient to work with asm patches and an assembler, so I converted my time code into a xkas-compatible asm patch, find it here. Thanks for the tip Reshaper!
I didn't bother to comment it since I'll re-write it to be fancier.

Another question about the fixed color substraction, I can't find a way to add the effect to both main-screen and sub-screen ; the best I can get is the tint working but with layer1 disappeared, though I tried to play with all mask,fixed color,screen designation and such registers

EDIT: Here's the updated version.


(edited by JaSp on 08-23-06 12:47 PM)
(edited by JaSp on 08-23-06 12:48 PM)
(edited by JaSp on 08-23-06 12:48 PM)
Raccoon Sam

Boomerang Brother
Custom Title








Since: 11-20-05
From: Correct

Last post: 6285 days
Last view: 6285 days
Posted on 08-23-06 01:01 PM Link | Quote
So does it go like BAM palette switch when night comes, or fade out slowly?
Nevertheless, excellent work.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6285 days
Last view: 6285 days
Posted on 08-23-06 01:13 PM Link | Quote
It's not a palette switch . It's a feature of the snes hardware where you can add a "fixed color" to any number of layers - you can select which ones. i.e. obj layer, BGs 0 through 3, and the "backdrop" which is the first color entry in cgram.

http://www.romhacking.net/docs/regs.txt for more info. Anomie is the shit.
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6328 days
Last view: 6285 days
Posted on 08-23-06 02:24 PM Link | Quote
Great, now I don't have to do anything.

edit: Gah! This is the ASM just for the timer itself, huh? I should've noticed that, I thought I was gonna get to see that blue tint effect.


(edited by Reshaper256 on 08-23-06 01:47 PM)
Pages: 1 2 3 4Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Zelda3 - Time + Day/Night system (IPS included) |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.022 seconds; used 450.15 kB (max 579.33 kB)