Jump to content
  • 0

[Project] Dynamic Trader Prices


fexxianosch

Question

Out of my first question i will make a project with dynamic trader prices

I would be pleased for any help because its my first modding project for DayZ Epoch -- have no testing enviroment, yet

 

 

This will be a custom mod with dynamic trader prices.

First of all i am collecting ideas about formulas and pro and cons about the values.

 

My ideas are the following:

 

- Use dynamic stocks of the traders (maybe an own for every trader) [look at

-> i want to give the traders a dynamic stock instead of a fixed stock after restart

=> e.g. Baked Beans stock is at 100 -- players sells 100 -- stock is at 200 -- server restarts and it will keep the 200 in stock

-> i want a factor for selling and buying -- the bigger the stock is the lower the prices -- up to a maximum (maybe 1000)

=> e.g. there are 1000 Baked Beans at the traders stock so its sell and buy price will be very low -- e.g. 100GC base price * 0,25 as the lowest stock modificator -- result 25gc

-> also randomized values for items getting on the stock

=> e.g. Baked Beans stock is at 200 -- after restart he gets stocked up with a random number (maybe 20-30) e.g. 24 -- stock is now 224

 

- Use a buy/sell ratio (maybe an own for every trader) [look at

-> depending on supply and demand -- saving a buy/sell ration for each item

=> e.g. Baked Beans 250 buyings/ 50 sellings --> ratio for the price of 5 (maybe there can be a minumum too e.g. 4?)

-> decaying ratio so the prices get a bit more affected over the time

=> e.g. Baked Beans 250 buyings/ 50 sellings -- factor of 5 -- after restart decaying (maybe a few % -- here 10%) -- Baked Beans 225 buyings/ 45 sellings -- again factor of 5 BUT selling or buying will affect the prices a bit more now

~> maybe deacaying in other % how high the value is -- e.g. if value>=1000 use 20% decay else if value>=500 && value<1000 use 10% decay

 

 

All in all i have to think about where i can save those values and how to make it effective and using less ressources.

Any help would be nice :-)

If anyone got any attempts for this, it would be nice telling me.

 

 

 

When it gets finished i will release it with all participants in the credits.

 

Regards, fexxianosch

 

 

 

 

Original starting Post (and its question)

Original threadname: Traders with random additional charge (SC)

 

 

Hi there,

 

is it possible to add random additional charges to traders every restart?

I have no idea how you can do such stuff in BIs scripting langauge -.-

 

e.g.

 

You want to buy/sell a DMR at a standard trader

-> standard trader buy price is 20000 gold coins

-> standard trader sell price is 10000 gold coins

 

Now you want to buy/sell at a trader with random additional charges (maybe 2 variables for all traders or 2 variables for every trader)

->caravan trader buy price is 20000+20000*(random 0 to 15) => e.g. after restart #1: 20000+20000*9/100 = 21800 => after restart #2: 20000+20000*13/100 = 22600

->caravan trader sell price is 10000+10000*(-(random 0 to 15)) => e.g. after restart #1: 10000+10000*(-6/100) = 9400 => after restart #2: 10000+10000*(-15/100) = 8500

 

Can it be realized with variables that gets randomized per restart and when you buy/sell something, the variables gets querried and you pay/get up to/only x*(random percentage)?

In addition, can it be realized to show those modified trader prices at the traders, when you querry the variable just when buying/selling or is it better to show the extra percentages somehow in the trader menu without displaying changed prices?

 

Regards, fexxianosch

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Thats good.

I will give it a try by myself :-)

I would be very pleased about hints.

 

btw... what about this:

[...]

In addition, can it be realized to show those modified trader prices at the traders, when you querry the variable just when buying/selling or is it better to show the extra percentages somehow in the trader menu without displaying changed prices?

[...]

 

Regards, fexxianosch

Link to comment
Share on other sites

  • 0

In addition, can it be realized to show those modified trader prices at the traders, when you querry the variable just when buying/selling or is it better to show the extra percentages somehow in the trader menu without displaying changed prices?

 

Yes it can. I think it's better if you actually modify the price itself. Otherwise players probably wont notice the percentage and get pissed when they see they got charged more.

 

It's an interesting concept you have here though. Might implement this on my server as well. Would be nice to actually have this working like a real economy though - price drops when people are selling in bulk, etc. But I think that's a little too ambitious and not very practical considering the coding behind this.

 

At the moment I don't have the time to code this myself (maybe in a few days) but if you manage to get this done and are kind enough to share then definitely let me know.

Link to comment
Share on other sites

  • 0

[...]

At the moment I don't have the time to code this myself

[...]

 

I got the time problem, too. Furthermore i need to get my server running. My first own server project, hosted on a friends root server (very strong root ^^) and its very problematic to configure WS2K8R2 in an VM on a Linux root system to run like i want...

 

When i have the time, i will probably add bulk traders anyway... kind of selling out of the car (everything) for about 50-60% of regular selling price. (maybe even use the one released in this forum)

 

//EDIT:

@ ZUPA: my scripting knowledge is not that good... i am more like a newbie ^^

 

 

 

 

 

IDEA:

 

Maybe there could be some database additions to regulate supply and demand. and on every server restart the trader gets just small numbers to the stock and selling buying numbers get saved/querried:

 

e.g. baked beans

 

what the trader got in stock as a factor:

 

=> baked beans, in stock 250

=> player sells 50 in one restart period

=> stock gets to 300

=> after restart stocks up for like 50 baked beans (maybe partly randomized)

=> 350 baked beans in stock

=> price is getting lower

=> another player buys 200 baked beans

=> 150 baked beans in stock

=> price is getting higher

---> i have to think about this factor in particular, but for example if the stock is near zero the factor should go to 1 and vice versa if it is very high (maybe a maximum) it will go to zero or at least something like 0,25...

 

numbers of buyings/sellings as a factor:

 

=> player A sells 200 in a single restart period

=> player B buys 50 in a single restart period

=> 200sell/50buy ratio will be safed somewhere in the DB

=> after restart (to normalize the prices) a fixed percentage will be substracted (e.g. 10%) results in 180/45

=> player C sells 100 baked beans in a single restart period

=> no buys in this restart period

=> ratio is now 280/45 and will be stored short before restart in the DB

=> again -10% results in 252/40,5

=> and so on... just about the ratio ^^

---> when sell>buy it should be something <1 ---> e.g. 250sell/50buy ---> switch numbers and divide ---> 50/250=0,2

---> when sell<buy it should be something >1 ---> e.g. 50sell/250buy ---> switch numbers and divide ---> 250/50=5

---> i will think about it to modify the factor to get smaller differences... not like (e.g.) 5 as the factor...

 

 

In the end i will deep think into this to develop some formulas next week after i got my server running and when i get time for it

Furthermore it depends on the mission system how this generates items...

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...