Page 1 of 1

[MOD 0.10.x] Barter mod [v0.8.1]

Posted: Thu Oct 23, 2014 5:34 am
by Xecutor
So, you have this big shiny factory that could mass produce rocket defence, if it was possible. But now you don't know what to do with all this goodies?
Then this mod is for you! Sell high tier items to get their cost in raw resources, with some bonus, back.
Then build more factories, produce more goods, sell more goods, BUILD MORE FACTORIES, PRODUCE MORE GOODS... MUA-HA-HA!!!

Or may be your heart is teared apart by obsolete stuff in trash chest that is lying around aimlessly?
Gun turret with tail made of clips crawls to you in your nightmare and hisses 'WHAT A WASSSSSSSSTE OF RESSSSSSOURCES!!!".
Than you can use this mod to exchange obsolete stuff for raw resources this stuff was made of!

With this mod you will get Barter technology that depends on Flying.
Immediately after researching this technology you will get two chests - Export chest and Import chest.
Two times a day all items from all export chests are converted into raw resources (ores) they are made of and placed into import chests.
Once logistic network is researched, you will be able to make Logistic export requester chest and Logistic import passive provider chest.

How exchange works:
For each crafting step you get 105% of resources used in crafting plus 1% for each second of base crafting time.
For example for iron plate you will get 105%+3.5%=108.5% of ore back (rounded down).
But for the same iron plate as part of electronic circuit you will get 108.5%*105%=113.925% of ore.

Items that have lubricant as their component cannot be sold.
Plastic is not decomposed further.
Sulfuric acid is decomposed into sulfur and iron.
Water is ignored.

Whoever you trade with, are quite greedy bastards and they think, that import chests overflow is your problem :)
Export is processed by chests then by item types. If cost of all items of current item type in current chest doesn't
fit into import chests then barter is stopped, but you loose excessive resources.
For modders

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Thu Oct 23, 2014 6:57 pm
by Devildog
Wish it was a market with high/low demand/value
* High Demand making the value more and the more items after an extend of item/time it decreases to become low demand but changes over time.
but this is still cool.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Thu Oct 23, 2014 8:36 pm
by n9103
This is different.
I was expecting someone to finally roll out a mod that implemented a market, using the Coin item from the extra scenarios :p

Not sure I agree with the increase in resources, rather than decrease. Seems like it would end up being a viable tactic to just take stuff out of the chests and process it a bit and stick it back in, once production facilities were fast enough, rather than going and making any more mines.
I do like the increased return on base for time invested, but I think it would probably be a better idea (for balance purposes of course) to start at a point well below 100%.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Fri Oct 24, 2014 4:47 am
by Xecutor
My initial intent was, like you expected, make a proper market.
But I don't see how I can make it more or less convenient with current gui available in mod.
And ATM I can't legally traverse recipes in mod, so I can't generate prices from all available items and up to date ingredients.

Exchange where you gain less then you invested is ... strange?
And it's not that simple. You have no control over what goes where in import chests.
So you need some kind of sorting facility.
And it takes quite some time to empty 48 slot chest with fast inserter with maxed inserter slot bonus!
In mid game you will want 4 inserters taking out ores out of import chest into other chests with further sorting.
I can't say it trivial to setup this.
And my initial intent was to make self-sufficient factory :)

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Fri Oct 24, 2014 5:13 am
by xnmo
n9103 wrote:This is different.
I was expecting someone to finally roll out a mod that implemented a market, using the Coin item from the extra scenarios :p

Not sure I agree with the increase in resources, rather than decrease. Seems like it would end up being a viable tactic to just take stuff out of the chests and process it a bit and stick it back in, once production facilities were fast enough, rather than going and making any more mines.
I do like the increased return on base for time invested, but I think it would probably be a better idea (for balance purposes of course) to start at a point well below 100%.
Well if you got less than 100% return, what would be the point of trading? Other than selling off obsolete scraps, which while would be neat, wouldn't really change how the game is played very much.

This is a very cool idea which I hope gets developed further. Though I do think that you should be able to get different resources than the raw material of whatever product you put in. So you could sell off stuff to pay for coal to fuel your boilers, for example. Or if you could find a way to get filled barrels of oil back if you put empty barrels in. If you combine that with a mod that lets you put more types of liquids into barrels you could get payed in things like petroleum too.

And maybe there should be trading fees? Transportation costs , tariffs and insurance is bound to add up (Especially if we are talking about interstellar trade, lol!) and so should be reflected in your returns :ugeek:

