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

7 Commits

Author SHA1 Message Date
lcddisplay 63e959fe66 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-11 15:27:51 +01:00
lcddisplay 2f4894cb68 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-11 14:38:36 +01:00
lcddisplay b035391488 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-11 13:43:40 +01:00
lcddisplay fe623778ee 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-11 13:01:53 +01:00
lcddisplay 77117d5f5d 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-11 12:59:14 +01:00
lcddisplay 849f8cf55a 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-11 11:16:56 +01:00
lcddisplay d9970b5dec 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-10 22:44:22 +01:00