jpcsupplies / Economy_mod

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

ENH: Selling Ships and Stations #76

Open jpcsupplies opened 8 years ago

jpcsupplies commented 8 years ago

Brain storm on ways to sell ships and stations. blueprints are not practical, especially as the only way to share is workshop items which sorta makes that free anyway (No access to the API for blueprints as yet anyway) But if we limit it to existing built ships and structures .. there may be a way to work it out.

We could tie some sort of [tag] to a block like the LCDs work, which puts the item it is attached to for sale in the market.
If someone buys it, the script automatically does like the admin /claim command on it and.. maybe flies it or cut pastes it to the buyer. Or use a used car lot method, ship is not touchable till they buy it, but they have to travel to it to inspect and decide to buy it.

Practical example: Screaming Angels: Zan sold a ship yesterday. Screaming Angels: flew it to the buyer. Screaming Angels: Allowed them to look at it first. PhoenixX: dronefab inc ? ye Screaming Angels: yeah.

Objectives: 1: Buyer can inspect ship (take them there to look at it? or vice versa, bring ship to them but send it back if they dont buy. Even if teleport is client side only that still allows them to examine it) (Should we allow a test drive?)(Or should we force the seller to take it to the buyer themself) 2: Buyer cannot take or steal ship unless they pay for it (make it indestruct during inspection? Wont work if there are piston/rotors tho.. maybe a temp protection zone? Tho that conflicts with admin mod) 3: Optional: Delivery? Can we use the AI search destroy logic, or the remote control autopilot logic to fly it to the buyer? 4: Ownership of all blocks is automatically changed to the new owner. (like admin mod /claim works) 5: Optional: Guns are left turned off so the seller / buyer can leave without getting killed! 6: Optional: Ship can be sold while owner is offline (means we can use it later in purge logic)

Example Case study. Zannador wants to sell Tempest. Screaming Angel wants to buy it. Zannador doesn't want to expose the location of his base however. The ship is taken to a special location where Screaming angel can inspect it. (sort of like a projector - but its the actual ship - Turrets are all disabled, (and the reactors too maybe?) but the ship also cant be grinded or damaged) While there Screaming angel uses /worth on the ship to see what its material value is. He notices Zannador only wants 3/4 of the component value to sell it. Screaming Angel decides that is a good deal and buys. Zannador gets paid. The ship is moved back (or sent to some random location where guns are not likely to shoot it up) and its ownership settings are changed to Screaming angel, and it is set back to being allowed to damage or grind again. At this point the ship is set to automatically fly to Screaming angel using ai logic? or we just leave the ship at a special location (ship yard somewhere?) Either way Screaming angel can take control of it, without anyones base being revealed and the transaction is complete.

Or skip the movement steps and change ownership on the spot in the case that we force sellers to deliver ships personally. (probably the safer option - avoids people selling ships for 12cents for cheap teleports around the map)

Example case study 2. Screaming Angel wants to sell his Europa base. Zannador would like somewhere to collect cheap ice and wants to buy it. Location of base is not really a concern. Generate a GPS point to Zannador and set the base as turrets off (and powered down? This should disable modded turrets as well.) Set the base so it cannot be grinded or damaged Zannador can inspect base (allow an amount of time once he arrives near the GPS?) Zannador does the usual things kicks the tires, checks the /worth. and decides to buy the base At this point money changes hands, and Screaming angel is allowed a certain amount of time to leave the area. Station ownership is changed to zannador, the reactors are powered up and the station is allowed to be grinded or damaged again. It is up to Zannador to enable the turrets again. At this point transaction is complete.


jpcsupplies commented 8 years ago

Keep this simple - maybe a command/block keyword or market list that allows a ship to be put up for sale. If purchased the ships ownership is changed to the new owner, and optionally gets moved to the player, or the player gets teleported to the ship

Research project only at this stage - no need to add to mod yet. Can it be done? Limitations? Only ships or stations that exist in current world? Can a prefab market be created allowing exploration ships to be sold and ownership be set?

jpcsupplies commented 8 years ago

Actually Case study 2 could probably work for both ship and station sales - either way its location is only revealed to buyers. Sellers would need to make sure they have it somewhere away from bases they dont want to expose before beginning the transaction.

midspace commented 8 years ago

