Entry 569
Fields as defs: FieldDef by field type, WORLD's pictures and background as systems on the runner
2h 39mworld
Documented in Field generation.
Files69 in 17 directories
area.rsfx.rsloaddisp.rssession.rsworld.rscrates/piney-game/src/fx/ambient.rscrates/piney-game/src/session/tests/survey.rscrates/piney-world/examples/ambient_probe.rscarmina_gadelica_probe.rsdun_loireag_probe.rsdungeon_probe.rsfield_probe.rsfoe_probe.rsmap_probe.rsstory_map_probe.rsworld_probe.rscrates/piney-world/src/area.rslib.rscrates/piney-world/src/combat/breath.rsgate_out.rsmod.rscrates/piney-world/src/dungeon/dress.rslake.rsmod.rscrates/piney-world/src/field/ambient.rsarea.rsdef.rsfirefly.rsmod.rsworld.rscrates/piney-world/src/field/world/ride.rscrates/piney-world/src/map/mod.rscrates/piney-world/src/sky/firefly.rscrates/piney-world/src/story_map/abyss.rsboss_arena.rsdisc.rsgiant.rsholy_ground.rsmod.rssky.rstruths_core.rscrates/piney-world/src/systems/bird.rsfireflies.rsfires.rsflare.rshaze.rslake.rsmod.rsrain.rsscrolls.rssky.rssmoke.rssnow.rssteam.rstobj.rscrates/piney-world/src/town/carmina_gadelica.rsdun_loireag.rsfort_ouph.rslia_fail.rsmac_anu.rsmod.rsrelic_city.rsdocs/engine/effects.mdfield-walk.mdfield.mdsound.mdtown02.mdplans/rust-cleanup.mdtools/test_field_ambient_rs.pyMentioned inplans/rust-cleanup.md:318
Section 2's map systems item, step 3's first half (plans/rust-cleanup.md):
a field was FieldArea with an Ambient that made every picture
inline by field type (ty == 0, ty == 7, ty == 9, ty == 10, ty <= 3) and handed a list of Ops to the field, which drew the models and
the background itself (ambient_models, bg_draw) and the sprites and
puffs through the effects. Now each field type is a FieldDef and the
pictures are its systems on the runner the towns and story maps use
(worklog 560, 566). Nothing drawn changed.
The def
field::def::FieldDef, one static a type (FIELDS, FieldDef::of),
each BASE_FIELD with its differences: class (GameClass::World),
ty, field (type 4 has none: its first dungeon is a lake's and stands
for it), def_se (GO's jump table, the old DEF_SE), skies
(GetWeather and GetTime by background row, the old get_weather /
get_time switches as data: DRY, WET, SNOWY), back (where
SetCharPosition stands the party back from the dungeon, the old
field_start's type 10 and 6 arms), spark (FIREFLY::Move's sparks,
EFF_sfzfir1 in type 9), and the systems by who makes them: init
(WORLD::Init's, from the seed's fieldrand), plain / hacked
(DrawBG's by isHacked), generate (Generate's after SetStartPos,
from the layout's); order (FIELD_ORDER) and asleep
(FIELD_ASLEEP).
| system | game | made | types |
|---|---|---|---|
Snow | SNOW: flakes by weather (type 5's sfg8, 6's sfh8, SnowDef::Flakes), type 0's embers | Init | 0, 5, 6 |
Smoke | WORLD's ccMask 2D smoke | Init | 2, 3, 5, 6 |
Steam | DrawSteam | Init | 0 |
Haze | the heat haze (HazeDef::ahead) | Init | 0-3 |
LensFlare | LENSFLARE mode 1: Sun::Row (DMY_<x>lig_<b+1>point), field_eff's six, FlareDraw::Field (the torus wrap) | Init | all |
Scrolls, Sky | DrawBG: v$4519 with the turns (ScrollsDef::turns, Wrap::Below hacked), the row's clumps (ClumpName::Row, Aurora) at the centre turned (At::Centre) | DrawBG | all |
Tobj | TOBJ by Generate's roll | Generate | all |
Rain, Thunder | DrawRain's drops; its storm | Generate | 7-10 |
Fireflies | FIREFLY by night or hacked (Made::Generate) | Generate | all but 9 |
Firefly2 | FIREFLY2 roaming (Firefly2Made::Roam) | Generate | 9 |
Lake | SetLake's water | Generate | all |
Fires | SetSpecialObj's fires' smoke | Generate | 7 |
Bird | BIRD by day out of the rain | Generate | 10 |
Each system's constructor makes what the game's does under the area's
weather, time and hack flag (FieldCx: the def, the weather row, the
server, the field as Init and Generate left it, WORLD_MAN's centre)
and nothing otherwise. The systems' steps are WORLD::Draw's and
DrawEffect's order; asleep, the last frame's pieces are drawn again, the
haze's and the lake's sampling of the picture under them brought up to
the camera (Hook::Again). GameClass is now a column of the systems
table (Kind::class).
What else became data
ScrollsDef: a material takes its lanesShown::Beforeor after per material (MatScroll::before; the arena's sky), names a field's sky or aurora material (Mat::Sky,Mat::Aurora), and the turns ride with their statics.FlareDef: itsSun(a dummy or a field row's) and its file (town_z, orfield_efffor a field).Firefly2Def: who makes them (Markers,Roam) and their sprite (ByField,Field); both steps read the frame'sEnv(Fly's ground aGround).TownView,TownEventaresystems::MapView(with camera 1's place and turns, the frame's low bit) andMapEvent(witheffSmoke, the sounds, TOBJ's hum, the flash).- New requests:
Posed(a field'sccAnm::Draw: drawn models, skin nodes, alpha, one model's edits, TOBJ's shadow) andMasks(accMask's puffs in one send). - The drawing's function statics (
SaveState::field_ambient) are each system's words (ambient::statics), the executable's startBOOT_STATICS; a field without a system keeps its words as they were.
What the world sees
FieldArea { def, core: AreaCore, .. } with step(view, awake, cc) (its
MapEvents), paint (its sprites), take / put, take_made (TOBJ's
tobjSeLoopStart, once). The field's draw, a dungeon's and the breaths'
sprites go through FieldFx::sprites, their puffs through
FieldFx::smoke; field::ambient::Op is gone. No world or game code
names a field type: WorldMan::no_field() and DungeonArea::no_field()
(type 4's def), the gate-out checks, member_transfer and loaddisp::kind
take that flag; defSE is the def's.
tools/test_field_ambient_rs.py and ambient_probe: the probe makes the
port's field from the disc (FieldArea::with_world with the case's
Init centre) and hands the game's side the sun, the fires and Ω's
runners it found; draws and calls are compared apart (each in order).
Checks
- Golden shots, every file byte for byte against worklog 568's baseline (4,548 files: the towns', story maps', fields', dungeons', breaths' and 568's field and dungeon sets, every frame's digest among them).
- Against the game on all four volumes, all fifteen EE harnesses (60 of
60, as the baseline),
test_field_ambient_rsthrough the new probe. - The crates' tests, piney-game's suite (release);
piney-gen gen --check, clippy with all features (too_many_arguments144, one fewer:anim_editedis gone; nodead_codeallows), fmt,cairns check,tools/docs.py check.
Found on the way, for the next entries: WORLD::Init loads fieldccs2
(field_a1 ..) for a hacked field, the port fieldccs always.
whether a hacked field's objects and ground come from fieldccs2 in the port as WORLD::Init loads them (it loads fieldccs)
Closed by No. 571 — A hacked field reads its field file from fieldccs2.