JonnyPtn / zomboi

A discord bot for project zomboid multiplayer servers
49 stars 32 forks source link

location is pretty zoomed! #52

Open afronob opened 1 year ago

afronob commented 1 year ago

Hi (again) @JonnyPtn !

MapHandler (location cmd) is pretty zoomed on my server.

Check it out: https://postimg.cc/7C7BKRKD

Is that normal ? Is they any chance to get a way to unzoom it ?

Is they a bug or something ?

Thanks for your work.

JonnyPtn commented 1 year ago

Hard to say without a bit more info - It just shows the current map cell the player is in, which should be the same size for everyone (on the same map).

Which map is this on and where is the location?

thurbridi commented 1 year ago

Hey, @JonnyPtn. I looked at the map code to correct the orientation so it is the same as the in-game map (btw, was this intentional?).

I see that the cell is drawn for every call, but perhaps you could draw the whole map once and only draw the player dot on top when the command is called, returning a cropped map section around the player. Implementing zoom levels with this method would be simple, only taking care around map edges.

JonnyPtn commented 1 year ago

I hadn't noticed the orientation was different, maybe something changed in the game recently? Will take a look anyway. And the rest of your suggestion makes sense, could generate and save the map on startup