Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Rewrite frame CRC generation

Open Starkku opened this issue 1 year ago • 6 comments

Reimplements game's frame CRC generation function, only change logic-wise is that it now excludes AnimClass and ParticleClass objects that are purely visual.

Starkku avatar Aug 30 '24 08:08 Starkku

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Aug 30 '24 08:08 github-actions[bot]

What kind of tests should be done here if you want feedback?

FS-21 avatar Aug 30 '24 08:08 FS-21

The wrapper may be good idea in theory but that implementation mostly just obfuscates what gets hashed and for what type of object (it also changes the functionality from how game does it slightly, although likely to little to no tangible effect). The benefits would be more obvious if there was a realistic chance for new properties that need hashing to be added for, say, TechnoClass and derivatives in the future but as it stands this is very unlikely. If you can think of a way to do it without extra overhead or the obfuscating nature while reducing repeated code be my guest, but the previous implementation was not it so I've elected to revert it. I do hold a local copy of it for now still just in case though.

I'm not even going to repeat the point about the rules hash check in Phobos anymore, should be obvious by now that it does not belong here.

I did do some cleanup to the first iteration too.

Starkku avatar Sep 15 '24 14:09 Starkku

If you can think of a way to do it without extra overhead or the obfuscating nature while reducing repeated code be my guest

It only wrapped a DWORD and serves for hash the object on creation and do the hash combine operation. I bet it makes less overhead than your current method. It also allows you to know the "sum" at compile time. But anyway these are small things and make literally no difference.

chaserli avatar Sep 19 '24 13:09 chaserli

Rebased on develop and applied some of the feedback. This is ready for further testing and another review pass.

Starkku avatar Mar 28 '25 09:03 Starkku

no desync or other issue occured in our testing so far

Coronia avatar Apr 08 '25 06:04 Coronia