Courseplay / courseplay

Courseplay for Farming Simulator 2019
http://courseplay.github.io/courseplay
GNU General Public License v3.0
952 stars 527 forks source link

Courseplay thinks a field is merged with another even when the roller is used to keep them divided #3074

Closed Fogest closed 4 years ago

Fogest commented 5 years ago

If you look at the image below I've tried to make it extra clear what is happening and you can see the field edge lines CP calculated. You can see fields 19 and 20 are being recognized as being one field when the field edge detection runs. I had done some plowing to expand one field and it meant I did connect the two fields at one point. However I do not want CP to think they are connected so I tried to even use the roller to make sure there is a clear divide between the fields (you can see the rolled land in the pic and the pencil marks marking it). Is CP just not taking into account the rolled land? It seems to be basing this field edge detection purely on land that has been plowed at some point even if it is rolled later.

image

Fogest commented 5 years ago

My workaround for now has been to just manually drive around the proper field edge and save that route and use it for the field edge when generating a course.

ftasch commented 5 years ago

I think this i a general problem with FS19, nothing CP can do about it. When you plow some non-field area this area gets marked in the cultivator_density.gdm as field. The roller will not erase this, therefore CP when reading the field cant really see that you have rolled it.

Guess this is something GIANTS would have to fix. Only way I found so far, was to convert the cultivator_density to a .png file and edit manually. Not ideal but working.

Fogest commented 5 years ago

@ftasch That rolled data is stored somewhere though isn't it? Can that be accounted for, or would that be a challenging bit of data to have to try and incorporate for the amount it's worth?

I will attempt to use the work around you mentioned of editing the PNG file and see if I have any luck for now 👍

Satissis commented 5 years ago

As far as I know, the roller should remove it from the cultivator_density.gdm and restore it to what it was before it got plowed, but again I could be totally wrong since i haven't really tested it and as @ftasch said, it might be something we need to ask Giants about how it's handled.

@Fogest just a question. When you recalculate the field boundary, are you using the auto field scanner for that or are you rescanning them as custom fields ? (Scanning custom fields is placing you vehicle inside the field and press the button to get the field boundary from current location and then you can save them as a field number)

Fogest commented 5 years ago

@Satissis Currently on my laptop without FS on it but from what I recall I did the calculate field boundary manually while on the field, but then also attempted it by just selecting it in the field list (which I believe is the normal auto field scanner). So I believe I tried both and they both had the same result.

It's hard to see in the picture I posted but if you click on it to view it in full size you can see the boundaries there. Those are the field edges generated from the custom one. When I get home in about 12 hours I can double check and make sure I have tried both ways but I am almost 100% sure I have attempted both methods of adding the field and ended up having to resort to using a manually made field edge based on a recorded path.

@Satissis If it helps I'll also upload a the log file, and my cultivator_density file when I test it and a short video clip. Are there any debug channels you'd like on when I run the test?

Satissis commented 5 years ago

Yeah I'm just truing to get more info for us to go out from since I'm not the one that have much knowledge on how all the field scanning works and is properly not the one going to try fix it but we will see. Also it's not the biggest problem atm so it might take a bit before we get to look into this one.

I don't think the log will show anything unless you go into your savegame folder and open up courseplaySettings.xml and change both debugScannedFields and debugCustomLoadedFields to true and then after testing changing them back to false again si it don't fill you log with tons of debug prints afterwards.

Btw: If this is one of the default maps, you could upload an savegame for us to test it out on, though we would like it to be without any other mods ;) Then you would not have to do the above in the cp setting file

ftasch commented 5 years ago

@Satissis Well only started playing with FS19, but I too was under the impression that the roller should delete the cultivator_density and thus the field. However I noticed that the (pre CP) helper AI still tried to work those areas non the less.

Originally I tried that with game version 1.0, but might have done something wrong beeing new. Now I did so again with 1.3. This shows the result both ingame and in the cultivator_density converted in png. With 1.3 at least the AI does no longer work those areas, however the roller still does not completely delete the field in the cultivator_density.

1

