[posila][16.4][MOD]Fish creating not check terrain colliding

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
maroder
Inserter
Inserter
Posts: 42
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

[posila][16.4][MOD]Fish creating not check terrain colliding

Post by maroder » Sun Dec 17, 2017 10:05 am

When a new fish is created, it is checked collision_box, but not checked terrain_collision_box. Because of this, new fish often gets stuck on the shore.
some data
Attachments
Fish.png
As you can see mod-fish(it's all stuck on shore) have collision_box ~= {{0,0}, {0,0}},
terrain_collision_box = {{-0.75, -0.75}, {0.75, 0.75}} like the fish.fish
And stuck fish.fish in the lower left corner
Fish.png (121.11 KiB) Viewed 1490 times

posila
Factorio Staff
Factorio Staff
Posts: 3657
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by posila » Sun Dec 17, 2017 10:14 am

How exactly are mod-fish created? This doesn't happen when map generator autoplaces them.

User avatar
maroder
Inserter
Inserter
Posts: 42
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by maroder » Sun Dec 17, 2017 11:14 am

posila wrote:How exactly are mod-fish created? This doesn't happen when map generator autoplaces them.
1)by script, 2)manual(by player in game). Anywhere it check collision_box only.

In the picture above:
1) Stuck fish.fish in the lower left corner. Was ctrated by script (dozens in one place).
script
2) Mod-fish created by player (on_built_entity)
item.tiny-fish
You can add item for vanilla fish and check it.
item.fish
Attachments
stuckFish.png
Same problem in vanilla-game. Loaded 0.15. Just look for the fish that was on the shore.
stuckFish.png (40.61 KiB) Viewed 1464 times
tiny-fish.png
tiny-fish created by the same script
tiny-fish.png (92.32 KiB) Viewed 1469 times

posila
Factorio Staff
Factorio Staff
Posts: 3657
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by posila » Wed Dec 20, 2017 11:50 pm

I still haven't decided how to resolve this,
I am inclined to removing terrain_collision_box from fish prototype and revert it to use just collision_box. I added terrain_collision_box as an optimization, beacuse I didn't want fish with big collision boxes to register on multiple tiles unnecesserily, making their update more expensive ... but if I am to pollute all collision checks with extra case for fish, I want to be sure the optimization was not pre-mature.

User avatar
maroder
Inserter
Inserter
Posts: 42
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by maroder » Thu Dec 21, 2017 1:12 am

If the decision is made not to remove terrain_collision_box, then it will be optimal to first check whether the entity has terrain_collision_box.
Perhaps it would be better to add some collision to the coast.
I hope there is a reasonable solution that will not be perceived in the game itself as "what the hell is going on ?!" :?

posila
Factorio Staff
Factorio Staff
Posts: 3657
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by posila » Thu Dec 21, 2017 10:34 am

Ok, I am going to remove terrain_collision_box. But after the Christmas, we had some issues with entities expanding their collision boxes before, so I am not going risk breaking everyone's saves before holidays just to fix this.
For the time being, configure your fish with collision_box equal to terrain_collision_box.

User avatar
Dev-iL
Fast Inserter
Fast Inserter
Posts: 220
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: [posila][16.4][MOD]Fish creating not check terrain colliding

Post by Dev-iL » Thu Dec 21, 2017 11:17 am

Related to Fish without water?
Leading Hebrew translator of Factorio.

User avatar
maroder
Inserter
Inserter
Posts: 42
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

Re: [16.4][MOD]Fish creating not check terrain colliding

Post by maroder » Thu Dec 21, 2017 12:20 pm

posila wrote:Ok, I am going to remove terrain_collision_box. But after the Christmas, we had some issues with entities expanding their collision boxes before, so I am not going risk breaking everyone's saves before holidays just to fix this.
For the time being, configure your fish with collision_box equal to terrain_collision_box.
Ok, I got it. Thank you.
I'll just removed all terrain_collision_box.
Dev-iL wrote:Related to Fish without water?
No, it is not.

posila
Factorio Staff
Factorio Staff
Posts: 3657
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila][16.4][MOD]Fish creating not check terrain colliding

Post by posila » Wed Jan 10, 2018 6:35 pm

So, terrain_collision_box won't be used anymore in 0.16.17. Normal collision_box will be changed to size of terrain_collision_box and by default the fish won't collide with entities (it's default collision mask will have 'colliding-with-tiles-only' flag)

It took so long because fish with non-zero collision boxes were blocking offshore pump placement, and I had hard time to decide what's the best way to solve it.

User avatar
maroder
Inserter
Inserter
Posts: 42
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

Re: [posila][16.4][MOD]Fish creating not check terrain colliding

Post by maroder » Wed Jan 10, 2018 10:33 pm

posila wrote:Normal collision_box will be changed to size of terrain_collision_box and by default the fish won't collide with entities (it's default collision mask will have 'colliding-with-tiles-only' flag)
I hope that with such а large collision_box there will not be a problem of the appearance of a new fish over the existing one. If the "construction" of a new fish takes into account only the collision of tiles, then everything is fine.

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: Google [Bot]