Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cheats-and-assists.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ game is shipped with Savage Wind.
| Weather | Holds the weather you pick (clear, cloudy, rain, heavy rain, snow, heavy snow, thunderstorm, thunder rain, rain in sunshine), or keeps out rain or thunderstorms. Automatic is the game's own. Cutscenes keep their weather. |
| Free sprint out of combat | Sprinting on the ground takes no stamina while no enemy is fighting you. Once enemies start the battle music, sprinting costs stamina again until the music fades. Climbing, swimming, gliding and attacks cost stamina as usual. |
| Item pickup multiplier | Multiplies the stackable items you pick up (materials, monster parts, arrows) by 2, 4 or 8, up to 999. |
| Sure-footed horse | A running horse no longer stops dead and rears when it runs into something, even a small rock. It no longer stops at cliff edges either: mind where you ride. |
| Improved horse controls | The horse answers the stick at once, small nudges included, and turns sharper at a canter and gallop without losing speed in the turn. The horse no longer stops dead and rears when it runs into something, even a small rock, at any pace. It doesn't stop at cliff edges either, even at a walk: mind where you ride. |
| Show shrines and towers | Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is. |

### Collectible hints on the map
Expand Down
2 changes: 1 addition & 1 deletion runtime/control_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static const Setting settings[] = {
{"color_lut", g_settings.color_lut, TEXT, 0, 0, NULL},
I(color_lut_strength, 0, 100, NULL), B(color_lut_set), B(no_weapon_wear),
I(weapon_wear, WEAPON_WEAR_MIN, WEAPON_WEAR_MAX, NULL), B(infinite_arrows),
B(infinite_stamina), B(infinite_rupees), I(item_multiplier, 1, 8, NULL), B(free_sprint), B(sure_footed), B(collectibles_map), B(show_all_places), I(weather, 0, WEATHER_COUNT - 1,
B(infinite_stamina), B(infinite_rupees), I(item_multiplier, 1, 8, NULL), B(free_sprint), B(improved_horse), B(collectibles_map), B(show_all_places), I(weather, 0, WEATHER_COUNT - 1,
"game|no_rain|no_storms|clear|cloudy|rain|heavy_rain|snow|heavy_snow|thunderstorm|thunder_rain|sun_shower"),
B(god_mode), B(one_hit_kill), B(silent_link), B(hero_soul_wind), B(hero_soul_electric), B(hero_soul_fire),
B(hero_soul_water), I(damage_taken, 25, 400, NULL), I(damage_dealt, 25, 400, NULL),
Expand Down
59 changes: 59 additions & 0 deletions runtime/improved_horse.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Cheats > Improved horse controls (settings.h improved_horse): its steering (runtime/sure_footed.c: its stops).
// The ridden horse's update (tools/patches.py _horse_ride, _horse_stick_scale, _horse_play_rate) steers from the
// stick's x as the rider hands it over: already squared (0.3 sideways arrives as 0.09, less still with the stick
// pushed forward), then scaled per gear (1, 1, 1, .8 at the canter, .5 at the gallop), then smoothed into the
// steering (action +0x268: rate 0.06 into a turn, 0.1 back out, per 30 fps frame, with the frame's delta: the same on
// a Switch). The horse turns only past a steering of about 0.1 (measured: ~170 deg/s per unit above it), so at a
// gallop the stick has to be two-thirds of the way out before anything happens. With the option on the stick's x goes
// in as it is, the steering follows it about three times as fast, and the canter and gallop keep more of it. The
// horse's own steering (roads, obstacles: the turn smoother at +0x278) is left as the game has it.
//
// A turn also slows the horse: it blends the gear's run toward a turning run (the gear's AS, from a steering of 0.1,
// all of it at 0.9) that covers about a third less ground (0.66 of the speed) at the full blend (measured at the
// gallop: 5% lost at 0.25 steering, 20% at 0.57). The steering stores the horse's play rate in its unit (+0x154), and
// the run and the turn both go with it (1.3 gallops and turns ~1.3 times as fast): with the option on it is raised by
// what the turning run loses, so the horse keeps its speed through a turn (measured flat at the gallop and the canter).
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

#include "settings.h"

#define STEER_IN 0.2f // the steering smoother's rates
#define STEER_OUT 0.3f
#define GAME_STEER_IN 0.06f // the game's, set once by the action's constructor (1.9.0 0x70006af738)
#define GAME_STEER_OUT 0.1f
static const float k_stick[5] = {1, 1, 1, .93f, .7f}; // the stick's share per gear (game 1, 1, 1, .8, .5)
#define TURN_RUN_LOSS 0.34f // the speed the turning run loses at the full blend
#define TURN_BLEND_FROM 0.1f // the steering where the turning run starts to blend in (the gear's AS)
#define TURN_BLEND_FULL 0.9f // and where it is all of the run

static void put32(uint64_t a, float v) { memcpy((void *)(uintptr_t)a, &v, 4); }
static float get32(uint64_t a) { float v; memcpy(&v, (const void *)(uintptr_t)a, 4); return v; }

// action: the riding action, one per horse, whose steering rates stay as last written
void rt_horse_ride(uint64_t action) {
if (g_settings.improved_horse) {
put32(action + 0x268, STEER_IN);
put32(action + 0x26c, STEER_OUT);
} else if (get32(action + 0x268) == STEER_IN && get32(action + 0x26c) == STEER_OUT) {
put32(action + 0x268, GAME_STEER_IN); // (a horse ridden while the option was on)
put32(action + 0x26c, GAME_STEER_OUT);
}
}

// stick: the stick's x the steering is about to scale (the caller uses what this leaves there)
float rt_horse_stick_scale(int64_t gear, float game, float *stick) {
if (!g_settings.improved_horse) return game;
*stick = copysignf(sqrtf(fabsf(*stick)), *stick);
return gear >= 0 && gear <= 4 ? k_stick[gear] : game;
}

// The play rate the steering stores in the horse's unit every update while it steers.
float rt_horse_play_rate(uint64_t action, float game) {
if (!g_settings.improved_horse) return game;
float blend = (fabsf(get32(action + 0x270)) - TURN_BLEND_FROM) / (TURN_BLEND_FULL - TURN_BLEND_FROM);
blend = blend < 0 ? 0 : blend > 1 ? 1 : blend;
return game / (1 - TURN_RUN_LOSS * blend);
}
4 changes: 2 additions & 2 deletions runtime/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void settings_load(void) {
else if (!strcmp(key, "item_multiplier")) g_settings.item_multiplier = atoi(val);
else if (!strcmp(key, "free_sprint")) g_settings.free_sprint = atoi(val) != 0;
else if (!strcmp(key, "show_all_places")) g_settings.show_all_places = atoi(val) != 0;
else if (!strcmp(key, "sure_footed")) g_settings.sure_footed = atoi(val) != 0;
else if (!strcmp(key, "improved_horse")) g_settings.improved_horse = atoi(val) != 0;
else if (!strcmp(key, "collectibles_map")) g_settings.collectibles_map = atoi(val) != 0;
else if (!strcmp(key, "weather")) {
g_settings.weather = 0;
Expand Down Expand Up @@ -974,7 +974,7 @@ bool settings_save_to(const char *path) {
fprintf(f, "item_multiplier = %d\n", g_settings.item_multiplier);
fprintf(f, "free_sprint = %d\n", g_settings.free_sprint);
fprintf(f, "show_all_places = %d\n", g_settings.show_all_places);
fprintf(f, "sure_footed = %d\n", g_settings.sure_footed);
fprintf(f, "improved_horse = %d\n", g_settings.improved_horse);
fprintf(f, "collectibles_map = %d\n", g_settings.collectibles_map);
int wx = g_settings.weather;
fprintf(f, "weather = %s\n", g_weather_keys[wx >= 0 && wx < WEATHER_COUNT ? wx : 0]);
Expand Down
3 changes: 2 additions & 1 deletion runtime/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ typedef struct {
bool infinite_rupees; // the wallet is kept at 9999 rupees (runtime/rupees.c)
int item_multiplier; // 1, 2, 4 or 8: multiply stackable item pickups (runtime/items.c)
bool free_sprint; // sprinting takes no stamina while no enemy is fighting Link (runtime/free_sprint.c)
bool sure_footed; // a running horse doesn't stop dead and rear when it hits something (runtime/sure_footed.c)
bool improved_horse; // the horse steers at once, keeps its speed through a turn, and doesn't stop dead and rear
// when it hits something (runtime/improved_horse.c, runtime/sure_footed.c)
bool collectibles_map; // the Korok seeds and shrines not found yet on the game's map (runtime/collectibles_map.c)
bool show_all_places; // every shrine, tower, lab and stable on the map (runtime/place_display.c)
int weather; // WEATHER_COUNT: the game's, rain or thunderstorms kept out, or one weather held (weather.c)
Expand Down
9 changes: 5 additions & 4 deletions runtime/sure_footed.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Cheats > Sure-footed horse (settings.h sure_footed): a running horse no longer stops dead and rears (Crash or
// Courbette) when it runs into something. The patches at the horse's crash check and at its stop check's look-ahead
// ask here (tools/patches.py _horse_crash, _horse_look_ahead); with the option on no obstacle stops the horse.
// Cheats > Improved horse controls (settings.h improved_horse), with runtime/improved_horse.c: a moving horse no
// longer stops dead and rears (Crash, Courbette or the short Dislike) when it runs into something, at any gear. The
// patches at the horse's crash check and at its stop check ask here (tools/patches.py _horse_crash,
// _horse_stop_check); with the option on no obstacle stops the horse.
#include "settings.h"

int rt_sure_footed(void) { return g_settings.sure_footed; }
int rt_sure_footed(void) { return g_settings.improved_horse; }
4 changes: 2 additions & 2 deletions runtime/ui/i18n/de.inc
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ T("Weather", "Wetter")
T("Holds the weather you pick, or keeps out rain or thunderstorms. Cutscenes keep theirs.", "Hält das gewählte Wetter oder hält Regen oder Gewitter fern. Zwischensequenzen behalten ihr eigenes.")
T("Free sprint out of combat", "Freier Sprint außerhalb von Kämpfen")
T("Sprinting takes no stamina while no enemy is fighting you. Once the battle music starts, sprinting costs stamina again.", "Sprinten kostet keine Ausdauer, solange dich kein Gegner bekämpft. Sobald die Kampfmusik einsetzt, kostet Sprinten wieder Ausdauer.")
T("Sure-footed horse", "Trittsicheres Pferd")
T("A running horse no longer stops dead and rears when it runs into something. It no longer stops at cliff edges either.", "Ein laufendes Pferd bleibt nicht mehr abrupt stehen und bäumt sich auf, wenn es gegen etwas läuft. Auch an Klippenrändern bleibt es nicht mehr stehen.")
T("Improved horse controls", "Bessere Pferdesteuerung")
T("The horse answers the stick at once, small nudges included, and turns sharper at a canter and gallop without losing speed. It no longer stops dead and rears when it runs into something, or at cliff edges.", "Das Pferd reagiert sofort auf den Stick, auch auf kleine Bewegungen, und lenkt im Kanter und Galopp schärfer, ohne Tempo zu verlieren. Es bleibt nicht mehr abrupt stehen und bäumt sich auf, wenn es gegen etwas läuft, auch nicht an Klippenrändern.")
T("Collectible hints on the map", "Sammelobjekt-Hinweise auf der Karte")
T("Hold D-pad Down on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Halte auf der Karte des Spiels Steuerkreuz unten gedrückt, um blasse Kreise um die Krog-Samen und Schreine zu sehen, die du noch nicht gefunden hast, und wie viele die Region unter dem Cursor hat. Nur in Regionen, deren Turm du aktiviert hast.")
T("Hold D-pad Down or %s on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Halte auf der Karte des Spiels Steuerkreuz unten oder %s gedrückt, um blasse Kreise um die Krog-Samen und Schreine zu sehen, die du noch nicht gefunden hast, und wie viele die Region unter dem Cursor hat. Nur in Regionen, deren Turm du aktiviert hast.")
Expand Down
4 changes: 2 additions & 2 deletions runtime/ui/i18n/es.inc
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ T("Weather", "Clima")
T("Holds the weather you pick, or keeps out rain or thunderstorms. Cutscenes keep theirs.", "Mantiene el clima que elijas, o evita la lluvia o las tormentas. Las cinemáticas mantienen el suyo.")
T("Free sprint out of combat", "Correr gratis fuera de combate")
T("Sprinting takes no stamina while no enemy is fighting you. Once the battle music starts, sprinting costs stamina again.", "Correr no gasta vigor mientras ningún enemigo te esté atacando. En cuanto empieza la música de combate, correr vuelve a gastar vigor.")
T("Sure-footed horse", "Caballo de paso firme")
T("A running horse no longer stops dead and rears when it runs into something. It no longer stops at cliff edges either.", "Un caballo en marcha ya no se detiene en seco ni se encabrita al chocar con algo. Tampoco se detiene ya al borde de los precipicios.")
T("Improved horse controls", "Mejor control del caballo")
T("The horse answers the stick at once, small nudges included, and turns sharper at a canter and gallop without losing speed. It no longer stops dead and rears when it runs into something, or at cliff edges.", "El caballo responde al instante al stick, incluso a toques pequeños, y gira más cerrado al medio galope y al galope sin perder velocidad. Ya no se detiene en seco ni se encabrita al chocar con algo, ni al borde de los precipicios.")
T("Collectible hints on the map", "Pistas de coleccionables en el mapa")
T("Hold D-pad Down on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Mantén pulsada la cruceta abajo en el mapa del juego para ver círculos tenues alrededor de las semillas kolog y los santuarios que aún no has encontrado, y cuántos tiene la región bajo el cursor. Solo en las regiones cuya torre has activado.")
T("Hold D-pad Down or %s on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Mantén pulsada la cruceta abajo o %s en el mapa del juego para ver círculos tenues alrededor de las semillas kolog y los santuarios que aún no has encontrado, y cuántos tiene la región bajo el cursor. Solo en las regiones cuya torre has activado.")
Expand Down
4 changes: 2 additions & 2 deletions runtime/ui/i18n/fr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ T("Weather", "Météo")
T("Holds the weather you pick, or keeps out rain or thunderstorms. Cutscenes keep theirs.", "Garde la météo choisie, ou écarte la pluie ou les orages. Les cinématiques gardent la leur.")
T("Free sprint out of combat", "Sprint gratuit hors combat")
T("Sprinting takes no stamina while no enemy is fighting you. Once the battle music starts, sprinting costs stamina again.", "Sprinter ne consomme pas d'endurance tant qu'aucun ennemi ne vous combat. Dès que la musique de combat commence, sprinter consomme à nouveau de l'endurance.")
T("Sure-footed horse", "Cheval au pied sûr")
T("A running horse no longer stops dead and rears when it runs into something. It no longer stops at cliff edges either.", "Un cheval lancé ne s'arrête plus net en se cabrant quand il heurte quelque chose. Il ne s'arrête plus non plus au bord des falaises.")
T("Improved horse controls", "Meilleur contrôle du cheval")
T("The horse answers the stick at once, small nudges included, and turns sharper at a canter and gallop without losing speed. It no longer stops dead and rears when it runs into something, or at cliff edges.", "Le cheval répond tout de suite au stick, même aux petites touches, et tourne plus serré au petit et au grand galop sans perdre de vitesse. Il ne s'arrête plus net en se cabrant quand il heurte quelque chose, ni au bord des falaises.")
T("Collectible hints on the map", "Indices de collection sur la carte")
T("Hold D-pad Down on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Maintenez la croix bas sur la carte du jeu pour voir des cercles discrets autour des noix korogu et des sanctuaires que vous n'avez pas encore trouvés, et combien en compte la région sous le curseur. Seulement dans les régions dont vous avez activé la tour.")
T("Hold D-pad Down or %s on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "Maintenez la croix bas ou %s sur la carte du jeu pour voir des cercles discrets autour des noix korogu et des sanctuaires que vous n'avez pas encore trouvés, et combien en compte la région sous le curseur. Seulement dans les régions dont vous avez activé la tour.")
Expand Down
4 changes: 2 additions & 2 deletions runtime/ui/i18n/he.inc
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ T("Weather", "מזג אוויר")
T("Holds the weather you pick, or keeps out rain or thunderstorms. Cutscenes keep theirs.", "שומר על מזג האוויר שבחרת, או מונע גשם או סופות רעמים. סצנות קולנועיות שומרות על שלהן.")
T("Free sprint out of combat", "ריצה חופשית מחוץ לקרב")
T("Sprinting takes no stamina while no enemy is fighting you. Once the battle music starts, sprinting costs stamina again.", "ריצה לא צורכת סיבולת כל עוד אף אויב לא נלחם בך. ברגע שמוזיקת הקרב מתחילה, הריצה שוב צורכת סיבולת.")
T("Sure-footed horse", "סוס יציב")
T("A running horse no longer stops dead and rears when it runs into something. It no longer stops at cliff edges either.", "סוס בריצה כבר לא נעצר בבת אחת ומתרומם על רגליו האחוריות כשהוא נתקל במשהו. הוא גם כבר לא נעצר בקצה צוקים.")
T("Improved horse controls", "שליטה משופרת בסוס")
T("The horse answers the stick at once, small nudges included, and turns sharper at a canter and gallop without losing speed. It no longer stops dead and rears when it runs into something, or at cliff edges.", "הסוס מגיב מיד לסטיק, גם לתנועות קטנות, ופונה חד יותר בקנטר ובדהירה בלי לאבד מהירות. הוא כבר לא נעצר בבת אחת ומתרומם על רגליו האחוריות כשהוא נתקל במשהו, וגם לא בשולי צוקים.")
T("Collectible hints on the map", "רמזים לפריטי אספנות במפה")
T("Hold D-pad Down on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "החזק את לחצן הכיוון למטה במפת המשחק כדי לראות עיגולים עמומים סביב זרעי הקורוק והמקדשים שעוד לא מצאת, וכמה יש באזור שמתחת לסמן. רק באזורים שאת המגדל שלהם הפעלת.")
T("Hold D-pad Down or %s on the game's map to see faint circles around the Korok seeds and shrines you haven't found yet, and how many the region under the cursor has. Only in regions whose tower you have activated.", "החזק את לחצן הכיוון למטה או %s במפת המשחק כדי לראות עיגולים עמומים סביב זרעי הקורוק והמקדשים שעוד לא מצאת, וכמה יש באזור שמתחת לסמן. רק באזורים שאת המגדל שלהם הפעלת.")
Expand Down
Loading