Physical constant sliders

Started by mothwentbad, January 02, 2010, 01:24:31 PM

Previous topic - Next topic

mothwentbad

I don't know the model that well, but maybe there is a constant or two in the formula that determine the propreties of the creep? If so, there could be sliders for that. If I had to guess, I'd guess that there's a constant needed to determine how quickly the creep spreads out to available lower ground, and a constant determining how quickly the creep evaporates. Sure this has been tinkered with with in development, and I'm guessing that "runny" creep would be harder to push back - but maybe runny creep with extra evaporation and a stronger emitter could be balanced for some maps. Though perhaps getting a mortar within range of a lake would pretty much devastate the entire stock of creep in this case? It's hard to know, having only seen the finished product.

knucracker

You would not believe the days and days that went into tweaking the creeper constants during development....
It took forever to balance them, the algorithm, and the CPU load.

FYI (and because I feel like talking about it :) )

So there is an expansion constant and an evaporation threshold.  The expansion constant is already set to the mathematical 'maximum' so that I could turn down the simulation speed and save on CPU resources.

The creeper spreads like heat would spread through a metal plate.  The simulation is just a discrete simulation that evaluates cells in a given order and sets cell contents based on neighbors (kinds like the Game of Life).  The cells are scanned at a regular interval (the simulation speed).  This is as low as I could make it since comparing 70x49 cells against each other repeatedly is CPU intensive.  To make the simulation speed low I made the mathematical constants for creeper expansion as large as possible without breaking the simulation.

The evaporation  is just the minimum below which the Creeper gets set to zero.  If there was no minimum, and I drew the creeper even when it was incredibly thin, you'd see this wave of creeper almost instantly spread across the map.  It would be super duper thin but it would spread at the rate of the simulation speed.


Karsten75

Quote from: virgilw on January 02, 2010, 02:08:08 PM
You would not believe the days and days that went into tweaking the creeper constants during development....
It took forever to balance them, the algorithm, and the CPU load.

FYI (and because I feel like talking about it :) )

So there is an expansion constant and an evaporation threshold.  The expansion constant is already set to the mathematical 'maximum' so that I could turn down the simulation speed and save on CPU resources.

The creeper spreads like heat would spread through a metal plate.  The simulation is just a discrete simulation that evaluates cells in a given order and sets cell contents based on neighbors (kinds like the Game of Life).  The cells are scanned at a regular interval (the simulation speed).  This is as low as I could make it since comparing 70x49 cells against each other repeatedly is CPU intensive.  To make the simulation speed low I made the mathematical constants for creeper expansion as large as possible without breaking the simulation.

The evaporation  is just the minimum below which the Creeper gets set to zero.  If there was no minimum, and I drew the creeper even when it was incredibly thin, you'd see this wave of creeper almost instantly spread across the map.  It would be super duper thin but it would spread at the rate of the simulation speed.

Since you are talking about this. ;)

I know that perhaps your AIR platform is not appropriate for this, but in other situations, would that heat speading simulation be possible to do on the GPU in modern graphics cards?

knucracker

Oh man.... don't get me started :)
If this simulation were written in C# or C++ it would run ridiculously faster.  I could have maps 9 times larger and run the simulation 10 times faster.  To even get the simulation to work in AS3 I had to write 'unmaintainable' code since every function call in AS3 is performance death.  I had to copy and paste the same math operations over and over in an 'if' statement.

AS3 and AIR have their advantages for indie development (PC and Mac support for free, easy to do a web version, small executable and widespread uniform support)...  but it comes as the cost of computational capabilities.


mothwentbad

Hmmm, interesting. This explains why sometimes an isolated creep pool needed a little nudge before it would start going away on its own.

So something about the inefficiency of the language you had to use makes it not possible to tinker with the constants much? And is there any possibility that a sequel might have larger maps and use another language? And if you used a different language, would it be feasible to have sliders for this kind of thing?

I guess I don't know of any theoretical maximum constant that could go in the heat equation, but maybe you're using something more sophisticated - I don't know the "right" way to modify this for height differences, for example. The one I know says that the time derivative is equal to a constant times the sum of the spacial second derivatives, and the constant could be any positive number.

Aurzel

virgil you shoulda sticked that topic where you explained all this :P