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
Feat 0.17api - Rendering and entity.status #53
Conversation
Add new sprite graphic and definition. Add invisible sprite on build and remove later.
This is more dynamic and allows for tint control via settings.
The position is now infered from the entity, if anyone moves it the sprite will follow. Removed move detection code.
Make the sprites invisible to enemies
We now only update the sprite if the status changed
As the sprites are now linked to the entities at creation, this is handled by the game itself.
It was not working reliably, use #+1 instead
Update the display in separate function, this removes a couple checks from on_tick. Furthermore the switch off is now almost instant.
We no longer need to check for machine validity, this is handled by the game. If the light or the sprite are missing, destroy both and recreate.
Check the forces that should be renderd ousite of on_tick.
I will clean up the code some more, but the features are there and can be tested! |
Ok I've found out there is still a performance problem with large bases, so I would hold of on releasing this branch until this is released. |
Awesome work! I accidentally merged it to master, but now moved it back to the feature branch. I haven't had time for a proper test of it yet :( About the big bases issue: One possible (major) change to the update logic is that we let go of the global dict of machines and their signals. Instead, updates would only happen around each player that want the signals shown (by re-scanning regularly). It would still be possible to cap the global number of updates per tick, and when its time for a new scan around a player, that scan would be the only computation that tick, so it might be fast enough. Pro:
Con:
|
Sorry I did not elaborate enough it was just a quick message to make sure you do not release the version yet. |
As mentioned in #52 I've updated the code to use the new 0.17 rendering engine.
I've also rebased the branch on master to include the latest fixes, just fyi.