A Gravity & Pressure revamp is needed

  • Tapmemer
    March 2017 Member 0 Permalink

    can we fix this by making a prediction system which traces a line from the start of the wave to where its heading to looking for 1 pixel who is able to block it? or make a area around that certain pixel to block the waves(would be more lag)

  • funky3000
    March 2017 Member 0 Permalink

    How much improvement would a 2x2 grid be as a compromise between performance and accuracy?

  • The-Fall
    March 2017 Member 0 Permalink

    Bowsernations mod features a smaller Air Grid and it runs fine on my machine.

  • motaywo
    March 2017 Member 0 Permalink

    I just had a thought. (Hopefully this one isn't as ridiculous as the last one I had!)

     

    The WALL element [STREAMLINE] is able to map beautiful and smooth lines of air velocity and pressure, even with the 4x4 grid. I'm assuming it simply takes an average of the surrounding tiles, but the fact that the result can be extremely responsive and smooth is really encouraging. In effect it would be a comination of Jacob1's and Tapmemer's suggestions.

  • jacob1
    March 2017 Developer 0 Permalink
    It technically doesn't do averaging, but it gives the impression that it does. I wrote CRMC to do some averaging, I didn't want it to break in an ugly 4x4 pattern like QRTZ, so it checks the pressure in 5 nearby locations when determining how strong it should be. There's no reason more stuff couldn't do that.
  • Lord_Bowserinator
    March 2017 Member 0 Permalink

    @The-Fall (View Post) That's a bug, I was playing around with the air sim and forgot to change it back to normal size :P

     

  • LeoTindall
    29th March Member 0 Permalink

    I've been looking at this, and to allow the user to change the cell size, the actual size (CELL) would need to be dynamic. It's used in a lot (a LOT) of places, so that's something of an issue.

     

    However, allowing the user to recompile with a different size, but still load saves with any CELL size, shouldn't be too difficult. Only changes to the loading algorithm would be needed; saves already encode their CELL size, so saves with a larger CELL would need their data granularized during loading and saves with a smaller, finer CELL size would need some kind of averaging applied during loading.

    Note that it also wouldn't be too hard to allow TPT to be started with a "cell size override" command line argument. The CELL #define could be replaced with a global variable, perhaps?

    I'd be happy to try and contribute the relevant code.

    Edited once by LeoTindall. Last: 29th March
  • jacob1
    29th March Developer 0 Permalink
    Yes, loading saves with alternate CELL sizes is technically possible. I've done stuff like that before, I once made a change where it could load saves that had a larger XRES/YRES.

    You can already compile TPT with alternate CELL sizes today, but that doesn't make it officially supported. I'm not going to compile two versions of TPT every new release with different sizes. One size has to be standard.

    I would rather not make CELL a global variable, because that could slow down the game slightly, depending on how often CELL is used. It might not have too much effect.


    I still like the averaging idea better ... instead of trying to force a 1x1 grid. You can see my earlier comments for issues a 1x1 grid would cause (slow air, laggy ngrav in android port).
  • Ben_Ger
    30th March Member 0 Permalink

    @jacob1 (View Post)

     I would have a suggestion, but it would be very much a giant piece of work for you and other developers:
    Create a kind of "High Power" Version of TPT, for test purposes.

    The rewrite would use the 1x1 grid, and only that option so toggling does not become and issue, hand that version out and open a thread (maybe even a new section?) to get feedback from people (With their machine configurations of course) so we can see just how demanding this would be for PCs.

    I personally would assume that around 6 fps would be the best that version can do, but thats me being pessimistic.

  • LBPHacker
    30th March Member 0 Permalink

    It's actually not too much work, IIRC it's literally one preprocessor macro that has to be changed.

     

    That's a compile-time change of course, it wouldn't be possible to just "change" in the settings menu. And it wouldn't be vanilla anymore, i.e. you couldn't even open online saves on the official server unless they were uploaded from your version. And the list of reasons why this is not done too often goes on endlessly and these reasons are scattered far and wide on the forum. Too lazy to round them all up.

    Edited once by LBPHacker. Last: 30th March