jpcsupplies / Economy_mod

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

[Player requests] Player trade zones. Sendto cargo. #94

Open jpcsupplies opened 8 years ago

jpcsupplies commented 8 years ago

Didn't get a notification on this oddly.

His basically asking for player trade zones. But his approach sounds reasonable. Although I was more thinking of having player markets command driven, I do like the idea of one crate per commodity.

Ie, create a crate with a special name identifying it as for buying/selling ice at x and y price in that players registered trade region. Trades are then added or subtracted from the stock in that crate. .

His original post is below. http://steamcommunity.com/workshop/filedetails/discussion/504209260/492378738692353629/

Devlah has Space Engineers 24 Nov @ 8:07pm Feature Suggestions I wonder if it might be possible to add a feature that would allow players to create their own MarketZoneSpheres. For example: Player builds a station somewhere, and labels one or more of his cargo containers to contain the string [MarketContainer]. This then allows players to establish their own shops.

To further elaborate; Player Derp could purchase a "Merchant License", which grants them a separate "Merchant Account" which they may name and transfer funds to and from at will via chat command. For example: /license "Derp-Mart" would create a merchant account belonging to the player, under the name "Derp-Mart". A licensing fee would be subtracted from their balance, and then they would be able to /deposit 500 "Derp-Mart" or /withdraw 500 "Derp-Mart" in order to transfer funds between their Merchant Account and themselves.

For simplicity sake, Merchant accounts could be limited to one per player. Any container belonging to Derp that contains the string [MarketContainer] and any other containers attached via conveyor system all count as one instance of a MarketZoneSphere for "Derp-Mart".

Derp could then dictate what to buy and sell from that container by using syntax such as: "Derp Ore [MarketContainer] {Sell Ore}" curly brackets tell the container to freely sell the ore contained within at the existing market prices. Optionally, he could use {Sell "Iron Ore" 0.50} to specifically sell any Iron Ore in the container at 0.50 per unit. or {Sell "Iron Ore" 0.50;Buy "Iron Ore" 0.45}. This particular container would only deal in Iron Ore with these options, unless Derp were to name the container with {Sell All; Buy All}.

jpcsupplies commented 8 years ago

Here is another - tho i pointed out I had asked you about detecting cargos on ships controlled by player.. which is probably more organic way to go about it, without needing a massive list of keywords

Nicholai 4 hours ago
I was thinking would it be possible for players to lable a cargo containor with their name etc like Nicholai Reciving like on a small trade ship in market zone so when i buy stuff it spawns in that cargo instead of on the ground? would be a nice feature if its possible.

midspace commented 8 years ago

Any container belonging to Derp that contains the string [MarketContainer]

Yeah, I think taking the tag approach is a little too complex. I was wondering if were even going to go down that route of having containers at all, and leave it all in virtual space.

I was thinking would it be possible for players to lable a cargo containor with their name etc like Nicholai Reciving like

I don't think this is required. We can detect when a player is in a cockpit, and used any inventory space in the associated ship. And, we can additionally detect when a player is in front of an inventory cube, and make use of it. As I was descibing here: https://github.com/jpcsupplies/Economy_mod/issues/91

A send to cargo is redundant. I believe they are all thinking along the lines of PB script where they have to name everything. I'll go through the points, listing what is achievable, and what I believe is a good approach. Selling and Buying players...

Restrictions....

When buying, this results in a more organic feel as you desired. When you /sell accept a large purchase:

jpcsupplies commented 8 years ago

