DEV Community

Maiu
Maiu

Posted on

1

JavaScript MMORPG - Maiu Online - #babylonjs - Ep32: Fully functional inventory system

Hello,
I finished work on inventory system, this is the list of supported features, which I added while working on it:

  • monsters have a chance to drop items/currency
  • dropped items with name labels are displayed on the ground
  • inventory UI with currency and items slots
  • players can pickup items/currency from the ground. Picked items are displayed in the inventory
  • not picked up items are removed after 30s
  • items can be moved between inventory slots
  • all picked up items are immediately persisted. In case of server crash they wont be lost. Saves are performed asynchronously and are not affecting engine loop. Players are seeing persisted inventory state.

UI changes are written in MVI pattern. I really like it and i think it suits well for online game. I will rewrite other UI parts to this pattern.

Also while recording this video i found one bug. Dropped item removing counter is not cleared after item pickup. So if player will drop it again within 30s, item will disappear earlier.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs