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

Suggestion: Use entity status and script rendering #52

Closed
Bilka2 opened this issue Mar 30, 2019 · 9 comments
Closed

Suggestion: Use entity status and script rendering #52

Bilka2 opened this issue Mar 30, 2019 · 9 comments

Comments

@Bilka2
Copy link

Bilka2 commented Mar 30, 2019

With 0.17, you can use https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.status to get the entity status in a performant way.

Furthermore, you can use the script rendering for per player visibility.

@troelsbjerre
Copy link
Owner

Thank you for the reminder. I've been looking forward to these changes, but haven't had much time to develop the idea. I've added a first attempt at it in the feat-0.17api branch, which looks promissing, but I haven't had time to test it.

@Roang-zero1
Copy link
Contributor

I would like to take a shot at the rendering engine to replace the spotlight entities. Would you be interested in me helping out with developing this?

@troelsbjerre
Copy link
Owner

@Roang-zero1 I'll try to help out, but I cannot promiss much, since I'm a little strapped for time these days. The primary target feature is the per-player visibility. The new rendering api allows to specify a list of players for whom the graphics is shown. I suspect it might be fast enough to keep that list up to date in the mod, and then have the update function blindly destroy the old signal and draw the new signal with the up to date list of players.

@Bilka2
Copy link
Author

Bilka2 commented Apr 5, 2019

I suspect it might be fast enough to keep that list up to date in the mod, and then have the update function blindly destroy the old signal and draw the new signal with the up to date list of players.

Just change it on the signal for better performance. I specifically made everything writable so that you don't have to destroy + recreate.

@Roang-zero1
Copy link
Contributor

Roang-zero1 commented Apr 8, 2019

As mentioned in the pull request (#53) there is still an issue with performance of the rendering engine call, this preventive of merging the changes. I've opened a request on the forums to address this: https://forums.factorio.com/viewtopic.php?f=28&t=69230

@Roang-zero1
Copy link
Contributor

Roang-zero1 commented Apr 9, 2019

As per forum thread it will not be possible to use the new rendering engine for Bottleneck due to low performance on the number of renderings needed.
So I will look into optimising the existing code with the new entity stati,

@Roang-zero1
Copy link
Contributor

Just a quick update was busy with work so no time to work on this, but I will continue work in the upcoming week.

@raiguard
Copy link

raiguard commented Jun 7, 2019

It's a shame that a functionality which almost seems specifically tailor-made for this exact kind of usecase isn't actually the best option. :(

@Roang-zero1
Copy link
Contributor

Finally had the time to complete the modification, so the part of the 0.17 API (entity status) that can be used is now included. See #62 .

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

No branches or pull requests

4 participants