[feat] Multiplayer network, ball jump control, respawn teleport, and respondence to user input, Close #4 #7 #63 #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #4 #7 #63
New Feature: Cross-Platform Compatible Multiplayer Network (UDP) for Linux, Windows, and Mac
Implemented Features:
room
,client
, andlocal
mode.room
mode is for the host of a playground.client
mode is for connecting to the room to join the party.local
mode is for playing with the dead ball for practice.Usage:
GameBall --mode=local
GameBall --mode=client --address=192.168.1.1 (your ip) --port=1115 (default port is 1115)
GameBall --mode=room --port=1115 (your server port, default is 1115)
Room
mode will automatically show room ip in the consoleEnhancements: Ball Jumping Mechanism
Implemented Features:
Jump Activation via Left Mouse Click: The ball is now programmed to jump when the left mouse button is clicked.
Grounded Jump Constraint: To add realism and challenge, the ball can only jump when it is in contact with the ground. This restriction prevents continuous mid-air jumps.
Single Jump per Click: The ball will perform a single jump for each click of the left mouse button. Holding the button down won't cause multiple jumps.
Consistent Spin During Airborne State: While the ball is airborne post-jump, its spinning motion remains constant. This detail ensures a seamless visual experience.
Enhancements: Ball Respawn Mechanism
This mechanism is simply teleporting the fallen ball back to the playground.
Known issue:
The main cause of segmentation fault and null pointer dereference is the Actor Cleaning Mechanism in GameBall::OnUpdate(), hope it can be fixed in the future.
Due to time constraints and exhaustion, I implemented a temporary solution where the client's port is automatically set to the host port number + 1. Hoping we can revisit this issue in the future to develop a more robust and user-friendly solution for port configuration in our game.
However, if client and host share the same ip(same device), the latency nearly disappeared.
Looking forward to feedback and suggestions!