First all of all: I have found the time to add the game data to a Github repo, so no danger of permanent data loss anymore. 😉
Now to the new stuff!
I didn’t like how the market module and the player data was bundled. And a wise developer once said; code mechanics, not games! Following that, I added some new modules: Wallets & Tokens.
The wallet module holds any bag data for the player and allows to deposit / withdraw tokens via TXNS (transactions). The token module itself provides an API to create token data (aka adding new coins). Per default, it holds USD as the game default stable coin.
This token data is referenced in wallets and transaction to get stuff like tickers and labels.
Another new cool module is the transactions or TXNS module. It allows to create a transaction with token data, sender and recipient etc. The module automatically triggers the deposit function in the receiving wallet and the withdrawal function in the sending wallet. You can also “mint” funds by sending tokens to your wallet from the genesis wallet address.
Wait! Wallet addresses? Ah, right! Every wallet has a simulated blockchain address (42 byte HEX string) as ID. This is kinda cool, because you can use this address to easily create correct transactions but might be also useful in other -later- game mechanics.
Writing those modules was really easy, fast and fun. I think I found a good data and struct structure for all the modules now. The game’s further development will benefit from this achievement.