lift 2B ceiling and enable 1B+ deal - Proposals and Suggestions - WarpPortal Community Forums

Jump to content


Photo
- - - - -

lift 2B ceiling and enable 1B+ deal


  • Please log in to reply
36 replies to this topic

#1 Raharja

Raharja

    I made it Off Topic

  • Members
  • 69 posts
  • Playing:Ragnarok Online

Posted 04 July 2012 - 03:57 PM

What's the purpose of limiting zeny owned at 2B?

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.
  • 0

#2 Talvis

Talvis

    Too Legit To Quit

  • Members
  • 1985 posts
  • LocationSomewhere in the Midwest
  • Playing:Ragnarok Online
  • Server:Renewal Chaos

Posted 04 July 2012 - 04:04 PM

Well, I'm not sure about deal limit, but the chara limit is due to a system limitation. Also, I think the devs never forsaw that high of a zeny cap being too small. They probably never thought there would be so many people running around with billions of zeny.
  • 1

#3 Viri

Viri

    They pay me to post.

  • Members
  • 6295 posts
  • Playing:Ragnarok Online

Posted 04 July 2012 - 04:08 PM

its a signed int i think? so max is 2^31-1. It would be a huge amount of DB work to change that, not really worth it. Just add zeny sinks
  • 0

#4 CeruleanGamer

CeruleanGamer

    They pay me to post.

  • Members
  • 7685 posts
  • LocationChicago, IL
  • Playing:Ragnarok Online
  • Server:Yggdrasil, Ymir

Posted 05 July 2012 - 10:14 PM

If you're trading an item worth over 2 billion, make sure there's a GM to work as a middle-man. That way, no scam will ever happen.
  • 0

#5 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 09 July 2012 - 01:15 PM

2 147 483 647 = integer limit, so there's your zeny limit. 4 bytes of memory. Game economy with billions in accounts is not cool in my opinion.. but upgrade chances and drop rates drive prices up.

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.

  • 0

#6 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

Posted 09 July 2012 - 01:17 PM

Signed Integer just to be explicit. After that number you'll get an overflow error and pretty much anything can happen.
  • 0

#7 Kadelia

Kadelia

    Rainbow Sparkle, Go!

  • Members
  • 14312 posts
  • LocationVirginia, USA
  • Playing:Ragnarok Online
  • Server:Chaos/Renewal

Posted 09 July 2012 - 01:27 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?
  • 0

#8 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

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.
  • 0

#9 Kadelia

Kadelia

    Rainbow Sparkle, Go!

  • Members
  • 14312 posts
  • LocationVirginia, USA
  • Playing:Ragnarok Online
  • Server:Chaos/Renewal

Posted 09 July 2012 - 01:44 PM

the second variable could be a bit even. on or off.

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.

  • 0

#10 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

Posted 09 July 2012 - 01:56 PM

Money isn't handled in its own stand alone packet, its stuffed into another struct for player info. The irony is, in some places money is a 4 byte unsigned long (4.2b) and in others its a 4 byte signed int (2.1b).
  • 0

#11 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 09 July 2012 - 02:23 PM

As I was saying up there somewhere, by adding 2 variables you can solve money crisis. no big database problem, export data, remake player entity to include these 2 new currencies (even 1 might be enough) and set them all to 0. 1 NPC can be used to convert money back and forward. Then work on a deal system,so that players can see which type of money they are getting. Sorta like copper silver and gold.

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.
  • 0

#12 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

Posted 09 July 2012 - 03:08 PM

Except you've increased the complexity and number of operations...First you would have to add two/three new vars to the player's information structure packet and the DB, then code said functions in the client, add the vars to the DB, code said functionality on the server. unsigned long and signed into store 10 digits, changing to a double would allow for 15 digits (1.7E +/- 308). This is far easier and less problematic.

Edited by Inubashiri, 09 July 2012 - 03:09 PM.

  • 0

#13 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 09 July 2012 - 03:48 PM

except you have to convert every item price and everything to double and do it without introducing new bugs.
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..
  • 0

#14 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

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?
  • 0

#15 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 09 July 2012 - 04:27 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.
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.

  • 0

#16 renouille

renouille

    Too Legit To Quit

  • Public Security Section 9
  • 2448 posts
  • LocationUS
  • Playing:Ragnarok Online
  • Server:retired

Posted 09 July 2012 - 04:45 PM

Here'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.
  • 1

#17 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 09 July 2012 - 04:54 PM

regarding voucher. this is a handier solution


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.


  • 0

#18 Kadelia

Kadelia

    Rainbow Sparkle, Go!

  • Members
  • 14312 posts
  • LocationVirginia, USA
  • Playing:Ragnarok Online
  • Server:Chaos/Renewal

Posted 09 July 2012 - 04:57 PM

Here'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.

Probably be better if the voucher was 100m zeny rather than 1b
  • 3

#19 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

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.

  • 0

#20 renouille

renouille

    Too Legit To Quit

  • Public Security Section 9
  • 2448 posts
  • LocationUS
  • Playing:Ragnarok Online
  • Server:retired

Posted 09 July 2012 - 08:09 PM

regarding voucher. this is a handier solution

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.
  • 0

#21 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

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.
  • 0

#22 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

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..
  • 0

#23 Inubashiri

Inubashiri

    Loyal White Wolf

  • Members
  • 7646 posts
  • LocationWaterfall of the Nine Heavens
  • Playing:Ragnarok Online
  • Server:All

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;
  • 0

#24 sniperkenny

sniperkenny

    Awarded #1 Troll

  • Members
  • 653 posts
  • Playing:Ragnarok Online
  • Server:Valk

Posted 10 July 2012 - 06:15 AM

this is not the problem.

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.
  • 0

#25 Kadelia

Kadelia

    Rainbow Sparkle, Go!

  • Members
  • 14312 posts
  • LocationVirginia, USA
  • Playing:Ragnarok Online
  • Server:Chaos/Renewal

Posted 10 July 2012 - 06:46 AM

Here's how I'd do values > the max on the sql columnI couldn't edit, in PHP

$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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users