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

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

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

Post by maroder »

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
As you can see mod-fish(it's all stuck on shore) have collision_box ~= {{0,0}, {0,0}},<br />terrain_collision_box = {{-0.75, -0.75}, {0.75, 0.75}} like the fish.fish<br />And  stuck fish.fish in the lower left corner
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 6397 times
posila
Factorio Staff
Factorio Staff
Posts: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

How exactly are mod-fish created? This doesn't happen when map generator autoplaces them.
User avatar
maroder
Inserter
Inserter
Posts: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

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

Post by maroder »

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
Same problem in vanilla-game. Loaded 0.15. Just look for the fish that was on the shore.
Same problem in vanilla-game. Loaded 0.15. Just look for the fish that was on the shore.
stuckFish.png (40.61 KiB) Viewed 6371 times
tiny-fish created by the same script
tiny-fish created by the same script
tiny-fish.png (92.32 KiB) Viewed 6376 times
posila
Factorio Staff
Factorio Staff
Posts: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

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: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

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

Post by maroder »

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: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

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
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

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

Post by Dev-iL »

Related to Fish without water?
Leading Hebrew translator of Factorio.
User avatar
maroder
Inserter
Inserter
Posts: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

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

Post by maroder »

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: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

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: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

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

Post by maroder »

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”