The-Powder-Toy / The-Powder-Toy

Written in C++ and using SDL, The Powder Toy is a desktop version of the classic 'falling sand' physics sandbox, it simulates air pressure and velocity as well as heat.
http://powdertoy.co.uk
GNU General Public License v3.0
4.57k stars 767 forks source link

Give DTEC an invert mode #568

Open moonheart08 opened 6 years ago

moonheart08 commented 6 years ago

More like i don't know how this should be approached. How should this be done in a backwards compatible way? I don't actually know how TPT handles backwards compat internally yet.

ghost commented 6 years ago

To do it in a backwards compatible way, you'd just make use of some property that would never have been used before. Unfortunately it seems DTEC uses tmp, tmp2 and life.

I'm not sure if any of those can have negative values saved, but if not it could work with really big range values, larger than the screen width.

Although I'm not sure how useful this is, why not just use a PTCT-based NOT gate?

12Me21 commented 6 years ago

I'm pretty sure the life is only ever 0 or 1, so the inverted setting could be stored in one of the other bits. (But yeah, you could just use a not gate)

iczero commented 6 years ago

PTCT-based NOT gates take a long time to revert. Also, pretty sure one of the properties can be used. If not, there are always pavg and flags

jacob1 commented 6 years ago

While flags is user-settable now, it shouldn't be used for anything that a user is expected to set. Right now it's used for compatibility stuff, and assisting with water equalization.

pavg could be used for properties but I'd prefer to see what else there is first. I think .tmp should be moved into .ctype, like I did with some elements recently.

12Me21 commented 6 years ago

What about temperature? (it might make more sense to store the range in temperature, and the inverted flag in tmp2) There are faster NOT gates than the PTCT kind, by the way.

jacob1 commented 6 years ago

Sorry, there was a typo in my last comment, I was trying to say .tmp should be moved into .ctype, freeing it up for more properties

ghost commented 6 years ago

I think the more important issue is with PTCT and NTCT. Why do they take so long to cool down?

iczero commented 6 years ago

It's how they're supposed to work?

12Me21 commented 6 years ago

It cools down faster if you use more particles of PTCT/NTCT.

ghost commented 6 years ago

Is it really intentional behaviour that they take so many frames with one pixel though? I just can't think of any reason why it should be like that.

jacob1 commented 6 years ago

They cool down at a constant rate. They are some of the original elements, so it wasn't obvious at the time that speed may be important. There was no such thing as "subframe".

Changing it would break a lot of saves, because things would be moving too fast. Nobody is asking for instant PTCT/NTCT, people have moved onto other elements.

cracker1000 commented 6 years ago

True.Use switch for making gates it's way fsster than ptct/ntct.I am using it since i started making logic.One trick to cool it faster is to attach a pscn part with ptct which fastens cooling.Anyway i will still love an new element which can instantly cool.

cracker1000 commented 5 years ago

Well since no one seems to be working on this, i did add a invert mode.Need someone to test it out (mainly compatibility stuff).

logic3456 commented 2 years ago

i think that you guys should add some features from the metacurcuits mod into vanilla. (im saying this because it including logic gates)