(Likely Dev Question) Maximum Gold Capacity?

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Q:

This is mostly a curiosity question and likely will need a Dev to answer.

After doing some digging on wiki and learning about Base64 code I created a spreadsheet to figure out what the maximum gold reference in the game was since it was the easiest way to quickly check if I understood Base64 and how the game read these codes.

From my work I found this result…

Max Gold Binary Value:
000000 011111 111111 111111 111111 111111 111100 111111

Max Gold Base 64 Value:
[&Af////8=]

Max Gold:
429,496g 72s 95c

An interesting thing was that using [&Af////8=], [&Af////9=], and [&Af/////=] all yielded 429,496g 72s 95c – which is why I concluded that this is the maximum value that can be achieved.

Am I correct? Additionally – What happens if someone reaches this capacity and goes beyond it?

I’m very curious to know

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Mikal Dynath.6195

Mikal Dynath.6195

Well … if you’re right, my guildie who claims to have 4 mill gold is a liar.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Behellagh.1468

Behellagh.1468

Signed 32 bit number would be 214,748g 36s 47c. Unsigned 32 bit number is 429,496g 72s 95c.

Now if they use a double precision floating point number, then the gold value could be at 11 digits long which is shy of 100 billion in gold.

We are heroes. This is what we do!

RIP City of Heroes

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Hannelore.8153

Hannelore.8153

Signed 32 bit number would be 214,748g 36s 47c. Unsigned 32 bit number is 429,496g 72s 95c.

Now if they use a double precision floating point number, then the gold value could be at 11 digits long which is shy of 100 billion in gold.

Fixed point is always used for calculations when currency is involved (even in games). Using floating point would introduced rounding errors.

It’s to do with accuracy regarding base 10 decimals:
http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency

The game likely uses 32.32 fixed point internally to calculate fractional values such as trading post fees or gem exchange and then round them to integers, so the maximum range would be similar to a 32-bit integer when rounded.

Daisuki [SUKI] LGBT-Friendly Guild Leader | NA – Jade Quarry
I’m usually really sweet… but this an internet forum and you know how it has to be.
/i’m a lesbiab… lesbiam… less bien… GIRLS/

(edited by Hannelore.8153)

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Behellagh.1468

Behellagh.1468

IEEE-754 guarantees 15 digits converted into a double precision value and back will always be the same. So 2 digits for copper, 2 digits for silver, 11 digits for gold. Adding and subtracting amounts won’t cause rounding errors.

We are heroes. This is what we do!

RIP City of Heroes

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Interesting comments so far, but i’m a bit confused as to some of the statements based on how the game reads these codes.

For Example:

Taking the 6 bit Base64 representation and looking at it in 8 bit Binary you see…

000000 011111 111111 111111 111111 111111 111100 111111
becomes
00000001 11111111 11111111 11111111 11111111 00111111

The first octet (left to right) is the leading bit for coins – 00000001 (0×01)
The second octet goes from 0c – 2s 55c

After the second octet is filled it’ll reset back to 0’s and move to a new octet to the right which starts at 2s 56c – 00000001 00000000 00000001

This third octet has a range of 2s 56c – 6g 55s 35c
The fourth octet ranging from 6g 55s 36c – 1,677g 72s 15c
and lastly the 5th octet range is 1,677g 72s 16c – 429,496g 72s 95c

But that is where the confusion lies…

Looking at the last two sets of 6 bits for Base64 we have

111100 111111

I have two bits unused in the first set of 6 bits that – when used – don’t change the value of the code.

Ex: [&Af////8=], [&Af////9=], and [&Af/////=] all yielded 429,496g 72s 95c

In a binary representation this makes sense as the last 2 octets look like…

11111111 00111111

…where the 2nd to last octet is full. But, then why doesn’t the value change when you have essentially 11111111 11111111?

In addition – i’m looking at what happens if someone reaches this point and attempts to go beyond it? I think of an old SNES game I played (Lufia II) where it had a digit overflow issue for the boss (Egg Dragon) whose hp was maxed out and so healing it for 20hp left it with only 19hp left since it reset the counter to 0 by overflowing with that first 1hp.

So would this happen and the person essentially lose all their gold or is there a safety measure in place to prevent this?

And am I correct in assuming this would be “Max Gold” for anyone?

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Wanze.8410

Wanze.8410

Im not much into binary stuff but at this point I would assume that far more than those 429k gold have been deposited into the gem exchange by players.

If the gem exchange can hold more than that, why couldnt a single player account?

Tin Foil [HATS]-Hardcore BLTC-PvP Guild
Bloin – Running around, tagging Keeps, getting whack on Scoobie Snacks.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Im not much into binary stuff but at this point I would assume that far more than those 429k gold have been deposited into the gem exchange by players.

If the gem exchange can hold more than that, why couldnt a single player account?

I don’t think that is the same thing as to what I’m asking here.

Yes, the TP has more than 429k gold pass through it daily (probably), but that money isn’t “stored” anywhere when you buy gems. In other transactions the money is transferred to players, but 15% of it just “disappears” since the game doesn’t “store” that gold anywhere.

And tbh – I don’t think anyone has dropped 429k gold in a gold → gem conversion on the TP yet or used enough gems to get 429k gold in 1-shot.

But, I see where you’re coming from – though it’s still a bit off topic (I think? O.o)

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Wanze.8410

Wanze.8410

Im not much into binary stuff but at this point I would assume that far more than those 429k gold have been deposited into the gem exchange by players.

If the gem exchange can hold more than that, why couldnt a single player account?

I don’t think that is the same thing as to what I’m asking here.

Yes, the TP has more than 429k gold pass through it daily (probably), but that money isn’t “stored” anywhere when you buy gems. In other transactions the money is transferred to players, but 15% of it just “disappears” since the game doesn’t “store” that gold anywhere.

And tbh – I don’t think anyone has dropped 429k gold in a gold -> gem conversion on the TP yet or used enough gems to get 429k gold in 1-shot.

But, I see where you’re coming from – though it’s still a bit off topic (I think? O.o)

I think you got me wrong, i wasnt talking about the trading post, i was talking about the gem exchange.

Tin Foil [HATS]-Hardcore BLTC-PvP Guild
Bloin – Running around, tagging Keeps, getting whack on Scoobie Snacks.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Wanze.8410

Wanze.8410

You might want to post your question in this sticky, so JS, the game economist might have a look at it.

Not sure how often he checks the rest of the general forums.

https://forum-en.gw2archive.eu/forum/game/gw2/I-have-a-question-about-the-economy/page/20#post5043751

Tin Foil [HATS]-Hardcore BLTC-PvP Guild
Bloin – Running around, tagging Keeps, getting whack on Scoobie Snacks.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Behellagh.1468

Behellagh.1468

Interesting comments so far, but i’m a bit confused as to some of the statements based on how the game reads these codes.

For Example:

Taking the 6 bit Base64 representation and looking at it in 8 bit Binary you see…

000000 011111 111111 111111 111111 111111 111100 111111
becomes
00000001 11111111 11111111 11111111 11111111 00111111

The first octet (left to right) is the leading bit for coins – 00000001 (0×01)
The second octet goes from 0c – 2s 55c

After the second octet is filled it’ll reset back to 0’s and move to a new octet to the right which starts at 2s 56c – 00000001 00000000 00000001

This third octet has a range of 2s 56c – 6g 55s 35c
The fourth octet ranging from 6g 55s 36c – 1,677g 72s 15c
and lastly the 5th octet range is 1,677g 72s 16c – 429,496g 72s 95c

But that is where the confusion lies…

Looking at the last two sets of 6 bits for Base64 we have

111100 111111

I have two bits unused in the first set of 6 bits that – when used – don’t change the value of the code.

Ex: [&Af////8=], [&Af////9=], and [&Af/////=] all yielded 429,496g 72s 95c

In a binary representation this makes sense as the last 2 octets look like…

11111111 00111111

…where the 2nd to last octet is full. But, then why doesn’t the value change when you have essentially 11111111 11111111?

In addition – i’m looking at what happens if someone reaches this point and attempts to go beyond it? I think of an old SNES game I played (Lufia II) where it had a digit overflow issue for the boss (Egg Dragon) whose hp was maxed out and so healing it for 20hp left it with only 19hp left since it reset the counter to 0 by overflowing with that first 1hp.

So would this happen and the person essentially lose all their gold or is there a safety measure in place to prevent this?

And am I correct in assuming this would be “Max Gold” for anyone?

First, nobody uses base 64 for in code for numbers, no idea why you would think that. Outside chance they might use BCD which uses 4 bits just like nybbles so a 32 bit value is 8 decimal digits and a 64 bit value is 16 decimal digits but that’s highly doubtful.

We are heroes. This is what we do!

RIP City of Heroes

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Ayrilana.1396

Ayrilana.1396

My Wallet shows 200,000 gold, but I had more than that stored on different characters. What happened to my money?

Although the Wallet displays just 200,000 gold, your money is not gone! Gold above 200,000 is stored on your account and will fill your wallet as you spend gold until your gold balance drops to 200,000 across your entire account.

https://help.guildwars2.com/entries/27658798-In-Game-Currency-Wallet-FAQ

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Behellagh.1468

Behellagh.1468

My Wallet shows 200,000 gold, but I had more than that stored on different characters. What happened to my money?

Although the Wallet displays just 200,000 gold, your money is not gone! Gold above 200,000 is stored on your account and will fill your wallet as you spend gold until your gold balance drops to 200,000 across your entire account.

https://help.guildwars2.com/entries/27658798-In-Game-Currency-Wallet-FAQ

Well it sounds like the wallet gold value is using a signed 32 bit number.

We are heroes. This is what we do!

RIP City of Heroes

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Weylin.6478

Weylin.6478

Honestly, they could just use a separate value for gold, or even introduce a platinum (blue?) coin for every 100 gold.

would that cover the game for the rest of its life?

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Lil Puppy.5216

Lil Puppy.5216

Why would you think they store your wallet currency in any of those formats? There are many others that are more likely, store easier, convert faster, and have higher values.
Base64 seems to have a very low maximum value, signed and unsigned 32 are pretty low as well. There are many players that exceed the base64 value already and bots will easily exceed int32 as well so those would immediately be exceeded and thrown out as storage possibilities, you need much higher values for economies than that.

If I were to plan out the economy of gw2 for the 10 year lifespan of an average good mmo with dedicated players, it would be very easy to assume that players would amass more than several million gold. At this point you really have to start wondering how much database space you’re going to dedicate to this one single number for every single player. You want the smallest possible storage value for the highest possible number.

A simple color code hex value used in web has 16.7 million numbers in it: #FFFFFF or 0xFFFFFF and is extremely low impact on a database as they can all store that very easily. Add in the alpha channel (FF) and you just multiplied the number by another 256 for a total of 4,294,967,295 (4.3 billion). It’s also already been indicated by Anet that they store your gold in a single number, not divided by copper, silver, gold values.

Programming in an optimal way you want to remove as many possible conversions in transaction systems as possible and hex is as natural as binary in programming languages. Either way, Anet hasn’t said which format they use to store your money in, afaik, but there are some that are more useful in long term high speed clearing house transaction systems than base64 and the 32int variants even though most TP transactions wont exceed a few thousand gold today, the numbers still have to be stored for accumulation in your accounts.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Behellagh.1468

Behellagh.1468

shakes head

Take your color code with an alpha channel and you get a 32 bit or 4 byte value.

Use the signed version gives you 31 bits or a range from -2147483648 to 2147483647. Assume that’s copper and you have a cap of 214,748 gold and change. Since the average person would scratch their head over such a weird number they capped it at 200,000 gold.

We are heroes. This is what we do!

RIP City of Heroes

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

First – anyone who is saying the 200,000 number hasn’t used my [&Af////8=] code in a chat log >.>

Second – anyone who is saying they don’t use base64 or this format for money please see
http://wiki.guildwars2.com/wiki/Chat_link_format

Lastly – anyone who wants to now back peddle because they didn’t read my OP’s statement “I created a spreadsheet to figure out what the maximum gold reference in the game was” may begin doing so now.

Note: I am assuming the reference to be the same as the cap (this may be wrong).

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Ayrilana.1396

Ayrilana.1396

First – anyone who is saying the 200,000 number hasn’t used my [&Af////8=] code in a chat log >.>

Second – anyone who is saying they don’t use base64 or this format for money please see
http://wiki.guildwars2.com/wiki/Chat_link_format

Lastly – anyone who wants to now back peddle because they didn’t read my OP’s statement “I created a spreadsheet to figure out what the maximum gold reference in the game was” may begin doing so now.

Note: I am assuming the reference to be the same as the cap (this may be wrong).

Rename the thread title to say reference instead of capacity and remove the question at the end about capacity.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Lil Puppy.5216

Lil Puppy.5216

Yeah… I shook my head too when I realized I forgot stuff in my old age… It’s been a while since I needed to know these numbers.
Anyway the display may be capped by a 32-bit int but behind the scenes it shouldn’t be 32-bit it should be stored in a 64-bit long (9 trillion gold). The 64-bit version is quite excessive but easily available and only really needed on the server side as the client is only 32-bit (hence the 200Kgold display limit).

Had to look stuff up in my old age…

Wiki says 32 bit stuff: The number 2,147,483,647 (or hexadecimal 7FFF,FFFF) is the maximum positive value for a 32-bit signed binary integer in computing. It is therefore the maximum value for variables declared as integers (e.g., as int) in many programming languages, and the maximum possible score, money, etc. for many video games.

Wiki says 64-bit stuff: The number 9,223,372,036,854,775,807, equivalent to the hexadecimal value 7FFF,FFFF,FFFF,FFFF, is the maximum value for a 64-bit signed integer in computing. It is therefore the maximum value for a variable declared as a long integer (long, long long int, or bigint) in many programming languages running on modern computers.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Rename the thread title to say reference instead of capacity.

References usually indicate something about capacity. The fact that every one is mentioning a cap of 200k gold is interesting considering the reference [&Af////8=] is more than double that cap.

In addition – I would personally be paranoid at being told that my gold caps at 200k, but not know if it was tested to hold values beyond that reliably (if I was a person with 200k gold >.>).

Noting that the reference is higher than the cap may indicate that once you reach the referencing point – you have reached the coding bit count cap – which could then possible relate back to old overflow issues that existed in games before this. You can’t see this overflow happen since the cap is lower than the reference…

Hence why this is (Likely [a] Dev Question) >.>

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Also – why do some of the Base64 codes show in chat and others not?

When I was doing this I would randomly get some of the codes to show in chat, but most commonly they would only appear in the dialog bubble above my character’s head.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Yamsandjams.3267

Yamsandjams.3267

Also – why do some of the Base64 codes show in chat and others not?

When I was doing this I would randomly get some of the codes to show in chat, but most commonly they would only appear in the dialog bubble above my character’s head.

That’s a question we may only ever be able to speculate on as we don’t know exactly how those codes are processed by the code. Since we’re not technically supposed to be able to see those ones in normal gameplay, it’s possible they may possess some sort of deficiency or case that’s not handled in the code since there was never any need for the developers to account for those. That is, the display of those codes would be outside the scope of the requirements.

But that conclusion again relies on assumptions on my part.

I doubt you’ll ever get a dev response on this one way or another since they probably wouldn’t want to release details about the inner workings of the game, however minor. That could possibly even constitute a breach of company policy in regards to the protection of their IP, but obviously I don’t know any of the details concerning that.

It may be worth considering that the chat code links don’t actually match the storage format for the gold. Since these chat codes are not even used anywhere in the game (it’s not normally possible to ping your gold in the chat), they may simply be a development artifact that has no real use or value. All you’re doing is generating an arbitrary code that produces an output, you have no way to show that this is the actual storage format the game uses for player gold. Information for chat links may be encoded in base64, but that does not mean their databases use that same format. While it’s plausible to assume that these chat code identifiers are used in database entries related to items (since they would be unique identifiers), I do not believe you can logically conclude that this same method is thus used for their currency storage variables as that would operate in a much different capacity than a simple identifier (i.e. you would not have a lookup table for discreet gold amounts like you do for items).

In all honesty, I would be surprised if they just discared any gold over some sort of theoretical limit. I mean, with the prices for items the way they are right now, having an extra 1000g on top of 200000+g wouldn’t make a difference in the slightest. Hell, I don’t even know what I would spend that much gold on.

(edited by Yamsandjams.3267)

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Well an interesting side note is the fact that the TP can’t even trade at 10,000g+ currently. According to a friend who had made a very high Agony Infusion who asked Anet how he could post it on the TP and not lose money – they responded with the statement that the TP can’t handle that kind of transaction yet.

So I don’t think i’d be concerned with TP overflow issues for single transactions, but I might be concerned with letting my gold pile up in the TP if it can’t store that value in the Funds section of the Delivery Box.

Though it’s unlikely anyone will ever reach this number – i’m sure an player nearing either the 200k gold or 429k gold point would like reassurance that his wallet isn’t going to reset to 0g 0s 0c if he gets too much money.

Therefore i’d feel it important to let their clients know the limitations of their game if it has any. More or less for peace of mind and to avoid possible future issues or claim tickets of people running into this problem.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Yamsandjams.3267

Yamsandjams.3267

Well, if they haven’t had to cross that bridge yet, I’m sure they’ll figure out some way to do so if it ever comes up. I imagine this would be a problem that affects a very small minority of people at best, so it wouldn’t cause an extreme burden on their support infrastructure if the issue did come to a head.

It’s like that guy that purchased 80 extra character slots, only to find out that they were capped at 64 characters. I’m not sure how that case was resolved, but it’s a very rare situation to begin with.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Ayrilana.1396

Ayrilana.1396

Anyone with that much gold likely wouldn’t have it be sitting in their wallet doing nothing.

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

It’s like that guy that purchased 80 extra character slots, only to find out that they were capped at 64 characters. I’m not sure how that case was resolved, but it’s a very rare situation to begin with.

That is actually a perfect example of the point I somewhat eluded to earlier.

Assume that Anet had stated openly that there was a maximum of 64 character slots you could have per account AND put in a simple checking mechanism in the TP to basically identify

IF(characterSlotCount + 1 == 65)
{
print(You already have the maximum number of character slots for this account!)
return -1;
}
Else
return characterSlotCount += 1;

(btw I have no idea what code language they used so hopefully this works to get my point across)

…Then the issue would have been entirely avoided!

It’s a similar example here (though slightly different).

As of right now there is no direct statement from Anet (that I can find) as to what the maximum gold capacity is OR what happens IF that capacity is exceeded. In addition I’d venture the guess that no precautions have actually been put in place to prevent this type of overflow such as

IF(playerGold + incomingGold > maxGold)
{
print(You have reached the maximum amount of gold for your Wallet!\n)
print(Please convert your gold into another form or spend some of it!)
return -1;
}
Else
return playerGold += incomingGold;

(again – no idea what they use for programming language – just trying to make a point)

…Then this would at least be obvious to the player!

By just putting a visible cap at 200k gold (not verified yet) the player just has to hope that there is no error in how the game handles the incoming gold beyond that point.

For example:
A player with 200k gold gets +5g and spends 10g – the game reliably updates to 199,995 gold. The player assumes the game can handle the money beyond that point accurately and then gains +10,000g. Not keeping track anymore the player just assumes that the game is doing its job, but in the background the game stopped keeping track of the gold after 201k gold. This is not going to be evident to the player right away and if they realize the error later – it is going to be very hard for them to put in a support ticket AND the support crew is going to have to fix the issue then.

But, if it was openly stated what max gold is and there are precautions set to avoid possible future issues – then those players can be at ease with how things work AND the support team will be able to identify liars claiming this happened to them faster since the precautions had been set in place to make their claim no longer possible.

It just seems that it would be a simple question to answer. Hell if I brought up something that could break the game for someone – 1) I didn’t know and 2) Why not fix it now before it happens? Chances are – someone who would reach this limit i’m proposing would be a valued customer (probably doing gem → gold conversions) and making sure their account doesn’t just suddenly break from an overflow issue doesn’t seem like a bad idea to me imo :/

(Likely Dev Question) Maximum Gold Capacity?

in Guild Wars 2 Discussion

Posted by: Dragon Ruler X.8512

Dragon Ruler X.8512

Btw – posted in the location that Wanze.8410 recommended, but is there perhaps a better location that is more fitting for this post? Just curious :o