Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Island bypass for custom fields #44

Open
nitroSkirata opened this issue Sep 3, 2024 · 21 comments
Open

[Feature] Island bypass for custom fields #44

nitroSkirata opened this issue Sep 3, 2024 · 21 comments
Labels
enhancement New feature or request

Comments

@nitroSkirata
Copy link

What is the problem this feature/enhancement solves?
When you have maps with very wonly fields (Mecklemburg Vorpommern for example) Courseplay is not able to generate courses for some of the fields.
To remedy this, one can cut the field into smaller section, using customs fields.

Those fields with still contain islands though, so it would be awesome, if courseplay could generate courses on customs fields and still bypass islands.

Describe the solution you'd like
Enable island bypass for custom fields

Describe alternatives you've considered
cutting the field even further to avoid islands, but that would result in a lot of very small fields.

Additional context
Screenshot 2024-09-03 182105
Field 22 of the Mecklemburg map
Without island avoidance, even CP-5 and CP-6 would need to be further fragmented, to generate a collision free course.
With Island avoidance, it might even be possible to combine CP-1 and CP-2. Maybe even CP-5 and CP-6

@nitroSkirata nitroSkirata added the enhancement New feature or request label Sep 3, 2024
@pvaiko
Copy link
Contributor

pvaiko commented Sep 3, 2024

I can't remember why we disabled island bypass for custom fields. It may have been the problem with detecting islands on a custom field, but not sure anymore.

@pvaiko
Copy link
Contributor

pvaiko commented Sep 3, 2024

