River movement mechanics

Web version of freeciv. Please mention the site you're using, if speaking things other than general freeciv-web codebase.
Lexxie
Veteran
Posts: 127
Joined: Fri Jun 23, 2017 4:18 pm

Re: River movement mechanics

Post by Lexxie »

The evolution of the idea, as far as ruleset implementation, currently stands here:

Bring in "Hard Entry" and "Hard Exit" road_flags that can be put on any road type. In particular, these can be used to effectuate the difficulty of crossing a bridgeless river. (But could also be used for special extras like trench warfare and cheval de frise). For rest of the post I'll just speak about rivers as if they hypothetically have these flags.
"Hard Entry":
Entering a tile with a river from a tile that has no river, uses all moves.
"Hard Exit":
Exiting a tile with a river to a tile that has no river, uses all moves.
Exceptions:
Not applicable to:
1. Units with IgTer flag or those not affected by TerrainSpeed (e.g., aircraft etc.)
2. Wherever there is an existing bridge/rail etc., the cheaper move cost applies.

Optional Considerations:
Hard Entry and Hard Exit penalties apply only where the RESTRICT_INFRA context is active. (Domestic/friendly units don't suffer hard entry/exit penalties on rivers, but pay normal move cost.)
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: River movement mechanics

Post by Ignatus »

Lexxie wrote: Mon Nov 28, 2022 6:47 pm
"Hard Entry":
Entering a tile with a river from a tile that has no river, uses all moves.
"Hard Exit":
Exiting a tile with a river to a tile that has no river, uses all moves.
Exceptions:
Not applicable to:
1. Units with IgTer flag or those not affected by TerrainSpeed (e.g., aircraft etc.)
2. Wherever there is an existing bridge/rail etc., the cheaper move cost applies.
Looks weird a bit (sometimes a unit enters the tile and goes back without crossing, or something...) but maybe is also some compensation for extra defense on river tile. I would propose an alternative solution (just a draft, this way has lots of reeves) - a unit gets "embarked" state if starts a turn on an appropriate extra (river) and in this state it may use the extra's movement benefits, but going astray removes the state and reduces move points proportionally before the side move is done; any attacking for units without AttFromNonNative is also considered disembarking.
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Re: River movement mechanics

Post by MikeDuk »

Path finding takes about 40% of the CPU time on a typical autogame.
What is an autogame?
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: River movement mechanics

Post by cazfi »

MikeDuk wrote: Thu Feb 09, 2023 7:42 am
Path finding takes about 40% of the CPU time on a typical autogame.
What is an autogame?
Game with just AI players. Usually those are run for testing purposes (to see that freeciv does not crash or produce any error messages, to observe how well AI performs). In most cases also run with timeout -1, meaning that turns go forward as quickly as AIs get their stuff done.
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Re: River movement mechanics

Post by MikeDuk »

OK, but could a singleplayer game, with say 12-15 AI players, be considered almost an autogame, regarding path finding computation?
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: River movement mechanics

Post by cazfi »

MikeDuk wrote: Mon Feb 13, 2023 7:58 pm OK, but could a singleplayer game, with say 12-15 AI players, be considered almost an autogame, regarding path finding computation?
At least during the turn change, where practically all the AI player activity happens, and no human activity takes place.

Originally I mentioned autogames just to make clear where I got the data, with also some implication of how much there is of it, to those who closely follow the development. (On average, I have 2 - 3 autogames running, resulting in around 10000 played turns per day, 365 days a year)
Post Reply