Name: Economy
Summary: This module aims to provide a very generic framework to simulate an economy with consumers and producers. On top of that however, it provides a robust method to share/trade/exchange resources between entities. It does so under a very libertarian credo: Use any storage component you want.
Curator: Cpt. Crispy Crunchy
Location: https://github.com/Terasology/Economy
In order to simulate the population on a resource level I needed a solid market system. After a long 2-3 hours of discussion with @Cervator (thanks again for that! ) the system transcended into something uhh quite bigger. Now, while I can't fathom all the ramifications of it yet I hope that someone will find it useful.
As a simple use-case, it could provide conversion between two modules. In MC terms it could provide the conversion between BuildCraft energy and storages to IndustrialCraft energy and storages, but it could also provide compatibility to any other mod with custom storage and energy.
However, at the same time it can provide the mechanism involved to build a furnace block, inclusive of the processing of the burning material, the energy created from that, the actual raw item and the final product.
Additionally, you could set up a handler for multi-entity distributed storages. Send an item to a warehouse and the system could distribute it to the individual entities.
How does it do that? I prepared a little diagram to hopefully make it clearer than I could describe it with words:
(Formatting in this forum seems to be a bit messed up for me atm I'll have to just post the link)
https://github.com/Terasology/Economy/blob/master/marketsystem.jpg
So in order to use the module for your system you would just have to write the handler and register it in the StorageHandlerLibrary. The handler will tell the economy module how to interact with your system and translate the abstract resource packages into the actual items used by your module. The internal representation of resources just uses a Map<String resource type, Integer amount> for easy serialization and conversion.
Ah and it searches in all registered storage components in an entity when a resource package is requested!
Now, the current version was put together in one day and needs therefore a lot more of testing. Nonetheless, the basic idea and methods seem to work so far .
Todo list:
In the upcoming week, I'll hopefully work a bit with @rzats's nui-editor to fashion a simple market interface to provide player interaction . Though I'm not quite sure if that will make it in this more generic module or in the DynamicCities module.
Summary: This module aims to provide a very generic framework to simulate an economy with consumers and producers. On top of that however, it provides a robust method to share/trade/exchange resources between entities. It does so under a very libertarian credo: Use any storage component you want.
Curator: Cpt. Crispy Crunchy
Location: https://github.com/Terasology/Economy
In order to simulate the population on a resource level I needed a solid market system. After a long 2-3 hours of discussion with @Cervator (thanks again for that! ) the system transcended into something uhh quite bigger. Now, while I can't fathom all the ramifications of it yet I hope that someone will find it useful.
As a simple use-case, it could provide conversion between two modules. In MC terms it could provide the conversion between BuildCraft energy and storages to IndustrialCraft energy and storages, but it could also provide compatibility to any other mod with custom storage and energy.
However, at the same time it can provide the mechanism involved to build a furnace block, inclusive of the processing of the burning material, the energy created from that, the actual raw item and the final product.
Additionally, you could set up a handler for multi-entity distributed storages. Send an item to a warehouse and the system could distribute it to the individual entities.
How does it do that? I prepared a little diagram to hopefully make it clearer than I could describe it with words:
(Formatting in this forum seems to be a bit messed up for me atm I'll have to just post the link)
https://github.com/Terasology/Economy/blob/master/marketsystem.jpg
So in order to use the module for your system you would just have to write the handler and register it in the StorageHandlerLibrary. The handler will tell the economy module how to interact with your system and translate the abstract resource packages into the actual items used by your module. The internal representation of resources just uses a Map<String resource type, Integer amount> for easy serialization and conversion.
Ah and it searches in all registered storage components in an entity when a resource package is requested!
Now, the current version was put together in one day and needs therefore a lot more of testing. Nonetheless, the basic idea and methods seem to work so far .
Todo list:
- add negative number checks to protect against exploitation
- more testing
- market interface
In the upcoming week, I'll hopefully work a bit with @rzats's nui-editor to fashion a simple market interface to provide player interaction . Though I'm not quite sure if that will make it in this more generic module or in the DynamicCities module.
Last edited: