src/field
Guide: Field Engine
Files
| File | Description |
|---|---|
actor_placement.c | The party leader's actor placement, which fdActorResetForLeader copies before a scene places its own actors, and the script it gives the leader. |
actor_script.c | Actor scripts: the ones the field starts itself, and the command table. |
actor_script_operands.c | Script state values: the handler SC_SET, SC_ADD and SC_CMP call for each. |
actor_scripts.c | The actor scripts the field's commands start: walking off and turning to face a set way, the dust puffs, the emote bubble's pop and the movement types fdActorSetMovementType starts by number; and, among them, the glyphs a message types before its speaker's first voice blip. |
actor_update_arm.c | Unused: an ARM copy of the actors' update, made to run from RAM. |
battle_background_rules.c | The battle background of each scene (fdBattleBackgroundSelectForMap). |
battle_music.c | The music a battle plays: the bosses, the guards of Crossbone Isle, the Colosso finals and the fights with Saturos have their own, and every other battle plays the usual battle music. |
encounter_zones.c | The 104 encounter zones, by zone number. |
facing.c | Which picture a sprite shows for the way it faces, and the small tables the actors read as they move: the direction pad's headings, the World Map camera's lean, a floating actor's bob, how long a footprint lasts and the order a sprite dissolves in. |
field.c | The field object: the code that draws and moves everything in towns, dungeons and the world map. |
field_actor_camera.c | The actor cameras, which place every actor's sprite each tick. |
field_actor_motion.c | Actor motion, each tick, and the first actor script commands. |
field_actors.c | The field's actors: the 64 slots and creating and releasing them, starting them on their scripts, setting their sprites' animations and looks, and dissolving sprites pixel by pixel. |
field_decompress.c | LZ decompression. |
field_effect_tables.c | A field Psynergy's cast colours, and two script tables of the field effects. |
field_engine.c | The field engine's object: random encounters, a field scene's actors, the leader's walking and the requests they raise, fdEngineRun, the scene's cues, using items and Psynergy on the field, the map's treasure spots, and the screen transitions and palette fade that the field and battles share. |
field_engine_actors.c | The party's sprites, placing a scene's actors, and the actor slots. |
field_engine_cues.c | Finding and running a scene's cues: talking, step cues, examine cues. |
field_engine_encounter.c | Random encounters, and each scene's music, area name and battle background. |
field_engine_ground_mask.c | The ground mask: raised ground in front of an actor hides the part of it behind, as a ledge in the Kalay Tunnel's treasure room hides Isaac's legs. |
field_engine_internal.h | What every part of field_engine.c shares: its includes and the macros and types more than one part uses. |
field_engine_item_display.c | Showing a found item, and Reveal's sparkles on hidden things. |
field_engine_items.c | Using an item on the field. |
field_engine_palette_editor.c | The debug palette editor. |
field_engine_palette_fade.c | The palette fade: palettes moved toward target colours. |
field_engine_psynergy.c | Using Psynergy on the field. |
field_engine_run.c | The field engine: running a scene until the party leaves it, and its entrance. |
field_engine_screen_transition.c | How a scene fades in and out: from or to black or the backdrop colour, through windows that open or close over the screen line by line, from or to the centre line, or by a dissolve, which no scene uses. |
field_engine_speakers.c | Speaker definitions: voices and Halted lines by sprite. |
field_engine_tables.c | The field engine's tables: the actor scripts its effects run, the colour curves of the palette tints, and the lookup tables of its transitions, speakers, weather and Psynergy. |
field_engine_targets.c | The actor a field Psynergy or item aims at, and the helpers that follow it. |
field_engine_treasure_spots.c | The map's treasure spots: chests and Psynergy Stones. |
field_engine_walking.c | Field requests and each tick of the leader's walking: exits, encounters, damage. |
field_internal.h | What every part of the field object shares: its includes and the few names more than one part uses. |
field_map_grid.c | Layered maps: loading, drawing and scrolling, and copying metatiles. |
field_player_control.c | Player control: the configured keys and moving actors by the pad. |
field_script_commands.c | Actor script commands: waits, jumps, flags, moves and state values. |
field_sprite_animation.c | Sprites, their animations and the picture caches they draw from. |
field_sprite_draw.c | Drawing sprites: composing their animations and placing them on screen. |
field_sprite_viewer.c | The debug sprite viewer: one sprite shown once for each way it can face, in a ring, with up to four sprite animations laid over it and the keys to change each one's sprite, animation, priority and colour mode. |
field_terrain.c | Ground heights, and the collision of metatiles and the world map. |
field_tile_animation.c | Timed map changes: the tileset animations that redraw a map's tiles in turn, the blend script that changes over time how its layers blend, and the palette cycles, which nothing starts. |
field_view.c | The screen shake, and two parts of the world map's view: its still image drawn from its tile maps, and its ground tilted away from the camera, worked out a screen line at a time. |
field_world_map.c | The world map: its perspective view, its tiles, and the still image of the view BG1 shows while a menu or script runs. |
lucky_dice.c | Lucky Dice, the dice game in Tolbi, drawn with the battles' 3D camera. |
lucky_wheels.c | Lucky Wheels, Tolbi's game of chance: the player bets game tickets on paylines, pulls the lever up to five times and locks wheels between pulls to line up matching symbols. |
map_grid_data.c | Map ground: the height curve of each metatile kind and the world map's battle environments. |
map_screen_markers.c | The map screen's markers (fdMapScreenShow). |
palette_scale.c | The fade of the Lucky Dice and Lucky Wheels screens, which darken and brighten by scaling their palettes; each game's object includes it. |
screen_transition_shapes.c | The window shapes of WINDOW_TRANSITION_SHAPE, one for each step of its progress (fdScreenTransitionUpdateScanlineTable): a clock wipe, a wedge from the screen's centre (120, 80) that sweeps round from twelve o'clock, over the right half in the first 16 steps and the left half in the next 16. |
script_commands.c | The field Psynergy and script command object: the commands scripts run (waits, items, questions, destinations, actors, messages and the camera), moving on the field (views, jumps and climbing), the field's weather and line scrolls, Djinn joining the party, each field Psynergy, the field effect sprites its particles use, and the map screen. |
script_commands_actor_commands.c | Script commands on actors: placing, moving and animating them. |
script_commands_arcs.c | The golden rings that swell around a caster and rise up its body: each ring is two arcs of SPRITE_GOLDEN_RINGS, its back half behind the caster and its front half, the same arc upside down, in front. |
script_commands_avoid.c | Avoid: the caster spins among falling arcs and flashes, and monsters attack less often until it wears off. |
script_commands_camera.c | The camera a script moves: following an actor, panning to a point kept inside the map, and waiting for it to arrive. |
script_commands_carry.c | Carry: two hands lift the target, move it with the d-pad and drop it. |
script_commands_catch.c | Catch: a hand reaches out from the caster, grabs what is ahead and takes it off the map. |
script_commands_climbing.c | Jumping and climbing on the field. |
script_commands_cloak.c | Cloak: the leader blinks into a dark outline and stays hidden while it walks on metatiles that allow it (METATILE_BEHAVIOR_CLOAK). |
script_commands_djinni.c | A Djinni's hop before its battle, a Djinni joining the party, and the field effect sprites the joining lights are drawn with. |
script_commands_douse.c | Douse: a rain cloud floats out over the target and rains on it, then shrinks back into the caster. |
script_commands_exit_animations.c | An actor's screen position, the encounter transition, and the leader leaving through an exit and arriving. |
script_commands_field_particles.c | Field effect sprites: the particles field Psynergy moves and draws. |
script_commands_field_psynergy.c | Running a field Psynergy by its kind, and helpers its kinds share. |
script_commands_field_psynergy_state.c | A field Psynergy's state: setting it up, its caster and target, cleaning up. |
script_commands_force.c | Force: a fist flies out from the caster and knocks what it hits back a metatile. |
script_commands_frost.c | Frost: snowflakes spiral in on the target, and a puddle freezes into an ice pillar. |
script_commands_ground_particles.c | The ground particles (rain) start and the floating motes' update. |
script_commands_growth.c | Growth: green sparks fly from the caster, and a sprout grows tall. |
script_commands_halt.c | Halt: a stopwatch flies out to the target, ticks and bursts into sparkles, and the target stands frozen, its colours flickering. |
script_commands_internal.h | What every part of script_commands.c shares: its includes and the macros and types more than one part uses. |
script_commands_jupiter.c | A Jupiter Djinni joining the party, and the first of the Mars Djinni's functions, linked after it: its shrinking and its sparks. |
script_commands_lift.c | Lift: two hands grip the target and raise it, and Force's flashes and heavy impact, linked beside it. |
script_commands_line_scroll.c | The line scroll: per-line scroll offsets fed by HBlank DMA. |
script_commands_map_screen.c | The map screen R shows on the World Map: its area markers, the cursor and the name of the area nearest it. |
script_commands_mars.c | A Mars Djinni joining the party, and the first of the Venus Djinni's functions, linked after it: its shrinking, its falling motes and its rising particles. |
script_commands_mercury.c | A Mercury Djinni joining the party. |
script_commands_messages.c | The scene scripts' speech: a message window opened beside the actor who speaks, with the speaker's portrait, a yes-or-no question, two speakers at once, and the speaker's voice. |
script_commands_mind_read.c | Mind Read: scanline waves, shifting colours and flowing particles. |
script_commands_motes.c | Weather drawn in sprites on the field, and the storm's lightning: floating motes, rising sparkles, and the flashes of the palettes. |
script_commands_move.c | Move: a hand pushes the target, steered with the d-pad. |
script_commands_movement_types.c | Actor scripts: moving, turning and the built-in movement types. |
script_commands_ply.c | Ply cast in the field: eight winged figures spiral into one, which flashes, sheds sparks and flies off. |
script_commands_requests.c | Battles and destinations a script requests, and the queued sound. |
script_commands_retreat.c | Retreat, the caster spinning away in a spray of sparks, and the golden rings that fall round the caster of Avoid. |
script_commands_reveal.c | Reveal: the world turns grey but for a rippling window round the leader, which ends when the leader walks out of it or its time runs out. |
script_commands_scripts.c | Script commands: waits, received items, questions and destinations. |
script_commands_venus.c | A Venus Djinni joining the party. |
script_commands_view.c | The view bounds, zoom transitions and actors that ride another. |
script_commands_weather.c | The weather on the field: the rain splashing round the leader and the lightning of the storm over Vale. |
script_commands_whirlwind.c | Whirlwind: an orb flies from the caster and spins up a ring of leaves that blows its target away. |
sprite_color_tables.c | The colour tables of the sprite colour modes (SPR_COL_MODE) that remap a pixel's colour, 256 bytes each: five that swap a sprite's colour channels, SPRITE_COLOR_GRB to SPRITE_COLOR_BRG (also used by fdSpritePictureCacheLoad for variants 1 to 5), then the grey one and the blue, red and green tints. |
sprite_viewer_scale.c | Unused: the scale of the debug sprite viewer's ring of sprites, which nothing in the game opens (field_sprite_viewer.c). |
terrain_tables.c | The ground's shape inside a metatile for two of its height kinds (enum TERRAIN_KIND): where a raised or sunken square rounds off at its corners, and which of three heights each pixel takes, split along two diagonals. |
world_map_encounter_rules.c | Where the World Map's random battles come from: each region of the map, and its forests, take their own encounter zone. |
world_map_lines.c | The World Map's tilt: each line of the screen draws the flat map at its own scale and turn, so the ground seems to stretch away to a horizon. |
world_map_resources.c | World map graphics: a palette and five tilesets for each of its two looks, the second the snowfield's (fdWorldMapLoadGraphics). |