Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 64 bit numbers data type? Higher values than Int and Floats?

Author
Message
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 18th Aug 2016 13:32
Is there any equivilent to long long or double ( i think double has more values than integers)

Basically i am making a clicker incremental game and at a certain point it just resets to a negative number. I want to have a 64 bit datatype which can go higher than an integer or float.

Thanks!
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 18th Aug 2016 14:14
Your number goes higher than 2147483647? That's a lot of clicks! Could you not use 2 integers? The first int for millions, the second for the remainder...
Using AppGameKit V2 Tier 1
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 18th Aug 2016 14:25 Edited at: 18th Aug 2016 14:25
Thanks!. The clicker games can go even higher with all the upgrades and people idling.

How would i go about using 2 integers? Please can you elaborate.

Thanks!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th Aug 2016 14:27 Edited at: 18th Aug 2016 14:28
I ran into the same problem with my tap-tap game "Phone Tap"

I had to create my own library of arbitrary position arithmetic functions. They can add, subtract, multiply and divide any length numbers with the values stored and processed as strings.

The current world high-score on there is 15067445650, so smashed the 2147483647 int limit.

EDIT - All done in Tier 1.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 18th Aug 2016 15:20 Edited at: 18th Aug 2016 15:21
Quote: "How would i go about using 2 integers?"


Something like this maybe (psuedo code)?

Using AppGameKit V2 Tier 1
Thugnificent
8
Years of Service
User Offline
Joined: 16th Aug 2016
Location:
Posted: 18th Aug 2016 16:10
@Funnell7 - yea that makes sense. That's pretty much what i'll do.

Thank you!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th Aug 2016 16:48
Wish I'd done that! Haha. Maybe a re-write is in order. Still, it was good experience wrapping my head around any-length calculations! Haha.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 18th Aug 2016 18:26
This is probably a better implementation, as it accounts for increments which do not hit 1000000 exactly... (unless of course you have increments of more than 1000000)

Using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-09-29 17:28:46
Your offset time is: 2024-09-29 17:28:46