jpcsupplies / Economy_mod

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

Complex items and gas #64

Open midspace opened 9 years ago

midspace commented 9 years ago

Need to change how we price complex objects like oxygen bottles to be inclusive of their content. Gas looks to be a new feature as Hydrogen has been hinted at in game. When buying bottles from the market, they should always be sold as full. When selling or trading bottles, their volume needs to be taken into account in valuation.

We may need to expand the market item definition to include volume as well as adding gas definitions to the table to get a value. See "GasProperties.sbc"

jpcsupplies commented 9 years ago

I noticed hydrogen in the item definitions.. along with organics. i suspect keen may be bowing to pressure to make rockets more realistic; and making them burn fuel instead of uranium. How they plan players to mine it is the question.. probably a hydrogen collector, if the physics inquisition have any say it will probably consume oxygen and organics too. Last update also appeared to remove the grass and flowers, my greenhouse under blue mining looks like green slime since the last update.. might just be a dx9 vs dx11 thing ill test that out later.

The oxygen bottles issue did occur to me, but I cant see an obvious way to detect gas levels in the bottles. At the moment if i sold a full one and bought it back it would likely be empty.

midspace commented 9 years ago

Oxygen and Hydrogen are defined as GasProperties. There is a Display definition for Hydrogen Tank. The FuelId indicates it'll be a fuel of some type.

How it'll be collected, I'm not sure. Lots of guesses we'll extract it from Ice along with Oxygen. HudCharacterInfo has a HydrogenRatio. Possibly indicating the the player can use hydrogen for the jetpack.

I'm most worried about selling and buying Bottles filled with it, and it's value. Oxygen would be a valuable commodity, so full bottles should be world more than empty bottles.

How much ice does it take to fill a oxygen bottle? Any idea?

jpcsupplies commented 9 years ago

Hard to say. You get 2 "hits" which fill your player Air supply fully twice. So the bottles contain 200% of whatever a fully gased player can carry.. whatever that is. Might need to do some more research here.. from memory oxygen is always listed as a percentage of full on containers confusing matters.. (not that my memory is any sort of authority on the topic! ha) - as i recall it took several thousand ice ore to fully fill my station oxygen tank last.. so potentially it could be quite expensive based on our scarcity/wastage/demand default price table.

jpcsupplies commented 9 years ago

see also #66

jpcsupplies commented 8 years ago

We might be able to cheat here... if we increase the bottle retail price to be cost of bottle plus gas, that fixes one side.

Then we only need to detect how full a bottle is when it is sold to set the buy price.

midspace commented 8 years ago

Increasing the buy price. Good idea. Detecting the volume shouldn't be a problem.

midspace commented 8 years ago

At the moment, I have no way of loading the gas definitions from the API. So it has to be manually entered.

jpcsupplies commented 8 years ago

Ok so i need to work out how much ice is needed to fill a bottle and increase retail price by that.. that's one half of the issue. Does the API issue mean you cant read how full a bottle is?

midspace commented 8 years ago

The definitions of bottles, and their maximum volume are accessible along with the current volume of an item.

Its the gas definition which isn't available.

jpcsupplies commented 8 years ago

i dont think it should hurt much we just need to know roughly how much ice makes how much gas and price appropriately then i dont think gas is a real item per-se just yet, as far as i can see its more like a trait

jpcsupplies commented 8 years ago

This is basically similar to #111 in implementation - although refuelling was under the assumption of a penalty fee for a quicker refuel. (i notice however as of last update stockpile on tanks has some interesting behavior when docked on a station with full fuel tanks which gives this effect indirectly now)

I notice we can price quote gases and such, can we buy and sell them yet ? I couldn't get that to work when I tested it last either way.

My Europa fuel base actually fills my hydrogen tanks now if I dock on it, which is cool.

midspace commented 7 years ago

This is blocked currently. gas Definitions are available (via a work around) which has been implemented. However, tank levels cannot be changed via the API. Either removing or filling them with gases.

https://github.com/jpcsupplies/Economy_mod/blob/6963a46888e67d8d2336cd49c35a6012d1d170ac/Economy/Data/Scripts/Economy.scripts/Messages/MessageBuy.cs#L116

jpcsupplies commented 7 years ago

Hmm can we detect how full they are tho? If so, we could merge this issue with #111.

Example: We name a gas tank as [fuel] or [economy] or similar. We monitor its gas level. If a player docks with any station attached to this gas tank with that name, and the tanks significantly get drained, and the players tanks significantly fill up, we automatically charge the docked player a "refuel" charge. Same could work in reverse, if a player docks and empties his tanks to refill the station tank; they get paid for the fuel. Could possibly be tied to the operation (if it can be caught by modapi) of the "stockpile" toggle option, which currently allows players to easily move gas between tanks. All we really need to do is be able to detect the changes in gas levels; without needing to actually touch the gas levels in any way. Could work on hydrogen or oxygen.