About reordering (subframe)

  • Qweryntino
    23rd May 2019 Member 0 Permalink

    What’s the best way to safely rely on DRAYed particles to be used in subframe electronics? I had an idea to use some kind of a buffer that’s created at the start of a frame before any particle creation/deletion occurs, then we just reuse its ids to safely create machines, but that kind of a clunky.

  • LBPHacker
    23rd May 2019 Developer 0 Permalink

    It's to delete particles with known IDs first with CRAY/DRAY/whatever and then reuse their IDs by spawning new ones. ID assignment is a very deterministic process; essentially all IDs that are freed go onto a stack and when an ID is allocated, one is popped from that stack. If the stack is empty, a new (mostly random or just difficult to predict) ID is assigned. The stack is also emptied between frames (due to some sort of optimisation that I can't recall right now) so you have to do all the ID freeing, reusing and resetting in a single frame. 

     

    No subframe tutorial that I'm aware of goes into this, you may want to join #powder-subframe and talk it out there.

     

    EDIT: Re-reading the OP I got the impression that you might already be aware of this. In that case, yes, the best solution is the clunky one :P

    Edited once by LBPHacker. Last: 23rd May 2019