(I'm going to ignore the fact that players can do this currently, outside of a controlled system.) Teleporting ships/stations to destinations is easy enough. the Admin helper mod does this, and safely enough.

Transporting to a location through normal space is questionable, because of.

  1. Need the ship to have a Remote Block.
  2. Stations cannot be transported.
  3. There needs to be sufficient fuel to fly the craft there.
  4. Navigation hazards (planets, asteroids, pirates, space junk, random players).

The other part is. Is the seller selling a complete ship, or off the plan? A complete ship might as well be Cash on Pickup, or COD.

A case study.

  1. Seller targets physical existing ship, and lists it on market. When listed, perhaps we should store the current worth of the ship. (One thing we haven't factored into worth, is damage and completeness.) 2.A. A prospective buyer sees the ship listing, and is interested. They respond to the query. We could have an auto evaluation process, where the player is given GPS to the ship. So they can travel there and inspect. 2.B. Or if the location is too far away, we can create a dummy projection? We can currently with the API, create a client side grid entity with no physics. That should be enough to allow offsite inspection. The /worth command should work under that condition.
  2. The buyer inspects ship and agrees to the purchase. The funds can be transferred instantly... 3.A. ... and the ship, because it was tagged earlier, can have ownership transferred instantly. Weapons and Warheads can be powered down, and can leave sharing for All on doors, to allow previous buyer to get out if they are still there during the transaction. I'm not sure about Timers and PB. They could still be running... scratch that, PB is supposed to be recompiled after ownership change. Timers however could be running funky stuff though. 3.B. The physical ship, same as 3A, but in addition, it's teleported to the buyer location. At a set cost. (Delivery fee = Mass x Distance x total cost x %).

Things I see from this:

jpcsupplies commented 8 years ago

I would suggest we over simplify it. Like my case study 2 above - Firstly the Economy script is used to only handle the actual transfer of funds, creating a GPS and ownership change, but make the original owner responsible for moving the ship somewhere appropriate etc. As such only already Built ships can be sold. Same applies for stations.

This allows partially completed things to be sold too.. (like the origin which was incomplete but I gave away to a new player.)

We could later on use projections or other cool stuff to remove the need to travel; but for the sake of simplification not yet.

If a buyer wants a blueprint built they can see the projection (without needing the mod) and once it is built Economy can be used to do the hand over.

Something like this - Player A wants to sell his ship. Player B shows interest in buying it. At this point the ship is not listed anywhere (and the owner is responsible for telling anyone he wants to sell, or a buy wants to buy) and our script is not needed yet. Player A tells player B he will bring the ship around so he can inspect it. Player A moves the ship them self to a location 5km away, then initiates the trade command. Player B gets a notification that the ship is ready to be inspected and is given a GPS point The ship is then stopped in place (all momentum removed) powered down, disarmed, and set indestructible and non grindable. probably open all the doors too. Player B travels to the GPS point (and has a time limit to travel?) On arriving near the GPS point, Player B is then given say 10 minutes to inspect the ship. If they like it they have the option to accept the sale, which will give the old owner 2 minutes to leave, then power the ship back up, remove all indestructible flags, and transfer the owner to the buyer. If they dont like the ship they can reject the sale, at which point he will have 2 minutes to leave the ship before it powers up (including guns) and has its indestructable flags removed. If they fail to accept or deny the ship in 10 minutes the reject routine will run anyway. if the seller cancels the sale it will also run the reject routine.

We may need to add a check to make sure the buyer can afford it too.. before setting the gps etc. to avoid.. incidents.

how does that sound?

jpcsupplies commented 8 years ago

If we can create client side only "projections" another long term feature we could add is the ability for players to go somewhere and scroll through ships/stations currently for sale. In theory this only effects their sim speed too, not the server.

Also I read somewhere that projected (projector block not client spawned) objects can be scaled in size, and this has been used for a number of mods. If we could exploit this behavior we could throw up a mini version of each ship being sold and players could rotate it and so on.

Seems like most options here are plausable in any event. The real question is what has the best mix of "cool" and low sim speed impact.

jpcsupplies commented 8 years ago

Step 1- Keep it simple. Mod handles the ship / station going up for sale, the payment and the ownership transfer. It also turns off turrets etc. (Should Ships be listed for sale for days/weeks ? Or just when the offer to sell is sent to a player. ?? i say for stage one just when offer is made to sell ship) Old owner is responsible for communicating GPS coords or moving the ship to where the buyer can inspect.

Step 2- maybe add the good stuff like projectors, long term open listings, auto-delivery and teleports later

jpcsupplies commented 7 years ago

@midspace @temar96 - any thoughts of the best way to have ships for sale show in a trade zone LCD?

Presumably we would have these to consider: 1: Should any for sale ship in range of a trade zone simply shows on that tradezone's ship category? 2: Make any economy sign within 1000 metres of the ship for sale (sort of like a wierd ship only trade zone) shows it in the ship category? (would work basically the same as option 1 if it was parked near a trade zone anyway) 3: or should a for sale ship simply show in the trade zone where it was put up for sale; but can be moved elsewhere; allowing purchase sight unseen (may require a way for them to locate the ship or move it, eg a GPS point, or teleport the ship nearby) - or even try to get the autopilot fly it to them. 4: As you suggested earlier - some sort of holographic display showing ships for sale - eg as an extension of option 3 perhaps.. have an inspect option?

I think option 1 and 2 has more realism; and matches existing /buy and /worth behavior - and option 2 and 3 allows the owner to keep using the ship while waiting to sell it.

Option 3 has some appeal, as it allows the ships for sale to be kept hidden until sold - but a GPS option has the danger that it may be parked near hostile ships.

Option 3 however may conflict with the idea of being able to purchase prefabs in an NPC zone which a number of players have expressed a desire for.

Option 1 and 2 will require keeping track of the ship somehow. It would also require a redesign of our LCD system This may have performance implications. Also how would you describe the ship? Ship name and weight, or allow seller to make a description?

Option 3 would have minimal performance impact assuming we can identify the ship by id somehow.

Option 4 would be very tricky to program; and use more complex modAPI functions than the rest of the economy mod has previously needed.

option 1 2 and 3 would all require a redesign of the buyship/worth commands to accept an ID parameter.

temar96 commented 7 years ago

At the moment it used grid id which stays the same

temar96 commented 7 years ago

I don't think buying while ship isn't there is good. The ship might be in a location that doesn't want to be known . The ship may become targeted by guns on owner change

The ships should be baught when physically in front of you. But maybe advertising while not there if the player doesn't wanna park his ship there

midspace commented 7 years ago

Maybe the seller opts in to advertising. Advertising necessarily displays the location of the ship from far away. It's at the sellers risk then to display such information, and how far such advertising reaches.

midspace commented 7 years ago

Additional ideas when talking to zataralee from the Tucana 2.0 server which is the Spokane survivalists, is perhaps we should offer buying of prefabs.

Like the components, certain prefabs can be restricted from sale by admins, otherwise players can buy a prefab ship if they desire. The aim again is to limit starter ships. First time players in zataralee's case do not get starter ships, but they get a substantial starting credits. The player can then buy whatever ship they want, with according balance. More expensive ship, means less starting credits for other things. El-Cheapo ship means more credits for other things.

Questions from this are: Do we list prefabs on LCDs? If you buy from LCD, where does ship go? Or do we buy from MessageBox list? Then require empty space for ship to be spawned in. Or a mix of both. Buy from LCD, but must move to empty space and then issue another command for ship to appear.

And we SHOULD restrict the space in which the ship can spawn in, otherwise we'll have people spawning crap inside of other people's ships.

jpcsupplies commented 7 years ago

@midspace - good questions.. here are some thoughts - The prefabs idea I always considered the "NPC" version of the sellship option. (much like we have player trade zones and NPC trade zones,) ie.. players can sell their own built ship. But NPC zones simply sell from a predefined list. Assuming we can make player ships show in an LCD catalog, it would be limited to actual ships in the game world. NPC ships would be limited to the allowed prefab list. Either way they show in the LCD list. But only real ships can be listed in a player zone; while real or prefabs could show in NPC zones?

I really don't like the idea of magically creating ships from thin air, there should be some element of immersion - (not to mention finding a free space) eg:

Another alternate option is set up a "ship yard" showroom with a bunch of static locked in place ships. These ships are owned by NPC, and cannot be moved or altered; but players can point at one and buy it. (Note: not sure best way to protect ships, ive noticed players playing "bump bump" to push ships out of protected regions to steal them since adding sellship)

Once purchased either: a: the ship can be boarded by the player and flown away. A few minutes later the NPC zone respawns another ship in the empty space.

or

b: on purchase a copy of the ship is created 100 metres behind the one in the "show room/ship yard" (or we nominate a fixed "delivery location") but this is owned by the player that purchased it. We could have some timer and a message along the lines of "your order is being processed and your new ship will jump in shortly" (this could actually work for prefab ships too actually if we skipped the showroom?) we could trigger the jump drive visual effect maybe for the sake of immersion. (could also use a random empty space and generate a GPS point for the buyer player)

zateralee i think also asked about the idea of "break down" selling of ships. ie, take a ship or wreck to an NPC zone, sell it for the component value and the NPC zone dismantles it, and puts all the components up for sale in the market. Basically a recycling yard. (downside here is we need to be strict in respect to ownership or griefers will LOVE doing this to peoples stuff - maybe require they own a trade zone or some sort of "permit" (or salvage contract?) which prevents players joining for 30 seconds and selling every ship in sight and leaving)

This would be nice if it could work in reverse too.. buy a ship and it only builds it when the parts it requires are in the market. This would give it a millionaire (minecraft mod) feel, where players have to supply parts to NPC zones for the NPC to construct stuff. now THAT would be immersive (also complement option a above nicely - only spawn in when it has parts) also gives an incentive to sell back to market, cool ships to buy only spawn when it has the parts.

jpcsupplies commented 7 years ago

having a mechanism for break down and build up of ships could also allow us to move forward with the ship inter-server travel idea.. but that's a different topic entirely - and (FTL) phoenix was thinking about doing that himself.. be nice to have that in economy tho.. assuming we can allow them to take money too. (cashers cheques or something? now we have that extra block data field to play with not a silly idea)

jpcsupplies commented 7 years ago

@midspace @temar96 Ok possible ways forward (not suggesting we do all of these but summarizing possibilities as previously discussed/suggested)

1: NPC Prefab market - ability to list all non-blacklisted prefabs in an LCD for sale (NPC market only) - we should have some way to add custom prefabs ideally in-game (this would allow admins to add server specific ships) - question is how do we select the place location of ship. Perhaps have a player mark a place themself by pointing at a spot or placing a special block as part of the purchase process, or have a pre-defined spawn zone or logic (ie the 100 metres behind X suggested earlier) from a logic perspective easiest implemented. (admin helper mod already does it essentially we just need to add an economic+lcd+blacklist element)

2: Option to only allow ships to be built/bought if enough components exist in market or in buyers inventory. (this could be an alternate player ship market behavior also?)

3: Fly-in option. Alternate delivery - if components option not used, or not enough parts - spawn the ship in 10km away and have it fly to the player or appear nearby with a fake "jump drive" effect. This will have an extra delivery charge however?

4: Ship recycling option - ability to sell a ship for scrap value, parts get added to the market. Suggest this as an NPC market only option, and force players to position the ship in a special location; as well as ownership checks. Should randomly "destroy" some parts (eg power cells, or some random parts to simulate entropy from scrapping it) also suggest there is a time element (ie it breaks it down a few blocks at a time(ship block scan loop on timer, breaks down first 2 blocks each iteration - number of blocks could be an admin option) instead of poof gone - although if we do have a "poof gone" option it should use a jump effect too - basically a cool down time to abort the scrapping - will also need a way to prevent people scrapping the NPC market space station too lol)

5: Break-down/build up option. Ability to convert ship into a datafile or prefab file and back. This file can then either be added to the ship list (in a player market or admin adds it to npc market) or utilized in any server travel facility we subsequently add.

6: Showroom option. Ability to inspect ship before purchase; either with a static indestructible version or a scaled projection/ghost of the ship. Projection could also be used to place it (expanding on point 1)

7: Show in LCD option. Way to make the current existing ship selling system list for sale ships on an LCD too. Possibly as an area check for in-range ships for sale within NPC/Player zones, or better yet for sale ships could be "jumped" to the new ship buy/spawn zone (as used by prefab purchases) when bought from an LCD - in which case we simply list ALL ships for sale in the server on any shipyard lcd; they don't need to be nearby. That seems a fair compromise. We could treat trade zones like the same "teleport tech" used for parts can also move any ship in the current sector as our "plot explanation" Description would be ship name.

8: expanding on point 7 - players own ships for sale could show in their own trade zone ship lcd, while all ships show on NPC ship lcds. Ships sold via NPC market get charged a "fee" paid to the NPC. Possibly also allow some way for players to list ships only in a specific market (for players acting as "shipyard" used ship salesmen - offering to sell ships for players - in which case that player not the NPC gets the "fee" and it isn't listed in the NPC market)

jpcsupplies commented 7 years ago

1+3+7 are my favorite btw. 2 is also pretty cool.

4 scares me but a few people asked for it

5 would be convenient

6 seems overkill

8 seems fairest for player merchants