Maybe there should be a chance that the transport gets robbed, and if you have insurance coverage you get your money back but otherwise nada? I'm just thinking out loud at this point, so maybe I should stop before I end up jumping in at the deep end :lol:

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Mon Oct 27, 2014 6:16 am
by Lumikins
This mod can also be mutated somewhat to become an end-game mod. Orders come in for random goods from throughout the galaxy and you need to fulfill them on time.

i.e. 50 electric engines
20 advanced processors
500 pistols
a set of power armor
230 barrels of oil
etc...

other ideas:

You're given materials which are not found ont he planet (ie dytech stuff on normal factorio worlds). You are contracted to create x amount of goods with those materials and export them before time runs out.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Mon Oct 27, 2014 6:34 am
by Xecutor
@Lumikins: I was thinking about something like this. Like one time and repeatable orders. But current mod GUI desperately needs something like ListBox, or at least something scrollable.
All my attempts at prototyping trading GUI ended up with something really clumsy and inconvenient.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Tue Jan 27, 2015 7:13 am
by osuf
Hi Xecutor,
I really enjoyed your mod and begun modifying it quite extensively to my preferences. The vision I had is that trains should be used for more than getting mined resources back to the base - there should be virtual locations to which produced goods have to be shipped, and traded goods sent back. The primary change which accomplishes this is the limiting of trade to trading posts spawned on the map. Additionally, every trading post has their own characteristics, including a limited budget/day. Early game, one should benefit from mining directly, but over time, at least with reduced resource spawns, trade should become a competitive alternative.

Some other changes include preprocessing data files to extract recipes and computing prices dynamically, providing mod support, and giving each trading post its own base values for various resources (the price of an item is computed by working out the cheapest crafting tree given base prices and costs of steps), having each trading post sell only one resource in exchange for goods (with biases towards more common resources such as ores), increasing the value of goods in general and per processing step (the best strategy is usually, 1. trade between trading posts that need each other's goods, 2. cap out budgets with simple produced goods, 3. switch to more advanced goods), trading can be done manually before unlocking the barter research (by dropping goods into the trading posts which act as containers), and trading-post budgets growing with trade (though not fast enough that one can focus on only a few trading posts).

Naturally, my changes are building on your mod, which is your property, so I am curious whether we could discuss, via email or so (I cannot PM yet im afraid), whether you might accept these changes as a mod mod, update, or similar.
Images
Thanks for your time.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Wed Jan 28, 2015 7:38 am
by Xecutor
Since it's a major overhaul, I think it's better to branch off your work into a different mod.
I hereby give you permission to use my mod as starting point for your mod, no problems here :)

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Sat Jan 31, 2015 8:10 pm
by Larmantine
osuf wrote:Hi Xecutor,
I really enjoyed your mod and begun modifying it quite extensively to my preferences. The vision I had is that trains should be used for more than getting mined resources back to the base - there should be virtual locations to which produced goods have to be shipped, and traded goods sent back. The primary change which accomplishes this is the limiting of trade to trading posts spawned on the map. Additionally, every trading post has their own characteristics, including a limited budget/day. Early game, one should benefit from mining directly, but over time, at least with reduced resource spawns, trade should become a competitive alternative.

