Modify Size of Simulation

  • NiqueT
    26th Apr 2013 Member 0 Permalink

    I've been poking around this forum, as well as the Powder Toy code, trying to figure out if there is a trivial way to change (via code) the size of a PowderToy simulation. For those familiar with the code, in which file(s) are the parameters located which control the simulation size? Would this just be a matter of a simple change, or extensive revision to other parts of the code?

     

    Also, just to clarify, I'm referring to the actual physical size of the simulation, and not the resolution of the window.

     

    Thanks for the help!

  • mniip
    26th Apr 2013 Developer 0 Permalink
  • NiqueT
    26th Apr 2013 Member 0 Permalink

    Awesome! Thanks for getting back so soon!

  • jacksonmj
    26th Apr 2013 Developer 0 Permalink

    Note that width and height are stored in single bytes in the save format, so stamping and saving won't work properly if the width or height are made any bigger than 1020 (unless you also change the save format).

     

    There's also a possibility that if the simulation size is increased a lot, the game may crash due to too much recursion, probably in grav_mask_r (a function to detect areas enclosed by gravity wall), or in one of the flood fill functions in Simulation.cpp. So if you get crashes, try making the simulation size a bit smaller.