18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 11:47:06 +01:00
Commit Graph

11 Commits

Author SHA1 Message Date
Hirek 969864f204 Merge staging into cleanup/mover
The windscreen weather (#367) and the compiler cache of the CI (#434). The
wipers' code of both renderers takes staging's side, reading the active cab and
the speed through TDynamicObject (ActiveCab(), Speed()) as the renderer does on
this branch; the windscreen water reads the speed the same way, and the deer
(world/deer.cpp) read the vehicle through its queries (V(), WarningSignal(),
CabOccupied()).

The golden traces recorded on dfb43c4f still match bit for bit: staging didn't
touch the physics.
2026-11-29 16:55:25 +01:00
Claude d8dc11aab2 Rebase onto staging (after #531)
The vehicle's physics is TDynamicObject::physics now (physics::Vehicle): the wipers, the insects and the
rain of the glasses, the snow of the windscreen water and the deer take it from there. The includes of
staging kept in opengl46renderer.cpp; the texture check of staging first in
Render_Instances_Indirect_Shadow(), then the materials with a vertex shader of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:53 +01:00
Claude 559d105aa4 Deer: take fright by the speed of the train, run over slopes leaning with the ground
A grazing deer takes fright when the train is deer.reactiontime seconds of its speed away (default 3.5 s: it needs 2.0-2.75 s
from the alarm to be off the track), but no nearer than deer.reactiondistance (default 20 m) for a slow or a standing train. So
the slower the train, the closer it gets before the deer runs. The horn (deer.hornrange) sends it off sooner, as before.
deer.fleedistance, of the test builds of this feature only and never in a release, goes; an eu07.ini that still has it is read
with its value passed over.

The way a deer runs away may go down the slope of an embankment (to 6 m below the sleepers) or up the one of a cutting (to 4 m
above them), no steeper than 35 degrees between the samples of the ground, now 17 of them, about 1.5 m apart. Water, walls and
cliffs still keep a deer away. Running, the deer leans up and down the slope by the ground under its hooves (at most 30 degrees,
smoothed, about its side axis, which keeps the turn the shader reads the clip and the moment from), and grazes leaning where it
stopped, drawn on its own, out of the groups of the instances of its model.

No change to the assets: the same models and textures of the deer (models/animals/jelen_*.t3d, textures/animals/jelen_*).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:15 +01:00
Claude d9980b78f7 Deer: LocalRandom(), not the seeded random engine of the simulation
The spawning, the side, the angle and the first frame of a deer no longer draw from Random(), so they don't shift the simulation of a seeded run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:14 +01:00
lcddisplay 5e605e8126 Deer: the ground of the heightmap terrain counts
On a scenery with heightmap terrain (Tomaszewo: terrain/tomaszewo_hgtmap/)
the deer looked for the ground among the shapes of the scenery only, found
none beside the track and weren't put anywhere ("no ground at 3.0 m" in the
log). Now the height of the heightmap terrain counts as the ground too, and
its bodies of water as water. The chunk under the point is read from its
pack file when it isn't in memory: the deer are put about 2 km ahead of the
camera, where the terrain isn't loaded for drawing yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 4a4fac1823 Deer: log why a deer wasn't put at a place
Every attempt that fails says why in the log: a switch, a crossing of roads
or the end of the track ahead; the platform found (its model, or the raised
terrain beside the track); or, for each side, why the way to run away isn't
flat ground: no ground found, water, ground too low or high, a step, or too
much rise and fall. For finding out why no deer appear on a scenery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay ff023e9047 Deer: keep away from long platforms too, and log where each is put
A platform model is placed by its middle, so a deer by the end of a long one
(peronowe/1k96w400m: 200 m from the middle) was farther than the 150 m looked
at, and was put there. Now a deer is kept 100 m beyond the reach of the model
(its bounding radius), the instances looked through up to 350 m away. Any
model with peron in its path counts (peronowe/..., przytorowe/tszopaperon).

The log tells where each deer was put ("Deer put at x y z").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay c476316bbd Deer: on curved track too, only the switches keep them away
The track at the place no longer has to be straight: a curve is fine. Only a
switch (or a crossing of roads) from the train to 100 m past the place keeps
a deer from being put there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay de99a8fc39 Deer: look at the train, only on plain straight track, not by platforms
The flight now has 6 clips instead of 2: the head turned 50, 80 or 110
degrees to the left or to the right. The game picks the one nearest to the
angle between the heading of the deer and the train. Before, clip 0 didn't
turn the head at all and clip 1 always turned it to the left, so the deer
looked away from a train on its right.

A deer is put only where the way from the train to 100 m past the place is
plain track: a switch (or a crossing of roads) on it fails, since the route
may change before the train gets there. The track there also turns at most
3 degrees over 50 m before and after the place.

No deer within 150 m of an instance of a platform model (a folder named
peron..., as peronowe/), nor where the terrain 2.5 or 4 m beside the track
rises 0.45 m over the sleepers (a platform made of terrain).

Assets: animals/jelen_skok.t3d and its VAT textures (jelen_skok_vatpos_hi,
_vatpos_lo, _vatnormal) have to be the ones baked with the 6 clips, in the
order 50, 80, 110, -50, -80, -110 degrees (jelen_anim2.py LOOKS). The deer
animations are kept local for now, not in the SVN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 6ca3339df8 Deer only where there's flat ground to bound away over
A deer is put beside the track only where the way it runs away is all over the
terrain of the scenery: ground found under each of the 9 samples of its way,
none of them water (a material named water/woda/wody), no farther than 1.2 m
below or 0.8 m above the sleepers, rising or falling at most 0.45 m between
samples and 1.2 m all along. So no deer on an embankment, in a cutting or by a
river. The side it runs to is picked at random first, then the other one; with
neither flat, the next deer is looked for 200 m on instead of a whole interval.
The ground is sampled when the deer is put there, so the run uses the same
heights. Translucent shapes count as ground too, for water drawn translucent.

Terrain made of models (e3d tiles) gives no ground, so there are no deer there.
No asset changes needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 8050ea8eb6 Deer at the tracks: graze ahead of the train, take fright at the horn and bound away
A deer is put on the path the player's train goes along (world/deer.cpp), grazing. The horn
within deer.hornrange, or the train closer than deer.fleedistance, frightens it: it raises its
head, looks at the train and bounds away from the tracks, then grazes where it stopped. The deer
go once the train is past them; they aren't parts of the scenery (not saved, not edited).

Off unless eu07.ini turns it on: deer (no), deer.interval (2000 m), deer.distance (2000 m),
deer.chance (1), deer.hornrange (600 m), deer.fleedistance (150 m).

- mat_vat.vert (ogl46, vk14): vat_random -1, the game picks the clip and the moment of an instance
  by the fraction of ten times its turn about the vertical, so one animation hands over to the
  next in the very same pose. 0 and 1 work as before.
- TAnimModel::draw_alone(): an instance the game moves leaves the groups of its model.
- scene_walk::Queue_Model: the record of an instance drawn on its own is made anew when the
  instance moved.

Assets (game data, installed locally in the game folder, not yet in the SVN; without them no deer
is made):
- models/animals/jelen_je.t3d, jelen_zryw.t3d, jelen_skok.t3d (the deer of jelen_lewo.t3d with the
  head turned straight, three animations baked by jelen_anim2.py)
- textures/animals/jelen_{je,zryw,skok}.mat and their _vatpos_hi, _vatpos_lo, _vatnormal .tga;
  diffuse animals/sarna_d_1, in winter animals/sarna_f_1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:10 +01:00