-
Notifications
You must be signed in to change notification settings - Fork 7
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
Visualize capture regions on the map #39
Comments
I do not have any experience with the map API/possibilities Drawing on the map would be nicest, but alternatively markers could be used to show the area(s). Although I have no idea how clear this would be and how much performance degradation it takes (updating only once in a while might counter performance issues) I guess some experiment/test needs to be done, to make this request more clear and to see what is feasible |
There is no API to render extra shapes onto the map. I have no idea the performance of adding and removing map markers, so as you say, this would need testing. It would be possible to use corner marker icons as the map icons though I think. It would mean shipping those icons with the mod. |
I've made a start on this. I can put down a map marker at the centerPos position on the map, and it tracks about as you would expect. How do I calculate the bounding box from the centerPos and other numbers in the camera? I am guessing I need to use the zoom somehow? And possibly the width and height? |
Trackers have a I guess if you reverse this you can calculate size again (where |
Is this the code I should be getting inspiration from?
If I'm following this, the values have the following units: tileSize: pixels per tile So I think to calculate my boundary in tiles I use:
The logic in the zoom method seems to clip the captured region. So if the region was very long and thin, it would cap the zoom to capture the height, and if it was very tall and narrow, it would cap the zoom to capture the width. Is this the intended behaviour? It may explain why I was having difficulty with some captures where I thought it would be maximal over the bookmarks I set for corners. If we are reworking the rectangles and zoom logic, perhaps this return value could become:
But perhaps I have misunderstood the zoom and got it inverted in my head. Bigger zooms show fewer tiles, right? |
See #48 |
I'll be merging #46 soon, which adds the It also adds more info on the fields (in an attempt to start documenting the code)
More to extend the captured region, I guess. So it will contain at the least the intended area of the tracker. With a perfect ratio zoomX and zoomY are equal. Otherwise the smallest zoom factor is picked (smaller zoom is bigger area screenshotted) making sure that the screenshots indeed contain the tracker area. |
Ok. I'll pull tomorrow, and depending on how inspired I am, add a box for
the tracker target.
…On Tue, 27 Jun 2023, 18:57 Maarten Bezemer, ***@***.***> wrote:
I'll be merging #46 <#46> soon, which
adds the transitionData object in the camera. This object has the start
and end positions/zoom factors. So I guess it makes sense to use that info.
It also adds more info on the fields (in an attempt to start documenting
the code)
The logic in the zoom method seems to clip the captured region
More to extend the captured region, I guess. So it will contain *at the
least* the intended area of the tracker. With a perfect ratio zoomX and
zoomY are equal. Otherwise the smallest zoom factor is picked (smaller zoom
is bigger area screenshotted) making sure that the screenshots indeed
contain the tracker area.
—
Reply to this email directly, view it on GitHub
<#39 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEOOXDXRYKYVCOMHWCATLDXNMNIJANCNFSM6AAAAAAZTXMYSQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I believe it is possible to change the tint of sprints? No idea whether this is possible for map tags... If so it would be nice to have different colors for the different areas on the map? |
Yes. I learned how to make an icon today. Tomorrow I will learn how to tint
them.
…On Tue, 27 Jun 2023, 19:02 Maarten Bezemer, ***@***.***> wrote:
I believe it is possible to change the tint of sprints? No idea whether
this is possible for map tags... If so it would be nice to have different
colors for the different areas on the map?
—
Reply to this email directly, view it on GitHub
<#39 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEOOXCKYNXD3KZTLVK5YWTXNMN4NANCNFSM6AAAAAAZTXMYSQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
note to self - the current code crashes if used with an old save with an old mod, as the camera doesn't have the new field for the tags - it just needs a nil check added, not an upgrade script, but if I don't document the issue I will forget it |
Note that there is already a migration script setup for the 'paused camera issue' fix and enable/disable the 'take screenshot' button: https://github.com/veger/TLBE/blob/master/migrations/tlbe.1.4.5.lua It will be run for existing games when the current changes are released |
OK, I'll hook into that then as the code will be less scruffy that way. |
As far as I can tell this is now fully implemented against master. It renders an off-white box for the capture region, and a green box for the target region during transitions. |
I'll take a look at your PR in the evening (in a few hours) |
#48 is merged, tt will be available in the next release |
I've used this for a few hours now, and imho it is a really useful feature. |
Agreed! When I read your request, I was wondering why I didn't think of it before 😄 |
I just stumbled upon this mod: https://mods.factorio.com/mod/eradicators-screenshot-maker It might be nice to show the camera/transition areas on screen/in-game? It would show that you are leaving the area with the player character or something? 🤔 Maybe enable alt-mode drawing, so the rectangles won't end up in the screenshots, or we hide them before taking a screenshot? 🤔 |
I think this uses the We could use these APIs to render in-game rectangles for the cameras in-world. But as you say, we'd then have to juggle if these are visible in screenshot somehow. |
Rendering to map may possibly be added in future. Mark as "when WUBE update their APIs" and park? |
Rendering to map would be nice, to the game/screen I have my strong doubts. parking until API supports such a functionality seems a good solution |
Capture regions with map markers is available in release v1.5.0 |
From https://mods.factorio.com/mod/TLBE/discussion/6498a5ed070072bbaa7d044c
The text was updated successfully, but these errors were encountered: