Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Multiplayer network, ball jump control, respawn teleport, and respondence to user input, Close #4 #7 #63 #25

Closed
wants to merge 9 commits into from

Conversation

lemonchu
Copy link

@lemonchu lemonchu commented Dec 31, 2023

Close #4 #7 #63

New Feature: Cross-Platform Compatible Multiplayer Network (UDP) for Linux, Windows, and Mac

Implemented Features:

  1. Mode Selection: we have room, client, and local 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.

  1. Compressed Data Transfer: Credit to Yuchen Yang for designing a wonderful compression scheme for transferring user inputs.

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 console

Enhancements: Ball Jumping Mechanism

Implemented Features:

  1. Jump Activation via Left Mouse Click: The ball is now programmed to jump when the left mouse button is clicked.

  2. 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.

  3. 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.

  4. 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:

  1. Client Quit Corrupts the Game: Due to the imperfection of the logic of GameX, this multiplayer network can not handle clients quitting properly now. Even though I tried to write some lines of this Quit logic, it won't stop occurring segmentation fault and null pointer dereference.

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.

  1. Port Customization Logic: Currently, the client not only needs to input the host's port but is also required to define its own port. However, the game settings only provide a single 'port' variable, leading to configuration challenges.

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.

  1. Latency to be Improved: The sync relies on smooth connection heavily. High latency occurred in client side.

However, if client and host share the same ip(same device), the latency nearly disappeared.

Looking forward to feedback and suggestions!

@lemonchu lemonchu changed the title [fix] make the ball respond to user input , Close #4 [feat] The ball can jump with the left mouse button clicked, and made the ball respond to user input ,Close #4 Jan 11, 2024
@lemonchu lemonchu changed the title [feat] The ball can jump with the left mouse button clicked, and made the ball respond to user input ,Close #4 [feat] Ball jump with the left mouse button, and ball respondence to user input, Close #4 Jan 11, 2024
@lemonchu
Copy link
Author

Close #4

@lemonchu lemonchu changed the title [feat] Ball jump with the left mouse button, and ball respondence to user input, Close #4 [feat] Multiplayer network, ball jump control, respawn teleport, and respondence to user input, Close #4 #7 #63 Jan 16, 2024
@lemonchu
Copy link
Author

Close #4 #7 #63

@lemonchu
Copy link
Author

lemonchu commented Jan 16, 2024

@chenzunh23
Copy link

Fancy game! You have been working on this strenuously since the calculus exam, right?

@lemonchu
Copy link
Author

This PR is closed because it is really a piece of shit code. A new PR is on the way!

@lemonchu lemonchu closed this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Feature] Control logic for regular ball unit.
2 participants