Skip to content

Add "onlyCheckCenter" option to ray cast check#372

Merged
Ingrim4 merged 6 commits intoImprex-Development:masterfrom
LoliColleen:master
May 23, 2024
Merged

Add "onlyCheckCenter" option to ray cast check#372
Ingrim4 merged 6 commits intoImprex-Development:masterfrom
LoliColleen:master

Conversation

@LoliColleen
Copy link
Copy Markdown

@LoliColleen LoliColleen commented May 22, 2024

Description

Disabling this option increases efficiency by reducing the number of ray casts

Related Issue

No

Motivation and Context

The original ray cast check checks all corners and edges of the block. Disabling this option allows you to check only the center point of the block, reducing the performance cost of ray cast.

How Has This Been Tested?

Local server

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 change)

this.rayCastCheckEnabled = section.getBoolean("rayCastCheck.enabled",
section.getBoolean("useRayCastCheck",
section.getBoolean("useFastGazeCheck", false)));
this.rayCastCheckOnlyCheckCenter = section.getBoolean("rayCastCheck.onlyCheckCenter", false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would be open to enable this flag by default since it shouldn't decrease security and we only lose some accuracy which is fine I think. I haven't had time to this yet so I'm not sure how big the impact is on accuracy. Any thoughts?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I was wrong about one thing. Enabling this option should improve performance. The default is false because before this PR all users used the default check full block. I'm not sure how much of a performance boost. I added this option because some PVP games (like UHC) don't require particularly precise checks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I will leave it off by default for now, maybe will change this in the future though.

Copy link
Copy Markdown
Member

@Ingrim4 Ingrim4 left a comment

Choose a reason for hiding this comment

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

lgtm, probably will compile now

@Ingrim4 Ingrim4 merged commit 5e82c2d into Imprex-Development:master May 23, 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.

2 participants