BrookJeynes / slime-rancher-2-interactive-map

An interactive map for Slime Rancher 2.
https://sr2interactivemap.com
24 stars 7 forks source link

Incorporated Powderfall Bluffs asset #20

Closed rodriguezrrp closed 11 months ago

rodriguezrrp commented 11 months ago

I swapped the background map asset to the one with Powderfall Bluffs. More precisely, the square aspect ratio one. I batch-relocated all the icons (positions inside src/data/) to fit their new locations. The relocated map icons are a little to the northwest by a few pixels on the background map. It is not off by a lot, but a few pixels would probably be a handful of meters in-game. Example, possibly moving plort door receptacle markers slightly away from their door. The reason I did not stress about this is: I assume these were placed by "eyeballing" the position in the first place, so there's already imprecision. If it is too much, I can work on getting them to their exact converted place. (I have all my batch relocating script in another branch for cleanliness)

FWIW, the Leaflet we have configured has been using the Web Mercator projection, notably with positive latitudes 0 - 85.051... . I chose to convert lat-long to pixels and back for rescaling instead of reconfiguring Leaflet and still rescaling.

I have not added teleport pad lines yet, nor any other icons.

If I make some of these changes while this PR is open, I'll commit them to this branch (i.e. PR).

rodriguezrrp commented 11 months ago

Here is zoomed-in comparison of a couple icon positions before and after rescaling/relocating: image showing comparison of icon positions

rodriguezrrp commented 11 months ago

Sticking this note here as well: Saber Gordo asset is needed. Currently placeholding it with a tabby gordo.

BrookJeynes commented 11 months ago

@rodriguezrrp Jeez man! great work!! Thanks for doing this! I've been putting it off for a while as I couldn't think of a nice way to shift everything over.

The reason I did not stress about this is: I assume these were placed by "eyeballing" the position in the first place, so there's already imprecision.

Yeah, I just eye balled it when making it so I wouldn't stress too much about exacts.

If it is too much, I can work on getting them to their exact converted place. (I have all my batch relocating script in another branch for cleanliness)

Feel free to include it in a scripts folder or something incase we ever need to resize the map again?

FWIW, the Leaflet we have configured has been using the Web Mercator projection, notably with positive latitudes 0 - 85.051... . I chose to convert lat-long to pixels and back for rescaling instead of reconfiguring Leaflet and still rescaling.

I honestly whipped this up pretty quickly without much knowledge of how leaflet works with it's coordinates. If there's a better metric for it, feel free to implement it!

Sticking this note here as well: Saber Gordo asset is needed. Currently placeholding it with a tabby gordo.

I'll grab the saber gordo asses when I get home.

I'll go ahead and merge this a little later as I'm a tab busy right now, Thanks again for the great work!

(Also, what's your reddit name :eyes: I'll make a post once live and mention your work)

rodriguezrrp commented 11 months ago

Okay, pretty much everything is added for powderfall bluffs now! Pending saber gordo.

Feel free to include it in a scripts folder or something incase we ever need to resize the map again?

It's just a bodge python script honestly, nothing pretty. Opens the original /src/data/*.js files (I created copies which had the original data) and remaps and rewrites the positions inside. But I could clean it up a bit and make it more "resilient" if you want me to include it officially.

(Also, what's your reddit name šŸ‘€ I'll make a post once live and mention your work)

Oh, thanks! It's rodriguezrrp. I don't have a large presence on there but I would still appreciate the credit!

BrookJeynes commented 3 months ago

Hey @rodriguezrrp, do you still happen to have that move script? I need to move a bunch of elements since i've switched the map to a tile layer šŸ˜“

Or, if you're feeling really helpful, just running the script for me šŸ˜… I'll put the tilelayer changes in a new branch for you to check out if you get a chance otherwise i'll probably just move them by hand lol https://github.com/BrookJeynes/slime-rancher-2-interactive-map/tree/tilelayer-map

rodriguezrrp commented 3 months ago

Hey @BrookJeynes! Wow your updates on this are amazing. Yes, I still have that script. I found it here: https://github.com/rodriguezrrp/slime-rancher-2-interactive-map/blob/rescaling-map-markers/src/data/sr2-position-rescaling.py

Fair warning it made some assumptions on where the files are (were) and what they look like inside. But the main logic should be in the transform(pos) function. However, if you give me until I'm free this afternoon I can probably run it myself on that branch! I'd love to help out.

BrookJeynes commented 3 months ago

@rodriguezrrp I wished I read this before I changed it all by hand šŸ˜‚

Ah well,, regardless. If you still wanna help out, I'd love if you make the script resilient and able to update positions in the future if we need to make changes to the map size / position again? That way we could add it to the repo :)

If you're wanting to help out more, I believe there are a couple small and "large" TODO comments.

Thanks again for all the awesome work man. I thought the original code was messy and I've learnt a lot since it's creation so it was easier to nuke it and start from scratch using typescript and setting everything up proper. Let me know if you have any feedback of course :)

Feel free to join the discord, if you plan on contributing more, I'll flag you as one :) https://discord.gg/yDQZuRJY

rodriguezrrp commented 3 months ago

Sure. I think I could do one better, and probably dump some of the gameobject's transform.position values from the game. I tried some preliminary testing of that idea last afternoon and it seemed promising. I think it'd be a more resilient approach to game updates than just manually placing and then needing rescaling every time the map changes size -- I am sure they will add more islands to the map as it updates, and the accuracy of positions is going to degrade every time with that script. You can let me know what you think of this idea.

(I dumped some locations of pods, gordos, and doors, but I'm still trying to find out how to dump the locations of the research drones :P it's strange how they structured a lot of their data internally. Plus I'd need to figure out the bounds of the map in-game so we have a reference frame by which to scale the positions onto our "global" map.) If you still want me to clean up that script, I can switch to that. Also, sure I can check out some of those TODO comments when I can. This week will probably be abnormally busy for me though.

And thanks for the invite to the Discord! I can join it too. I think that's a nice way to make this project more approachable for non-github users.