-
Notifications
You must be signed in to change notification settings - Fork 117
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
End game graph/log scale #1368
End game graph/log scale #1368
Conversation
Make a widget? I don't think this is the engine's job. |
It isn't the engine's job but it is currently doing it. Making a widget requires me to learn lua, which I currently don't want to do and even then it will take a while to build everything from scratch. |
Yes, but it's just there to start you out. Eventually you'll need to move to a Lua implementation anyway. If anything, it's a good argument to remove it and put a Lua implementation in basecontent since it doesn't really do anything vital. Perhaps the upcoming rmlui rewrite of native engine GUI would be an excellent opportunity to do that. |
So until rmlui gets implemented and the new graphs are made, maybe we can use this implementation? I would really like to view my graphs in log scale without having to wait for the new stuff (I believe other people would like that too), but if we must wait for the new stuff (who knows for how long), should I delete my PRs? |
You don't have to wait for the new stuff, the Lua API to do so has been there for about 15 years and there's existing implementations (e.g. https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaUI/Widgets/gui_chili_endgraph.lua ) that I would recommend stealing.
The other PR looks fine since it's just a tweak. To this one, normally I'd say yes but given that there is going to be a rewrite anyway I think we can accept it as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bit of bad whitespace all around but it probably doesn't matter if this is due a rewrite anyway.
Form my end (VS Code), the whitespace looks consistent with the original code. Although when looking through GitHub's "Files changed", I can see some missing spaces, I don't know why that is. |
spaces vs tabs i suppose i can fix that myself if i have a few minutes to spare before the merge window opens up |
Base 10 log is overkill, I would choose either log2 or natural log. Can the UV coordinates of the background images (graphpaper.bmp) be adjusted, and games can supply their graphpaperlogX.bmp to get logX tiling? Handling all negative log10's as zero isn't very pretty for the non-resource type stuff. Does std::log handle the -inf correctly for values of zero? Can any numbers of the graph be negative, where log isundef or NaN and the resulting clamping fails? |
rmlUI has been merged so it would be ideal to move the graphs from engine into a rml widget. |
Guess we can merge it as is, it's not clear if and when it's going to be migrated to RML. |
Sure |
Added log scale option.
Before:
![Screenshot 2024-03-16 190918](https://private-user-images.githubusercontent.com/111707981/313421658-97b804af-4124-4efd-82df-3eb7a4896e35.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjQ0MDAsIm5iZiI6MTczOTMyNDEwMCwicGF0aCI6Ii8xMTE3MDc5ODEvMzEzNDIxNjU4LTk3YjgwNGFmLTQxMjQtNGVmZC04MmRmLTNlYjdhNDg5NmUzNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQwMTM1MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMTc5ODlhOGM0OTAwYmRjNWRmNjM3MGI5NzE1NTU3OTQ0ODY4MTQ4ZDNmMDZmYTk4NTBlMmVkNTdiMWYwZmE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.x8mfCTzQnuO1NBfJrQnm3BX1eym0kT95zRKbwl_NBPg)
After:
![Screenshot 2024-03-16 190928](https://private-user-images.githubusercontent.com/111707981/313421667-dde32aa8-f464-438a-8527-9e1db56644e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjQ0MDAsIm5iZiI6MTczOTMyNDEwMCwicGF0aCI6Ii8xMT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