Object-oriented Powder/Collision check?

  • boxmein
    1st Jul 2011 Former Staff 0 Permalink
    Hello and welcome to this thread. This time I'll discuss about re-making TPT with an object-oriented language. Also I'll discuss performance-boosting via collision checks.

    Part 1. Object-oriented language for Powder Toy.


    What if we coded Powder Toy into an object-oriented language like Java or C#? That way we could make Powder Toy's code a bit simpler to understand and we could use object-oriented power to increase performance. For example, see this paste: http://pastie.org/2143753
    Now, if we'd use a similar class in the Powder Toy, we'd create new elements like this:
    Element elementName = new Element();
    elementName.properties.PROPERTY = DESIREDVALUE;
    and soforth. Making new elements would be easy.
    EDIT: Some new additions that will be with this: all element values could basically be editable. Elements become much more dynamic. More than ever before. Ever wondered how green diamond powder would feel? With such declaration this would be possible.(even without deco)
    The rest is up to you guys. Do you like it? (my knowledge of C# is not rather great, but this might give you a glimpse into the future)

    Part 2. Collision-testing before pmapping.


    You'd notice that Powder's speed is going down because every frame it checks around for any particles? Will this be possible: checking for collisions and during collision, pmapping? (collision checking needs pmapping aswell?)

    Edited by boxmein, 2011-06-30 12:04:12
  • code1949
    1st Jul 2011 Member 0 Permalink
    @boxmein (View Post)
    What new possibilities would it create? I use gamemaker which is object orientated and I don't notice much of a performance difference.
  • boxmein
    1st Jul 2011 Former Staff 0 Permalink
    I've been dragged down of my good mood.
    Doxin basically disapproves because the .NET languages are not made into machine code.
    This object-orientation should/would/could speed things up.
  • JoJoBond
    1st Jul 2011 Member 0 Permalink
    I ported big parts of TPT to c++ already. Still needs a hell lot of work though.
  • jalfor
    1st Jul 2011 Member 0 Permalink
    @boxmein (View Post)
    I thought object oriented languages were slower actually, though they would make the code less painful to understand. Though you can write object oriented code in C/++.

    With the second part, if it can be implemented then it would be a great idea I think.
  • DucTape
    1st Jul 2011 Member 0 Permalink
    @JoJoBond (View Post)
    I wish you luck with that. I mean this in a genuine non sarcastic way.
  • boxmein
    1st Jul 2011 Former Staff 0 Permalink
    Good luck, JoJoBond. Though, what will c++ make better than C?
  • jalfor
    1st Jul 2011 Member 0 Permalink

    boxmein:

    Good luck, JoJoBond. Though, what will c++ make better than C?


    Yes, I'm curious about that as well.
  • 321boom
    1st Jul 2011 Member 0 Permalink
    :|
    but c++ is object orientated too...
    wait if it was written in Java wouldn't it be hard to run on desktop?
  • boxmein
    1st Jul 2011 Former Staff 0 Permalink
    Java makes it not an executable. Java's half interpreted, half compiled. This makes it faster than Python-like scripts, but slower than pure executables. Java isn't hard to run at all. I believe if we write a good engine to it, it'll be very fast. And with the fluidness of variables, we could make thousands of elements out of a few.