[Mod] Currency and economy [currency][0.1]

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

[Mod] Currency and economy [currency][0.1]

by Dan Duncombe » Post

Currency and Economy mod
Image

Provides shops, barter tables, safes, and three denominations of currency, called "Minegeld".

License: WTFPL

Dependencies: default/nothing specific.

Download: See below

Screenshots:
Image
The basic unit of currency, called Minegeld.
Image
A barter table. Each party to the trade places items at one side or the other in the upper part of the table. Press "start" to begin the exchange.
Image
Similar to a barter table, but automated.
Image
A safe - basically a locked chest with a different texture.
Attachments
currency.zip
(75.1 KiB) Downloaded 1301 times
Last edited by Dan Duncombe on Sun Nov 24, 2013 20:28, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Brief update- barter table and tweaked Minegeld texture.
EDIT: If you downloaded version 2, try again,I corrected the Mg texture (again)
Last edited by Dan Duncombe on Fri Aug 23, 2013 12:32, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

jin_xi
Member
Posts: 165
Joined: Mon Jul 02, 2012 18:19

by jin_xi » Post

Dan Duncombe wrote:This is a money mod that is different to the others, because it uses actual craftitem money, meaning admins can't fiddle with your accounts in some file somewhere.
wut?

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

jin_xi wrote:
Dan Duncombe wrote:This is a money mod that is different to the others, because it uses actual craftitem money, meaning admins can't fiddle with your accounts in some file somewhere.
wut?
Instead of having all your money stored in a file the admin can edit, you keep your money somewhere in a safe or something and the admin can't just open a file and set your money to -400 or something.
Last edited by Dan Duncombe on Fri Aug 23, 2013 18:31, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Dan Duncombe wrote:Instead of having all your money stored in a file the admin can edit, you keep your money somewhere in a safe or something and the admin can't just open a file and set your money to -400 or something.
O RLY?
Last edited by kaeza on Fri Aug 23, 2013 18:54, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

Dan Duncombe wrote: Instead of having all your money stored in a file the admin can edit, you keep your money somewhere in a safe or something
and the admin can't just open a file and set your money to -400 or something.
The admin could open your player file and remove any money in your inventory or sacks. An admin wanting to mess with their players enough to edit their money file probably wouldn't have a problem "worldediting" your chests full of money out of existence either.

This does seem like a cool mod though. If I were you I would increase the stack_max on currency:minegeld, so you could carry more than 99 minegeld in one inventory slot. At the default stack_max of 99 if somebody wanted to sell something for 100,000 minegeld that would require 1010 inventory slots full of minegeld.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

BrandonReese wrote:
Dan Duncombe wrote: Instead of having all your money stored in a file the admin can edit, you keep your money somewhere in a safe or something
and the admin can't just open a file and set your money to -400 or something.
The admin could open your player file and remove any money in your inventory or sacks. An admin wanting to mess with their players enough to edit their money file probably wouldn't have a problem "worldediting" your chests full of money out of existence either.

This does seem like a cool mod though. If I were you I would increase the stack_max on currency:minegeld, so you could carry more than 99 minegeld in one inventory slot. At the default stack_max of 99 if somebody wanted to sell something for 100,000 minegeld that would require 1010 inventory slots full of minegeld.
To do this do I just add stack_max = 100000, or stack_max = "100000",
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

Dan Duncombe wrote:To do this do I just add stack_max = 100000,   or stack_max = "100000",
Yeah so your craftitem definition would be

Code: Select all

minetest.register_craftitem("currency:minegeld", {
    description = "Mine-Geld",
    inventory_image = "minegeld.png",
        stack_max = 100000
})

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

BrandonReese wrote:
Dan Duncombe wrote:To do this do I just add stack_max = 100000,   or stack_max = "100000",
Yeah so your craftitem definition would be

Code: Select all

minetest.register_craftitem("currency:minegeld", {
    description = "Mine-Geld",
    inventory_image = "minegeld.png",
        stack_max = 100000
})
Thanks. 'parently the max stack limit is 65535
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Casimir
Member
Posts: 1204
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

basic income

Code: Select all

players_income = {}

local timer = 0
minetest.register_globalstep(function(dtime)
    timer = timer + dtime;
    if timer >= 720 then --720 for one day
        timer = 0
        for _,player in ipairs(minetest.get_connected_players()) do
                local name = player:get_player_name()
                if players_income[name] == nil then
                    players_income[name] = 0
                end
                players_income[name] = 1
                print("[currency] basic income for "..name.."")
        end
    end
end)

