What is it that dictates the element limit?

  • The-Fall
    8th Aug 2012 Member 1 Permalink

    What in the code and where does the program specify the element limit?

    If the elements are stored in the program in an array, why are there instead not an  individual array for all solids, powders, gases, and energy particles instead of one array for all of the elements?

    Why does the program update by cell? Why are particle movements calulated in the same cells as pressure?

    If Heat is calulated by indvidual particle why is pressure calculated per cell on its grid, and not on the particle itself as heat is? 

  • jacob1
    8th Aug 2012 Developer 1 Permalink
    @The-Fall (View Post)
    element types and indexes are stored in pmap (or photons). The type is in the first byte, the index is stored in the other bytes. One byte can only hold a number up to 256, so that is why there is a limit, it would take some re-writing to get rid of the limit. There is also a 221 limit, because walls start at 222, but they don't have that problem so could be easily moved if needed.

    Storing them in the same array makes more sense, if not, you would have to check all the arrays for everything, and also that's just how the game was written. Energy particles are stored in a separate array only so they can go on top of other elements without stacking.

    Pressure updates are really laggy on a 1x1 grid. It was made this way to prevent lag. Particle movements are calculated on a 1x1 grid though

    Particles don't have pressure, if they did, then air with empty space wouldn't have any pressure or velocity. It makes more sense that they are separate.

    You have a lot of hard questions, hopefully I answered these right. The game has been like this since was written, so that is probably the most important reason.
  • DoctorWhooves
    8th Aug 2012 Member 0 Permalink

    and I think the particle limit is locked at the int limit ...

  • grandmaster
    8th Aug 2012 Member 0 Permalink

    @jacob1 (View Post)

    Is the pressure in a 1x1 grid in c++ possible without making it really laggy???

  • jacob1
    8th Aug 2012 Developer 0 Permalink
    @grandmaster (View Post)
    It's the same exact code, so no. It's possible it might actually run fine on your computer, but it would make everyone's fps go down a lot, so it won't be changed.
  • grandmaster
    8th Aug 2012 Member 0 Permalink

    @jacob1 (View Post)

    Hehehe run fine on a pentium dual core, no chance, but normally c++ runs a bit faster I thought (also depends on how you code it)

  • boxmein
    8th Aug 2012 Former Staff 0 Permalink
    @DoctorWhooves (View Post)
    In sizeof(byte) to be precise, which is 255. It can be extended with grouping elements together if they're really similar.

    @grandmaster (View Post)
    Get the source, open "defines.h", change CELL to 1, there you go. Check out the speed yourself >:D
  • me4502
    9th Aug 2012 Member 0 Permalink
    @jacob1 (View Post)
    I have before managed to stabley increase the limit to 4096 with some help from cracker64... But it caused quite a bit of lag. Probably due to each element taking up 4x the memory allocation size.
  • billion57
    9th Aug 2012 Member 0 Permalink

    Hmm... Here's my guess...

    What if you changed the way bytes hold information from binary to decimal, making the element limit 100 million?

    Could you do that?