feat: Multiplayer #2

Merged
jzitnik merged 14 commits from multiplayer into main 2026-02-04 10:33:25 +00:00
Owner

Make this game multiplayer.

Setup:

  • common for common classes used both by the server and the client
  • game the actual client
  • server the server
Make this game multiplayer. Setup: - `common` for common classes used both by the server and the client - `game` the actual client - `server` the server
jzitnik added 1 commit 2026-01-30 12:17:12 +00:00
jzitnik added this to the Multiplayer migration project 2026-01-30 12:18:44 +00:00
jzitnik added 1 commit 2026-01-31 16:02:43 +00:00
jzitnik added 1 commit 2026-01-31 18:46:43 +00:00
jzitnik added 1 commit 2026-02-01 14:16:58 +00:00
jzitnik moved this to WIP in Multiplayer migration on 2026-02-01 14:22:09 +00:00
jzitnik added 1 commit 2026-02-01 14:23:27 +00:00
jzitnik added 1 commit 2026-02-01 14:23:44 +00:00
jzitnik added 1 commit 2026-02-02 17:53:26 +00:00
Hello miss Meitnerova... If you are not Meitnerova but some random
person stalking my projects go get a life.

Anyways have a great time reading this awful code :)
jzitnik added 1 commit 2026-02-02 18:18:36 +00:00
jzitnik added 1 commit 2026-02-02 20:06:59 +00:00
Author
Owner

Now we have working connection and player movement in current room.

Now I have to implement going to another rooms so the state in the server changes and pings other players in other rooms if the player disappeared on their screen or appeared or nothing happened. Edit: Done

Then the complete player movement will be done. Next we have to implement interacting with chests. Taking out items from chest will have to be handled so players cant take the item from both of their chests. This is gonna involve probably a rewrite of the whole chest system because now its managed on the client not the server. Maybe I'm thinking I'll just kinda fuck it and put ID's on the items and just say to client when they have to remove and add items from their state and each client will manage their state independently.
Also we have to do that for dropped items too.

Then we have to implement fighting (maybe even friendly fire) and killing mobs. This will require clients to manage their state too.

And also probably better error handling and better socket disconnect management (retry connection, after some time disconnect player from the game).

Now we have working connection and player movement in current room. ~~Now I have to implement going to another rooms so the state in the server changes and pings other players in other rooms if the player disappeared on their screen or appeared or nothing happened.~~ Edit: Done Then the complete player movement will be done. Next we have to implement interacting with chests. Taking out items from chest will have to be handled so players cant take the item from both of their chests. This is gonna involve probably a rewrite of the whole chest system because now its managed on the client not the server. Maybe I'm thinking I'll just kinda fuck it and put ID's on the items and just say to client when they have to remove and add items from their state and each client will manage their state independently. Also we have to do that for dropped items too. Then we have to implement fighting (maybe even friendly fire) and killing mobs. This will require clients to manage their state too. And also probably better error handling and better socket disconnect management (retry connection, after some time disconnect player from the game).
jzitnik reviewed 2026-02-02 20:14:51 +00:00
@@ -0,0 +28,4 @@
@Override
public void handle(CreateGame event, Client client) {
ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
String pass = PasswordGenerator.generatePassword(Config.WORLD_PASSWORD_LENGTH); // TODO: Generate
Author
Owner

Remove TODO. This is done

Remove `TODO`. This is done
jzitnik marked this conversation as resolved
jzitnik added 1 commit 2026-02-02 21:00:11 +00:00
Author
Owner

Players can now finally move between rooms. Except storing their player rotation on the server. This will need to be stored and handled properly. Will do it in the future.

Players can now finally move between rooms. Except storing their player rotation on the server. This will need to be stored and handled properly. Will do it in the future.
jzitnik added 1 commit 2026-02-02 21:05:00 +00:00
jzitnik added 1 commit 2026-02-03 08:54:40 +00:00
jzitnik added 2 commits 2026-02-04 07:10:57 +00:00
Author
Owner

Now probably the whole synchronization is done. The only thing left i wanna do is chat but I'll do that in separate PR.

Now probably the whole synchronization is done. The only thing left i wanna do is chat but I'll do that in separate PR.
jzitnik changed title from WIP: feat: Multiplayer to feat: Multiplayer 2026-02-04 10:31:30 +00:00
jzitnik merged commit aec0e8e978 into main 2026-02-04 10:33:25 +00:00
jzitnik deleted branch multiplayer 2026-02-04 10:33:25 +00:00
jzitnik referenced this issue from a commit 2026-02-04 10:33:26 +00:00
jzitnik moved this to Done in Multiplayer migration on 2026-02-04 10:41:23 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jzitnik/game#2