some data
[posila][16.4][MOD]Fish creating not check terrain colliding
[posila][16.4][MOD]Fish creating not check terrain colliding
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.
- Attachments
-
- 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
- As you can see mod-fish(it's all stuck on shore) have collision_box ~= {{0,0}, {0,0}},
Re: [16.4][MOD]Fish creating not check terrain colliding
How exactly are mod-fish created? This doesn't happen when map generator autoplaces them.
Re: [16.4][MOD]Fish creating not check terrain colliding
1)by script, 2)manual(by player in game). Anywhere it check collision_box only.posila wrote:How exactly are mod-fish created? This doesn't happen when map generator autoplaces them.
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.
- stuckFish.png (40.61 KiB) Viewed 6371 times
-
- tiny-fish created by the same script
- tiny-fish.png (92.32 KiB) Viewed 6376 times
Re: [16.4][MOD]Fish creating not check terrain colliding
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.
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.
Re: [16.4][MOD]Fish creating not check terrain colliding
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 ?!"
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 ?!"
Re: [16.4][MOD]Fish creating not check terrain colliding
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.
For the time being, configure your fish with collision_box equal to terrain_collision_box.
Re: [posila][16.4][MOD]Fish creating not check terrain colliding
Related to Fish without water?
Leading Hebrew translator of Factorio.
Re: [16.4][MOD]Fish creating not check terrain colliding
Ok, I got it. Thank you.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.
I'll just removed all terrain_collision_box.
No, it is not.Dev-iL wrote:Related to Fish without water?
Re: [posila][16.4][MOD]Fish creating not check terrain colliding
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.
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.
Re: [posila][16.4][MOD]Fish creating not check terrain colliding
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.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)