(BTW, this isn't new, this was the same for the old course generator too...)

@nitroSkirata
Copy link
Author

Can you check if it would break anything to reenable it?

Or quickly tell me how to enable it on my own, so I could check?

@pvaiko
Copy link
Contributor

pvaiko commented Sep 5, 2024

Replace 'false' here with 'true':
https://github.com/Courseplay/Courseplay_FS22/blob/dbe77e48261de28c2b8ac682e8638e53e343b9c1/scripts/ai/jobs/CpAIJobFieldWork.lua#L192

@nitroSkirata
Copy link
Author

Tried it on a small scale, on the first few attempts, it works quite fine

@pvaiko
Copy link
Contributor

pvaiko commented Sep 6, 2024

@Tensuko can you remember why we disabled island bypass on custom fields?

@pvaiko
Copy link
Contributor

pvaiko commented Sep 7, 2024

Oh, just remembered. Custom fields can be drawn anywhere, also areas which aren't fields (not plowed). In that case, the entire area would be detected as island.

@nitroSkirata
Copy link
Author

Oh, just remembered. Custom fields can be drawn anywhere, also areas which aren't fields (not plowed). In that case, the entire area would be detected as island.

Yep, thats it.

Even with island bypass disabled in the ingame generator settings, CP is not able to create a course on a non-Field with custom field island avoidance enabled

@Tensuko
Copy link
Contributor

Tensuko commented Sep 18, 2024

@Tensuko can you remember why we disabled island bypass on custom fields?

I guess your 2nd answer is the reason.

What if we say the island needs its own custom "field" ?
So if we have a custom field within our custom field, the one within is counted as island?

I know that CAD software works like that for 3D construction, when you want a hole in a plate, you just draw one within your plate dimensions. But that would be the only way I can imange getting arround that non-field problem....

Else there is only left a "won't fix" / "can't do"...

@nitroSkirata
Copy link
Author

nitroSkirata commented Sep 18, 2024

@Tensuko can you remember why we disabled island bypass on custom fields?

I guess your 2nd answer is the reason.

What if we say the island needs its own custom "field" ? So if we have a custom field within our custom field, the one within is counted as island?

I know that CAD software works like that for 3D construction, when you want a hole in a plate, you just draw one within your plate dimensions. But that would be the only way I can imange getting arround that non-field problem....

Else there is only left a "won't fix" / "can't do"...

How about making the Island avoidance selection in the generator do the work?
IF it is selected to OFF, it is OFF for customs fields.
currently it seems to still run in the background.

Island avoidance for custom fields works, if the custom field is created on a field.
The problem with the Island Avoidance comes up, when the customfield is other ground.
In this case even with Island avoidance in the ingame settings turned off, the Coursegenerator somehow still tries to avoid islands.
Only in this case the entire field is an Island

@pvaiko
Copy link
Contributor

pvaiko commented Sep 19, 2024

What if we say the island needs its own custom "field" ? So if we have a custom field within our custom field, the one within is counted as island?

All the generator needs is a polygon for the field boundary and a list of other polygons which are the islands. So yes, this can easily be done, if you find a way on the UI to mark the islands...

Otherwise, for the use case here, not disabling island avoidance is the easiest solution.

@Tensuko
Copy link
Contributor

Tensuko commented Sep 20, 2024

All the generator needs is a polygon for the field boundary and a list of other polygons which are the islands. So yes, this can easily be done, if you find a way on the UI to mark the islands...

Draw or record another custom field arround the islands. Is not that hard to do.
Could even make custom island for those who want that.
So I would say that is the best solution for custom fields.

As said, the Idea behind custom fields was for "non fields" wich would be big islands and it won't work at all.

@BoxerHUN
Copy link

I can't remember why we disabled island bypass for custom fields. It may have been the problem with detecting islands on a custom field, but not sure anymore.

Hello.
I don't know what could have been the reason, but v7.4.0.0 did it properly, and v7.4.2.3 also does it after enabling bypass islands. He was tasked with 8 lands and 10 islands. I think he handles the islands well.

settings.bypassIslands:setValue(false)
v7 4 2 3_bypassislands_false

settings.bypassIslands:setValue(true)
v7 4 2 3_bypassislands_true

@nitroSkirata
Copy link
Author

I can't remember why we disabled island bypass for custom fields. It may have been the problem with detecting islands on a custom field, but not sure anymore.

Hello. I don't know what could have been the reason, but v7.4.0.0 did it properly, and v7.4.2.3 also does it after enabling bypass islands. He was tasked with 8 lands and 10 islands. I think he handles the islands well.

settings.bypassIslands:setValue(false) v7 4 2 3_bypassislands_false

settings.bypassIslands:setValue(true) v7 4 2 3_bypassislands_true

Yeah, it works well for this purpose, but it fails, if you create a field on non-farmland

@BoxerHUN
Copy link

Yeah, it works well for this purpose, but it fails, if you create a field on non-farmland

Ahh... I get it.

@Anonymous-any
Copy link

Anonymous-any commented Oct 29, 2024

Hi, to continue in this theme been read the wiki so I continue here I will not read ALLL the issues !!
Ok my problem seem a bit same but not ^^.
I tried to DL the (True) version for testing from @nitroSkirata but I can't... It seem locked.

So I post my picture's, I try to make understand to CP there is a custom field CP-3 to avoid inside the custom field CP-2 because I put some factories and CP continue to generate into them... So what can I do for that avoid if there a way ?

I add you I been tried to create and make pause-continue when I created the previous CP-2 field related to same the path of the CP-3 but without the CP-3 (I hope you understand my bad english), then the line reached continue the (after paused) dot, You know that CP do it, then the field CP-3 have meaning because the CP-2 only with CP-3 path simply not work to avoid, CP think its the same field... With the pictures maybe better understood Thank guys Regard
4
1
2
3

@nitroSkirata
Copy link
Author

@Anonymous-any You gotta edit that one for yourself, I am not even sure what kind of CP version I may have in my account.

Though that will not work for what you want.

Island avoidance will always only avoid areas that are not field.

@Anonymous-any
Copy link

@nitroSkirata 'You gotta edit that one for yourself' I don't understand where you mean to edit what ? I can avoid this problem you say me ?
You see that colliders from factories CP have don't care about em :/ That mean it doesn't avoid them ! amazing...

'Island avoidance will always only avoid areas that are not field.' <- Ok

@nitroSkirata
Copy link
Author

@Anonymous-any On September 6th in this thread, pvaiko posted what needs to be changed, to enable Courseplay to avoid islands on custom fields.

This change is usefull, for when a field has a wonky shape, requiring it to be split up for courseplay to compute a course.

However, when this change is applied, coursplay won't be able to compute a course on a custom field, which ground is not considered farmland.

AKA custom fields can no longer be used to create new fields, or mow grass wich is not growing on farmland.

Neither of these options will cause courseplay to avoid an additional custom field painted on ground considered farmland.

If you really want CP to avoid that area, you need to create a boundry, by for example boxing it in with the paint and terraform tool in the ingame shop.

@Anonymous-any
Copy link

@nitroSkirata Thank for the return,
Ok I will try to use paint on ground then I hope that will be done without needed using terraform added !

But for the devs team :
Wouldn't it be simpler to add the collisions of the 'factories' object masks or items to be detected to just avoid them in my case without necessarily referring to the ground? Maybe it can make you think, I don't know. Thank you in any case for these details @nitroSkirata.

@Anonymous-any
Copy link

@nitroSkirata Thank for the return, Ok I will try to use paint on ground then I hope that will be done without needed using terraform added !
Thats not work for me @nitroSkirata. Regard

@Tensuko Tensuko transferred this issue from Courseplay/Courseplay_FS22 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants