FilipeTessaro - Interactcraft: Replicated Interaction System for Multiplayer

Interactcraft is interaction for multiplayer games, for Unreal Engine 5.6, 5.7 and 5.8, written in C++ with every gameplay function open to Blueprint. One component goes on the pawn, one on the object, and the server checks every press.

Tested with a dedicated server and two clients at 150 ms and 5% packet loss each way: 3 of 3 rounds ended with the same state on every machine. 80 automated tests ship in the plugin and pass on all three engine versions.

Interacting.

  • Aim at an object (first and third person) or take what is nearest (top-down, side view), with a Priority for the chest behind the NPC.

  • Press, or hold with a progress bar that lives on the object, so every player sees the same bar. Toggle Hold for players who cannot keep a key down.

  • Holds that need two players: a heavy gate rises only while both hold it.

  • Several options on one object (Open, Lock), picked with the mouse wheel or the D-pad. The server checks the option again.

  • Keys, cooldowns, Gameplay Tags the player must or must not have (read from an Ability System Component too), and conditions with a reason the player reads: "Blue team only".

  • A use spot slides the player into place and plays a montage on every machine.

  • Pick an object up and turn it around. Only the player holding it sees it in their hands.

The prompt. Drawn over the object, with the key bound right now on the device the player touched last, and dots on what is usable nearby. Two prompt widgets are included, and a Blueprint child of the prompt class takes your own look.

Ready pieces, wired without graphs.

  • A door that swings or slides, locks, takes a key and waits for a character in its way.

  • A lever, a hold button and a valve that keeps its progress.

  • A keypad checked on the server, with lockouts for the player who typed the wrong codes. The code is never sent over the network.

  • A code display one player reads while the other pulls the lever.

  • A pickup for a key or an item of your own inventory, a chest that opens, gives what is inside and closes, and a pressure plate.

  • Action lists in the Details panel connect them: open, unlock, switch, give a key, spawn, destroy, save, load, each with a delay.

Network.

  • The server checks range, line of sight, aim, conditions, keys and options. Presses and keypad codes are rate limited.

  • State travels as replicated properties, so a player who joins late sees the doors as they stand.

  • Idle pieces sleep on the network: 300 idle levers added to the demo take the server from 1.9 to 2.1 KB/s.

  • Doors and levers move at once on the pressing player's screen, and go back if the server says no.

Save and load. One node saves every piece and every player's keys to a slot, one node loads it, async too. Placed actors, actors spawned in play (back with their owner), actors destroyed in play, and World Partition cells that stream out and back. Open Level And Load From Slot loads a game while playing and takes the players along.

AI. Behavior Tree and State Tree tasks, a Smart Object behavior and an Interact And Wait node. An AI goes through its own interactor, with the checks a player gets.

Gameplay Ability System. Optional. ITC Interact Ability lets tags, cooldowns and costs block interacting, and the server checks each press against the ability.

Blueprint. 333 functions, events and settings, checked by reflection. Works in a Blueprint-only project: nothing to compile on your side. C++ source included.

Included: 7 Blueprint pieces with sounds, 2 prompt widgets, the Input Actions (remappable in Enhanced Input's user settings), a demo map with 16 stations and an AI worker, a manual with recipes, and the node reference.

Good to know. It enables the engine's Enhanced Input, State Tree, Smart Objects and Gameplay Abilities plugins. Win64 and Linux, client and dedicated server (a dedicated server build needs the engine from source, as in any Unreal project). The Content folder is about 54 MB, most of it the demo's Epic content, and it stays out of your packaged game unless one of your maps uses it. Physics grabbing and button mashing are not part of it.

Documentation: https://apps.tessaroapps.com/interactcraft/docs/

Support: contato@tessaroapps.com

PS: Feature requests are accepted!