18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 10:46:45 +01:00
Commit Graph

126 Commits

Author SHA1 Message Date
maj00r 1abcad631e Merge remote-tracking branch 'origin/feat/eu07m-gref' into feat/eu07m-geometry-streaming
# Conflicts:
#	model/Model3d.h
#	model/eu07m/eu07m_load.cpp
2026-12-02 00:18:16 +01:00
maj00r 7009b9b81b Merge branch 'feat/eu07m-gref' into feat/eu07m-geometry-streaming
Brings the .ng3d extension and modelformat ng3d (8637101d9). Where both sides changed a line, this branch's text is kept with the names changed; what this branch adds is renamed with it: the model files .ng3d, the family store .ng3p.
2026-11-30 22:27:11 +01:00
maj00r 56756ddb8e feat(model): .ng3d and .ng3p in what this branch adds, as below it
The model files are .ng3d and the family store .ng3p, selected with modelformat ng3d (8637101d9 on feat/e4d-compact).
2026-11-30 22:27:05 +01:00
maj00r db75e47615 Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector 2026-11-30 22:27:03 +01:00
maj00r c446a1640d Merge branch 'feat/eu07m-clip-event' into feat/eu07m-gref
Brings the .ng3d extension and modelformat ng3d (8637101d9). Where both sides changed a line, this branch's text is kept with the names changed; what this branch adds is renamed with it: the model files .ng3d, the family store .ng3p.
2026-11-30 22:27:02 +01:00
maj00r ff55024be9 Merge branch 'feat/eu07m-skin-compute' into feat/eu07m-clip-event 2026-11-30 22:26:38 +01:00
maj00r 7cad10c39a Merge branch 'feat/eu07m-clips' into feat/eu07m-skin-compute 2026-11-30 22:26:38 +01:00
maj00r bf66a704b1 Merge branch 'feat/eu07m-skinning' into feat/eu07m-clips 2026-11-30 22:26:37 +01:00
maj00r 3be62b067e Merge branch 'feat/eu07m-instancing' into feat/eu07m-skinning 2026-11-30 22:26:36 +01:00
maj00r 3c7824199c Merge branch 'feat/e4d-compact' into feat/eu07m-instancing 2026-11-30 22:26:36 +01:00
maj00r 8637101d96 feat(model): the EU07M model files take the .ng3d extension, the switch is modelformat ng3d
In place of .r3a (2fe1064f9): the model files are .ng3d and eu07.ini selects them with modelformat ng3d. The format keeps its name (EU07M), its magic and the -eu07m command line tool. Neither name has been released.
2026-11-30 22:26:29 +01:00
maj00r 8473b4fab1 Merge branch 'feat/eu07m-gref' into feat/eu07m-geometry-streaming
Brings the .r3a extension and modelformat r3a (2fe1064f9). Globals keeps this branch's modelstreaming settings, with r3a written for modelformat. What this branch adds is renamed with it: the model files .r3a, the family store .r3p.
2026-11-30 22:13:14 +01:00
maj00r d918d5f2f6 feat(model): .r3a and .r3p in what this branch adds, as below it
The model files are .r3a and the family store .r3p, selected with modelformat r3a (2fe1064f9 on feat/e4d-compact, merged up through feat/eu07m-gref).
2026-11-30 22:12:58 +01:00
maj00r c6fbd7801f Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector 2026-11-30 22:12:57 +01:00
maj00r a669be8f8f Merge branch 'feat/eu07m-clip-event' into feat/eu07m-gref
Brings the .r3a extension and modelformat r3a (2fe1064f9). docs/eu07m-format.md keeps this branch's English text, with the names changed. What this branch adds is renamed with it: the model files .r3a, the family store .r3p (geometry.r3p).
2026-11-30 22:12:49 +01:00
maj00r 20f6b2f52f Merge branch 'feat/eu07m-skin-compute' into feat/eu07m-clip-event 2026-11-30 22:12:13 +01:00
maj00r 981640d6e0 Merge branch 'feat/eu07m-clips' into feat/eu07m-skin-compute 2026-11-30 22:12:12 +01:00
maj00r 13d40487f8 Merge branch 'feat/eu07m-skinning' into feat/eu07m-clips 2026-11-30 22:12:11 +01:00
maj00r 79c90368a3 Merge branch 'feat/e4d-compact' into feat/eu07m-instancing 2026-11-30 22:12:09 +01:00
maj00r d12d54a83c Merge branch 'feat/eu07m-instancing' into feat/eu07m-skinning 2026-11-30 22:12:09 +01:00
maj00r 2fe1064f9a feat(model): the EU07M model files take the .r3a extension, the switch is modelformat r3a
The model files of the format are named .r3a in place of .eu07m, and eu07.ini selects them with modelformat r3a in place of
modelformat eu07m. The format keeps its name (EU07M), its magic and the -eu07m command line tool. Neither the extension nor
the key has been released, so nothing reads the old ones.
2026-11-30 22:11:57 +01:00
maj00r 1cab605911 Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector
The base split vehicle/DynObj.cpp into vehicle/dynamic/*: the holds of the editor on the parts and the pantographs move with
it. The table and the functions of the holds go to the end of vehicle/dynamic/visual.cpp, the held lamps and hooks are applied
in ABuLittleUpdate there, and a held pantograph is moved at the start of updatePantographMotion (vehicle/dynamic/update.cpp),
which skips the pressure-driven motion as the old loop did with continue. DynObj.h keeps both sides: the LightList of the
VehicleEnd rename and the holds.

The two reads of MoverParameters this branch added go through TDynamicObject, as the base's AGENTS.md asks outside physics/
and vehicle/: GetLength() for the fly-to distance, and a new query OccupiedCab() for the side of the cab entered.
2026-11-30 21:27:25 +01:00
maj00r 7ab6080096 docs(eu07m): the store as the game reads it now, the id of a block hashed again only with verify_hash, the store opened again when its file changes; the id to settle before packing 2026-11-30 05:24:20 +01:00
maj00r d3c9a94af2 Merge feat/eu07m-gref (with the current staging) into feat/eu07m-geometry-streaming 2026-11-30 01:01:39 +01:00
maj00r 5bfdd756de Merge feat/eu07m-channels into feat/eu07m-gref 2026-11-30 00:33:53 +01:00
maj00r 96198fa7a4 Merge feat/eu07m-clip-event into feat/eu07m-channels 2026-11-30 00:33:51 +01:00
maj00r e80cfc4f14 Merge feat/eu07m-skin-compute into feat/eu07m-clip-event 2026-11-30 00:33:50 +01:00
maj00r 91d334a484 Merge feat/eu07m-clips into feat/eu07m-skin-compute 2026-11-30 00:33:48 +01:00
maj00r f640657549 Merge feat/eu07m-skinning into feat/eu07m-clips 2026-11-30 00:33:46 +01:00
maj00r af3815eee3 feat(editor): a part of an EU07M model taken out with what it draws
"Remove this part" (Del) in the Models mode takes out any part without parts under it which nothing else
in the model points at (an animation, a light slot, a skin): with its components, its transform and its own
mesh. eu07m::remove_node now takes such a node with its geometry: its primitives go, and their vertices and
indices leave the streams where no other primitive shares them. The primitives after them move back, and
so do the meshes, the vertex groups and the references to the geometry store. A part whose mesh another
node draws too, or whose mesh has vertex groups, stays. Ctrl+Z puts the part back and picks it again.

So the flat glowing patch under a lamp post of E3D (placek) is taken out and a real light source put in the
lamp instead. Unit tests take out a part with geometry, check the streams and the primitive moved into its
place, write and read the model back, and keep a part whose mesh is shared.
2026-11-30 00:33:41 +01:00
maj00r 14dc873b05 Merge feat/eu07m-instancing into feat/eu07m-skinning
# Conflicts:
#	model/Model3d.h
#	rendering/common/scenewalk.cpp
#	rendering/common/scenewalk.h
#	rendering/opengl46/opengl46renderer.cpp
2026-11-30 00:33:39 +01:00
maj00r 470d4510ed Merge feat/e4d-compact into feat/eu07m-instancing
# Conflicts:
#	rendering/common/scenewalk.cpp
2026-11-30 00:33:16 +01:00
maj00r a4dd61cd2c Merge feat/e4d-load into feat/e4d-compact 2026-11-30 00:33:02 +01:00
maj00r 161a7762c9 Merge feat/model-format-e4d into feat/e4d-load 2026-11-30 00:33:00 +01:00
maj00r fc74ff0860 Merge origin/staging into feat/model-format-e4d 2026-11-30 00:32:49 +01:00
maj00r b3916500ce docs(eu07m): an animation event takes a node over from the clips and channels for good, and a sheared node loses its shear under a clip 2026-11-30 00:32:39 +01:00
maj00r 287424a3e1 fix(model): a light source added in the editor lights its surroundings
The renderer lights a light point of a model only past its threshold of self-illumination, which E3D keeps
in the material of the submodel. A LGHT node without an LMAT (made in the editor, or exported anew) had the
threshold -1, never lit, so a light added to a lamp post and saved lit nothing. Such a light now shines
whenever its node is shown, as one of a .t3d with "selfillum: true"; the lamp slot of its parent still
switches it. The converter gives every light of E3D an LMAT with the threshold it had, so the converted
models don't change. TModel3d::AddEditorLight gives the light it adds the same threshold.

Self-test: modelsave and modelbrightness, and modelplace takes the parameters of the node after the skin
(lights 3). Tested on a lamp post imported from E3D: a light added in the editor, saved, and after a new
run the lamp lights the vehicle beside it, both from the scenery file and when it is put in later.
2026-11-29 23:58:43 +01:00
maj00r 42e0884606 feat(editor): the cab of a vehicle edited in the Models mode, from the seat of the driver
The cab of a vehicle is loaded only by getting in. "Get in the cab" in the Models mode does what the
simulation does then: it makes the train of the vehicle (TTrain::Init loads the cab, its controls and its
sounds), makes it the vehicle driven, and puts the camera in the seat of the driver. While the cab is edited
the editor draws it as from that seat: FreeFlyModeFlag is off and the vehicle owns the camera, which moves
with it by its offset (the sounds read the owner of the camera then). With the body picked, or in another
field of work, the view is free again.

A new self-test command, modelvehicle <name> [cab], picks a vehicle and gets in its cab. Tested on the
EU07-424 (303e-tv) with a light added to its cab.
2026-11-29 23:00:52 +01:00
maj00r 6828e52a45 feat(editor): the EU07M models as a field of work of their own, made for those who don't know the format
The window of an EU07M model becomes the field of work "Models" (F7) beside the surroundings, the tracks,
the roads, the terrain and the catenary. The node bank says what is edited and lists the vehicles, the tool
options hold the page of the tool chosen in the toolbar (Lights, Parts of the vehicle, All parts,
Animations), and the inspector the settings of the part picked, in plain words; the fields of the format
are kept under Advanced.

- A click on the model picks its part (the smallest box of geometry of a part shown holding the point);
  a light is added where the model is clicked, a spot shining towards the camera.
- A light which nothing else points at is taken out (eu07m::node_removable / remove_node, with
  TModel3d::UnlinkEditorSubmodel / LinkEditorSubmodel on the model the game has).
- Ctrl+Z / Ctrl+Y take the changes of the model back and make them again, a light added or taken out
  among them; another model asked for with changes not saved asks first.
- "Import to EU07M" writes <model>.eu07m beside the .e3d or .t3d of a model without one, made of the
  model as the game loaded it (eu07m::import_model), so a lamp post or a cab gets its lights here.
- "Put a model in the scenery" puts a model of the folder of the models in front of the camera, "Whole
  model" moves the scenery model with the gizmo of the editor, "Put a vehicle on a track..." opens the
  Trainset tool.
- The inspector of a scenery model with an .eu07m file offers "Edit this model (F7)"; the floating window
  is gone.
- Review: the model is written to its .tmp, closed and checked before it replaces the file, and a failed
  .tmp is removed; play_clip counts From only for a positive pace again, so a pace of 0 holds the clip
  and a negative one runs it backwards.

New icons at the end of editor_icons.png (the cells before them are unchanged), the strings in
lang/editor_pl.po, new self-test commands (modelmode, modeltool, modeladdlight, modelundo, modelredo,
modelremove, modelplace, modelimport) and unit tests of remove_node. No asset in the SVN is needed or
changed; the import writes an .eu07m file into the game data only when the user asks for it.
2026-11-29 22:17:14 +01:00
maj00r ecfb99db1a Merge branch 'feat/eu07m-gref' of https://github.com/MaSzyna-EU07/maszyna into feat/eu07m-model-inspector
# Conflicts:
#	model/AnimModel.h
2026-11-29 21:34:23 +01:00
maj00r 89405a6eaf feat(render): the geometry of the scenery models and the data of the textures streamed, on by default
The streaming of the geometry of EU07M models (modelstreaming) and the streaming of the textures (gfx.textures.streaming) are now
both on by default; either is turned off in eu07.ini with "no", and turned off the game does what it did before.

Geometry (modelstreaming yes, with modelformat eu07m):
- A scenery model (node ... model) of an .eu07m file of at least modelstreaming.minsize KiB (256), without skins, stars and texts of
  E3D and with BNDS, has only its structure read at the load: one read of the beginning of the file (eu07m::read_file() with
  read_options::streams false, validate_scope::structure). Vehicles, cabs, loads and every other model load whole, as before; a
  streamed model asked for by anything else gets its geometry loaded and kept (TModelsManager::GetModel(..., Streamable)).
- Its geometry bank keeps its chunks empty (gfx::residency). A bank without its data draws nothing and is asked of the streamer
  (rendering/geometrystreamer.h): threads read and unpack the streams and the GREF blocks, nearest first, and the main thread hands
  them to the banks, 64 MB or 3 ms a frame. A bank unused for modelstreaming.evictafter s (30) lets go of its data in memory and on
  the GPU; above modelstreaming.budget MB (0, no limit) sooner. Whatever reads the vertices (picking, editor, sky occlusion) gets
  them loaded at once. The walks kept by the GPU culling are made anew when a bank got its data.
- The nodes, materials, components, clips and channels stay loaded: the walk goes through an instance without its geometry as
  through any other (RaAnimate(), RaPrepare()), only its draws are left out, so animations, lights and the events at their ends
  keep their timing. The radius of a streamed model and the bounds of its branches come from BNDS instead of the vertices.
- rendering/common/modelprefetch.h goes through the cells within the draw range and 500 m, 32 a frame, and asks for the geometry
  of the streamed models ahead of their drawing.

Textures (gfx.textures.streaming yes):
- The same pass has the data of the textures of the instances, shapes and tracks in reach read ahead by the texture workers in the
  Vulkan renderer (the OpenGL renderer has its own pass); the read-ahead data not drawn for 5 minutes or left behind is dropped.
- The loading screen waits, two minutes at most, for the geometry and the textures around the start and, in Vulkan, for their
  images made on the GPU (vulkan14_texture::request_background(false), made()).

Measured on Tomaszewo, Vulkan, editor self-test flight start to Kaletnik, four runs on an idle machine, alternated:
- peak committed memory 11.0 GB without streaming, 7.0 GB with textures, 6.2 GB with both; working set 9.0 / 4.8 / 4.2 GB
  (the copies of the texture data were 4.5 GB, the geometry banks 1.55 GB);
- scenario load 104-145 s without, 95-97 s with;
- frame time over the flight the same (11.8-12.5 ms), draws without their texture at the start the same as without streaming and
  fewer in the flight (380 against 636); the prefetch costs the main thread 0.1-0.2 ms a frame.

Also: the self-test commands "modelstream evict|wait|stats" and "memory <label>" (rendering/common/memoryreport.h, a breakdown of
the memory of the process), file_parts (utilities/wholefile.h) for reads of parts of a file, and the docs in docs/eu07m-format.md
("Streaming of the geometry"). The format doesn't change and no asset change is needed. Unit tests: test_eu07m_streaming.cpp.
2026-11-29 20:39:47 +01:00
Hirek 5d5e271edb Create vehicle-architecture.md 2026-11-29 18:32:22 +01:00
maj00r b03fff75df Merge the review fixes of the PRs below from feat/eu07m-channels into feat/eu07m-gref 2026-11-29 18:23:01 +01:00
maj00r 6efc1eb718 Merge the review fixes of the PRs below from feat/eu07m-clip-event into feat/eu07m-channels
RaPrepare() applies the clips, then the channels, then the animation events, so an event on a node takes over from both.
The spec has the fixes of #538, #540 and #542 in English.
2026-11-29 18:23:01 +01:00
maj00r 6402e2191b Merge the review fixes of the PRs below from feat/eu07m-skin-compute into feat/eu07m-clip-event
# Conflicts:
#	model/AnimModel.cpp
2026-11-29 18:22:25 +01:00
maj00r 49ef69bb34 Merge the review fixes of the PRs below from feat/eu07m-clips into feat/eu07m-skin-compute 2026-11-29 18:22:14 +01:00
maj00r c171e2e7d5 Merge the review fixes of the PRs below from feat/eu07m-skinning into feat/eu07m-clips 2026-11-29 18:22:13 +01:00
maj00r 05a8ddaabd Merge the review fixes of the PRs below from feat/eu07m-instancing into feat/eu07m-skinning 2026-11-29 18:22:12 +01:00
maj00r ce40e11b94 fix(model): EU07M review of #543: channel names keep their case, the joint moves from its rest value
- The channel event reads the name of the channel as written (getTokens lowercased it), and set_channel() finds it
  regardless of case: a channel named doorLeft couldn't be set from a scenery.
- JOIN.rest is read: the node is modelled at the rest value of its joint, which moves it by the value less rest (the
  limits stay values of the joint). A part modelled half open no longer jumps when its channel is set. Files without it
  (rest 0) move as before.
- The spec says so, and that no vehicle sets channels yet.

Test: a slider modelled half out.
2026-11-29 18:20:09 +01:00
maj00r 7b6bdf22bb fix(events): EU07M review of #542: clip names keep their case and match regardless of it, an event without a pace told
- The clip event reads the name of the clip as written (getTokens lowercased it), and play_clip() finds the clip
  regardless of case, as the submodels are found by their names: a clip named Open or Armature|Wave couldn't be started
  from a scenery.
- An event without a pace (clip <name> endevent) plays the clip at its own pace with a line in the log, and leaves the
  keyword it met to the event: before, endevent was read as a pace of 0 (stopping the clips) and the next token was
  swallowed.
- Pace 0 with several instances of one model is held by #540's fix (the clips stopped stay set per instance).
- The spec says so.
2026-11-29 18:19:19 +01:00