Skip to Content
The Alchemy Project

src/field

Guide: Field Engine

Files

FileDescription
actor_placement.cThe idle script, and the placement table the field starts with.
actor_scripts.cThe actor scripts the field and its scenes run.
actor_step_angle.cAn actor script call that turns an actor toward an angle a step at a time.
battle_background_rules.cThe battle background of each scene (fdBattleBackgroundSelectForMap).
battle_music.cThe battle music of the story's and the hidden bosses' battles (fdEncounterSelectBattleMusic).
encounter_zones.cThe 110 encounter zones, by zone number: each zone's rate, level, formations and their weights.
facing.cWhich picture a sprite shows for the way it faces, and the small tables and scripts 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, the order a sprite dissolves in and the World Map's graphics sets.
field.cThe field object, the field module's C as The Broken Seal's field.c is: resource metadata and LZ decompression, composing sprite pictures and placing projected sprites, the resource slots (sprite animations, actors and their motion and scripts, the player's control, the map grid and layers and the World Map), the tile animation, the view (screen shake and the ground plane) and the debug sprite viewer.
field_actor_camera.cThe actor camera: placing every actor's sprites on screen each tick under the scrolling or the fixed camera.
field_actor_motion.cActors' motion each tick: their scripts, steering toward a target, falling, floating and riding a platform, and being sent somewhere.
field_actors.cActors: a sprite dissolving pixel by pixel, the actor system, creating and releasing actors, their animations and scripts, and placing their sprites each tick under the scrolling or the fixed camera.
field_decompress.cResource metadata records and LZ decompression.
field_effect_advance_motion.cA field effect's motion each tick.
field_effect_data.cThe ropes' phases, the tints a field Psynergy fades toward, and the scripts that hold and release a field effect.
field_effect_move.cA field effect's motion, growth and spin each tick, with no drag.
field_effect_scripts.cFour effect scripts of the field engine module, the found item's picture growing in and pulsing, a sinking particle and a Reveal marker, then the screen transitions' tables and the palette tints' channel curves, as The Broken Seal's field_engine_tables.c has them.
field_effect_spawn_resident.cThe main image's copy of the overlays' effect spawner (field_effect_spawn.c), an object of its own between the script commands: Carry's ring of dust (fdEffectSpawnRadialParticleRing) spawns through it.
field_effect_tables.cTables of the field Psynergy, in the order of The Broken Seal's field_engine_tables.c: the pad's eight headings, Move's hand poses, the scripts of Growth's leaves, Force's fist and the three effect lengths, a halted actor's flicker, the Arrow's wobble, the metatiles Cyclone looks at and Blaze's tints.
field_engine.cThe field engine's object, as The Broken Seal's field_engine.c begins: random encounters, a field scene's actors, the leader's walking and the requests it raises, fdEngineRun, the debug palette editor, the scene's cues, the actor a field Psynergy or item aims at, using items and Psynergy on the field, and the map's treasure spots.
field_engine_actor_commands.cScript commands on actors: placing, moving and animating them.
field_engine_actors.cThe party's sprites, placing a scene's actors, and the actor table.
field_engine_cues.cFinding and running a scene's cues: talking, step cues, examine cues.
field_engine_encounter.cRandom encounters, and each scene's music, area name and battle background.
field_engine_ground_mask.cThe ground mask: 16-pixel sprites kept beside an actor where the ground before it rises, in a fade form nothing starts and a blank form Aqua Rock starts, which draws no visible pixel; and the effect sprites that borrow their tiles.
field_engine_heading.cA heading picture shown in a window that opens from the centre, and wiped away from the left.
field_engine_internal.hWhat every part of field_engine.c shares: its includes, and the declarations its parts call before their definitions or once declared differently.
field_engine_item_display.cShowing a found item, and Reveal's sparkles on hidden things.
field_engine_items.cUsing an item on the field.
field_engine_palette_editor.cThe debug palette editor.
field_engine_palette_fade.cThe palette fades: a fade between two built palettes over a number of ticks, and the palettes it builds from the shown one.
field_engine_psynergy.cUsing Psynergy on the field.
field_engine_requests.cBattles and destinations a script requests, and the queued sound.
field_engine_run.cThe field engine: running a scene until the party leaves it, and its entrance.
field_engine_screen_transition.cThe screen transitions: windows that close over the screen or open it, line by line, and the dissolve.
field_engine_script.cScript commands: waits, received items, questions and destinations.
field_engine_speakers.cWho speaks: each sprite's speaker definition, its voice and its halted lines, and the pair table.
field_engine_sprite_color_tables.cA second copy of the ten sprite colour tables in field/sprite_color_tables.c, the five conversion tables then the five byte remap tables, in the field engine module: the picture decoder's data (picture_decode.s) points at this copy.
field_engine_tables.cThe search command's messages.
field_engine_targets.cThe actor a field Psynergy or item aims at, and the helpers that follow it.
field_engine_treasure_spots.cThe map's treasure spots: chests and Psynergy Stones.
field_engine_walking.cField requests and each tick of the leader's walking: exits, encounters, damage.
field_internal.hWhat every part of the field object shares: its includes and the names two or more parts use.
field_map_grid.cLayered maps: decoding their tilemaps and palette, loading, drawing and scrolling, copying metatiles, and the edits flags apply.
field_move_by_keys.cMoving actors by the direction pad: the party's keys, crossing a rope or a tightrope, and moving as Sand, on a map and on the world map.
field_pad_movement.cScript commands that move the leader by the pad, on the map and the world map, and the configured keys checked from a script.
field_player_control.cPlayer control: the configured keys, and SC_PLAYER, the leader moved by the pad (fdActorUpdatePlayerControl).
field_psynergy.cThe field_psynergy object: the field Psynergy that spread effects around their target, then in ROM order the tile copies, the field Psynergy The Lost Age adds, from Cyclone to Hover (each part named for the Psynergy it runs, its kind in fdPsynergyRun), the summon tablets, the actors' metatiles, the canvas, sparks and field particles, and the world and map screen and its image.
field_psynergy_actor_metatiles.cActors standing as blocks in the map: their metatiles tagged and the tags cleared, the actor at a position, and effect sprites filled and queued.
field_psynergy_arcs.c
field_psynergy_arrow.cArrow: the unused "A??" field Psynergy's bow and flaming arrow.
field_psynergy_avoid.c
field_psynergy_blaze.cBlaze, and the check whether an actor stands where the map or another actor blocks it.
field_psynergy_burst.cBurst: its glow and sparks, and its explosions on the target.
field_psynergy_canvas.cThe canvas a field effect draws into and its darkening, an actor appearing in a whirl of sparks, and the field particles that fly to their targets.
field_psynergy_catch.cCatch: throwing a hand at a distant item to pull it back.
field_psynergy_cyclone.cCyclone and the whirlwinds: Cyclone's 96 leaves, the leader carried or lifted to a Cyclone metatile, Cyclone itself, an actor arriving in a whirlwind, spinning down from above (fdActorDescendInWhirlwind) or appearing in it (fdActorAppearInWhirlwind), then Blaze's jet of flame and the smoke it leaves.
field_psynergy_grind.cGrind: the screen shakes up and down while spray rises round the target, a sea rock is ground away, and the plain sway Grind makes at nothing.
field_psynergy_growing_sprite.cThe dust Scoop throws up, each grain growing as it flies.
field_psynergy_halt.c
field_psynergy_hover.cHover: its glow, the cast and its end.
field_psynergy_internal.hWhat every part of the field_psynergy object shares: its includes.
field_psynergy_lash.c
field_psynergy_lookups.cLookup tables of field Psynergy after Burst's glow: the Ring's picture map, the sprite shapes' sizes and the darkening maps of the colour ramp.
field_psynergy_map_screen.cThe map screen: its markers and cursor (The Broken Seal's script_commands_map_screen.c), and where the leader stands on it.
field_psynergy_map_screen_image.cThe map screen's image: drawing it, scrolling it with the cursor, its area markers, and zooming the view out while L is held.
field_psynergy_parch.cParch, then two drawing helpers of the Ring's: a canvas pixel on a circle, and its 16 by 16-tile picture copied to BG0 clipped to the screen.
field_psynergy_pound.cPound: its shine, the object it drives into the ground, and a picture's columns shifted by a wave.
field_psynergy_retreat.c
field_psynergy_ring.cThe Ring, the field Psynergy of the unused ability "Ma????" (named here for the ring of light it draws): its event, its burst of sparkles, and moving the view (opening the whole map to it, swinging it and giving the bounds back).
field_psynergy_sand.cSand: the leader sinking into the ground and moving as sand, the grains it throws up, the event that ends it off sand, and the dust puff it ends with.
field_psynergy_scoop.cScoop: the giant hand digging, the actor dropped from it and the item dug up.
field_psynergy_shape_entries.cThe map's shape entries and the flag blocks: the puddles Frost freezes into pillars of ice, each with the flag that says it is frozen.
field_psynergy_summon_tablet.cA summon tablet read: its pictures cycling, its pebbles and runes flying, and placing the flag blocks.
field_psynergy_tables.cTables of field Psynergy after Burst's palette: what Scoop digs up, Hover's glow, the Summon tablet's squash and the World Map markers' blend.
field_psynergy_teleport.cTeleport: the leader leaving in a burst of sparks and arriving in a whirl of them, and the cast that opens the picture of the world.
field_psynergy_tile_copies.c
field_psynergy_tremor.cTremor: the view swayed from side to side.
field_psynergy_whirlwind.cWhirlwind: radial particle rings, circling and wandering leaves and the Whirlwind orb.
field_script_commands.cActor script commands: waits, jumps, flags, moves and work values.
field_sprite_animation.cSprites, their animations and the picture caches they draw from.
field_sprite_draw.cDrawing sprites: composing their animations' pictures and placing projected sprites on screen.
field_sprite_viewer.cThe 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.cThe ground heights and the collision of metatiles and the World Map.
field_tile_animation.cWorld map tile preloading and still image, and timed map changes: the map animations, the blend script, the palette cycle and the World Map region tint.
field_view.cScreen shake, the copied BG row drawer and the ground plane scanlines.
field_world_map.cThe world map: its perspective view, its tiles, and drawing its metatiles into a BG map.
grid_outline.cThe grid outliner, compiled as ARM code and copied to RAM to run, entered in Thumb through fdGridDrawOutlineCode (field_arm_entries.s).
lucky_dice.cThe Lucky Dice minigame: its tables, its start, its helpers and its run.
lucky_wheels.cLucky Wheels, Contigo's game of chance: the player trades game tickets for lines, pulls the lever up to five times and locks wheels to line up matching icons.
map_grid_data.cMap ground: the height function of each metatile kind, the world map's battle environments and the sprite viewer's small tables after them; then the actor scripts the field starts by itself, the actor script command table and the work value handlers.
palette_cycle_add.cAdding a palette cycle.
palette_cycle_initialize.cAllocating the palette cycles' queue.
psynergy_reach.cHow far each field Psynergy reaches.
screen_transition_shapes.cThe window shapes of WINDOW_TRANSITION_SHAPE, one for each step of its progress (fdScreenTransitionUpdateScanlineTable): a hand sweeping clockwise from twelve o'clock round the centre of the screen, as The Broken Seal has them.
script_commands.cThe script_commands object, its parts in script_commands/ in ROM order, ending with the script commands that follow it: the effect scene, Mind Read to Cloak, the rest of Cloak and Carry.
script_commands_actor_commands.cScript commands on actors: their callbacks, sprite priority and still pictures.
script_commands_camera.cThe script commands that move the camera and wait for it.
script_commands_carry.cCarry: two hands lift the target, move it with the d-pad and drop it, or crash together when cast at nothing.
script_commands_climbing.cJumping, climbing and stepping onto and off ropes and tightropes.
script_commands_cloak.cCloak, Douse, falling particles and steering a lifted target.
script_commands_djinni.cA Djinni's battle start and its joining the party, the field effect sprites' slots, and a Jupiter Djinni's light.
script_commands_douse.c
script_commands_exit_animations.cAn actor's screen position, the encounter transition, and the context effects of leaving through an exit and arriving.
script_commands_field_psynergy.cHelpers the field Psynergy kinds share: map metatiles, spawned actors and particles, and the field's tint.
script_commands_field_psynergy_state.cThe effect scene a field Psynergy runs in: fading to and from its cast colour, its effect slots and resources, the actor pair it works on, and Mind Read's wave and palettes.
script_commands_force.c
script_commands_frost.c
script_commands_ground_particles.cThe ground particles, the rising particles and the floating motes.
script_commands_growth.cGrowth: growing plants, hanging vines and scattering leaves.
script_commands_internal.hWhat every part of script_commands.c shares: its includes and the macros and types more than one part uses.
script_commands_jupiter.cA Jupiter Djinni joining the party, and per-tick updates the field effects share: a pulse, a quickening spin, a slow shrink, and a Mars Djinni's sparks.
script_commands_lift.cLift: lifting a target with two hands and the heavy impact burst.
script_commands_line_scroll.cThe line scroll: per-line scroll offsets fed by HBlank DMA.
script_commands_mars.cA Mars Djinni joining the party, the fast shrink that ends a spin, and a Venus Djinni's motes and particles.
script_commands_mercury.cA Mercury Djinni joining the party.
script_commands_messages.cMessages shown at an actor, and the speaker's voice.
script_commands_mind_read.cMind Read: its wave, ripple, tint, crescents and caster colour cycle.
script_commands_motes.cWeather drawn in sprites on the field, and the storm's lightning: floating motes, rain, rising sparkles, and the flashes of the palettes.
script_commands_move.cMove: steering a pushed target with the +Control Pad and the Move hand.
script_commands_movement_types.c
script_commands_ply.cPly: swaying particles, shrinking orbits and sparks.
script_commands_psynergy_dispatch.cRunning a field Psynergy by its kind, and the priority and depth its sprites take to be drawn with an actor.
script_commands_reveal.c
script_commands_ropes.cRopes, tightropes and hanging vines: chains of nodes laid between two points or round one, drawn and updated each tick, and the leader crossing them.
script_commands_scripts.cThe particle scripts of the field commands after the rope and vine pictures, Mind Read's colour cycle and the pad's headings, in the order of The Broken Seal's field_engine_tables.c.
script_commands_tables.cTables of the field commands, in the order of The Broken Seal's field_engine_tables.c: the rope's headings, the line scroll's sine, the rain's frames and offsets, the sparkles and the leader's pulse as a Mars Djinni joins.
script_commands_venus.cA Venus Djinni joining the party, and a Mercury Djinni's droplets.
script_commands_view.cThe view bounds, zoom transitions and actors that ride another.
script_commands_weather.cThe weather on the field: The Broken Seal's rain kept whole, this game's rain, and the storm's lightning.
speaker_voices.cThe voice each sprite speaks in, and a few small actor scripts and tables: an actor's bounce, the dust puffs' lives and a blinking actor's colours.
sprite_color_tables.cThe sprite colour tables, 256 bytes each, that recolour a sprite picture by turning each colour of the basic sprite palette into another: five channel swaps, a greyscale, three tints and a negative.
super_lucky_dice.cSuper Lucky Dice, Contigo's four-dice game with its hi-lo game to double the winnings.
terrain_tables.cThe 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 slants.
world_map_cursor_angles.cWhich way the cursor of the map screen moves for the +Control Pad (fdMapScreenUpdateMarkers).
world_map_encounter_rules.cWhere the World Map's random battles come from: each region of the map, on foot and aboard the ship, takes its own encounter zone, and each Djinni battle its zone and slot.
world_map_lines.cThe 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.

On this page