Page 1 of 4

Smallmap zoom/Minimap zoom

Posted: 06 Jul 2007 03:28
by NukeBuster
The original was made by Thomasdev. (last know revision r7236 dated 22 November 2006)

Flyspray task.

But, what does it do?
This patch lets you zoom in and out of the minimap.

Please give it a try.

Edit: 20-07-2007 - Updated post with latest patch(-r10643), and added a screenshot.

Posted: 06 Jul 2007 04:40
by Bilbo
I tried it, it looks great, but I found some small glitches:

* After zooming competely out and back in I was unable to return to 100% zoom (except by closing and reopening the window). Zooming was snapping between 80 and 160 or some other values. When I pressed the zoom in/out button, the zoom goes 100->50>25->12->10. Then zoom in: 10->20->40->80->160 ...

* The "smooth zoom scrolling" is quite slow. I think it should scroll maybe two or three times as fast. Or maybe it will be good to be able to set up scrolling instantly for those who does not want the "smooth zoom"

Posted: 06 Jul 2007 12:54
by NukeBuster
i will have a look at the zoom in and out problem.

The smooth zoom came around -r10200 so some internals probably changed around that time... I'll look into that aswell.

Thank you for your testing and comment.

Posted: 06 Jul 2007 18:17
by mikeel
great work!
only some suggestion:
1 - as bilbo said, the zoom snap must be fixed to 12-25-50-100-200-400-800 an it mustn't be recalulate from the previous one (althought if i zoom out from 25% i will get 12%, if i re-zoom in i'll get 24% and 48% and 96%: that's wrong)
2 - smooth scroll is really useful? (this is only a doubt :D )
3 - when i zoom in and out the minimap is re-centered to the current view, and if i'm looking another zone of the minimap is quite boring
4 - there's a way to implement a screenshot of the minimap? (ok, maybe this is off-topic, but if you want to think about it... :wink: )

Posted: 06 Jul 2007 18:40
by NukeBuster
The zoom problem is isolated, i will still have to test it, but i know where to look for that. I'm still looking in to the other problems.

Posted: 11 Jul 2007 22:26
by NukeBuster
An update for this patch.

The messed up zooming has been fixed.
I have removed the smooth scroll, as it also interfered with the percentage.
And 6% zoom has been added.

Edit: Oh, and to make a screenshot. Just stretch the viewport so it fits in the screen. Then use the nor

Todo:
Don't center on main screen position when zooming.

Changes:
Fixed: Removed smooth scroll. As it did not really add anything and it messed up the variables when scrolling while still zooming.
Fixed: Zoom in no longer messes up percentage.
Feature: 6% Zoom added, 2048x2048 maps were not entirely visible with 12%

Posted: 11 Jul 2007 23:12
by Bilbo
NukeBuster wrote:An update for this patch.

The messed up zooming has been fixed.
I have removed the smooth scroll, as it also interfered with the percentage.
And 6% zoom has been added.
Good, I've tried it and there are no glitches now.

But I've thought of one possible improvement - move information about current zoom to the statusbar of the map, like shown in the attached picture. Since if showing town names is on, and the map is cluttered with them, the zoom is not visible as it is likely to be overdwarn by the town names....

Re: Smallmap zoom/Minimap zoom

Posted: 19 Jul 2007 16:05
by Bilbo
I have tried it with my new large maps patch .... well, it works fine, but for 8192x2048 maps there may be use for even smaller zooms :)

Re: Smallmap zoom/Minimap zoom

Posted: 20 Jul 2007 18:51
by NukeBuster
For that to work the zoom probably needs to be turned inside out...

I've done a little update. The only change in this version is the suggestion of Bilbo a few posts back.

Todo:
Don't center on main screen position when zooming. But rather on mouse position.

Changes:
"Zoom: x%" text moved to status bar as suggested by Bilbo.

Re: Smallmap zoom/Minimap zoom

Posted: 20 Jul 2007 19:07
by Bilbo
Well, I tried it with 8192x2048 and with 1600x1200 the max zoom was fine, lot of space remained too ...

So i think it's fine, no more zoom levels needed, since smaller zooms would make it too unreadable.

BTW I thought of one more possible improvement, to show the map size along with the zoom, so the text won't read "Zoom: 50%" but for example "Zoom 50%, map 1024x512" ... or something like that.

Re: Smallmap zoom/Minimap zoom

Posted: 23 Jul 2007 13:21
by TheJosh
cool patch, good idea!

Re: Smallmap zoom/Minimap zoom

Posted: 24 Jul 2007 12:10
by mikeel
is possible to show only the names of the biggest cities in the smallest zoom levels?
becouse if you've a map with a lot of cities the map is unreadable

Re: Smallmap zoom/Minimap zoom

Posted: 24 Jul 2007 15:09
by NukeBuster
@mikeel, you can disable the names by depressing the city icon in the minimap window. I'll look into if its possible to show only the biggest citys at < 25%

At the moment I am working with tho original author to get the patch finished.

Please follow Flyspray task 54 if you want to try the latest diffs and follow progress closely.

Re: Smallmap zoom/Minimap zoom

Posted: 10 Jun 2009 18:31
by fonso
Sorry for grave digging, but I have updated this patch as I need it for cargodist. You can pull it from my git repository at http://fickzoo.com/fonsinchen/openttd.git, branch smallmap-zoom or you can use the attached patch. See the FS task for some details.

Re: Smallmap zoom/Minimap zoom

Posted: 11 Jun 2009 06:39
by jonty-comp
Ooh, this looks very useful! I hope it gets more attention than it did in 2007! :P

Re: Smallmap zoom/Minimap zoom

Posted: 11 Jun 2009 12:07
by CommanderZ
Yeah, the current minimap sucks, it is only slightly smaller that the maximum zoom out level.

Re: Smallmap zoom/Minimap zoom

Posted: 10 Jul 2009 00:09
by fonso
new version:
  • vehicles are drawn as full tiles, not only as single pixels
  • scrolling is less shaky
The scrolling is still not pixel by pixel in the lowest zoom level but much finer grained than before. Please tell me if this is enough.

Re: Smallmap zoom/Minimap zoom

Posted: 12 Jul 2009 17:26
by fonso
New version:
  • disable the "+" and "-" buttons when reaching max/min zoom levels.
  • enable mouse wheel zooming
  • make zooming a little more smooth
  • document some things
  • remove useless code
By now I have understood most of the obscurity in smallmap and either documented or removed it. The only thing left are some magic offsets in DrawSmallmap which I can't make any sense of. I have, however, marked those places accordingly.

Re: Smallmap zoom/Minimap zoom

Posted: 12 Jul 2009 19:56
by StopRightThere
I wonder what the chances are of this going into trunk?

Re: Smallmap zoom/Minimap zoom

Posted: 12 Jul 2009 20:26
by jonty-comp
I'll back it for inclusion, if it's suitable! (Not that I have much say in dev affairs)