Save Rendering Fault

  • cyberdragon
    15th Jun 2013 Member 0 Permalink

    Here's a nasty one. I don't know what's causing it but it's ruining this save. The lamps stayed glowing on unpause even after reloading. But I reopened it and unpaused and they died. Do I have to save unpaused or is there something wrong?

     

     

  • Pilihp64
    15th Jun 2013 Developer 0 Permalink

    The renderer has nothing to do with this.  The photons die shortly after loading, I'm not exactly sure why, probably something with particle order changes when loaded.

  • cyberdragon
    15th Jun 2013 Member 0 Permalink

    The system itself is faulty. I opened a save that did not use to cause much lag and noticed it lagging badly. Not even starting the save, just unpausing, it went down to about 40 fps. So, I decided to check something. I opened the same save in my mod and it ran about 10 frames faster. Something is wrong.

     

    Note: I'll try erasing each element and wall indevidualy till it stops lagging to see if it's a certain element(s) causing the problem.

     

    EDIT: My God! I left it sitting unpaused (still not doing much) and was dropping below 30 fps. This is BAD!

     

    EDIT: The simulator has major errors, people are going to start noticing. I erased a tiny bit of water and it got WORSE! And yes, I'm sure this is in the official version.

  • Pilihp64
    15th Jun 2013 Developer 0 Permalink

    The random massive slowdown has been reported ages ago, I'm guessing it is still there from what that sounds like.  Why do you need to leave it running for so long?  There is no major error, and people have noticed the huge lag spikes before, which are very rare so it is hard to know what is wrong.

  • cyberdragon
    15th Jun 2013 Member 0 Permalink

    No, this is frequent, and major slowdown with nothing much going on in the save. And my mod runs faster when I've added to the engine. Something is slowing it down, either a stray variable (floating) or an out of control function running when it's not supposed to. I think I found one problem...glass is causing some of the lag.

     

    Note: I immediately found it before I finished this post, this: parts[i].pavg[1] = sim->pv[y/CELL][x/CELL];

    is double defined here:

    int Element_GLAS::update(UPDATE_FUNC_ARGS)
    {
    parts[i].pavg[0] = parts[i].pavg[1];
    parts[i].pavg[1] = sim->pv[y/CELL][x/CELL];

    (blah...blah...blah)

    }

    And here too:

    if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUNG)
    {
    parts[i].pavg[0] = 0.0f;
    parts[i].pavg[1] = pv[y/CELL][x/CELL];
    }

     

    BUT WAIT...THERE'S MORE!

    Notice...that parts[i].pavg[0] is also double defined this way

     

    parts[i].pavg[0] = 0.0f;

     

    and this way too:

     

    parts[i].pavg[0] = parts[i].pavg[1];

     

    EDIT: I FIXED IT! :D :P

    if (t == PT_QRTZ || t == PT_TUNG)
    {
    parts[i].pavg[0] = 0.0f;
    parts[i].pavg[1] = pv[y/CELL][x/CELL];
    }

     

  • Pilihp64
    15th Jun 2013 Developer 0 Permalink

    Err I don't think you get what that does.  That isn't causing any extra lag.

    Glass isn't the most lag friendly element, but that change does nothing to fix lag (unless you removed the update part completely, which breaks breaking glass), and introduces an old glitch.

     

    If you are getting constant slowness, something else is going on with your computer that isn't normal.

  • cyberdragon
    15th Jun 2013 Member 0 Permalink

    I can see exactly what it does, it's crap stuck on there for that "else" statement to prevent the simulator from stopping some elements from breaking. WEEELLL....

     

    Merry Christmas

     

    /*if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUNG)
    {
    parts[i].pavg[0] = 0.0f;
    parts[i].pavg[1] = pv[y/CELL][x/CELL];
    }
    else
    {
    parts[i].pavg[0] = 0.0f;
    parts[i].pavg[1] = 0.0f;
    }*/

     

    And a Happy New Year too...

     

    if(t != PT_GLAS || t != PT_QRTZ || t != PT_TUNG)
    {
    parts[i].pavg[0] = 0.0f;
    parts[i].pavg[1] = 0.0f;
    }

     

    Everthing works fine with less lag.

  • Pilihp64
    16th Jun 2013 Developer 0 Permalink

    @cyberdragon (View Post)

    Err no.

    The if checks for the pressure change breakable elements, then sets the current value to the current pressure it is on.  If it doesn't (and you removed it) the element will break instantly placing it initially in high pressure (pause, add air, place glass on it, hit f).

    The else is so that new elements do not transfer pavg values, which some elements use for properties.

     

    None of this would make the game slow, it ONLY runs at element creation, which is not much in a normal simulation.  Even something with lots of creating, one pressure grid access is not much.

  • cyberdragon
    16th Jun 2013 Member 0 Permalink

    Err YES

    You already defined that reset in the elements themselves.

    2) glass SHOULD break immediately in high pressure, it's glass AND IT DOES IN THE OFFICIAL VERSION ANYWAY, and I tested pausing and putting it in high pressure than turning air off, it stayed intact

    3)no, you are totally and absolutely wrong, it won't "keep it's pressure values", they will be reset by that definition in the element loop. 

    And the final nail in your particularly ugly coffin...when glass melts, it's no longer glass, it's Molten GLAS, which is actually LAVA(GLAS) SOOOO...any values it had are gone. :P:P:P:P:P:P:P:P:P:P:P:P:P :  P

     

    If this goes on any longer...I might spontaniously turn into Pheonix Wright.

     

    EDIT: TAKE THAT Edgeworth!

  • Pilihp64
    16th Jun 2013 Developer 1 Permalink

    @cyberdragon (View Post)

    2. Okay yea that glass example was bad, the pressure unbounded does change too much for glass, better instructions: Make a box of wall, fill with a bunch of air, maybe 100+ pressure, wait a sec for it to equalize, add glass.  It won't break.

     

    3. Yes particle properties must explicitly be set/reset somewhere, this is done on creation.

     

    Final: Exactly, I didn't even say Part3 would even happen in your code, if you remove the set/reset "else" in current version, it would transfer into lava with the same pavg values, and then back into glass again.  Of course current element transitions don't use the create function at all, so yea it might still transfer.