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

see-other-players with Proper movement packets and File logging #155

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

Sweattypalms
Copy link
Member

Proper movement packets (change pos, change pos & rot, change rot, teleport) and File logging.

Description

^

Motivation and Context

It's required cuz I didn't implement the additional less bandwith taking packets before. And file logging is needed because why wouldn't we need file logging?

How has this been tested?

uh

Screenshots (if appropriate):

👍

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (restructuring code, without changing its behavior)

Checklist:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Clippy passes with no warnings.

@@ -45,6 +55,12 @@ async fn handle_player_move(
let mut position = conn_id.get_mut::<Position>(&state)?;
trace!("Got position 1 for player move");

delta_pos = Some((
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIMD might help here? would suggest benchmarking first tho

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should matter that much, and maybe a micro-optimization? SIMD, as far as I know, has overhead, so maybe not worth it.

Copy link

@GStudiosX2 GStudiosX2 Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should matter that much, and maybe a micro-optimization? SIMD, as far as I know, has overhead, so maybe not worth it.

Yeah I think SIMD only helps when you have a lot of elements

}
};

broadcast(&packet, state, BroadcastOptions::default().all()).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should limit this to only players that can see them

Copy link

@GStudiosX2 GStudiosX2 Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should limit this to only players that can see them

Imo probably should be done in a different pr the previous one that used teleport didn't only send it in range either iirc although probably wouldn't be hard to fix here

Copy link
Member Author

@Sweattypalms Sweattypalms Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm waiting for chunks shit to be more stable to add a regional entity system. So we can have lookup for entities in a radius with the ECS. Right now, we don't have much choice, other than literally looping through every living entity and finding the closest one.

@@ -11,10 +13,33 @@ pub fn init_logging(trace_level: Level) {
//let console = console_subscriber::spawn();
let env_filter = EnvFilter::from_default_env().add_directive(trace_level.into());

let is_verbose = trace_level > Level::INFO;

let file_layer = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also have a latest.txt that is overwritten every time the server boots up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah definitely possible. I'm using tracing-appender library right now, with builtin shit. I'll figure it out by tomorrow hopefully.

@ReCore-sys ReCore-sys merged commit 1df4866 into master Jan 2, 2025
9 checks passed
@ReCore-sys ReCore-sys deleted the feature/see-other-players branch January 2, 2025 12:58
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.

3 participants