Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OW_USE_FAKE_RTC and OW_ALTERED_TIME_RATIO #4910

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

pkmnsnfrn
Copy link
Collaborator

Description

Gif of the wallclock moving forward one minute for every second in the gif

  • Created OW_USE_FAKE_RTC, which allows users to control the flow of time using frames instead of the RTC.
  • Created OW_ALTERED_TIME_RATIO, which allows users to control the speed at which time flows within the game.

Usage

OW_USE_FAKE_RTC

In include/config/overworld.h, developers must define if OW_USE_FAKE_RTC is TRUE or FALSE.

== TRUE

The time within the game is determined by the number of frames that has passed since the clock was initalized. Every 60 frames, time increments by X seconds, as defined in OW_ALTERED_TIME_RATIO.

== FALSE

The time within the game is determined by the reading of the RTC.

OW_ALTERED_TIME_RATIO

In include/config/overworld.h, developers must define which generation OW_ALTERED_TIME_RATIO should use.

This only works in conjuction with OW_USE_FAKE_RTC.

== GEN_8_PLA

For every 60 frames, time in game moves forward 60 seconds.

== GEN_9

For every 60 frames, time in game moves forward 20 seconds.

!= GEN_8_PLA && != GEN_9

For every 60 frames, time in game moves forward 1 second.

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/fakeRTC.patch -O fakeRTC.patch ; git apply fakeRTC.patch ; rm fakeRTC.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion fakeRTC

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script and config file, or manually create the changes.

Download

OW_USE_FAKE_RTC OW_ALTERED_TIME_RATIO Command
FALSE GEN_3 wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/include/config/f3.h -O include/config/overworld.h && wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/data/scripts/debug.inc -O data/scripts/debug.inc
TRUE GEN_3 wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/include/config/t3.h -O include/config/overworld.h && wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/data/scripts/debug.inc -O data/scripts/debug.inc
TRUE GEN_8_PLA wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/include/config/t8.h -O include/config/overworld.h && wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/data/scripts/debug.inc -O data/scripts/debug.inc
TRUE GEN_9 wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/include/config/t9.h -O include/config/overworld.h && wget https://raw.githubusercontent.com/PokemonSanFran/pokeemerald-expansion/fakeRTC_testing/data/scripts/debug.inc -O data/scripts/debug.inc

Manual Testing

  • Change the config file and change OW_USE_FAKE_RTC and OW_ALTERED_TIME_RATIO to their desired values.
  • Change data/scripts/debug.inc to match the one provided
  • Compile the game
  • Start a new save
  • Run Script 1

Verified Scenarios

All videos show:

  • The player sets the clock to 15:00
  • The player battles against TRAINER_RONALD and wins in 6 turns.
  • A script prints the current time.

OW_USE_FAKE_RTC == FALSE

f3.mp4

OW_USE_FAKE_RTC == TRUE && OW_ALTERED_TIME_RATIO == GEN_3`

t3.mp4

OW_USE_FAKE_RTC == TRUE && OW_ALTERED_TIME_RATIO == GEN_8_PLA`

t8.mp4

OW_USE_FAKE_RTC == TRUE && OW_ALTERED_TIME_RATIO == GEN_9`

t9.mp4

People who collaborated with me in this PR

All of this code was written by Anon822.

Features this PR does NOT handle:

#4909

Discord Contact Info

I am pkmnsnfrn on Discord.

include/config/overworld.h Outdated Show resolved Hide resolved
include/global.h Outdated Show resolved Hide resolved
src/fake_rtc.c Outdated Show resolved Hide resolved
src/play_time.c Outdated Show resolved Hide resolved
@Bassoonian Bassoonian merged commit e953a80 into rh-hideout:upcoming Jul 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants