Jump to content

[Done] Inflation in NPC shop


freeman129

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

Hello everyone

 

Before introduction, I apologize for my poor english...

If you find something mean weird, please let me know. /thx

------------------------------------------------------------------------------------------------------------------
 
Started:
- 20/06/2013
 
Developer:
freeman129

 

General Info:

 

Items's price would change, when someone buy/sell them.

 

Player buy many A items, and then the A item's price will be increase.
Player sell many B items, and then the B item's price will be decrease.

 

Main System:

 

This inflation is linear formula,

 

new_price =  new_price + origin_price * buy_sell_change / inflation

 

inflation var. is constant and it according to item's type.

 

Init:   -0.5*inflation <= buy_sell <= inflation

 

show diagram below:

 
RO_rAthena_inflation.png
------------------------------------------------------------------------------------------------------------------
 
If someone buy/sell, server will add/minus sum of arithmetic sequence to your deduct/get money.
 
The sum of arithmetic sequence just like the area of ​​the triangle.
 
ex: If someone buy many A items and then sell all A items, just like diagram below:
 
RO_rAthena_inflation_AP.png
-------------------------------------------------------------------------------------------------------------------------------------
 
Other Mechanism:
 
This system add auto-recover function,
 
it means, manager can set timer to recover the changed items(be close to origin price).
 
File Modification:
 
I modify some file in conf/
                                 conf/battle/
                                 src/map/
                                 src/config/
 
I also modify itemdb datastructure,
I add 3 data are 'origin_value_buy' (int). 'inflation' (int) and 'buy_sell' (int),
and change 2 data structure are 'price_buy' (float) and 'price_sell' (float).
 
This version , dbs must on sql.
 
Test Video:
 
 
Download:
 
 
(Git clone from rathena github, and then git push origin master on my github with inflation.)
 
This project is not perfect, so welcome to modify it to perfect.
 
If you want to use that, please back up your original version!
 
and you must use item_db_inflation_re . mob_db_re and mobskill_db_re on sql.
 
Thank you for reading~ /ok
Edited by freeman129
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

Interesting concept :) 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   4
  • Joined:  02/06/12
  • Last Seen:  

fail concept. because it indeicates that ever player who is inflicted by this system is playing since the start of the server.

 

example:

 

Player 1 is playing from day 1: started to level his first character and bought some red potions for 50zeny. he is able to kill 300monsters with these potions.

Player 2 starts playing on day 100 when the inflation is allready going his way and a red potion is not costs 50zeny anymore, its costs 80zeny. he is only able to kill 170monsters with these potions.

 

both had the same build, but you gave the player who comes new to your server a disadvantage as he have to pay more for the potions in the same situation then another player some weeks ago.

in the real world its maybe working, but in a game where you are starting completly from 0. this system is fail.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

Thx to @Tepoo

 

The main purpose of this project is to restrain zeny increase exponentially by time

 

(if players don't want be punish of inflation, they must change the economic monster, or just to wait the auto-recover function come),

 

and increase alchemist's 'repare potion' skill to exert.

 

 

Older players have more superiority than the newer players,

 

it's true , when everyone follow the same way.

 

This project provide the mechanism,

 

what server execute routine auto-recover function periodicity(make the changed items to be close to origin price).

Edited by freeman129
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

Interesting project looking forward on this. wish you luck!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

fail concept. because it indeicates that ever player who is inflicted by this system is playing since the start of the server.

 

example:

 

Player 1 is playing from day 1: started to level his first character and bought some red potions for 50zeny. he is able to kill 300monsters with these potions.

Player 2 starts playing on day 100 when the inflation is allready going his way and a red potion is not costs 50zeny anymore, its costs 80zeny. he is only able to kill 170monsters with these potions.

 

both had the same build, but you gave the player who comes new to your server a disadvantage as he have to pay more for the potions in the same situation then another player some weeks ago.

in the real world its maybe working, but in a game where you are starting completly from 0. this system is fail.

good point.

One idea I am thinking (maybe stupid) - Add an exclusion list for items that would not be suffered by the inflation system.

We could include Items like red pots & the like that would not contribute much (if not 0) to zeny increase. /hmm

 

*waits for counter point*   /ok

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

to @Vlync
 
This project is available, just download the files from Github,
and cover your trunk folder(before cover, please back up your original version).
 
These files work in trunk 17459.
 
thx to @NeoMind
 
Items' inflation according to items' type :
-------------------------------------------------------------------------------------------
item's type data                                   |        init  inflation constant
-------------------------------------------------------------------------------------------
0 = Usable : healing                            |               2500
2 = Usable : other                               |               1000
3 = Misc                                              |                 400
4 = Weapon                                        |                 100
5 = Armor                                            |                 100
6 = Card                                              |                 100
7 = Pet Egg                                         |                 100
8 = Pet Equipment                               |                100
10 = Arrow/Ammunition                       |          500000
11 = Usable : delayed consumption    |               1000
default                                                 |                2000
-------------------------------------------------------------------------------------------
 
If you don't want to inflation something like red potion,
you can modify trunk/src/map/itemdb.h,and change 

 

#define INFLATION_USABLE_HEALING 2500

to

 

#define INFLATION_USABLE_HEALING 0
 

or just increase the inflation number to slow down players stress.

 

By the way, I don't test that in multiplayer's situation, so I don't kown what the data is appropriate.

 

I think, maybe the suitable data relate to number of player in server.

Edited by freeman129
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   4
  • Joined:  02/06/12
  • Last Seen:  

your work is pretty awesome, i wish i would have such knowledge about the sourcecode and implementation of rathena.

 

me for myself, implemented into my server a npc who can convert zeny into credits for the cash shop. i created a economy system where the balance of zeny > credits gets calculated.

there more zeny are on the server, there more you have to pay for 100credits.

i think this is a good start to prevent a inflation.

but its not a work like yours.

 

i tought about how to improve this possiblity, i think a new player indicator would be a good solution.

as you know, kids are having advantages compared to adults.

cheaper tickets for the train for example.

 

as the database stores the registration time, you could imlement a check (when account is junger then 1-2months dont inflict this account to the inflation system)

maybe this could solve the problem.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

to @Tepoo

 

After read your last reply, I realize what my project isn't the inflation,

 

just like something fake inflation XD.

 

It just restrain zeny increasing fast by time, and I think I give it a wrong name...

 

By the way, your idea is cool.

 

 

In your idea, the ratio of zeny and credit is important. 

 

I think how to judge who is new player is important,

 

because if there are so many advantages to create new character,

 

someone would use it to destroy the balance of the world.

 

Or how to judge what new player need and would not affect the world.

Edited by freeman129
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

can u make diff for this?maybe this is usefull hehehe awesome project O_Oa....heheh i need for change log with origin...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   4
  • Joined:  02/06/12
  • Last Seen:  

@freeman:

 

in the login table there is a creation date. so you can differ which account is new and which one is old. me personaly would also implement a secure system which checks if a completly new account is trading with a allready existing old account, as they could abuse the status of the new account to buy items cheaper for older players.

 

so the system would recognize if a old player is giving much money or items to a new account. then the new accounts gets removed from the protection system and is also a "inflation" account.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

to @kangfredy

 

I git clone from rathena github, and then git push origin master on my github with inflation.
 
I already modify the download link.
 
By the way, this is my first time to use git, so ... if this has some problems, please let me know. /thx
 
to @Tepoo
 

Your solution is nice.

 

I think you have started to explore.

 

Good luck, and if you have problems, please let me know, maybe I can help you or just discuss.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

to @kangfredy

 

I git clone from rathena github, and then git push origin master on my github with inflation.
 
I already modify the download link.
 
By the way, this is my first time to use git, so ... if this has some problems, please let me know. /thx
 
to @Tepoo
 

Your solution is nice.

 

I think you have started to explore.

 

Good luck, and if you have problems, please let me know, maybe I can help you or just discuss.

 

hm...sorry :) can u give me raw for the change?no full with ratehan..just coding.with ekstension diff??or can u give me file what should i change this.i will make diff for u..heheheh

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

to @kangfredy

 

I git clone from rathena github, and then git push origin master on my github with inflation.
 
I already modify the download link.
 
By the way, this is my first time to use git, so ... if this has some problems, please let me know. /thx
 
to @Tepoo
 

Your solution is nice.

 

I think you have started to explore.

 

Good luck, and if you have problems, please let me know, maybe I can help you or just discuss.

 

hm...sorry :) can u give me raw for the change?no full with ratehan..just coding.with ekstension diff??or can u give me file what should i change this.i will make diff for u..heheheh

 

 

Do you mean this bfd856dcaf6fddd1b45ba8de5d3b66649f5d85ba ?(github commit diff)

 

Github commit diff bfd856dcaf6fddd1b45ba8de5d3b66649f5d85ba link.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

no i mean like this (filename.patch) :) so people can see the diff and can easy to add this feature.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

no i mean like this (filename.patch) :) so people can see the diff and can easy to add this feature.

 

I use Google to search some informations about diff and patch.

 

And then , I try to make my first patch. :lol:

 

The original source code is trunk_17511(origin),

 

first, I create a copy of trunk_17511(origin) which named trunk_17511(inflation),

 

and then modify the trunk_17511(inflation).

 

second, I open a terminal ,

 

and then type "diff -aur trunk_17511\(origin\) trunk_17511\(inflation\) > trunk_17511_inflation.patch".

 

third, I create an other folder which contains a copy of trunk_17511(origin) and trunk_17511_inflation.patch,

 

and then type "patch --dry-run -p0 -i trunk_17511_inflation.patch",

 

it print the success output looks like this:

 

patching file 'trunk_17511(origin)/conf/battle/misc.conf'

patching file 'trunk_17511(origin)/conf/inter_athena.conf'

patching file 'trunk_17511(origin)/src/config/renewal.h'

patching file 'trunk_17511(origin)/src/map/battle.c'

patching file 'trunk_17511(origin)/src/map/battle.h'

patching file 'trunk_17511(origin)/src/map/clif.c'

patching file 'trunk_17511(origin)/src/map/itemdb.c'

patching file 'trunk_17511(origin)/src/map/itemdb.h'

patching file 'trunk_17511(origin)/src/map/map.c'

patching file 'trunk_17511(origin)/src/map/map.h'

patching file 'trunk_17511(origin)/src/map/npc.c'

patching file 'trunk_17511(origin)/src/map/npc.h'

patching file 'trunk_17511(origin)/src/map/pc.c'

patching file 'trunk_17511(origin)/src/map/pc.h'

 

and then, I type "patch -p0 -i trunk_17511_inflation.patch",

 

and it do a good job.

 

I upload the trunk_17511_inflation.patch to rAthena, and the download page here.

Edited by freeman129
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

like this :) congrats for conclution ur project..do you want to improve again?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  06/28/13
  • Last Seen:  

like this :) congrats for conclution ur project..do you want to improve again?

 

thx to  kangfredy

 

but what is the improve meaning?

 

I come up with new ideas about this (floating item price).

 

1.  Limited supply of goods in NPC shop.

 

     - Like buying store, but it add floating item price.

 

     - This will let inflation be more real.

 

2. Stock market

 

     - ex: Prontera pharmaceutical . Izlude blacksmith factory ...and so on.

 

     - Changes in the value of stocks according to the inflation of items.

 

             + ex: Prontera pharmaceutical provides red potions. When red potion's buy_sell be increase, Prontera stock's price will be increase.

 

3. Black market

 

     - Black market randomly sell what players sold.

 

 

I don't have much time, so I slowly get it done, and enjoying it.

Edited by freeman129
Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  12/10/13
  • Last Seen:  

 

like this :) congrats for conclution ur project..do you want to improve again?

 

thx to  kangfredy

 

but what is the improve meaning?

 

I come up with new ideas about this (floating item price).

 

1.  Limited supply of goods in NPC shop.

 

     - Like buying store, but it add floating item price.

 

     - This will let inflation be more real.

 

2. Stock market

 

     - ex: Prontera pharmaceutical . Izlude blacksmith factory ...and so on.

 

     - Changes in the value of stocks according to the inflation of items.

 

             + ex: Prontera pharmaceutical provides red potions. When red potion's buy_sell be increase, Prontera stock's price will be increase.

 

3. Black market

 

     - Black market randomly sell what players sold.

 

 

I don't have much time, so I slowly get it done, and enjoying it.

 

 

like wow, this is some next level ideas.

looking forward for it. do it!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...