lift 2B ceiling and enable 1B+ deal
#1
Posted 04 July 2012 - 03:57 PM
It's annoying (and time consuming) to constantly trade zeny among alts to give room for extra zeny and quite often i couldn't buy some cheap vended items in bulk since the vendor couldn't receive any more money. And please enable 9-figures-and-up deal for the sake of handiness -- there are few things that cost more than 999.999m.
#2
Posted 04 July 2012 - 04:04 PM
#3
Posted 04 July 2012 - 04:08 PM
#4
Posted 05 July 2012 - 10:14 PM
#5
Posted 09 July 2012 - 01:15 PM
One way to fix this is add a second, third tier currencies. zeny being the lowest one, will exchange with 2nd tier by a ratio of 100:1 , so your billion become 10 000 000 of this new currency. if there are super mega rich people in this game, they can use 3rd tier currency which will have a same ration with 2nd tier... so if anyone has say 10 000 000 000 zeny they can convert it to 3rd tier currency and have 1 000 000 of 3rd tier cash.. if they need lower tier currency to buy pots or something, convert it back to lower tiers.. That is basis of my idea..
Edited by sniperkenny, 09 July 2012 - 01:16 PM.
#6
Posted 09 July 2012 - 01:17 PM
#7
Posted 09 July 2012 - 01:27 PM
#8
Posted 09 July 2012 - 01:34 PM
Couldn't it be designed to use 2 locations in memory and add the 2 together, so that the limit is actually twice the amount?
You would need a third memory location large enough to hold the summation, preferably a double. The best way is just to convert to a double and be done with it, its 8 bytes as opposed to 4 byte integers. It was most likely done in that fashion to keep packet sizes down in its original conception 10 years ago since not everyone had broadband.
#9
Posted 09 July 2012 - 01:44 PM
Basically you send the 2 packets, one with the 1 or 0 and the other with the total. If 1 on the first packet its 2147483647 + X, where X is the second packet. That's virtually no increase in transfer time and you double the money capacity?
Or actually the first packet could be like rolling over the speedometer. Every time you exceed 2147483647, it iterates the first memory address and resets second one to 0. That way in memory you have 5 in one db entry and 4646025 in the other, you know you have 10742064260 zeny (10.74b)
That'd be near infinite ceiling on money with a tiny packet to clients
Edited by Jaye, 09 July 2012 - 01:48 PM.
#10
Posted 09 July 2012 - 01:56 PM
#11
Posted 09 July 2012 - 02:23 PM
Or instead you can put banking system finally in place and have golden chips/nuggets/ coins representing say 1 million zeny. hold 10000 of those coins and you have 10 billion.. Then go back to the bank and convert some of them if cheap things are to be bought... No database work for player's character here.
#12
Posted 09 July 2012 - 03:08 PM
Edited by Inubashiri, 09 July 2012 - 03:09 PM.
#13
Posted 09 July 2012 - 03:48 PM
Plus from the player perspective, all the 0s make your eyes water. I've seen people sell stuff on vend missing a '0' and losing millions..
#14
Posted 09 July 2012 - 03:56 PM
except you have to convert every item price and everything to double and do it without introducing new bugs.
Let me demonstrate why you are wrong.
int Number; int Answer = (int)sqrt((double)Number);
Plus from the player perspective, all the 0s make your eyes water. I've seen people sell stuff on vend missing a '0' and losing millions..
What does this have to do with anything?
#15
Posted 09 July 2012 - 04:27 PM
all this does is take an int convert it to double, take a square root and then converting result to int again, thus losing precision
test it with 24 million and you get 4898, which if squared is 23990404. losing almost 10 000.
so
"What does this have to do with anything?"
---
You will have to convert player money to double in the database in order to have larger sums anyway.
Edited by sniperkenny, 09 July 2012 - 04:31 PM.
#16
Posted 09 July 2012 - 04:45 PM
- Create an item ("voucher") that represents one billion zeny.
- Add an NPC, say in the Eden group map, that deals in vouchers.
- You can give one billion zeny to the NPC in exchange for one voucher.
- You can give one voucher to the NPC in exchange for one billion zeny. (Of course, the NPC will refuse to trade if you have more than a certain amount of zeny, so that you don't overflow and lose zeny.)
- Vouchers weigh 0.
- Vouchers can be traded, mailed, and placed in storage.
- Vouchers cannot be dropped, sold to NPC, purchased in buy shops, or placed in cart/vended.
All of this can be done without relying on kRO since it's just adding one item and one NPC.
#17
Posted 09 July 2012 - 04:54 PM
Or instead you can put banking system finally in place and have golden chips/nuggets/ coins representing say 1 million zeny. hold 10000 of those coins and you have 10 billion.. Then go back to the bank and convert some of them if cheap things are to be bought... No database work for player's character here.
#18
Posted 09 July 2012 - 04:57 PM
Probably be better if the voucher was 100m zeny rather than 1bHere's a possible solution that doesn't involve modifying code or database schema.
- Create an item ("voucher") that represents one billion zeny.
- Add an NPC, say in the Eden group map, that deals in vouchers.
- You can give one billion zeny to the NPC in exchange for one voucher.
- You can give one voucher to the NPC in exchange for one billion zeny. (Of course, the NPC will refuse to trade if you have more than a certain amount of zeny, so that you don't overflow and lose zeny.)
- Vouchers weigh 0.
- Vouchers can be traded, mailed, and placed in storage.
- Vouchers cannot be dropped, sold to NPC, purchased in buy shops, or placed in cart/vended.
All of this can be done without relying on kRO since it's just adding one item and one NPC.
#19
Posted 09 July 2012 - 07:11 PM
int Answer = (int)sqrt((double)Number); - this doesn't make any sense in game.
all this does is take an int convert it to double, take a square root and then converting result to int again, thus losing precision
test it with 24 million and you get 4898, which if squared is 23990404. losing almost 10 000.
...
It was not a literal statement and had nothing to do with the game, it was only a general example to show you that you do not in fact have to convert the DB field values from unsigned int to a double. Its called type casting and just about every programming language has it.
You will have to convert player money to double in the database in order to have larger sums anyway.
Are you for real? You can upskirt from a DB 4 byte int to a DB 8 byte float (double) with absolutely no loss, its an implicit conversion.
Vouchers are an okay idea, however I have my doubts due to dups and accidental item loss. From a legacy stand point since this is a 10 year old piece of software, I'm of the school of thought, the less tinkering done to it the better.
Edited by Inubashiri, 09 July 2012 - 07:13 PM.
#20
Posted 09 July 2012 - 08:09 PM
It is essentially the same idea. I went into a little more detail and eliminated needless complexity.regarding voucher. this is a handier solution
There's no need for multiple denominations. A single denomination of 1 billion zeny makes it so that there's exactly one way to complete all trades, which also happens to be the obvious way. For trades involving less than 1 billion zeny, you would use only zeny. For larger trades, you would use 1 voucher per 1,000,000,000z, plus zeny for the remainder. On the other hand, if we had coins worth 100m (for example), there could be many valid combinations of coins+zeny for a single trade. More choices mean more opportunities for human error.
#21
Posted 09 July 2012 - 08:56 PM
It is essentially the same idea. I went into a little more detail and eliminated needless complexity.
There's no need for multiple denominations. A single denomination of 1 billion zeny makes it so that there's exactly one way to complete all trades, which also happens to be the obvious way. For trades involving less than 1 billion zeny, you would use only zeny. For larger trades, you would use 1 voucher per 1,000,000,000z, plus zeny for the remainder. On the other hand, if we had coins worth 100m (for example), there could be many valid combinations of coins+zeny for a single trade. More choices mean more opportunities for human error.
I would disagree on the amount, 500m is I believe the min requirement for GM overseen trades, I could be wrong my memory is bad sometimes.
#22
Posted 10 July 2012 - 05:27 AM
Are you for real? You can upskirt from a DB 4 byte int to a DB 8 byte float (double) with absolutely no loss, its an implicit conversion.
this is not the point. In any case you do transactions, error might be generated when you try to put more into integer than it can handle..
#23
Posted 10 July 2012 - 05:55 AM
this is not the point. In any case you do transactions, error might be generated when you try to put more into integer than it can handle..
Read what you wrote vs what I wrote, you would not be assigning anything to an integer
For the sake of argument:
-Assume 15 came from (SELECT price_buy FROM item_db WHERE id = '512';) which is an apple with no discount. Buy price is an integer.
-Assume player has 3 billion zeny under the new system which is a double (float for MS SQL SERVER). (SELECT zeny FROM char WHERE account_id = 1 AND char_num = 1;) That says I'm the first account on the server in slot 1 on char select.
int itemPrice = 15; double zeny = 3000000000; double newZenyTotal = zeny - (double) itemPrice;
Quick and dirty SQL statement.
UPDATE char SET zeny = newZenyTotal WHERE account_id = 1 AND char_num = 1;
#24
Posted 10 July 2012 - 06:15 AM
1. say there is a trade going on. deal window has to store the amount of money you're giving for an item. if it's an int (hasn't been changed) correct sum won't be possible over 2+ billion.
this is just one example of how this can go wrong. I'm sure there are places where double -> int downgrading can hurt the game..
This is not a 10 minute project, in other words.
#25
Posted 10 July 2012 - 06:46 AM
$zenyarray = mysql_fetch_assoc("SELECT `zeny`,`zenyiterations` FROM char WHERE account_id = 1 AND char_num = 1");
$zeny = $zenyarray['zenyiterations']*2147483647 + $zenyarray['zeny'];
Echo 'You have '.$zeny.' zeny.';
Client would handle doing this rather than the server. Server just knows the two zeny values.
Buying something.
Script for buying stuff could use a variable that holds more than 2147483647... 2147483647 is only the limit of the field in SQL.
if ($cost <= $zenyarray['zeny']) { $zenyarray['zeny'] -= $cost; }
elseif ($cost > $zenyarray['zeny'] && $zenyarray['zenyiterations'] >= 1) { $zenyarray['zenyiterations']--; $zenyarray['zeny'] += 2147483647; $zenyarray['zeny'] -= $cost; }
else { echo 'You don't have enough zeny.'; }
mysql_query("UPDATE char SET `zeny`=".$zenyarray['zeny'].",`zenyiterations`= ".$zenyarray['zenyiterations']." WHERE account_id = 1 AND char_num = 1");
Edited by Jaye, 10 July 2012 - 06:52 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users