Can you exlain the basics of powder toy?

  • orendr7500
    11th Jul 2015 Member 0 Permalink

    Hey, i spent 2 months learning c++ from many books. And i know the basics.

    Although, i love the elements in powder toy and i want to learn how to make at least a WALL.

    but i first need to learn how to set resolution?..

    Basiclly. Help me please. Thanks

  • 4722202468
    11th Jul 2015 Member 0 Permalink

    https://github.com/simtr/The-Powder-Toy/blob/master/src/Config.h

     

    On line 104/105 you can change the window resolution, if that's what you mean

    Edited once by 4722202468. Last: 11th Jul 2015
  • orendr7500
    11th Jul 2015 Member 0 Permalink

    Hmm. Thanks

  • jacob1
    11th Jul 2015 Developer 0 Permalink
    @orendr7500 (View Post)
    I'd suggest keeping the resolution the same, I don't know what you mean though.

    If you want to add an element, we have a guide here: https://powdertoy.co.uk/Wiki/W/Coding-tutorial.html
    There is lots of other useful information in the wiki: https://powdertoy.co.uk/Wiki/W/Main_Page.html#Powder_Toy_Development_Help
  • orendr7500
    11th Jul 2015 Member 0 Permalink

    I mean. I want to make a similar thing to powder toy.. A LITTLE thing.

  • ChargedCreeper
    12th Jul 2015 Member 0 Permalink

    orendr7500:

    I mean. I want to make a similar thing to powder toy.. A LITTLE thing.

     

    So, you want to know the technical detail of how TPT tracks the particles?

  • orendr7500
    12th Jul 2015 Member 0 Permalink

    No. Or i do, i dont know.

    I dont know what is TPT..

    I want to just have fun with particles and make my own kinda powder toy..

  • boxmein
    13th Jul 2015 Former Staff 3 Permalink
    @orendr7500 (View Post)
    Well, that's going to be a tedious process. @nucular, @ristovski and me started on a super-ultra-early-alpha-totally-not-even-working-yet falling sand game and there's a ton to work out. Let's start off:

    1. Graphics

    In C/++ making graphics is hard. Lots of groundwork, buffer shuffling, preparation calls and no actual error throwing, which means you gotta do a lot of error handling yourself. (Remind me why again try-catch isn't standard C++). The Powder Toy uses SDL 1.2, but I'd suggest for a start go to this SDL 2 tutorial and try making a very basic animation. This'll show you the complexity of making graphical shinies in C/++.

    2. Simulation

    TPT's particle simulation is advanced. Pressure and velocity simulation, liquids with interesting viscosity-like behavior when pouring with a brush, densities, heat transfer, latent heat, ambient heat simulation (including inter-linking with air simulation), equalizing liquid behaviour, and a whole bunch of other things.

    https://github.com/boxmein/PixPlay Here's an example of a Processing sand game I made forever and more ago, its particle simulation is basic as hell - no air or water simulation, basic powders, no density simulation, no gravity or heat.

    3. Organization

    After all this your project either looks like a bunch of spaghetti or you're God themselves. Organization is key from start to end to make sure your code is less spaghetti than possible.
  • Mdkar
    29th Aug 2015 Member 0 Permalink

    Side note...

    How does TPT track particles?

    Does it use some kind of matrix or array?

    vectors?