Prevent Creeper Conversion

Started by Ginger88895, May 24, 2014, 07:18:09 AM

Previous topic - Next topic

Ginger88895

It's all known that when creeper amount exceeds 2147483647, creeper would be turned into anticreeper. However, I want to make a map that would contains creeper amount far more than 2147483647, is there a way in CRPL that prevents this overflow? Like force the game to use 64-bit long integer?

ZackNAttack

Quote from: Ginger88895 on May 24, 2014, 07:18:09 AM
It's all known that when creeper amount exceeds 2147483647, creeper would be turned into anticreeper. However, I want to make a map that would contains creeper amount far more than 2147483647, is there a way in CRPL that prevents this overflow? Like force the game to use 64-bit long integer?
No, but it can be capped. Otherwise if it is more then 2^31 - 1 then 32-bit machine would crash. :'(
Zack on cw3

Ginger88895

How about using two 32-bit integers to represent a 64-bit integer, and override some basic creeper properties?

Relli

What sort of map are you making where Two Thousand terrain's worth of Creeper is too small? Maybe there's something that would work that doesn't involve such drastic measures. Care to share your idea?

kwinse

#4
Quote from: ZackNAttack on May 24, 2014, 07:58:03 AM
Otherwise if it is more then 2^31 - 1 then 32-bit machine would crash. :'(
What? 32 bit machines can process 64 bit numbers just fine. For example, javascript's basic number type is 64 bits.

Grayzzur

There is no way to override the game engine's design limits via CRPL. Virgil would have to make a code change that I'd bet he's not willing to make. You can easily overwhelm a map with a lot less creeper though, especially if you maintain a fast emit rate. What are you trying to accomplish?
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Asbestos

CRPL can't let you do that, Dave. Allowing more than the limit would likely crash the game.

Annonymus

#7
You COULD simulate higher creeper by looking for changes on every cell with more than 2147483647 creeper, adding/subtracting the difference in creeper to the core's creeper value and changing the creeper to be 2147483647 until the core's value is no more over 2147483647

example:

simulated creeper height: 3000000000
Real creeper height: 2147483647
Bertha shoots 200 layers off the cell
real creeper height: 2147483447
simulated creeper: 3000000000
Core detects that the cell is no more at 2147483647
core reacts appropriately
simulated creeper: 2999999800
real creeper: 21474834447
core sets real value back to 2147483647
simulated creeper: 2999999800
real creeper: 2147483647
...
...
simulated creeper: 2147483747
real creeper: 2147483647
bertha shoots: -200
real creeper: 2147483447
core reacts
real creeper: 2147483547
simulated creeper: -1, cell deleted from list of monitored cells.


If you also have emitters which emit on such heights you'll have to change the height creeper gets set to to something like 2000000000 in order to be able to detect growing values, too also, you'll have to monitor every single cell on your map, not only these with more than 2147483647 creeper, which will cause massive lag.

EDIT: The bertha would have to shoot off 200000000 creeper since we're not talking about terrain layers, but I think (hope) you understood anyways
EDIT2: in case it is not clear, during the ... lines the player continued to shoot at the creeper until the values matchthe ones showed in the next lines
If a topic started by me is in the wrong place feel free to move it at anytime.

Grayzzur

That still wouldn't work in all cases. You'd be unable to tell how much was lost due to weapons and how much was moved by the creeper creeping to adjacent cells. Plus, the natural creep tendencies would be different as the game engine wouldn't know the difference between adjacent cells that you're holding at 3000 and 4000, for instance.

It would probably work better to stick within the limits of the engine and use fast emit frequencies and change the flow rate to make it flow quicker. You can easily create so much creeper that a map is un-winnable, so efforts to circumvent the 2147 limit are ultimately not necessary.

It seems like this thread is trying to solve the wrong problem. What is the actual goal you have in mind?
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Crimson King

If you don't want the creeper to flip, why not just use the SetCreeperMax CRPL command and have the value be 2147483647?

ZackNAttack

Quote from: kwinse on May 24, 2014, 10:20:32 AM
Quote from: ZackNAttack on May 24, 2014, 07:58:03 AM
Otherwise if it is more then 2^31 - 1 then 32-bit machine would crash. :'(
What? 32 bit machines can process 64 bit numbers just fine. For example, javascript's basic number type is 64 bits.
That's because of it uses 2 numbers.
Zack on cw3

Ginger88895

Quote from: Annonymus on May 24, 2014, 11:45:03 AM
You COULD simulate higher creeper by looking for changes on every cell with more than 2147483647 creeper, adding/subtracting the difference in creeper to the core's creeper value and changing the creeper to be 2147483647 until the core's value is no more over 2147483647

example:

simulated creeper height: 3000000000
Real creeper height: 2147483647
Bertha shoots 200 layers off the cell
real creeper height: 2147483447
simulated creeper: 3000000000
Core detects that the cell is no more at 2147483647
core reacts appropriately
simulated creeper: 2999999800
real creeper: 21474834447
core sets real value back to 2147483647
simulated creeper: 2999999800
real creeper: 2147483647
...
...
simulated creeper: 2147483747
real creeper: 2147483647
bertha shoots: -200
real creeper: 2147483447
core reacts
real creeper: 2147483547
simulated creeper: -1, cell deleted from list of monitored cells.


If you also have emitters which emit on such heights you'll have to change the height creeper gets set to to something like 2000000000 in order to be able to detect growing values, too also, you'll have to monitor every single cell on your map, not only these with more than 2147483647 creeper, which will cause massive lag.

EDIT: The bertha would have to shoot off 200000000 creeper since we're not talking about terrain layers, but I think (hope) you understood anyways
EDIT2: in case it is not clear, during the ... lines the player continued to shoot at the creeper until the values matchthe ones showed in the next lines
I think this would work. I'll try it.
In my large map, all creepers are sucked into one terrain tile, and then release every 3 minutes. If the cap is set to 2147483647, then the creepers would be almost all lost when concentrated.

Crimson King

By sucking all of the creeper into a single terrain tile, there is the risk of loss no matter what method you use.

Since the max creeper in any one cell can be 2147483674 without flipping and sucking the creeper into that cell may make the creeper in that cell exceed the limit any creeper over the limit is going to be lost when the limit is exceeded.

You may want to consider lowering the amount of creeper that is being sucked up or reducing the amount of time that the creeper is sucked up so that creeper isn't lost if it such a big deal.