Up to Main Index Up to Journal for January, 2024 JOURNAL FOR TUESDAY 30TH JANUARY, 2024 ______________________________________________________________________________ SUBJECT: 40 years of WolfMUD + Money and currencies DATE: Tue 30 Jan 20:53:05 GMT 2024 I realised over the weekend that WolfMUD turns 40 this year. For the last 40 years I’ve had a version of WolfMUD in one form or another. I’ve written versions in many languages including BASIC, C, C++, assembler, Java, Go and had it running on many operating systems and architectures. Even after all these years I still enjoy coding on WolfMUD and talking to its users. Recent work has kept me busy learning some new skills. I’ve been up to my eyeballs deploying clusters to the cloud with Helm charts, Kubernetes and AWS. A simple 4 vCPU/16Gb RAM virtual machine deployment is now a 32 vCPU/272Gb RAM 4 node cluster running 40 pods — and doing the exact same thing as before, but now it’s enterprisey and Devops and… stuff? :| Needless to say I’ve only managed to spend a little time on WolfMUD :( What have I been up to? I’ve been working a currency system. This will open the way for shops, traders, bankers, accounts and a few other things. I want the currency system to be simple but flexible. If you just want to use gold pieces as currency that’s fine. Want to have a historical British MUD and have things like £3/10/6¾ (3 pounds 10 shillings and 6 pence 3 farthings), 2/- (two shillings or a florin) or 3d (3 pence or thruppence)? I can manage 12 pence to a shilling and 20 shillings to a pound. Not sure about farthings, ha’penny, groat, florin, thrupney bits and so on. I can manage 8 ningi to a triganic pu though ;) At the moment defining a currency is kept simple. Pick a base denomination of 1 and define your other denominations based off that. It looks something like: # Classic currency where base unit is a gold piece Currency: gold:gp→1 # Advanced currency where: # 10 copper = 1 silver # 10 silver = 1 gold # 100 copper = 1 gold Currency: gold:gp→100 silver:sp→10 copper:cp→1 # Pre-decimal currency where 12d=1s, 20s=1L, 240d=1L # 12 pence = 1 shilling # 20 shillings = 1 pound # 240 pence = 1 pound Currency: pound:L→240 shilling:s→12 pence:d→1 separator→/ zero→- It’s possible to have as many denominations as you want to define. How’s this for a very silly example: # Baker’s currency where: # 13 crumbs = 1 crust # 4 crusts = 1 sandwich # 13 crusts = 1 loaf # 169 crumbs = 1 loaf # 13 loaves = 1 picnic # 169 sandwiches = 4 picnics Currency: picnic:p→2197 loaf:l→169 sandwich:s→52 crust:c→13 crumb:b→1 I’m still tinkering with how to apply the formatting rules. The rules can be configured using the ‘separator’ and ‘zero’ attributes and an abbreviation. For example “gold:gp→1” defines a denomination of ‘gold’ with an abbreviation of ‘gp’ which is the base unit as its value is 1. How will this all work in game? Most of the time it will be transparent. You would ‘sell trinket’ or ‘buy trinket’ at whatever price is shown. You will be able to ‘drop 10 silver’ or ‘give 2 silver 10 copper’. However, receiving money always converts it to the base unit. If we have 1gp=10s, 1s=10c then receiving 2 gold, 3 silver and a copper increases your balance by 231 copper. When you spend money it will always be assumed you have the exact change :) Big question is, do we allow multiple currencies? What about exchange rates? -- Diddymus Up to Main Index Up to Journal for January, 2024