FilipeTessaro - Gearcraft: Replicated Inventory (Grid, Slots, Equipment, Crafting, Multiplayer)

Gearcraft is a replicated inventory for Unreal Engine 5.6, 5.7 and 5.8. Backpacks, chests, corpses and shop stock are all one component, set up as a grid, as slots or as a list with a weight limit. Items are data assets: size, weight, stack, rarity, wear, equipment slot and price, with no C++.

Around it comes what a survival or looter game needs: equipment slots, a hotbar, shared chests, items on the ground, loot tables, crafting at workbenches, vendors and save. The server owns every item and the owning client shows its own moves on the frame of the click, so it feels local at 150 ms of lag and a cheating client still can't make items.

Three kinds of inventory.

  • Grid: items take cells by their size and turn a quarter, like Tarkov or Resident Evil.

  • Slots: one stack per slot whatever its size, like Minecraft, Valheim or Rust. Drop an item on another and they swap.

  • List: one entry per stack, limited by entries and kilograms, like Skyrim.

  • The same items work in all three, and moves between them work both ways.

  • Weight with an encumbered threshold and a speed scale for your movement.

Items.

  • One data asset per kind: size, weight, max stack, rarity, durability, equipment slot, carry weight bonus, value.

  • No icon to draw: leave it empty and the item's world mesh is rendered into one at run time, shaped like the item on the grid.

  • Values of one item, like a quality roll or charges, travel with it as tagged numbers and keep it out of stacks that differ.

  • Wear and repair, a use event for eating or healing, and a use sound per item.

In the world.

  • Chests that anyone in reach can open, at the same time, with nothing duplicated.

  • Pickups on the ground with the item's mesh. Interact with them, or drop anything out of the screen.

  • Loot tables with chances and counts, filled on the server.

  • Crafting with recipes, a timed queue and workbenches by tag.

  • Vendors that buy and sell for a currency item, with prices from the item's value or a table of your own.

  • Save one inventory to a slot, or its data into your own save game.

Add the component and press Play.

On the player's own pawn the component runs itself: Tab opens the screen, E picks up or opens what is in front, 1 to 9 and the wheel pick the hotbar slot, F uses it, with a prompt and an aim dot on the HUD. Turn Auto Controls off and drive it from your own input and UI instead.

The ready screen.

  • Equipment, backpack, hotbar and weight on one side, the open chest, shop or recipes on the other.

  • Drag, half stacks, turn, send across, use or wear, drop, bind to the hotbar, with mouse or gamepad.

  • Hover light, a shadow under the item in hand, a small settle when it lands, a flash when the server says no.

  • Four ready looks in a dropdown. Every colour, the font and the cell size are settings, or lay it out in your own Widget Blueprint.

  • Sound slots for pick up, put down, equip, trade, refused, open and close, played only for the player who acts.

Multiplayer.

Every change is a request the server checks: reach, room, weight and that the item is still the one the client saw. The owning client predicts its moves on the frame of the click and corrects itself when the answer comes. Items replicate as a fast array, so a move sends the items that changed, and private bags go to their owner only. Tested with a dedicated and a listen server and 4 clients at 150 ms of lag and 5% packet loss: every client ends with the server's items, nothing duplicated and nothing lost.

Measured, not promised.

  • Moves show on the frame of the click; the server's answer arrives 340 to 500 ms later on that line.

  • 50 idle chests full of loot add nothing to the server's network send: 514 µs a frame, the same as with none.

  • 14 automated tests, including 20,000 random moves across a grid, slots and a list that must never make or lose an item.

  • Built on 5.6, 5.7 and 5.8 with strict includes.

What it does not do.

  • No containers inside containers: a worn backpack adds carry weight, not a grid of its own.

  • No weapon logic: a weapon is an item worn in a slot. Attaching meshes to the character is yours.

  • What using an item does is yours, through the On Item Used event.

Everything is open to Blueprint (247 members) and the C++ source ships. One plugin, no other marketplace plugin needed. A demo project with a yard, chests, a trader and a workbench shows all of it.

Windows demo to try before buying: https://github.com/filipetessaro/gearcraft-demo

Support by email: contato@tessaroapps.com.

PS: Feature requests are accepted!