This shows the starting fields of Felsbrunn in "new farmer" mode. I changed the colors to clarify since originally all would be almost black. As you can see, there are 3 distinct colors on the left field. White was RGB(0,0,0) and in areas without any field, the blue area has RGB(3,12,0) and corresponds to field19 with fully grown crop, the area that was rolled ingame RGB(0,12,0).

So basically it seems the roller removes the red channel, but leaves the green one unchanged. At least it does effect a change in the cultivator density.

Satissis commented 5 years ago

Hmm who would have known :) Well thanks for that info @ftasch ;)

ftasch commented 5 years ago

Finally I tried CP on my example field. And the current CP and game version 1.3 works fine for me. Meaning the field scanner will recognize all rolled areas and exclude them. So I would recommend @Fogest to update game and CP to the most current version and everything should be fine.

fsscreen_2019_02_02_19_21_01

Hope one can see the automatic field borders, but those look fine to me. To be complete I also connected field 19,20 by plowing until they ended up as one field in the scanner. Afterwards I used the roller and again both field were scanned seperate.

So all things considered, I would say there is no issue here, just a need to update the game :-)

Fogest commented 5 years ago

I am on the latest FS19 (it's auto updated via Steam) and I just did a git pull from the CP repo before launching it. Still no change even when I re-rolled. I have a video showing this. I will comment in a bit with a link to the video, I am currently out of my house and have some pretty slow internet so it will come later.

However you'll see in the video just like the screenshot in my original post that the field edge still is connecting the two fields where I had plowed before. There is no connection made earlier in the field where no plowing was done. The rolling does not seem to do anything to change the field edge generation.

It does not seem to make any difference if it is done using the auto field scanner or pressing the calculate field edge button (As the video shows).

ftasch commented 5 years ago

Did you try to use the standard helper to work your field? Does it stop on the field edge or will it continue? E.g. When you send a plow will it reconnect your fields?

Might very well be some bug in CP, but im wondering since I didnt have any problems there. Would love to take a look at your savegame's cultivator_density.gdm to see if there is still a connection.

Fogest commented 5 years ago

I've attached my cultivator_density file. The fields in questions are the fields 19 and 20 being connected. I will have to upload the video later on as the WiFi I am on right now is too slow to upload the video. cultivator_density.zip

pops64 commented 5 years ago

Sorry if this has been said but are you only doing one pass on the roller? This most likely is not enough space in between the fields. The default scan step is 5ms. Which means two rows will work or adjust the scan step in the CP settings file

Fogest commented 5 years ago

Hmm maybe that is the problem then as I am using only one roll width. I will attempt a second roll later though that does make the width larger than the original gap was by default between the two fields so I'm curious why there is a difference?

On Sat, Feb 2, 2019, 7:23 PM pops64 <notifications@github.com wrote:

Sorry if this has been said but are you only doing one pass on the roller? This most likely is not enough space in between the fields. The default scan step is 5ms. Which means two rows will work or adjust the scan step in the CP settings file

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Courseplay/courseplay/issues/3074#issuecomment-460011485, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHBbBeZVhA3tCpj4E7IlgxoP5lyaQFzks5vJiv0gaJpZM4ae1Nd .

pops64 commented 5 years ago

It comes down to luck honestly. If the last scan was 4 m from the edge the next jump doesn't land in a field. If the last jump is 1 m from the edge then the next jump would land in a field and it wouldn't know there is a gap. Steppenbach in 17 had major issues with this having there fields only a .5 m apart

Fogest commented 5 years ago

Ah I see. I will maybe try to only roll half the width of the roller extra to see if that is enough to do it.

On Sat, Feb 2, 2019, 7:33 PM pops64 <notifications@github.com wrote:

It comes down to luck honestly. If the last scan was 4 m from the edge the next jump doesn't land in a field. If the last jump is 1 m from the edge then the next jump would land in a field and it wouldn't know there is a gap. Steppenbach in 17 had major issues with this having there fields only a .5 m apart

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Courseplay/courseplay/issues/3074#issuecomment-460011980, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHBbB4vn1zL6aUPg2MlmQLxnuF6M2znks5vJi52gaJpZM4ae1Nd .

pops64 commented 5 years ago

In the savegame folder there should be a file called courseplaySettings.xml If you open that with your favorite text editor you should see a line that says scan step. Set that to 3 or 2.5 and save. Then try to see if that works. don't go to small has the smaller this gets the longer it takes to do auto scans

Fogest commented 5 years ago

I am going to have to check again later if changing that settings helps or not. I made the change to the file and played for about 30 minutes. I was about to test it and saved the game and the game could not save. Looks like my save file got corrupted. I am not sure if it is CP related because of that change. Who knows, but I am headed to sleep and will test again tomorrow. Luckily I have a savegame backup, only 30 min lost :)

