Build a shared crafting bench for a two-player survival game
Put three planks in a co-op workbench and give two players one bridge to build. Check how the server handles two requests for the same materials.
Put a stream across a path and a workbench beside it. The bench has three planks. A bridge costs all three. Now give both players a Build bridge button. What happens if they both press it before either sees the other’s result?
That small race is worth testing before you add a hundred recipes. The game has enough wood for one bridge, both players are allowed to build it, and the result is easy to check by walking across.
Put the recipe in one place
Ask your coding agent to add the bench to a Summer multiplayer project:
Create a shared bench with three planks. Show its stock to both players. A nearby player can request one bridge for three planks. The match server checks the stock, distance and whether the bridge already exists. For an accepted request, spend the three planks and create one bridge as one game action. Tell both players what changed. Give the second player a useful message if the bridge is already built.
Each window can show the cost or gray out an unavailable button. The server still checks on arrival. Between a player seeing “3 planks” and pressing the button, their partner might already have used them. Summer’s shared-state guide describes this pattern for collecting, buying and opening objects. Shared game state
Try the test from each side
Start two Local Play windows. Let the first player build the bridge alone. Both should see the bench fall from three planks to zero. Walk across with the second player. A visible bridge that only its builder can cross is a different bug from a bad inventory count.
Reset the example and try both buttons close together. Count the bridges and the remaining planks. You want one bridge, zero planks and the same answer in both windows. If your hands are too slow to exercise the race, ask the agent to send both craft requests against the same starting stock during the local test. Repeat with only two planks. The bench should keep both and the path should stay empty.
Decide what should still be there tomorrow
If this is a shared survival world, the bridge and bench stock belong to the place. A lantern a player earns permanently can belong to that player. Check the crafting action in the running match first, then decide how returning players should find the world. Save a shared world and each player’s progress · Summer’s survival and sandbox guide
Keep reading
All postsBuild the first round of a multiplayer FPS in Summer Engine
Give two teams one objective, a shared round clock and a score that advances once. Check the whole match loop in two Local Play windows.
Make a two-player card game with private hands
Build a short online card duel in Summer Engine. Deal a private hand to each player, share the board and let the match server decide whose turn it is.
Build a two-player co-op puzzle in Summer Engine
Build a room with two switches and one door. Test it from both players’ windows and see how to keep the puzzle in sync in a hosted Summer match.