Some other changes include preprocessing data files to extract recipes and computing prices dynamically, providing mod support, and giving each trading post its own base values for various resources (the price of an item is computed by working out the cheapest crafting tree given base prices and costs of steps), having each trading post sell only one resource in exchange for goods (with biases towards more common resources such as ores), increasing the value of goods in general and per processing step (the best strategy is usually, 1. trade between trading posts that need each other's goods, 2. cap out budgets with simple produced goods, 3. switch to more advanced goods), trading can be done manually before unlocking the barter research (by dropping goods into the trading posts which act as containers), and trading-post budgets growing with trade (though not fast enough that one can focus on only a few trading posts).

Naturally, my changes are building on your mod, which is your property, so I am curious whether we could discuss, via email or so (I cannot PM yet im afraid), whether you might accept these changes as a mod mod, update, or similar.
Images
Thanks for your time.
Holy crap man. Could you post a link with this?

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Wed Feb 11, 2015 1:16 pm
by Larmantine
Hi Xecutor,

I'm getting the following error:

Error while running the event handler: __barter__/control.lua:37: LuaGameScript doesn't contain key gettext.

that probably is because I use 11.x version. Is there a quick fix in the control.lua that would make it run on 11.x version?

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Wed Feb 11, 2015 5:58 pm
by n9103
I would say it's very doubtful that making this compatible with later .11.x versions could be described as either fast or easy.
Even updates within .11.x versions can be more difficult than expected.

That being said, I'm not the author, or overly familiar with this code.
I think most fans are still waiting/hoping osuf will release his version.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Fri Feb 13, 2015 7:10 am
by Xecutor
Larmantine wrote:Hi Xecutor,

I'm getting the following error:

Error while running the event handler: __barter__/control.lua:37: LuaGameScript doesn't contain key gettext.

that probably is because I use 11.x version. Is there a quick fix in the control.lua that would make it run on 11.x version?
Replace line 37 in control.lua with this:

Code: Select all

game.player.print({msg})

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Sun Feb 15, 2015 11:06 am
by Larmantine
Great, it works!

Thanks, am very excited.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Sun Feb 15, 2015 1:04 pm
by dee-
Hm, I experienced this:

Image

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Sun Feb 15, 2015 7:19 pm
by dee-
Okay, I fiddled around with the mod and, as nice as the idea is, it's in a quite broken state and needs serious attention.

I am a total LUA noob and have 0.01% knowledge of the factiorio LUA API but I still figured those things out:
- not blueprint compatible. Placing/removing with bots results in internal data corruption! Do NOT use bots to place or remove chests, it causes items to disappear to simply bug out.
- using game.player.print({msg}) as stated above just fixes the game print but also is in 90% of the calls just wrong as the curly braces may not be used on normal text prints as they resolve text string keys

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Sun Feb 15, 2015 10:04 pm
by dee-
I'm currently updating the core code to be compatible with 0.11.x, bot-awareness and other fixes.
If Xecutor accepts the changes there will be a new version (it's ready at my desktop).
MP testers sought.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Mon Feb 16, 2015 7:51 am
by Xecutor
dee- wrote:Okay, I fiddled around with the mod and, as nice as the idea is, it's in a quite broken state and needs serious attention.

I am a total LUA noob and have 0.01% knowledge of the factiorio LUA API but I still figured those things out:
- not blueprint compatible. Placing/removing with bots results in internal data corruption! Do NOT use bots to place or remove chests, it causes items to disappear to simply bug out.
In 0.10 required event wasn't available. Thanks for fixing this.
dee- wrote: - using game.player.print({msg}) as stated above just fixes the game print but also is in 90% of the calls just wrong as the curly braces may not be used on normal text prints as they resolve text string keys
Aside from debug messages, all text that is being displayed to player must be localized text, hence curly braces.
For the sake of debug output another function must be added.
dee- wrote:I'm currently updating the core code to be compatible with 0.11.x, bot-awareness and other fixes.
I quickly peeked into your recipes changes and I'm not entirely sure that I support them.
Originally there were 2 (two) iron chests in receipt. So capacity increase was justified.
Having 2 steel chests resulting in one chest with the same capacity as one steel chests seems strange.
Smart chests already have advanced circuit in them. The idea was - remaking them into import/export chests is just the matter of slight reprogramming :)

Anyway, thank you for your interest in the mod and for your support.
I'll look into your changes more carefully a little later.

Re: [MOD 0.10.x] Barter mod [v0.8.1]

Posted: Fri Jun 19, 2015 3:34 am
by omega_haxors
This has potential to be an excellent gameplay addition to any game if the following is addressed:

The market needs to be dynamic. If it's just a flat 110% return rate, then people are just going to abuse it to dupe for resources. This isn't bad on its own, but when people build over half of their factory just to mass produce some almost-worthless item it becomes a whole lot less appealing for everybody involved.

Everything should have a base value (based on return value) multiplied by a %-based arbitrary value. Then, to keep the game fresh, there will be a modifier based on Supply and Demand, with a bit of randomization involved.

Items that are consumable like fish and ammo will hold its value VERY well and sways very little while items that you generally only need one of, such as power armor Mk2, would spike and dip chaotically. The more consumable the item is, the "heavier" it is in the market, and the more resistant to change it would be. To keep things even more interesting, there could even be a market crash, which causes the value of everything to tank. This would obviously only go off either on a very rare probability, or if abuse is detected in the market such as Buying/selling only a few items or producing an extreme amount of profit off a few item.

Also, implementing the Coin and Market would be a real selling point for pretty much the entire player-base, IMO. Being able to buy whatever is needed regardless of research would allow for a lot of freedom for the player if they are willing to pay the price, and would make an amazing reward for those that are able to game the market without causing it to crash.

Taxes and Fines would be a great addition as well, encouraging you to dodge taxes like a true 1%er and discouraging you from ruining the environment in the process.