[MOD 0.13] Black Market (sell and buy on the market)

Topics and discussion about specific mods
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

As a possible solution or just yet another idea about pricing (pseudocode):
Sorry but your simple recursive solution won't work mainly because of loops in recipes. Go deeper into the code if you want to understand why, or try to code by yourself. I cannot go further here. But believe me, the problem is more complex.
Btw, in my previous last screenshot hidden groups still present in BM GUI, or i miss something?
The API do not provide ways to detect hidden groups yet. So all groups are shown. But there is a solution, so I will work on this.
My mods on the Factorio Mod Portal :geek:
danymatrix
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Aug 10, 2016 11:36 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by danymatrix »

please, can u upload 1.0.22 here? thanks in advance.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

danymatrix wrote:please, can u upload 1.0.22 here? thanks in advance.
It is available ingame. Please buy this game if you did not already. Dev team deserves it. :)
BlackMarket_1.0.22.zip
(1.15 MiB) Downloaded 116 times
My mods on the Factorio Mod Portal :geek:
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

Don't know if this was said already and I'm too lazy to read all those pages of post, but it would be nice if you could set the accumulator to only sell energy if it's day.
Since solar panel are kinda cheaper than accumulator to produce, it would be fun to set a lot of solar panel and sell the extra energies during day.

edit: I supose I could set the solar panel and the trading accumulator on their own grid tho :\
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

devilwarriors wrote:Don't know if this was said already and I'm too lazy to read all those pages of post, but it would be nice if you could set the accumulator to only sell energy if it's day.
Since solar panel are kinda cheaper than accumulator to produce, it would be fun to set a lot of solar panel and sell the extra energies during day.

edit: I supose I could set the solar panel and the trading accumulator on their own grid tho :\
My next step is to add circuit network commands to traders.
For example to enable/disable automatic trading.
So, combined with my timetools clock combinator, you would be able to command sales only on day, or with a minimum "lightness".

I don't want to make it automatic because some people are selling non-solar energy and don't want this day/night behaviour.
My mods on the Factorio Mod Portal :geek:
mavzor
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue May 06, 2014 11:03 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by mavzor »

http://www.offworldgame.com/

prices should change on supply, demand, and consumption

You will radically change the depth of your mod if you implement this.

http://www.designer-notes.com/?p=114
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

binbinhfr wrote:
devilwarriors wrote:Don't know if this was said already and I'm too lazy to read all those pages of post, but it would be nice if you could set the accumulator to only sell energy if it's day.
Since solar panel are kinda cheaper than accumulator to produce, it would be fun to set a lot of solar panel and sell the extra energies during day.

edit: I supose I could set the solar panel and the trading accumulator on their own grid tho :\
My next step is to add circuit network commands to traders.
For example to enable/disable automatic trading.
So, combined with my timetools clock combinator, you would be able to command sales only on day, or with a minimum "lightness".

I don't want to make it automatic because some people are selling non-solar energy and don't want this day/night behaviour.
maybe a checkbox to only sell when the global accumulator charge is full, so when it's not checked it behave like normal but you when check it, it will only sell when all normal accumulator are full and you're currently wasting solar energy since there no place to store it.

Can you get current accumulator charge from the circuit network? Maybe I could put the trading accumulator on their own grid and only open the switch when it's full.

edit: seem like that would be possible but I would have to connect every accumulator to the network and then do (number of accu * 100) since they output in percentage.. it's tedious work when you accumulator are all over the place like me. You don't happen to know of a mod that do like your timetools clock combinator but output the current total accumulator charge instead?
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

one more thing :P

using on_entity_settings_pasted you could make it so you can copy/paste the time period of accumulator to each other, to make this less of pain to do.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

maybe a checkbox to only sell when the global accumulator charge is full, so when it's not checked it behave like normal but you when check it, it will only sell when all normal accumulator are full and you're currently wasting solar energy since there no place to store it.
There is no difference between the trading accu and the "normal" accu. Factorio takes care about their charging/discharging commands. So I cannot make my accu wait for other "normal" accus to be full before charging itself.

> Can you get current accumulator charge from the circuit network?

I don't know. And I don't know any way for the API to read the global accu charge or global electrical infos in general (I would like it).

For the moment, I could add a checkbox for selling energy only at daylight. But it would not change a lot of thing, because my selling accu is not discharging at night. I put a nul output on it. So it keeps energy for selling only. And when night arrives, it just kept its energy, waiting for next daylight to sell and recharge.

EDIT I never saw this on_entity_settings_pasted event before ! Good idea. I'll do it for every trader.
EDIT 2 : alas this event does not seem to be triggered on entities that are not supposed to be copied. Work on chests for example, but not on accus... :cry:
But I will make the default period equal to the default period in the main menu. It will help.
Last edited by binbinhfr on Sat Aug 20, 2016 10:28 pm, edited 3 times in total.
My mods on the Factorio Mod Portal :geek:
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

mavzor wrote:prices should change on supply, demand, and consumption
You will radically change the depth of your mod if you implement this.
I like your emphasis :-)

Prices already change on supply and demand (sales and purchases).
But I do not understand how consumption is supposed to influence prices ? If a player mines iron, creates and then consumes a lot of iron-plates, what should happen ? If he does this process on his own planet, in his own factory, it's only a local process : the universal black market won't be aware about it, and prices won't change...
My mods on the Factorio Mod Portal :geek:
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by Airat9000 »

binbinhfr wrote:
mavzor wrote:prices should change on supply, demand, and consumption
You will radically change the depth of your mod if you implement this.
I like your emphasis :-)

Prices already change on supply and demand (sales and purchases).
But I do not understand how consumption is supposed to influence prices ? If a player mines iron, creates and then consumes a lot of iron-plates, what should happen ? If he does this process on his own planet, in his own factory, it's only a local process : the universal black market won't be aware about it, and prices won't change...
dynamic prices in fix please

a very long time there is one price for sale .. as soon as the price changes? and goes up if you do not sell ..??
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

Airat9000 wrote:dynamic prices in fix please
a very long time there is one price for sale .. as soon as the price changes? and goes up if you do not sell ..??
... not easy to understand.
If anyone on the map sells a lot, prices are going down to x0.5.
If anyone on the map buys a lot, prices are going up to x2.
Both effects can be mixed.
If everybody stop selling and buying, the price slowly returns to its normal value.
My mods on the Factorio Mod Portal :geek:
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by Airat9000 »

binbinhfr wrote:
Airat9000 wrote:dynamic prices in fix please
a very long time there is one price for sale .. as soon as the price changes? and goes up if you do not sell ..??
... not easy to understand.
If anyone on the map sells a lot, prices are going down to x0.5.
If anyone on the map buys a lot, prices are going up to x2.
Both effects can be mixed.
If everybody stop selling and buying, the price slowly returns to its normal value.

If anyone on the map sells a lot, prices are going down to x0.5.
understand

If anyone on the map buys a lot, prices are going up to x2.
understand
Both effects can be mixed. - who is day? hours?

and find bugs
1.0.22 - items in lost!

1.0.20 - normal works in items
Attachments
bandicam 2016-08-21 01-43-23-081.jpg
bandicam 2016-08-21 01-43-23-081.jpg (143.23 KiB) Viewed 7572 times
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

> Both effects can be mixed. - who is day? hours?

prices are updated every day at 12:00

> and find bugs 1.0.22 - items in lost! 1.0.20 - normal works in items

please give me the precise name of the items that have value 0. The icon of your screencopy is not enough...
My mods on the Factorio Mod Portal :geek:
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by Airat9000 »

binbinhfr wrote:> Both effects can be mixed. - who is day? hours?

prices are updated every day at 12:00

> and find bugs 1.0.22 - items in lost! 1.0.20 - normal works in items

