A downloadable Ren'Py file

Have you ever thought, 'Wouldn't it be fun to not use gold or whatever boring single currency for a medieval setting, but proper pounds/shillings/pence?' I did, and so I created one. Turns out that was far more complex to put into execution than I initially thought.

After much trial and error, I succeeded. *

*It does what I want it to do well enough.

What it is: A .rpy file that contains a money system focused on non-decimal units.

Note: Old Pence refers to non-decimal, and New Pence refers to decimal.

Features: 1. Non-Decimal Currency. Think classic GBP, with 240 pence per pound, 20 shillings per pound, and 12 pence per shilling.

2. Decimal Currency: Some people might have trouble understanding non-decimal money, so I included an option to convert to decimal. That way they can toggle back and forth and get a feel for what the equivalents are. The base unit is the penny, not the pound, so 1 pound/240 pence become 2.40 pounds in the decimal version. Currently, I recommend only allowing this change at the beginning for that reason. If I think it's worthwhile, I might put the effort in to get more accurate conversions between the two. I fixed/improved the conversion functions, so now it converts between the two, preserving the Pound value. 1 Pound/240 Pence becomes 1 Pound/100 Pence. Should I make it automatically toggle the decimal currency names to new? 100 New Pence? It also works with custom non-decimal ratios. In testing the conversions were never off by more than a couple Pence, and only with the initial conversion due to rounding. The bias was towards adding, not removing value. 1 Pound/1 Shilling/1 Penny converted to decimal becomes 1.06, but converted back becomes 1 Pound/1 Shilling/2 Pence.

2A. Because the point of this is for a non-decimal currency system, that's what the code is set up to do. If decimal is turned on, the ratio between the non-decimal code and decimal output is preserved. 1 Shilling becomes 5 New Pence.  The rounding error with Pence is higher, due to the 2.4 Old Pence to New Pence ratio. So 3 Old Pence becomes 2 New Pence.

3. Editable Currency Names: There's a label to allow the names of the currency units to be changed in game. Don't like pounds/shillings/pence? Let your players change them to whatever they like. Or you can change it via the defaults if you don't want the players messing with the names.

4. Editable Currency Ratios: Want your players to be able to change the 240/20/12 ratios? You can let them do so via a label. Why? That's on you. I added it for testing purposes and left it in because someone might find it useful. If you, the developer, don't like the ratios I recommend changing them via the default values. If you let players decide, there's a chance it could lead to uneven ratios. For example, 11 shillings 3 pence to the pound instead of 11 shillings even. Again, not sure why you'd let players mess around with this.

5. Notifications: Whenever you change the value of the money via the relevant function, you get a notification of how much was gained or lost in a readable format, X Pounds, X Shillings, X Pence. Adjust the X and Y values you change where the notification appears, and the timer for how long it's visible.

6. Screens: It comes with a screen that displays the amount of money. You can change where this appears, and the format in which the money is displayed. The options are $X/X/X or X Pounds, X Shillings, X Pence. All you need to do is un/comment the relevant lines of text.

7. Default values: Comes with test_char variable for testing purposes. Also comes with wallet variable for regular use. You're of course welcome to create your own variables, but you don't have to if you don't want to. If you add your own variables, be sure to include them in the relevant list so the functions know to use them.

8. Test Labels: File comes with included labels for testing purposes.  This should let you get a feel for how it works. 

9. Self Contained: Everything needed to run this file is included in the file(theoretically). All the defaults, classes, screens, and relevant labels.

10, Comments!:  There's a lot of comments, and I'll concede a chunk of them are probably unnecessary. I added them to help me as I went, and hopefully they're helpful to anyone using this file.

Todo A. I might remove the decimal conversion. As it currently stands, it causes an issue if the code is made for a non-decimal setup, but you switch to a decimal setup. 
A1. If I do keep the decimal, I'll need a way to convert between the two using the existing Pound/Shilling/Pence function. You can use the existing function with just pennies, but it's easier if you don't have to do the math yourself. I'd much rather say "Subtract 17 Shillings" than work out that's equal to 204 Pence.
Fixed conversion between decimal and non-decimal.
B. I've run into some issues with merchants. The current setup doesn't make it easy to display a variety of prices.
C. This is why I'm leery of posting the code, I tried to add a fix to the merchant issue, and it breaks everything. I don't think I need to do a complete rewrite, but I wouldn't be surprised if it does.
D. As I come to a finish on this, I realized the majority of effort expended on this was making it compatible with decimal display and use.  With that in mind, I might add a toggle to allow the code to be written in decimal format. Currently the code must use the non-decimal to function properly. Or not, and force people to use the non-decimal format for the code.

You may have noticed there's no link to it. That's because I'm still tweaking it, and a little nervous in all honesty. This post is to gauge if this is something others would be interested in. If so, I'll upload it.

This work is licensed under Creative Commons Attribution-ShareAlike 4.0 International 

Leave a comment

Log in with itch.io to leave a comment.