Skip to content

Commit

Permalink
Add in no bloom and no background blur.
Browse files Browse the repository at this point in the history
  • Loading branch information
luckytyphlosion committed Nov 25, 2022
1 parent b42b7e9 commit a021077
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 11 deletions.
8 changes: 8 additions & 0 deletions data/RMCE01_gecko_codes_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,14 @@ C251FF68 00000007
3863FFFF 7C6329D6
7C841A14 00000000

$No Background Blur [davidevgen]
* https://mariokartwii.com/showthread.php?tid=485
04257E64 30000000

$No Sun Filter [Anarion]
* https://mariokartwii.com/showthread.php?tid=174
002572BF 00000000

[Gecko_Enabled]
$Ghost Always Saves
$Advanced Live Replay
Expand Down
8 changes: 8 additions & 0 deletions data/RMCJ01_gecko_codes_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,14 @@ C2523D5C 00000007
3863FFFF 7C6329D6
7C841A14 00000000

$No Background Blur [davidevgen]
* https://mariokartwii.com/showthread.php?tid=485
04257B24 30000000

$No Sun Filter [Anarion]
* https://mariokartwii.com/showthread.php?tid=174
00256F7F 00000000

[Gecko_Enabled]
$Ghost Always Saves
$Advanced Live Replay
Expand Down
8 changes: 8 additions & 0 deletions data/RMCK01_gecko_codes_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,14 @@ C2512400 00000007
3863FFFF 7C6329D6
7C841A14 00000000

$No Background Blur [davidevgen]
* https://mariokartwii.com/showthread.php?tid=485
04257F44 30000000

$No Sun Filter [Anarion]
* https://mariokartwii.com/showthread.php?tid=174
0025739F 00000000

[Gecko_Enabled]
$Ghost Always Saves
$Advanced Live Replay
Expand Down
8 changes: 8 additions & 0 deletions data/RMCP01_gecko_codes_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,14 @@ C25243dc 00000007
3863FFFF 7C6329D6
7C841A14 00000000

$No Background Blur [davidevgen]
* https://mariokartwii.com/showthread.php?tid=485
04258184 30000000

$No Sun Filter [Anarion]
* https://mariokartwii.com/showthread.php?tid=174
002575DF 00000000

[Gecko_Enabled]
$Ghost Always Saves
$Advanced Live Replay
Expand Down
12 changes: 9 additions & 3 deletions gen_gecko_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_gecko_code_file(template_file, out_file, params):
2: "c3ed"
}

def create_gecko_code_params(tt_character, tt_vehicle, default_drift, speedometer, disable_game_bgm, track_id, track_name, ending_message, on_200cc, region):
def create_gecko_code_params(tt_character, tt_vehicle, default_drift, speedometer, disable_game_bgm, track_id, track_name, ending_message, on_200cc, region, no_background_blur, no_bloom):
params = GeckoParams()