minetest.register_on_dignode(function(pos, oldnode, digger)
    if not digger then return end
    local name = digger:get_player_name()
    if players_income[name] == nil then
        players_income[name] = 0
    end
    if players_income[name] > 0 then
        count = players_income[name]
        local inv = digger:get_inventory()
        inv:add_item("main", {name="currency:minegeld", count=count})
        players_income[name] = 0
        print("[currency] added basic income for "..name.." to inventory")
    end
end)
This adds a basic income of 1 Minegeld per Minetest-day. It only gets payed if the player digs something within this day. This is to prevent people just joining and standing arround.
Dan Duncombe wrote:1) The exchange shop. [...] This system means you can also trade other items
I like that part.

p.s. It would be nice to see this mod on a server.
Last edited by Casimir on Fri Aug 23, 2013 19:36, edited 1 time in total.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Casimir wrote:basic income
This adds a basic income of 1 Minegeld per Minetest-day. It only gets payed if the player digs something within this day. This is to prevent people just joining and standing arround.

p.s. It would be nice to see this mod on a server.
Wow, thanks.Adding now! Does it cause a crash if the person's inventory is full?
Last edited by Dan Duncombe on Fri Aug 23, 2013 19:37, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Casimir
Member
Posts: 1204
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Dan Duncombe wrote:Does it cause a crash if the person's inventory is full?
No. But the money does not get added.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Casimir wrote:
Dan Duncombe wrote:Does it cause a crash if the person's inventory is full?
No. But the money does not get added.
Okay,thanks loads :)
PS: How do I change the amount given?
Last edited by Dan Duncombe on Fri Aug 23, 2013 19:48, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Casimir
Member
Posts: 1204
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Added variables for this.

Code: Select all

players_income = {}

local amount = 1
local time = 720

-- per time grant each player amount of money
local timer = 0
minetest.register_globalstep(function(dtime)
    timer = timer + dtime;
    if timer >= time then --720 for one day
        timer = 0
        for _,player in ipairs(minetest.get_connected_players()) do
                local name = player:get_player_name()
                if players_income[name] == nil then
                    players_income[name] = 0
                end
                players_income[name] = amount
                print("[currency] basic income for "..name.."")
        end
    end
end)

-- when diging pay off the granted amount of money
minetest.register_on_dignode(function(pos, oldnode, digger)
    if not digger then return end
    local name = digger:get_player_name()
    if players_income[name] == nil then
        players_income[name] = 0
    end
    if players_income[name] > 0 then
        count = players_income[name]
        local inv = digger:get_inventory()
        inv:add_item("main", {name="currency:minegeld", count=count})
        players_income[name] = 0
        print("[currency] added basic income for "..name.." to inventory")
    end
end)

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Update- 0.3
Texture for Minegeld is fixed
Barter table has an inventory image texture
You get a basic income of 1 Minegeld per day, so long as you dig at least 1 node per day- this (helps to) prevent people just logging on a getting money for being AFK
Money can now be stacked up to 30,000
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Maybe you could have some recipe to turn gold into money. Or some machine.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Update 0.4:
  • New Minegeld Texture
  • Added craftable stacks of 5 and 10 Minegelds
  • Moved to Github
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

I want it uncraftable.
I do not want the players to assemble.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

brunob.santos wrote:I want it uncraftable.
I do not want the players to assemble.
Just remove the crafting code for each item then.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Oh and also, update to V0.5

New: Income can also be gained when nodes are placed, as well as dug.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

I made some changes! Looks good!
Image
Image
Last edited by BrunoMine on Wed Oct 16, 2013 18:29, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

brunob.santos wrote:I made some changes! Looks good!
Image
I see that you changed the shop and safe textures.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Casimir
Member
Posts: 1204
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

(Note: the following is only making a subtle change in the actual game play and is at this state just theoretical, but it is an important step to my longterm goal of enabling unmoderated but beautiful servers.)
I stated that I will invent ways to do both, a demurrage and a basic income for the currency. Income is already done, and just now I had the idea on how to make something to partly replace the need of a demurrage.
The major reason here* is inflation of the income. The income is created out of nothing, so within time there will be so much money in use that the little that is given as an income has nearly no value left. That would make the basic income useless in the fist place. The consequence is, we need some of the money to disappear.
The solution to this is a protector node, that protects a certain area (like this one but simpler) and needs money as fuel. The money it uses up just disappears and when it is used up the area becomes available to public again. But you are able to refill it any time.
This causes every player to have a guaranteed amount of land they can own (because of the income they will always have some money, and can claim some land). It also limits the total amount of land that can be owned (because the total amount of new money is limited by the number of players). And prevents big areas to be claimed and abundant forever.

* There is also the attempt to encourage the usage of the currency through the demurrage and thereby prevent hoarding money.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

Casimir wrote: The income is created out of nothing
That is not entirely true. Income is - at least with this mod - generated when a player digs or places something for the first time each MT day. There is no money given if the player is not logged in or does not dig or place anything. So it is no more or less created out of nothing than anything else withhin the game.
Casimir wrote: The solution to this is a protector node, that protects a certain area (like this one but simpler) and needs money as fuel. The money it uses up just disappears and when it is used up the area becomes available to public again. But you are able to refill it any time.
Many ideas sound good at first but do not work out or are even harmful when applied. This way of protecting land has one major drawback: The income will be activity-based (players have to log in and dig/place something), while the land will get unowned after some fixed timespan. Players will have to log in and pointlessly dig/place nodes regulary just to maintain their property. Again, under rl circumstances, that's necessary for most types of property. But MT is not rl. It's a game people play in their spare time for fun.

Plus protection is not really the same as property. Protection mods exist as a defence against griefers who would otherwise pointlessly destroy other peoples buildings just because they can or steal material that looks intresting to them. Protection mods fascilitate the work of moderators because they don't have to constantly worry which building got griefed today and who needs to be rolled back. Protection mods help against players who do not follow the rules. The second - albeit minor - advantage of protection mods is that you can see more easily who built what.

To me, everyone needs to get as much land as the player can fill with halfway decent buildings. In the end, neither land, buildings (selling buildings is utterly pointless) nor materials (stored in a chest) have any real value. The only value lies in the fun you have while playing, and the fun visitors have while looking at the buildings and enjoying the sight.

That doesn't mean there can't be trade. Trade usually happens if someone has something someone else would like to have. It happens quite often that for a particular building one has in mind the own storage of the desired material turns out to be too short. That's when trade comes in.

On Redcrabs server, Mese and steel ingots act as some kind of "currency": If you don't need anything specific right now but have a potential customer, some Mese or steel can't hurt - it can be used for many purposes later on.

Servers that have technic installed are usually on an inofficial copper base (copper lumps/ingots = money) due to the high amounts of copper the technic machines require. This is mostly true for Vanessas survival server. Copper is required to generate new technic playthings, while for money...you won't get much (nobody sells much of any intrest for minegeld). So minegeld is kind of like the money in the DDR used to be - it exists, it's somehow money, but the really intresting things require hard cash. Plus minegeld pretty soon becomes unhandy (Stack of 5000 MG? And want to buy something for 100 MG? Good luck.). The barter tables of this mod are fine because they allow to trade combinations of goods. The disadvantage is that you have to store what you want to trade on each side - that binds money (needed as a price indicator) and the goods (the sample item can't be sold); you can't offer some goods in return for something you need and don't have yet.

The best solution to the money problem in my eyes is the one used on linuxgaming.us: You get 100 credits for a stack of cobble and can buy land close to spawn for incredibly high amounts of money. Plus there are admin shops selling items that are not available through normal gampelay (wool, dyes, shops, ...). Normal mining is a source of income, while getting land close to spawn (=easy/fast to reach) and some building materials is a one-time money sink. That balances each other out fine.

Then there's the landrush server, where new players are a source of income (ca. 10 gold ingots worth), and where further money can be obtained through converting gold and silver into money (kind of like an admin shop that buys them). The server has the advantage of a huge player base - which is very good for trade. The disadvantage is that most players have so much money they literally don't know anymore what to do with it. While on the other side, money is not really necessarry - you can obtain everything on your own.

There are at least two testing servers out there who have a diffrent mapgen - MG nore and Dan's Realtest - both of which do not generate ores in the usual way. MG nore creates veins of the usual ores (so you may easily end up with tons of mese but without enough coal and iron and totally without ore xyz that you're in need of), while the Realtest mapgen creates deposits of ores far apart from each other. The frequency and amount of ores was changed recently, but with the original distribution, the "you get everything everywhere if you just dig a bit" way of obtaining changed to "got some stacks of xyz - but nothing else" - which is excellent to encourage trade. At least if there are enough players. With too few of them or in singleplayer, it would simply lead to frustration.

And please don't worry about more money beeing around. That's ok - players explore the map, dig building material up, produce buildings - the server grows. Money helps to fascilitate the trade of building materials and may be fun on its own (i.e. when buying a pie or a bread). Making some materials more difficult to obtain can encourage trade. RL time based rents of land do not fit in here.
A list of my mods can be found here.

mectus11
Member
Posts: 14
Joined: Tue Nov 12, 2013 21:32
Location: Tunisia
Contact:

by mectus11 » Post

Now tell me why would I use this mod? It seems like a good concept for a mad but misinterpreted, maybe try convincing me why I should use it.

To be honest, I'd rather trust those pesky admins with my money than an automated system that can be exploited.
Sup, I'm Fadi and you're reading this.
Main project
My mod

Locked

Who is online

Users browsing this forum: No registered users and 0 guests