New Element!

  • Braxiatel
    30th Jan 2012 Member 0 Permalink
    Back on topic: It can't be that hard to code... Can it?
  • Minishooz
    30th Jan 2012 Member 0 Permalink
    I remember thinking of something like this being useful but I forgot what its use was....
  • jacksonmj
    30th Jan 2012 Developer 0 Permalink
    jacob1 has powered INVS in his mod. However, having two particles in the same place doesn't always work very well. Powered INVS might not turn off correctly when there are particles passing through it. A demonstration (use jacob1's mod):


    There may be a way to fix this (other than adding a third particle map), but I haven't yet worked out what it is. There are some other places in TPT where better handling of multiple particles in the same place would be nice - CO2 in BUBW for example.
  • jacob1
    30th Jan 2012 Developer 0 Permalink
    @jacksonmj (View Post)
    I never thought about that happening, I will try and fix it. I have a few ideas about what to do, but i'm not sure how well they would work. I could try preventing pmap from being updated ontop of PINV, or I could try creating a second pmap with some kind of linked list like the OPS saving format does.
  • jacksonmj
    30th Jan 2012 Developer 0 Permalink
    @jacob1 (View Post)
    Completely replacing pmap and photons with a linked list is something I've been considering for a while (hence why I was so quick to do it for OPS), but I don't know what impact on speed it would have. And most of the loops for iterating over nearby particles would need changing, so I haven't bothered to try it yet.

    More than two particle maps starts to get a bit messy. Preventing PINV being overwritten in the pmap is probably the easiest option, but it does prevent collisions between particles passing through the PINV.

    A post from a couple of months ago:
    A powered element which lets particles pass through it wouldn't work very well. The game can only store one particle per pixel in the pmap (which is used to find nearby particles to switch on/off or interact or collide with). Switching on/off would only work properly if putting pixel thick e-wall in the pmap was prioritised, but it would then always act like INVS sometimes does (collisions are broken, allows an infinite number of particles to be in the same place).


    But try out your ideas, see which one works best!
  • jacob1
    30th Jan 2012 Developer 0 Permalink
    The first idea works perfectly, so i'll just do that. No collisions between particles isn't that noticeable, and maybe some kind of use for that could be found. The second idea would be useful, but seems really hard to do because almost all pmap checks would have to be changed. I don't want to spend the time right now to try and change it, but in the future it could be a little useful.