params.add_subst("tt_character", tt_character)
Expand Down Expand Up @@ -154,14 +154,20 @@ def create_gecko_code_params(tt_character, tt_vehicle, default_drift, speedomete
if on_200cc:
params.enable_optional_code("$CTGP 200cc")

if no_background_blur:
params.enable_optional_code("$No Background Blur")

if no_bloom:
params.enable_optional_code("$No Sun Filter")

return params

def create_gecko_code_params_from_central_args(rkg, speedometer, disable_game_bgm, timeline_settings, track_name, ending_message, on_200cc, region):
def create_gecko_code_params_from_central_args(rkg, speedometer, disable_game_bgm, timeline_settings, track_name, ending_message, on_200cc, region, no_background_blur, no_bloom):
tt_character = rkg.character_id
tt_vehicle = rkg.vehicle_id
default_drift = 2 if rkg.drift_type else 1

return create_gecko_code_params(tt_character, tt_vehicle, default_drift, speedometer, disable_game_bgm, rkg.track_id, track_name, ending_message, on_200cc, region)
return create_gecko_code_params(tt_character, tt_vehicle, default_drift, speedometer, disable_game_bgm, rkg.track_id, track_name, ending_message, on_200cc, region, no_background_blur, no_bloom)

def create_gecko_code_params_for_custom_top_10(rkg, timeline_settings, track_name, region):
custom_top_10_and_ghost_description = timeline_settings.custom_top_10_and_ghost_description
Expand Down
8 changes: 5 additions & 3 deletions record_ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def checkpoint_done(checkpoint_filename):
checkpoint_filepath = pathlib.Path(checkpoint_filename)
checkpoint_filepath.unlink(missing_ok=True)

def record_ghost(rkg_file_main, output_video_filename, mkw_iso, rkg_file_comparison=None, ffmpeg_filename="ffmpeg", ffprobe_filename="ffprobe", szs_filename=None, hide_window=True, dolphin_resolution="480p", use_ffv1=False, speedometer=None, encode_only=False, music_option=None, dolphin_volume=0, track_name=None, ending_message="Video recorded by Auto TT Recorder.", hq_textures=False, on_200cc=False, timeline_settings=None, checkpoint_filename=None):
def record_ghost(rkg_file_main, output_video_filename, mkw_iso, rkg_file_comparison=None, ffmpeg_filename="ffmpeg", ffprobe_filename="ffprobe", szs_filename=None, hide_window=True, dolphin_resolution="480p", use_ffv1=False, speedometer=None, encode_only=False, music_option=None, dolphin_volume=0, track_name=None, ending_message="Video recorded by Auto TT Recorder.", hq_textures=False, on_200cc=False, timeline_settings=None, checkpoint_filename=None, no_background_blur=False, no_bloom=False):

if szs_filename is not None:
szs_filepath = pathlib.Path(szs_filename)
Expand Down Expand Up @@ -181,7 +181,7 @@ def record_ghost(rkg_file_main, output_video_filename, mkw_iso, rkg_file_compari

disable_game_bgm = music_option.option in (MUSIC_NONE, MUSIC_CUSTOM_MUSIC)

params = gen_gecko_codes.create_gecko_code_params_from_central_args(rkg, speedometer, disable_game_bgm, timeline_settings, track_name, ending_message, on_200cc, mkw_iso.region)
params = gen_gecko_codes.create_gecko_code_params_from_central_args(rkg, speedometer, disable_game_bgm, timeline_settings, track_name, ending_message, on_200cc, mkw_iso.region, no_background_blur, no_bloom)
gen_gecko_codes.create_gecko_code_file(f"data/{mkw_iso.region.title_id}_gecko_codes_template.ini", f"dolphin/User/GameSettings/{mkw_iso.region.title_id}.ini", params)
lua_mode = timeline_setting_to_lua_mode[timeline_settings.type]

Expand Down Expand Up @@ -360,6 +360,8 @@ def main():
ap.add_argument("-hqt", "--hq-textures", dest="hq_textures", action="store_true", default=False, help="Whether to enable HQ textures. Current HQ textures supported are the Item Slot Mushrooms. Looks bad at 480p.")
ap.add_argument("-o2", "--on-200cc", dest="on_200cc", action="store_true", default=False, help="Forces the use of 200cc, regardless if the ghost was set on 200cc or not. If neither -o2/--on-200cc nor -n2/--no-200cc is set, auto-tt-recorder will automatically detect 150cc or 200cc if -cg/--chadsoft-ghost-page or -ttc/--top-10-chadsoft is specified, otherwise it will assume 150cc.")
ap.add_argument("-n2", "--no-200cc", dest="no_200cc", action="store_true", default=False, help="Forces the use of 150cc, regardless if the ghost was set on 150cc or not. If neither -o2/--on-200cc nor -n2/--no-200cc is set, auto-tt-recorder will automatically detect 150cc or 200cc if -cg/--chadsoft-ghost-page or -ttc/--top-10-chadsoft is specified, otherwise it will assume 150cc.")
ap.add_argument("-nbb", "--no-background-blur", dest="no_background_blur", action="store_true", default=False, help="If enabled, on most tracks, the blurry/fuzzy background images are now sharp and clear.")
ap.add_argument("-nb", "--no-bloom", dest="no_bloom", action="store_true", default=False, help="If enabled, disables the \"bloom\" effect (see https://en.wikipedia.org/wiki/Bloom_(shader_effect)). The effect is notable for not rendering properly on resolutions higher than 480p. Disabling bloom will cause graphics to look sharper however textures will have increased contrast which some might not like.")

# timeline no encode
ap.add_argument("-nm", "--no-music", dest="no_music", action="store_true", default=False, help="Disable BGM and don't replace it with music.")
Expand Down Expand Up @@ -608,7 +610,7 @@ def main():
else:
on_200cc = True

record_ghost(rkg_file_main, output_video_filename, mkw_iso, rkg_file_comparison=rkg_file_comparison, ffmpeg_filename=ffmpeg_filename, ffprobe_filename=ffprobe_filename, szs_filename=szs_filename, hide_window=hide_window, dolphin_resolution=dolphin_resolution, use_ffv1=use_ffv1, speedometer=speedometer, encode_only=encode_only, music_option=music_option, dolphin_volume=dolphin_volume, track_name=track_name, ending_message=ending_message, hq_textures=hq_textures, on_200cc=on_200cc, timeline_settings=timeline_settings)
record_ghost(rkg_file_main, output_video_filename, mkw_iso, rkg_file_comparison=rkg_file_comparison, ffmpeg_filename=ffmpeg_filename, ffprobe_filename=ffprobe_filename, szs_filename=szs_filename, hide_window=hide_window, dolphin_resolution=dolphin_resolution, use_ffv1=use_ffv1, speedometer=speedometer, encode_only=encode_only, music_option=music_option, dolphin_volume=dolphin_volume, track_name=track_name, ending_message=ending_message, hq_textures=hq_textures, on_200cc=on_200cc, timeline_settings=timeline_settings, no_background_blur=args.no_background_blur, no_bloom=args.no_bloom)

def main2():
popen = subprocess.Popen(("./dolphin/Dolphin.exe",))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ output-width: null
speedometer: standard
speedometer-metric: xz
music-filename: bgm

no-bloom: true
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ game-volume: 1
music-volume: 1
output-width: null

no-background-blur: true

speedometer: regular
speedometer-metric: engine
speedometer-decimal-places: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ game-volume: 1
music-volume: 1
output-width: null

no-bloom: true
no-background-blur: true

speedometer: regular
speedometer-metric: xyz
music-filename: bgm
10 changes: 5 additions & 5 deletions test_auto_tt_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import pathlib

test_config_filenames = (
#"test_150cc_default_drift_standard_som_no_bgm_lapmod.yml",
#"test_150cc_top10_region_filter_nohighlight_ht_standard_som_xz_main_ghost_auto_comparison_ghost_auto.yml",
#"test_200cc_regular_som_d0_comparison.yml",
"test_200cc_top10_3rd_comparison_censors_regular_xyz_som_malaysia.yml",
"test_150cc_top10_region_filter_nohighlight_ht_standard_som_xz_main_ghost_auto_comparison_ghost_auto_no_bloom.yml",
"test_200cc_regular_som_d0_comparison_no_blur.yml",
"test_200cc_top10_3rd_comparison_censors_regular_xyz_som_malaysia_no_bloom_no_blur.yml",
"test_150cc_default_drift_standard_som_no_bgm_lapmod.yml",
"test_200cc_fancy_som_d0.yml",
#"test_comparison_fancy_xz_som_d1.yml"
"test_comparison_fancy_xz_som_d1.yml"
)

class RegionFilenameAndName:
Expand Down

0 comments on commit a021077

Please sign in to comment.