please give me the precise name of the items that have value 0. The icon of your screencopy is not enough...
substation mk4
assembling machine mk6
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

binbinhfr wrote: EDIT 2 : alas this event does not seem to be triggered on entities that are not supposed to be copied. Work on chests for example, but not on accus... :cry:
But I will make the default period equal to the default period in the main menu. It will help.
ahhh too bad, it would still be nice if you could make the buy chest support it. Copy/paste the period an the items being ordered.
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

You could probably support copy pasting those value when you do blueprint tho, so you could use a blueprint to place a lot of accumulator that already have their order maxed so you don't have to set them all one by one.
They don't hold much power so you need a lot to do any meaningful trading of power.
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by devilwarriors »

another idea to make this easier, when you select one of the trade entity you could show a lite version of that entity gui just to pick the default value for period, automation, order, etc and then give those value to any entity placed after that.

you could use on_player_cursor_stack_changed to detect that the player is trying to place one of your entity (if the player is suddenly holder a stack of trading accumulator you know that he's about to place one down, when that event trigger and the cursor is suddenly empty, you check if you have a gui open and close it).
mavzor
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue May 06, 2014 11:03 am
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by mavzor »

binbinhfr wrote:
mavzor wrote:prices should change on supply, demand, and consumption
You will radically change the depth of your mod if you implement this.
I like your emphasis :-)
Thank you.

I included what I think is a good article from a developer on game economics.
I also suggest the example of Soren Johansen's Offworld Trading Company as an excellent example of this.
http://offworldtradingcompany.gamepedia.com/Market
But I do not understand how consumption is supposed to influence prices ?
The colony also acts as demand on the market.
http://offworldtradingcompany.gamepedia.com/Colony
And the market has its own pricing forces.

Is this simple? No.
Soren and his team spent years designing and balancing their work.
Should you choose to go down this path, through process of implementing this you will learn a great deal about balance, economics, and game design.

And that will be lasting value for you and your career far beyond this project.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Black Market (sell and buy on the market)

Post by binbinhfr »

> I included what I think is a good article from a developer on game economics.
I also suggest the example of Soren Johansen's Offworld Trading Company as an excellent example of this.
http://offworldtradingcompany.gamepedia.com/Market

it says :

> Apart from the differences based on the number of players in a game, or the changes when a resource hits a price of $101, $201, etc..., the market works on a simple supply and demand model. Produce too much of a resource, and the price will eventually diminish.

as I told you, it is already what I am doing. "a simple supply and demand model"
I just do not use nb_players because in factorio this is not a relevant number : on public MP maps, you have a lot of players "subscribed", but not a lot of players at the same time. Factorio is far from a MMO. Most players plays single.

> The colony also acts as demand on the market.
http://offworldtradingcompany.gamepedia.com/Colony

I do not know this game, and I do not understand what relies behind this concept of "colony". It seems a wider concept, simulating faked people living on the same map. Nothing comparable to factorio, where you are supposed to be alone on your planet.

> And the market has its own pricing forces.

We already speak in previous posts that I could add some kind of random fluctuations to the market. But as Factorio API do not provide any graphical display (curves, etc...), it would be a pain for players to try to study/follow these prices variations and optimize sales/purchases, and at the end, people will give up, using fully automatic trading (remember taht factorio is about automation : user should not have to choose trading options every day). So I would implement complex routines for nothing. I think I won't go into this. Moreover, all these routines needs a lot of calculations and could slow down the game (I have the case with my Efficiensee mod that cannot work continously without slowing down the game, even with optimisations). Factorio mod API was not designed for such large calculations.
And that will be lasting value for you and your career far beyond this project.
My career ??? You know that I am not part of the Factorio team at all ? I am no game designer. I just have a few computer skills that I use for my pleasure, and in this case sharing the result with factorio community. By luck, I have a "classical" job for living, because Factorio costs me €20, but did not return anything :-D
Last edited by binbinhfr on Sun Aug 21, 2016 8:35 am, edited 1 time in total.
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Mods”