Well the organic ways i was thinking is these.. (sorry ive only skimmed your reply have to go shopping in a sec ill reread later tho your idea seems to match mine so all good) 1: When a player is piloting a ship and buys more than he can carry, the purchase goes into the first available cargo space on the ship we are piloting that the player owns (this could include the new "carry on luggage" storage space in the seats/cockpits now. 2: Any cargo container under the players crosshair that he owns picks up overflow on buys, or is drawn from on sells.

jpcsupplies commented 8 years ago

Also if we were to use a cargo crate for player stock method, we could use the LCD convention and a crate called [economy] could be used. Really all depends how we end up making our player trade zone registration work to decide how we proceed.

jpcsupplies commented 8 years ago

Ok, i'v re-read your entire post more carefully. I pretty much agree with it all.

The only thing i liked was the idea of stock selling out of a crate for a players registered trade zone. Simply from the perspective they could be using sorters to dump stock in there when they unload from a mining trip. They could set buy/sell price in the name maybe. Downside is it would allow other players to steal his stock - and how do we tie it to our virtual shop stock which all the other logic is built around.

A best of both worlds approach maybe I suppose a cargo crate named [economy] which could automatically "upload" its contents to the players digital inventory in his registered trade market.. (or any in range market really.). if he is in the NPC zone and dumps all his ore into an [economy] crate on his ship or the trade station it auto sells into the NPC market.

Possible issues then are if he doesnt own the [economy] crate how does the game work out who gets the money for the sale.

I really like the [economy] dump idea tho.. it means players can sell stock by just drag dropping it into their economy crate, or if they own the trade zone, it restocks their market stock.

Got any thoughts here?

My older original idea was a crate that shows a qty of every item you can buy/sell. To buy it you right click drag out the quantity you want to buy and it auto bills you, and vice versa to sell back in.

jpcsupplies commented 8 years ago

from a logic perspective.. we have to consider things like if the ship has reactors or turrets but no storage, and they are buying fuel and ammunition should we allow the materials to drop into the gun/reactor.

Although the issue is mitigated somewhat by underseat storage i think all cockpits have it now. SO technically no ship should have no storage space except drones with no cockpit which doesnt effect this issue anyway.

jpcsupplies commented 8 years ago

another long term thought that occurs to me is there any way we can expose buy and sell to in game scripting.. i suspect at some point someone will try to make a trade bot script..

which oddly reminds me of the ambient trader ships discussion we had earlier for some unspecific reason..

Devlah commented 8 years ago

My primary concern with my post on steam was the allowance for offline trading. And naturally, things could be stolen from a player's shop, that's just realistic. However, if the effective range of any particular shop is something in the neighborhood of 5km or even 1.5km, that's a considerable amount of space to search for the particular container holding the player's stock.

Now if the intent is to simply have a player's stock converted to datafile and modified as needed, then I suppose the same could be accomplished for their market presence. a command entered to establish their shop somewhere in 3D space (similar to the serverside beacons before GPS) would also be sufficient.

Then players could safely buy/sell entirely virtually without risk of losing any "physical" objects. Although the idea of being able to deposit object items from the game world to the "Virtual EconoSpace" through an interface like a storage cube would be helpful in terms of automation.

Perhaps a player would like to establish a factory that autonomously purchases raw materials from other players, withdraws those materials from the "EconoSpace" via a labeled container, runs through a refinery, an assembler, then back into EconoSpace through said container cube once again as a finished product with a final price attached.

jpcsupplies commented 8 years ago

Yes, given the plugin is doing so much now, an element of automation would inspire a lot of creative building. For instance a mining robot that auto sells its ore, or a ship foundry that uses projectors and in-game scripting to allow a player to order a ship at the push of a button, and it projects, buys parts and welds up the ship.

jpcsupplies commented 8 years ago

44 is the main player trade issue so it probably belongs there.

This issue here is the enh to player zones to somehow allow them to use crates to interact with a market. Eg: 4 possible approaches:

  1. simplest implementation: anything dropped in a special crate by player or conveyor auto sells to the market currently in range if not blacklisted. (it pays the owner of the crate so factions need to be careful!)
  2. Middle ground implementation is a crate that also shows a "phantom" quantity of each item for sale allowing players to right click drag to purchase (in addition to behaving like point 1)
  3. Extreme other end implementation is certain player stock is optionally stored in a crate (designated by some special name) (possibly 1 per item) and the market interacts with that for buy/sells somehow instead. (appeal being raiders/pirates can rob them; downside being it wont hold much)
  4. Or a combination of 2 and 3 - a crate shows a "phantom" qty proportional to the available stock in the market. But we still store it in our "network" - Issue here is who gets paid, owner of crate? Or do we detect who is dropping stock.. if there is a conveyor involved that limits us to owner. If a conveyer pulls stock who pays for it? It would need to be owner of crate again.

Although I am liking 1 or 2, i dont this it is entirely practical. I like the idea of auto selling, but the click buy thing is a can of worms. Especially if sim lag allows people to steal/duplicate items by using them client side before server catches up.

Another MAJOR concern would be sim loading for all of these - If we are scanning dozens or hundreds of crates, i expect that will make our mod perform pretty terribly.

We could also just have the mod throw out random stock if the beacon is captured/destroyed (hell we could even make it explode similarly to the jump drive singularity mod and then spew out a few random items) Advantage being pirates are not forgotten by the mod and can raid traders, traders dont lose ALL stock, disadvantage being traders now have to defend their trade zones better - which prevents hostiles or neutral factions trading there.. (or is that an advantage? since it actually gives aliiances something useful to do)

PS: I agree with all you suggest BTW - although i would be more inclined to use our search logic instead of exposing the raw object builder ids, everything else is a yes i agree.