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

Topics and discussion about specific mods
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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
Attachments
barter_0.8.1.zip
(61.66 KiB) Downloaded 355 times
User avatar
Devildog
Fast Inserter
Fast Inserter
Posts: 170
Joined: Tue Aug 19, 2014 8:19 pm
Contact:

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

Post 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.
Last edited by Devildog on Sat Jun 27, 2015 10:17 pm, edited 4 times in total.
Image
Check Out Factorio Mod Madness 2.0 Here : http://bit.ly/1afTDl0
Mod Madness ModPack
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

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

Post 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%.
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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 :)
User avatar
xnmo
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Wed Sep 17, 2014 8:44 pm
Contact:

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

Post 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:
Lumikins
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Sep 13, 2014 4:22 am
Contact:

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

Post 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.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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.
osuf
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 14, 2014 10:25 am
Contact:

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

Post 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.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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 :)
Larmantine
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Oct 10, 2014 9:39 pm
Contact:

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

Post 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?
Larmantine
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Oct 10, 2014 9:39 pm
Contact:

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

Post 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?
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

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

Post 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.
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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})
Larmantine
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Oct 10, 2014 9:39 pm
Contact:

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

Post by Larmantine »

Great, it works!

Thanks, am very excited.
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

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

Post by dee- »

Hm, I experienced this:

Image
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

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

Post 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
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

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

Post 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.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

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

Post 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.
omega_haxors
Inserter
Inserter
Posts: 42
Joined: Sun May 24, 2015 9:08 am
Contact:

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

Post 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.
Post Reply

Return to “Mods”