jpcsupplies / Economy_mod

Basic Economy System for Space Engineers
13 stars 12 forks source link

ENH: set command - to adjust on hand etc values #66

Closed jpcsupplies closed 8 years ago

jpcsupplies commented 8 years ago

We probably should think about adding the /set command. This will allow admins to manually refill items in the market stock. Should be pretty simple - /set "item name" qty ## /set "item name" buy ## /set "item name" sell ## /set "item name" reset /set reset /set (anything else you think may be useful)

Logic: 1: regex the options (if admin) 2: locate the item name in the item list 3: if (qty) set "item name" stock quantity to ##; return 4: if (buy) set "item name" buy price to ##; return 5: if (sell) set "item name" sell price to ##; return 6: if (reset && no item name) reset entire price table and on hand to the factory default prices 7: if (reset && item name) reset only the price table price/stock of "item name" 8: if () reply = "Usage etc etc" 9: return

Might also be a good test place to experiment with our GAS research.

jpcsupplies commented 8 years ago

This could also be a round about fix for bug #53 - an admin could tweak his prices in economy config, then use a /set reset to apply them.

The price set commands could also be used for factions to change their own market offer prices.

From a logical perspective this means the 0,0,0 NPC (gov?) market is basically the admins faction market, and any registered player factions are treated similarly; they just cant edit on hand figures other than putting more in from their inventory.

midspace commented 8 years ago

I would actually say, the NPC merchant is the default market if no other market exists in the region. If there is going to be more than one market, then I'll have to make adjustments to the data structure before you publish. At the time that I wrote it, I was only expecting one market.

jpcsupplies commented 8 years ago

Hmm.. for the Alpha, one market is fine. If players can trade to each other directly -that meets our current milestone requirements on the alpha release. I think I stated tho, try to keep the logic flexible enough that more than one can be added later without needing to rebuild from scratch.

( After the next milestone - with the range check and register commands; it should be possible for other markets to exist. Albeit much more limited than the NPC one. I would also suggest a charge is involved to register a market. Something large, and probably configurable when we get around to reading the settings from a file instead of the constants file - constants file would then be the defaults if a setting file doesnt exist)

Default market if none exist... hmm well I was thinking the NPC market be subject to range check on 0,0,0 - but we could make the range check a configurable option on the NPC too.. for default to.

One server admin player was looking forward to forcing players to travel to a particular location for trading, It was central to their game server gameplay style.

jpcsupplies commented 8 years ago

So far players seem most excited about: 1: Player driven pricing buy/sell qty offers (free/stock market?) Multiple prices on items. 2: Multiple trade locations (with different pricing set by players or factions) that players can transport goods between and make a profit on the price differences. (Think Elite style space trading games)

Both of these are not planned until our next milestone however.

Other markets would probably just expand on the player offers.. just without a time limit. So we just reuse that data structure.

midspace commented 8 years ago

try to keep the logic flexible enough that more than one can be added later without needing to rebuild from scratch.

It's not the logic, it's the file format. I guess all we'll lose is the current market prices and market stock if it gets rearranged. Less fearful than losing player balances. Unless I get it to merge the market in as I did with the old balances.

jpcsupplies commented 8 years ago

35 has a suggested file format

the following xml fields type as string, amount as decimal, price as decimal, item as string, person intended for as steam ID, person sending request as steam ID, time to wait in minutes

type field instructs the mod what sort of record it is

midspace commented 8 years ago

What I'm concerned about, is the Price Table in the file format. There needs to be one for each market region or trader.

It's not hinted at in either #35 or https://github.com/jpcsupplies/Economy_mod/wiki/5:-Data-Structures-and-logic-considerations

jpcsupplies commented 8 years ago

Ahh. In data structures it would be the order book. using the type field as a way to filter/discriminate between record types.

the person sending request field could be used instead to refer to a registered trade region of a player or faction, which may require an extra table (such as the stations table) to cross reference location.

I might need to write an updated spec given the way economy is evolving to clarify matters.

Method 1: add a region/player field to the current price table to allow duplicate products with different prices or on hand amounts to the NPC market. This would allow player/factions to maintain smaller scale trade regions with fixed pricing. We would probably need a bank balance record in the case of a faction/registered market that works like our NPC. To clarify - these items with a different region/player code would NOT show up in the NPC price list. They would only show up on the price list if the player was in range of that market.

Method 2: order book this works pretty similarly but it allows one sided prices - giving us our stock market. For example a player could post a buy request for a given quantity, at a given price; without posting a sell offer. or Vice versa - a player could post a sell offer for a quantity of items at a given price without a buy offer. In stockmarket mode the offer would not be time or player limited and probably available to anyone in range of the region. In player to player mode it would be time limited and only available to the other player. To clarify, in stockmarket mode the same item could be posted by different players at different prices. Traders would get a list of all prices and qtys available of a given product. When buying the game automatically breaks up the different price points for each quantity. Eg. Buyer requests 10 ice at 3 each. in the stock market there is 2 at 1 each, 3 at 2 each, and 5 at 3 each. the game deducts 2 credits for the first 2 (at 1 each) 6 credits for the next 3 (at 2 each) 15 credits for the final 5 (at 3 each)

if none are for sale, but the fixed price table has them for 2 each, and has 10 in stock it instead spends 20 credits to buy them from the fixed price (method 1) table

jpcsupplies commented 8 years ago

Method 1: is basically an NPC market tied to a particular region ID, where our LCD pricing would show the 0,0,0 default price book prices/stock when near 0,0,0, if it enters a different region it would instead see the pricing/stock of that region.. which most likely wont be for every item, only those added by the owner of the region.

Method 2: this is stockmarket mode.. so it would allow multiple prices on a single item in the same market- it would probably look like the sell orders/buy orders here https://poloniex.com/exchange#btc_mrs

For simplicity and our sanity, it might be best if only the NPC zone has a stock market, or we make it global, and have registered trade regions only working in fixed price mode.

OR

we make every station behave like a stock market

OR we skip the stock market entirely and use fixed price mode only which forces players to trade between stations.

jpcsupplies commented 8 years ago

Players seem to like the idea of player driven pricing, which leans towards stock market mode..
But stock market mode becomes somewhat inconvenient if we want elite style station to station trading.

Players are free to trade directly with each other however, which gives them player driven pricing.

Perhaps a compromise might be allowing players to post offers to buy, and items to sell in a given market, but restrict what items CAN be posted to whatever the region owner selects.

So for example a new player mines some iron in the NPC zone, and puts it up for sale slightly cheaper than the NPC sells it for, but more than the NPC buys it for.

in the NPC market all items can be traded, in a registered trade region only those selected by the owner.

jpcsupplies commented 8 years ago

At the moment however for our current milestone we should finish off player to player. The station to region trade we can iron out the specifics of once the Alpha is released and we look to the next milestone

jpcsupplies commented 8 years ago

i think this issue is basically sorted.. we have a multifunction set command now we can add more to later