Page 1 of 1

[0.12.22][posila] vehicle coliding with decorative makes game crash

Posted: Sat Feb 20, 2016 7:30 pm
by StanFear
when a vahicle colides with a decorative entity which have a collision mask the game crashes with nothing getting put in the log (Microsoft windows : Factorio stopped functionning ...)

the entity prototype concerned by the bug :

Code: Select all

  {
    type = "decorative",
    name = "air-vent",
    flags = {"placeable-neutral", "not-on-map"},
    collision_mask = { "item-layer", "object-layer", "player-layer", "water-tile"},
    icon = "__Subsurface__/graphics/icons/air_vent_11_icon.png",
    minable = {mining_time = 1, result = "air-vent"},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    collision_box = {{-0.4, -0.4}, {0.4, 0.4}},
    render_layer = "decorative",
    max_health = 350,
    order = "z",
    pictures =
    {
      {
        filename = "__Subsurface__/graphics/entities/air_vent_11.png",
        width = 64,
        height = 64,
      }
    },
  },
it seems to me that the problem comes from decorative entities not handling correctly collision masks or health
(player does not walk through the entity and does not crash the game)

Re: [0.12.22] vehicle coliding with decorative makes game crash

Posted: Sun Feb 21, 2016 1:55 am
by Rseding91
Can you post a simple mod and save that reproduces the issue?

Re: [0.12.22] [Rseding91] vehicle coliding with decorative makes game crash

Posted: Sun Feb 21, 2016 7:22 am
by StanFear
sure,

there yo go :
Decorative_collision_debug_0.0.1.zip
the mini mod
(8.9 KiB) Downloaded 167 times
Bug_save.zip
the save
(111.62 KiB) Downloaded 178 times
steps to reproduce the bug :
  • enter the car
  • drive towards the air vent

Re: [0.12.22][posila] vehicle coliding with decorative makes game crash

Posted: Mon Feb 22, 2016 9:21 am
by posila
Thanks for the report. Fixed for 0.12.23

EDIT: Quick question. Why did you chose to use decorative instead of i.e. simple-entity? I am asking this because we are trying to decide if car should take impact damage or not.

Re: [0.12.22][posila] vehicle coliding with decorative makes game crash

Posted: Mon Feb 22, 2016 10:14 am
by StanFear
posila wrote:Why did you chose to use decorative instead of i.e. simple-entity? I am asking this because we are trying to decide if car should take impact damage or not.
before I used the collision mask, the entity was a simple decorative item (whith some code behind to move pollution), when yuoki made new gfx for it, I looked like it should colide with the player, so ... I added collision masks.
What I mainly wanted was an entity that could colide with the player bit not have side effects like the flashing no-power icon, or the multiple need for entries of graphics that wall need, etc.
I just didn't know that something like simple-entity existed (it does right ?) since when I searched, the only place I found a linsting of possible types for prototypes was here :https://forums.factorio.com/wiki/index.ph ... efinitions

is there another place that list entity types such as simple-entity ?

As to knowing if the car should take damage, I think it should, even if it is decorative, making it collide with the car should, imo, damage the car...
I just can't think of any case it wouldn't, if it colides, it should damage

hope that answered your question !

and I really found that funny how while I developped the mod, I found bugs that were not reported before, am I using functions noone ever used ?

Re: [0.12.22][posila] vehicle coliding with decorative makes game crash

Posted: Mon Feb 22, 2016 11:04 am
by posila
I don't think we keep updated prototype documentation anywhere, sorry. The best source of available prototypes is base mod, imho :).

"stone-rock" is simple-entity (those large rocks you have to shoot to get rid of).

I was thinking same thing - if it collides, it should cause impact damage. Thanks.