Day / Night Cycle
Patch data
Name | Day / Night Cycle (beta 2) |
Author | madsiur |
Link | Download |
Rom data
ROM Name | Final Fantasy III (USA) 1.0 |
ROM SHA-1 | 4F37E4274AC3B2EA1BEDB08AA149D8FC5BB676E7 |
Header | No |
Space Used
$C0D613 - $C0D63B | Previously Unused, New Code. |
$D4F650 - $D4FBFD | Previously Unused, New Code and Data. |
$EEAF01 - $EEAF1C | Previously Unused, New Code. |
New Free Space
$EE84BC - $EE8509 |
$EE8769 - $EE87B6 |
$EE8A55 - $EE8AA4 |
Description
This hack is currently in beta stage. Tests have been made but the hack has not yet been tested extensively on a single playthrough. I am in fact looking for people to do a test playthrough.
This is a complete day / night cycle that work everywhere you want: on regular map, on world maps and during world map events or mode 7. The battle backgrounds can also reflect the time of the day.
The game goes through a day or night then will gradually switch to day or night by tinting the screen toward blue or the opposite. The day length is customizable as well as the number of color transitions, thought the default 9 is kinda optimal. You can also customize the length of a single transition. There is also the option to have a set of predefined night palettes instead of global palette tint but this feature has not been tested due to the lack of proper palettes.
If you use a map on the world map, after the tent event the day will be set to the beginnign of the morning. Also, if you are in a desert battle at night, the wavy effect will be disabled. You can check if it's daytime or nighttime in events with an unused event bit I've chosen. This event bit can also be changed if needed. This event bit would be useful for any change involving night time but this is out of scope for now.
Finally there is an unused event command ($69) that I now use to manage the cycle. 69 01 will freeze the cycle, meaning the timer will stop and period of the day will stay the same everywhere until 69 02 is used, which restart the timer. 69 03 disable the cycle, meaning the timer stop as well as the initial tinting everywhere. On the next map load, it will look as vanilla game. 69 04 enable the cycle meaning timer is restarted and initial tinting as well, meaning on next map load, the map will look the same as before the disable command (69 03). Note that 69 03 and 69 04 should be used right after a fade out or right before a map load. They are not meant to be used in the middle of an event because they could break the cycle and transitions.
Usage
The hack requires 3 bytes of SRAM and one event byte (default $1E80:2). The first two bytes used are for the timer (default $1E1D-$1E1E) and the other one for flags (default $1E1F). Flags are as follow:
0x80 = progression toward nighttime (automatically toggled) 0x40 = timer is disabled (from event command) 0x20 = player is currently on a regular map (automatically set on regular maps) 0x10 = initial tint is disabled (from event command) 0x01-0x0F = numbers of transitions toward nighttime or daytime
The hack also has a set of cutomizable variables as follow:
!initialFlags = $88 ; initial flags values for !timerFlags ; 9 transitions ; progression toward nighttime !transLength = $0040 ; transition length time ($003C = 1 second) !dayLength = $0400 ; nighttime / daytime length ($0E10 = 1 minute) !transAmount = $09 ; number of transitions (real amount is !transAmount minus 1) ; limit is $0F but using the limit setting would make nighttime ; look black and blue only. On the other hand, values below 4 would ; make nighttime and daytime look quite similar. !nightValue = $05 ; transition ID where a current transition lower than this number ; will result in a nighttime. as an example, if setting is 5, ; transition 0 to 4 will result in nighttime
The hack also require 4 data files (plus 1 optional), that can be generated with the excel file maps.xlsm. Here is a brief explanation of each file taken from the main asm file:
maps_enabling.bin ; file generated with the "maps-enabling" macro in the Excel sheet ; each map has 1 bit, 1 for tint enabled, 0 for disabled incbin maps_freeze.bin ; file generated with the "maps-freeze" macro in the Excel sheet ; each map has 1 bit, 1 for freeze enabled, 0 for disabled background_tints.bin ; file generated with the "background-tints" macro in the Excel sheet ; each background has 1 bit, 1 for tint enabled, 0 for disabled ee_events.bin ; file generated with the "ee-events" macro in the Excel sheet ; 1 byte per overworld events at $EE43DB, 1 for enabled, 0 for not enabled background_palettes.bin ; file generated with the "background-palettes" macro in the Excel sheet ; to be used if you have a set of night palettes
Regarding the above data, the hack will not consider the world maps and serpent Trench data, meaning the cycle is always enabled and unfreezable on those maps. The only exception is if the cycle is disabled by the event command, then it will reflect on world maps. When a regular map is not tintable, the timer will continue working on these map, the difference is that they will never tint. When you set a map to be freezable, the tint will freeze as well as the timer.