The most complicated aspect of TPT Code?

  • The-Fall
    24th Feb 2013 Member 0 Permalink

    What is the most complicated, math intensive, computation ridden, difficult aspect or part of the TPT Code? I would guess that it might be the Newtonian gravity calculations, or the pressure / Air Simulation calculations.
    the most convoluted class file seems to be Simulation.cpp, but I could be wrong.

     

    Another small question, Is the reason the code was never stream-lined & made efficient from the begining because the code was initially so complex that such a task would have been considered ridiculous? 

     

  • therocketeer
    24th Feb 2013 Member 0 Permalink
    @The-Fall (View Post)
    Photons are pretty complex. They have to regard Newtonian gravity and also refraction/reflection calculations too. But I would agree air simulation is probably the most math intensive.
  • jenn4
    24th Feb 2013 Member 3 Permalink
    According to the time mniip ported air simulation for android on his phone, I would say air simulation. Skylark did stuff which original developers of C never thought were possible with their language, on TPT. Or pretty much like that.
  • MiningMarsh
    25th Feb 2013 Member 0 Permalink

    @jenn4 (View Post)

     

    Yeah, I am not sure I buy that. One, C is turing complete. Two, they were fully aware of the crazy stuff structs and unions make possible. OOP and Lambda based C is entirely possible, and they knew it. They just didn't make it easy.

     

    I did some profiling a while back, and determined that most time is spent in Simulation.cpp. The simulation update function that loops through and updates each particle (I forget the name of the function). Of course, this is kind of a moot point since short of multi threading, that function can't really be improved, and it's speed depends entirely on the speed of the update functions.

     

     

  • jenn4
    25th Feb 2013 Member 0 Permalink
    There probably are much more complicated parts, I just now anything only about air simulation.
  • bimmo_devices
    25th Feb 2013 Member 0 Permalink

    How difficult is it, in c++, to register a program window for windows? I'll tell you - DIFFICULT, unless one copies a template. I would think that images and other graphics would be hard to manage too.

  • MiningMarsh
    25th Feb 2013 Member 0 Permalink

    @bimmo_devices (View Post)

     I don't think they actually have to worry about that at all, considering that they are using SDL. It handles all that auto-magically. I do imagine the text rendering would be a PITA, since SDL is not like GTK or QT, which are centered towards text intensive apps.

  • dom2mom
    27th Feb 2013 Member 0 Permalink

    jacob1 once told me that photons were immensly complex, so I will go with that.

  • jacob1
    27th Feb 2013 Developer 0 Permalink
    @MiningMarsh (View Post)
    actually the text rendering, and the button drawing and all the interface code like textboxes, is all done manually and not using any other library. There's some complicated font file that you need a fancy (actually, hard to use ...) editor to change. And we have classes for things like windows, buttons, labels, and textboxes. So we use own own code instead of a type of bread.
  • FeynmanLogomaker
    27th Feb 2013 Member 0 Permalink

    How do you use the font editor? It only ever draws white for me :(