GrapeshotGames / ServerGridEditor

ServerGridEditor for Atlas
https://playatlas.com/
MIT License
82 stars 140 forks source link

Slippy map generates large blank areas #56

Open baylf2000 opened 5 years ago

baylf2000 commented 5 years ago

I have 2X3 grid, and when I generate the slippy map, it seems to still generate a 3x3 map, with right 1/3 of the map just empty blue space. This causes issues with the overlay programs as they take the 1/3 space as actual map, so the overlays are in the wrong place.

Is there any way I can fix this?

smooreace commented 5 years ago

Sounds like you have a 3x3 with only a 2x3 area populated. So its doing exactly whats intended.

On Tue, Jan 29, 2019 at 7:57 PM Lachlan Fletcher notifications@github.com wrote:

I have 2X3 grid, and when I generate the slippy map, it seems to still generate a 3x3 map, with right 1/3 of the map just empty blue space. This causes issues with the overlay programs as they take the 1/3 space as actual map, so the overlays are in the wrong place.

Is there any way I can fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GrapeshotGames/ServerGridEditor/issues/56, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah5OQ4VyxLKaGV8FtpN1MfQuuffcMGGpks5vIPv1gaJpZM4aZTCE .

baylf2000 commented 5 years ago

@GrapeshotGames Attached is a zip file containing a sample 2X3 map config I created just now for demonstration, and the top level of the resulting slippy map (0.png) which shows the incorrect aspect ratio with the empty space. Also in the zip file is the exported MapImg.jpg from the same config which is correct, so it seems the slippy map creation is not working for 2x3 while the normal mapimg export is.

Thanks for your time.

Export.zip

smooreace commented 5 years ago

You might want to include the config.json file from AtlasTerritoryMap! Its kinda important

smooreace commented 5 years ago

Then you are using some unofficial overlay that wasn't created properly to deal with a 2x3 map. The slippymap is exported as needed for use with AtlasTerritoryMap. And works perfectly with it.

On Thu, Jan 31, 2019 at 12:19 AM Lachlan Fletcher notifications@github.com wrote:

What are you talking about? "AtlasTerritoryMap"? It has nothing at all to do with anything. I don't use it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GrapeshotGames/ServerGridEditor/issues/56#issuecomment-459229675, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah5OQzXrIM88B9Q7y7CWuegwTB0BgN-Tks5vIoqzgaJpZM4aZTCE .

GrapeshotGames commented 5 years ago

Hey @baylf2000 . You are using this for the AtlasMapViewer, correct? Slippy (google maps) style images are just meant to be used with that example. The AtlasTerritoryMap is what generates the territory overlay for the game and optionally the AtlasMapViewer. If it is meant for the AtlasMapViewer do you have that config.js/config.json as well? I'm assuming it just you just set the config.js to 2x3. Are ships offset or just the Territory Overlay from AtlasTerritoryMap?

baylf2000 commented 5 years ago

Hi @GrapeshotGames. Thanks for the reply.

The in-game map is correct with the territory overlays working and in the correct place.

When I try and use AtlasMapViewer, I get the attached view. I've also included the config.js in the attached zip. I've tried it with both 2x3 and 3x3 config and it doesn't seem to make any difference. I have confirmed the correct config version is being received by the browser.

capture

config.zip

GrapeshotGames commented 5 years ago

@baylf2000 Thanks for the screenshot and clarification. I would have to look back over the leaflet setup and see if there is a quick change. I'm not sure exactly when we can get to something like this given our main focus currently is still the core game and making that a better experience. What comes to mind is just changing it to be non square in leaflet within the AtlasMapViewer and compensating the slippy map generator in ServerGridEditor as well. If that is trouble for any reason I would say just keep it square but make the image transparent vs solid colors for those off the grid and get the AtlasMapViewer to compensate by how it generates lat/long coords which would just take the 'X' in your image above and compress it so it's 2/3. It's not as elegant as the first approach but not all that bad. If it feels weird with that case being too far to the left the transparent border could be split between the two sides so it's centered. If someone else ever gets to this first or puts up PR's we are more than happy to take it in. We could have not given this out or just waited but we figured it was cooler to just let you guys have it and src as a working example of things that you can do with it all vs trying to keep it locked down. With that said we do try to add or fix little things when we can or get the urge ourselves for something!