News:

SimuTranslator
Make Simutrans speak your language.

r11768 - new map oil rigg not in water

Started by Andarix, October 18, 2025, 12:26:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andarix

Simutrans r11768
pak64.german 0.124.0.0.7

New map generated timeline off.

simscr00.png

Isaac Eiland-Hall

Maybe it's the new mobile oil rig, just hard to see all the tiny wheels underneath.

Yona-TYT

Quote from: Isaac Eiland-Hall on October 18, 2025, 03:44:51 PMMaybe it's the new mobile oil rig, just hard to see all the tiny wheels underneath.
Wait, I hadn't realized it was an oil platform, what the hell is it doing there?  😅

victor_18993

I had a look at this. It is still there in current trunk (r12109) — the factory placement
code has not changed since you reported it.

What happens: at map generation, when a factory's supplier cannot be placed near it, the
builder retries with an "ignore climates" fallback. In that fallback (fabrikbauer.cc, in
build_chain_link) the supplier's *placement* is also forced to Land — for everything except
City:

    placement = ignore_climates ? (placement==City ? City : Land) : producer->get_placement();

But placement (Land / Water / City / river / shore / forest) is a geographic rule, not a
climate one. Forcing a Water supplier to Land makes the site check skip its "open water"
test, so the offshore oil rig is accepted on grassland. The same is true for river/shore
factories.

Two things confirm it: the identical downgrade is already sitting commented out in
find_random_construction_site with an explicit "site != Water" exception (so water was never
meant to be downgraded), and the climate is already relaxed separately via the ignore_climates
argument to find_random_construction_site. So the site-downgrade does nothing useful — it is a
no-op for Land and City and only ever misplaces the geographic factories.

The one-line fix keeps the supplier's real placement:

    factory_desc_t::site_t placement = producer_d->get_placement();

A water/river factory that cannot find its spot near the consumer is then simply not built in
that chain, instead of landing on the wrong ground. Behaviour for Land/City factories is
unchanged. No dat/savegame/network change.

Base r12109. Reproduced the downgrade during a real dense generation (a river paper mill forced
onto land); after the fix a full 250-factory generation shows zero downgrades, and it is
structurally impossible for it to happen. Standard test suite still 201/201. Patch attached with
the details.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Thank you, most helpful.

However, the river/forest/Shore are meant to relax as these are hard to satisfy abd maybe even impossible. Only water and city are strict. There may be maps without river or forests (No trees often used for smaller online games over slow lines) or even open water. But chains should still work (minus oil riggs and fish swarms, of course). So for intermediate produces, if ignore climates has switched on, then allow all sites either land or water.

Sumbitted a more releaxed relaxation in r12110.

One could thin of a more gradual release, first ignore climates and a while after even the geographical constrains, The code would be now prepared for it.

Isaac Eiland-Hall

This might be worth a different discussion, but it seems like if an oil rig can't be placed, it would be handy if the pakset could say "If you can't place this factory, try this other factory type" as a land-based oil well would still give an oil connection. Although this might be the sole instance of this need, so maybe too much work for a single factory type :)

Andarix

Asset pack developers are needed for the water industry sector. After all, there should be a land-based counterpart for every water industry asset.

Fish from a school leaping about on a green meadow or even in desert sand would likely look very odd.

victor_18993

Thanks for the explanations and for the ideas raised here.

I am always open to reviewing and implementing new mechanics as a programmer, especially when they solve a real gameplay problem. At the same time, I think any further change should remain aligned with the intended product design and with how Simutrans is expected to behave across different paksets and map configurations.

The original bug now seems properly addressed in r12110. If you think there is a useful feature that should be developed from the ideas discussed here — such as fallback industries, alternative placement rules, or a more gradual relaxation system — I would be happy to look into it.

In that case, I think it would be better to open a separate thread for the proposal. That would allow us to define the actual problem, expected behaviour and scope clearly before starting any implementation, without mixing a new mechanic with the already resolved bug report.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

pak128 for instance, has fishponds which, in urgent need, spawn in the dessert. (Maybe like real saudi arabia?)

And all paks with oil rigs have oil fields too, I think.