EntityCulling icon indicating copy to clipboard operation
EntityCulling copied to clipboard

try to fix #126

Open BenXII12 opened this issue 11 months ago • 17 comments

BenXII12 avatar Feb 25 '24 20:02 BenXII12

PR Summary

  • Introduction of new calculation improvement file A new file titled CameraMixin.java has been added. This file includes a code modification aiming to improve the accuracy of the third-person camera rotation in the Minecraft game.

  • Update and modification in DebugHudMixin.java file The DebugHudMixin.java file now includes two exclusive aspects: lastTickedEntities and lastSkippedEntityTicks. The getLeftText method has been adjusted - it updates these new aspects when the debug feature is switched off, and instead of returning a List<String>, it now returns void.

  • Inclusion of new feature in entityculling.mixins.json file The file entityculling.mixins.json has been updated to include the CameraMixin in its list of interleaved code modifications.

what-the-diff[bot] avatar Feb 25 '24 20:02 what-the-diff[bot]

Huh, that is certainly a way to fix it. My plan was to modify the culling code to allow going through blocks when the initial point is inside a block(until it's outside once, then continue as normal). That would also fix spectator mode and freecam mods. Will have to check out if this has other potential side effects/conflicts with other mods.

tr7zw avatar Feb 25 '24 20:02 tr7zw

image

Visually no changes. And in general, it seems like there is a bug on the side of the Minecraft developers, that by 0.001 the camera fails inside the block when rotated > ~85 degrees

BenXII12 avatar Feb 25 '24 20:02 BenXII12

Huh, that is certainly a way to fix it. My plan was to modify the culling code to allow going through blocks when the initial point is inside a block(until it's outside once, then continue as normal). That would also fix spectator mode and freecam mods. Will have to check out if this has other potential side effects/conflicts with other mods.

I wanted to change the culling code, but it ended up inside another library

BenXII12 avatar Feb 25 '24 20:02 BenXII12

Yea, I know that the bug is that the f3 camera is able to sliiiightly clip into blocks. My point is that this fix might become redundant by implementing the other fix to make spectator/freecam mode work. But might as well use this fix for the time being. Will check/merge/publish it tomorrow as EntityCulling is still on the old project setup.

tr7zw avatar Feb 25 '24 20:02 tr7zw

https://github.com/LogisticsCraft/OcclusionCulling the lib is developed by me^^

tr7zw avatar Feb 25 '24 20:02 tr7zw

https://github.com/LogisticsCraft/OcclusionCulling the lib is developed by me^^

Oups... :D

BenXII12 avatar Feb 25 '24 20:02 BenXII12

Feel free to implement the fix I mentioned above there, should just be one boolean that is set to true if the ray starts in a wall, and allows progressing till it's outside the wall, then gets set to false. While true it can continue in walls. Just haven't gotten around to it because irl time(currently looking for a job) 🙃 .

tr7zw avatar Feb 25 '24 20:02 tr7zw

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Feb 25 '24 20:02 sonarqubecloud[bot]

Feel free to implement the fix I mentioned above there, should just be one boolean that is set to true if the ray starts in a wall, and allows progressing till it's outside the wall, then gets set to false. While true it can continue in walls. Just haven't gotten around to it because irl time(currently looking for a job) 🙃 .

To be honest, I don’t have time either, being a student is all that...

BenXII12 avatar Feb 26 '24 16:02 BenXII12

Yea I just finished uni, so now need to get stuff worked out. Currently prototyping something for ItemSwapper, then I'll try to add my fix, if that has issues/doesnt work well I'll merge this fix instead.

tr7zw avatar Feb 26 '24 21:02 tr7zw

Ok, I implemented the in-wall bypass and also removed the spectator mode special handling since this new logic should take care of that. Please try the new build, at least with f5 and spectator mode it seems to be all working.

tr7zw avatar Mar 02 '24 23:03 tr7zw

image

Oops, I have a bit of a problem right now, have you ever had this happen when you move a project from one folder to another?

BenXII12 avatar Mar 08 '24 15:03 BenXII12

Possible that some intellij project file has absolute paths. I use eclipse, so not sure.

tr7zw avatar Mar 08 '24 22:03 tr7zw

But a built version with my proposed fix for #126 and spectator mode can be downloaded from the actions tab above.

tr7zw avatar Mar 08 '24 22:03 tr7zw

In block (spectator)

image

Normal (survival)

image

The pass time increased from ~6 to ~64, it seems to me that this should not be the case, I even felt slight lags

Why not just disable the mod in spectator mode?

..and as for the main problem, I could not identify any problems, everything else works fine :+1:

BenXII12 avatar Mar 09 '24 06:03 BenXII12

The pass time increased from ~6 to ~64, it seems to me that this should not be the case, I even felt slight lags

Since it traces to the caves in that moment. Yea it could turn off culling while in a wall in spectator mode, but that just feels like splitting hairs. 64ms is still fine, worstcase stuff pops in after flying into a wall, which it does anyway since the chunk culling by vanilla/sodium needs to happen(that might also be the cause for the lag you noticed).

tr7zw avatar Mar 09 '24 16:03 tr7zw