what causes neutrons to die?

  • zBuilder
    23rd Sep 2015 Member 0 Permalink

    I was working on something and noticed that even with an empty update procedure, neutrons still die seemingly randomly. I tried looking in simulation.cpp-under what conditions will they vanish and is there a way to add more/remove existing conditions? 

    Edited once by zBuilder. Last: 23rd Sep 2015
  • mecha-man
    24th Sep 2015 Member 0 Permalink

    There is a PROP_LIFE_KILL_DEC in the property value of it which causes the life to decrease until 0 and then kill it.

  • ChargedCreeper
    24th Sep 2015 Member 1 Permalink

    mecha-man:

    There is a PROP_LIFE_KILL_DEC in the property value of it which causes the life to decrease until 0 and then kill it.

     

    Something else kills it too. If you set life of neut to 0 via console, it still dies eventually. This does not happen with electrons or protons.

    Edited 3 times by ChargedCreeper. Last: 24th Sep 2015
  • Sandwichlizard
    24th Sep 2015 Member 1 Permalink

    its when the contact a surface there is a chance for them to die.

  • zBuilder
    24th Sep 2015 Member 0 Permalink

    mecha-man:

    There is a PROP_LIFE_KILL_DEC in the property value of it which causes the life to decrease until 0 and then kill it.

     yeah- I probably should have mentioned I removed that flag- thus was suprised that it still went down without it and without anything specificly in the element it's self

     

  • jacob1
    24th Sep 2015 Developer 0 Permalink
    It is this code that kills it specifically, I think: https://github.com/simtr/The-Powder-Toy/blob/dab25160cc8f0a69488e422d158b3f230f75f326/src/simulation/Simulation.cpp#L4226-L4236

    Apparently neutrons die with a 10% chance when bouncing off anything.
  • zBuilder
    24th Sep 2015 Member 0 Permalink

    jacob1:

    It is this code that kills it specifically, I think: https://github.com/simtr/The-Powder-Toy/blob/dab25160cc8f0a69488e422d158b3f230f75f326/src/simulation/Simulation.cpp#L4226-L4236

    Apparently neutrons die with a 10% chance when bouncing off anything.

     ahh thanks.

    and seems I also have to take out "continue" as well- even without kill_part it will while that's there, now I can focus on the other stuff :)