Creeper Overflow

Started by r00tdemon, August 19, 2011, 09:43:02 AM

Previous topic - Next topic

r00tdemon

This is half a suggestion half bug report. Using the map editor i found that by compacting alot of creeper together I can get the int used for the creeper to overflow and turn creeper into anti creeper and the other way around. Looking it up it happens at about 2147M creeper. Adding a check to prevent this, changing it to use the Number data type (which supports up to 4,503,599,627,370,496), or forcing a max density for creeper (2000M is a good number).

Still a great game that only appears to be getting better.

thepenguin

Quote from: r00tdemon on August 19, 2011, 09:43:02 AM
This is half a suggestion half bug report. Using the map editor i found that by compacting alot of creeper together I can get the int used for the creeper to overflow and turn creeper into anti creeper and the other way around. Looking it up it happens at about 2147M creeper. Adding a check to prevent this, changing it to use the Number data type (which supports up to 4,503,599,627,370,496), or forcing a max density for creeper (2000M is a good number).

Still a great game that only appears to be getting better.

Working as designed, several maps take advantage of this "wraparound" for a cool effect
We have become the creeper...

r00tdemon

Ahhh ok. Thanks for the information. I looked around and didn't see anything about that. Still would be nice to have a map option to prevent that.

thepenguin

#3
Quote from: r00tdemon on August 19, 2011, 10:19:25 AM
Ahhh ok. Thanks for the information. I looked around and didn't see anything about that. Still would be nice to have a map option to prevent that.

the main problem is that in "computer math", any result over 2^31-1 becomes -(2^31)-(result-(2^31-1)), (in 32 bit languages/Operating Systems)

(for those of you who don't speak geek, any number too big becomes negative, and Anti-creeper is represented by negative numbers)
We have become the creeper...

Mister_Andy

This is a serious problem for me on some maps, as I like to pack creeper into a small area in case I mess something up (run out of power) so that I can release it and protect my base. Problem is that once I get a good amount, IT ALL DISAPPEARS! (because when it hits that ~2bil point, one subcell turns neg, and the others nearby cancel it out immediately.)

Really takes a lot away from the game for me. I wish that we just had a plain ol' cap on it by default so that once you hit the limit, that tile simply doesn't increase any further.

While some folks (who?) are using this to their advantage in maps as if it were a feature, it's really a programming logic hole that should've been dealt with in beta :)

It's a bug, and I hope it gets fixed.
Come on, Virgil. You're too amazing to leave the game unpolished. You showed that with CW1 :D

Ranakastrasz

Quote from: Mister_Andy on August 23, 2011, 11:11:50 AM
This is a serious problem for me on some maps, as I like to pack creeper into a small area in case I mess something up (run out of power) so that I can release it and protect my base. Problem is that once I get a good amount, IT ALL DISAPPEARS! (because when it hits that ~2bil point, one subcell turns neg, and the others nearby cancel it out immediately.)

Really takes a lot away from the game for me. I wish that we just had a plain ol' cap on it by default so that once you hit the limit, that tile simply doesn't increase any further.

While some folks (who?) are using this to their advantage in maps as if it were a feature, it's really a programming logic hole that should've been dealt with in beta :)

It's a bug, and I hope it gets fixed.
Come on, Virgil. You're too amazing to leave the game unpolished. You showed that with CW1 :D

True, this could be considered a bug. However, some maps take advantage of this clever fact, and I think that adding a gameplay-constants section may be called for.

Kithros

I have never ever seen this happen unintentionally except while messing around in the editor with ridiculous densities that should not be used in game.. Also, there are very practical uses for it in the editor like being able to detect when creeper/anti-creeper is at a certain space and how much if you made the fields meticulously enough.

UpperKEES

Quote from: Mister_Andy on August 23, 2011, 11:11:50 AM
This is a serious problem for me on some maps, as I like to pack creeper into a small area in case I mess something up (run out of power) so that I can release it and protect my base. Problem is that once I get a good amount, IT ALL DISAPPEARS!

Saving 2 billion Creeper just to protect your base in case.... ? How many makers did you use, how much ore was available and how long did you have to wait?

Like Kithros, I can't imagine this happening on a normal map. What maps does it create a problem for you?

Of course it isn't a bug when it's intended behaviour.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

thepenguin

#8
I ran the calculations and got 71853 ore units to overflow in a single cell

and 17963 maker seconds

or:

let M be the number of makers, M ≠ 0
let T be the time it takes to complete

17963/M=T

5 hours for one maker :P
We have become the creeper...

Michionlion

you forgot evaporation ;)
"Remember kids, the only difference between science and messing around is writing it down."
                                                                                                                         - Adam Savage

My website
My CW1, and CW2 maps!

Ranakastrasz

Quote from: Michionlion on August 23, 2011, 05:59:00 PM
you forgot evaporation ;)
Not really, If you were going to attempt to make an overflow, you would probably surround it with shields, which would kinda prevent any possibility of evaperation, unless you have less than 90 anticreeper (which if you are going for 2.1billion, well.)

thepenguin

Quote from: Michionlion on August 23, 2011, 05:59:00 PM
you forgot evaporation ;)

in this scenario, no evaporation would occur, as the creeper levels are > 10
We have become the creeper...

Katra

Quote from: UpperKEES on August 23, 2011, 04:01:17 PM
Quote from: Mister_Andy on August 23, 2011, 11:11:50 AM
This is a serious problem for me on some maps, as I like to pack creeper into a small area in case I mess something up (run out of power) so that I can release it and protect my base. Problem is that once I get a good amount, IT ALL DISAPPEARS!

Saving 2 billion Creeper just to protect your base in case.... ? How many makers did you use, how much ore was available and how long did you have to wait?

Someone has been shooting off conversion bombs.  ;)
Power. Power! I must have more POWER!

J

LOL with this I created an ANTI-CREEPER FACORY with EMITTERS ;D :P :D

thepenguin

We have become the creeper...