On Sat, Feb 2, 2019 at 7:39 PM pops64 notifications@github.com wrote:

In the savegame folder there should be a file called courseplaySettings.xml If you open that with your favorite text editor you should see a line that says scan step. Set that to 3 or 2.5 and aave. Then try to see if that works. don't go to small has the smaller this gets the longer it takes to do auto scans

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Courseplay/courseplay/issues/3074#issuecomment-460012272, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHBbCNPGpRkPxY7vMNuE_W0YDuMVCGlks5vJi_VgaJpZM4ae1Nd .

ftasch commented 5 years ago

I took a close look at your fields in the cultivator density and as far as I can tell they are still conntected. And the shape looks rather similar to what CP selected as field edge in your picuture (as far as I can tell).

See this picture whitch is a representation of you density:

fogest_cultvatordensity_colored

White means no red channel, whereas red means any red channel in the converted cultivator_density. Anything in black is the original and I didnt care to change those colors :)

As you can see there is a major connection of your fields in the northern part. And the automatic scanner should recognize this red shape as your field.

Now why your roller doesnt work as it should I can't tell... If you give me your savegame I am happy to try it out myself and see if I can reproduce your problem.

ftasch commented 5 years ago

@Fogest

And you might try CP with this density. I seperated your fields here. Should work with this again. But might cut some pieces of your fields you would want to keep. So this is just for trying if it works then, it does on my maschine :)

cultivator_density.zip

Fogest commented 5 years ago

@ftasch haha, wow my fields look like quite the mess there, looks like I was drunk plowing all over there 😉 .

But on a related note here is the video I mentioned of me rolling the field: https://xboxdvr.com/gamer/Duel%20MachineGun/video/68655106#t=24 (start 24 seconds in)

It's kinda odd how the cultivator density is not showing any change even with that rolling. I am wondering if there is a FS19 problem now rather than this even being a problem related to CP? Unless I am using the roller wrong but it seems to be functioning correctly.

ftasch commented 5 years ago

No your usage of the roller looked fine. But if you saved after that and the cultivator density still looks like this, then there is definitly something strange happening. Especially since the changes on the ground textures and even your corn field can be seen. Meaning the roller is working... sort of.

No idea what might be the issue here, but dont think anything CP can do about it. It is showing the same behaviour I have seen when I first used the roller and didnt get its purpose (not really deleting anything that is). But at least for me that seems to have been fixed. When I tried with CP, rolled areas immediatly got detected by CP and where no longer scanned as field.

Will make some further tests tomorrow. Because if your also using 1.3, the only difference I can think of might be that I changed my maps i3d to accept .png for fruit and cultivator density instead of the original .gdm, maybe that changes something, but just a wild guess.

pops64 commented 5 years ago

To prove my eailer comment. Field 19 has yet to be bought but I did extened 20 to the south. It is just random chance that they might combine. This was taken with default scan of 5. Happend twice cause I forgot you must edit the file after quiting fsscreen_2019_02_24_10_30_26 This was taken with a scan step of 2 fsscreen_2019_02_24_10_33_50

To change the scan step go into the savegame folder for that save open courseplaySettings.xml with your favirote editor and find this line <courseplayFields automaticScan="true" onlyScanOwnedFields="true" debugScannedFields="false" debugCustomLoadedFields="false" scanStep="5"/>

and change the scanStep to 2 eg <courseplayFields automaticScan="true" onlyScanOwnedFields="true" debugScannedFields="false" debugCustomLoadedFields="false" scanStep="2"/>

Tensuko commented 4 years ago

Works just fine, in case of trouble, the ingame paint tool does a good job too.