Skip to content

Conversation

@Axel32019
Copy link
Contributor

This will replace the setPipeInFruitMap calculation in AIDriveStrategyCombineCourse with a segmented approach.

Background is a field course with > 500.000 waypoints. It takes > 4min on my PC to execute setPipeInFruitMap function before a harvester is starting to work and game is frozen during this time. Approach is to divide the calculation in small pieces to calculate the PipeInFruitMap. Currently 80 calculations are done in each update-frame, leading to complete the PipeInFruitMap after ~2min (Surprise!!!). During this time the isPipeInFruitAtWaypointNow function is used to determine if pipe might be in fruit area if isPipeInFruitAt value is not yet available. If isPipeInFruitAt value is available it will be used.

Possible further improvements:

  • adjust the fixed 80 calculations per frame acording to the actual physics-FPS
  • consider field harvest strategy CP_vehicle_courseGeneratorSetting_centerMode_...

Remark:
I will not invest more time on this, so leave it up to you: Take it, improve it or drop it.

This will replace the setPipeInFruitMap calculation in AIDriveStrategyCombineCourse with a segmented approach.

Background is a field course with > 500.000 waypoints.
It takes > 4min on my PC to execute setPipeInFruitMap function before a harvester is starting to work and game is frozen during this time.
Approach is to divide the calculation in small pieces to calculate the PipeInFruitMap.
Currently 80 calculations are done in each update-frame, leading to complete the PipeInFruitMap after ~2min (Surprise!!!).
During this time the isPipeInFruitAtWaypointNow function is used to determine if pipe might be in fruit area if isPipeInFruitAt value is not yet available.
If isPipeInFruitAt value is available it will be used.

Possible further improvements:
- adjust the fixed 80 calculations per frame acording to the actual physics-FPS
- consider field harvest strategy CP_vehicle_courseGeneratorSetting_centerMode_...

Remark:
I will not invest more time on this, so leave it up to you:
Take it, improve it or drop it.
@pvaiko
Copy link
Contributor

pvaiko commented Nov 25, 2025

Distributing long running calculations is a good idea but the solution does not fit our current architecture. Since you don't seem to be ready to spend more time on this, I'm closing it.

@pvaiko pvaiko closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants