[28] Banking

01/12/2021, 10:22pm

I've been working on banking for about a month now. It was supposed to be a simple feature, but as I got started I realized that the inventory required a few fixes to support it. I mentioned some of those fixes a bit in the last dev log, so I won't really cover them here.

The Vaults

The Vaults of Antorum have been opened, allowing players to bank their materials, equipment, and coins in a safe place!

Each vault connects to the others via a complex arcane network, which can be accessed and manipulated by a Vaultmage NPC. They can be found in every settlement on the Isle.

At the moment, you can hold 100 item stacks in the vault, and the maximum stack size of banked items is in the thousands. Even non-stackable items will stack inside the vault. Hopefully this makes things like fishing trips less painful, as you can store your combat gear somewhere safe and make use of your entire inventory for fish.

New Packets

/// 65 - 0x41 - Bank Inventory Open /// Server BankInventoryOpenPacket { // (slot, resource_id, quantity) items: Vec<(u8, i64, u16)>, bank_size: u8, } /// 66 - 0x42 - Bank Inventory Close /// Server BankInventoryClosePacket {}; /// 67 - 0x43 - Bank Inventory Deposit Request /// Client BankInventoryDepositRequestPacket { src_inventory_slot: u8, quantity: u16, } /// 68 - 0x44 - Bank Inventory Deposit /// Server BankInventoryDepositPacket { // (src_inventory_slot, dest_bank_slot, quantity) deposited: Vec<(u8, u8, u16)>, } /// 69 - 0x45 - Bank Inventory Withdraw Request /// Client BankInventoryWithdrawRequestPacket { src_bank_slot: u8, quantity: u16, } /// 70 - 0x46 - Bank Inventory Withdraw /// Server BankInventoryWithdrawPacket { src_bank_slot: u8, quantity: u16, } /// 71 - 0x47 - Bank Inventory Close Request /// Client BankInventoryCloseRequestPacket {}

Side note, it was a big mistake choosing to use 16 bit fields for all item quantities at the start of this project. I have no idea why I did that - right now the maximum amount of an item you can hold is 65,535. That means you can't stockpile many coins, which sucks. I'll get around to changing the types to something more sane, but it is a pain to go and update it everywhere in both the client and server codebases (and I'm procrastinating).

Player Item Drops

Since you can store your items now, it's only fair that I get to turn up the difficulty in some way. Upon death, players will now drop all of their items and equipment.

This might force me to re-balance some areas and equipment, but it's alright.

Other

  • Decreased inventory size to 16 slots
  • Added Shopkeeper's Apron item
  • Added Chef's Apron item
  • Quantity input menu should now do it's best to stay on-screen when opened
  • Moved inventory code out of the item module and into it's own module
  • Entities now inherit rotation and scale from their spawners

Not much else to report. The next thing I do will probably be bug fixes. I'm also (very slowly) building another new area, with new enemies, items, etc.

- Declan (@dooskington)