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

Shroud, Invalidate, oldHash #17521

anvilvapre opened this issue Dec 30, 2019 · 0 comments

Shroud, Invalidate, oldHash #17521

anvilvapre opened this issue Dec 30, 2019 · 0 comments


Copy link

@anvilvapre anvilvapre commented Dec 30, 2019

if (oldHash == Hash)

Consider making oldHash a object member over a local variable. The hash will now flip to its original value when called 3 times. Or perhaps just use TickCount as a hash. Consider changing WorldTicks * 3 to just WorldTicks.

Consider calculating the start player hash once, assuming i won't change during the game. Save the function call and calculations.

Consider combinding all CellLayer members into one CellLayer i.e. CellLayer<struct { passiveVisibleCount, visibleCount, etc }>. Avoiding the need to lookup a cell in multiple layers in several methods like Invalidate.

In function Invalidate visibleCount[uv] is looked up twice.

In function Explore. When Shroud is disabled and when Fog is disabled. Should changes still be processed? Wouldn't all cells already be explored? Or does game logic still need to know what terrain was/wasn't explored even if it's not rendered as such? I.e. for spies?

In the IsExplored and IsVisible functions the map/celllayer bounds seem to be checked more often. Consider adding private versions of these functions which do not again check map bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.