News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[7764] Message-Window size independant of pak size

Started by Leartin, February 14, 2016, 10:30:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leartin

I was very sure this bug was already reported, but I checked now and only found it on the German forums - ooops

Original bug report (December 2014, German)
http://simutrans-forum.de/forum/index.php?page=Thread&postID=105443#post105443


Message windows have a fixed size, which is the same for all paksets. But pictures included in them scale with pakset size. Because of this, the image in pak192.comic messages is broader than the box containing it, text goes vertical first and continues normally beneath the image. As a bug, this only happens at 192 size (though 128 is not looking good either) and depending on message settings won't be visible at all (if no messages pop up) - perhaps that's why nobody else mentioned it.

Possible fixes:
Scale message window with pak size (this is done with most other windows I think);
Change break-line-behaviour to be able to break at the beginning of a line, rather than after the first character. If this does not fix that the image is too far left (which I assume is because of the text), fix that position seperately - for pak192.comic, this would be perfect, since the text would simply be beneath where it has enough space. Bug would still exist for possible paksets larger than 192, but those probably have a lot more problems.

prissi

I cannot reproduce this; however, factory dialogues are now in the new "standard" size system. I could impose this too on buildings.

Leartin

That actually made things worse. You cannot simply make windows the same size across paksets, since if you do that, the image will eat up a lot more space in bigger paksets than in smaller paksets. I attached the change to a factory window in pak192, now you can't read the end of the line anymore.

And in case it was not clear before: The request was about messages, not buildings. Citybuildings, Monuments and Tourist Attractions have the same text space available across paksets, meaning the windows have 128px more width in pak192 than in pak64, while messages... well, the old screenshot of 2014 still applies.



Flemmbrav

I can easely reproduce this with just letting a train finding no route on R7720 (the newest one i use, should be the current stable).
I also took a screenshot, but you'll see nothing new, just looks like the ones above: linktotheimage

prissi

Sorry, I fix the infowindow temporary by making them also tileable. Not sure of the other side effects.

And I think one should set the width of tileable windows in the simuconf.tab, as this is certainly pakset dependent (since with larger convois the lists widows should become wider too).

Ters

If windows grow in size proportional to the tile size, that would severely restrict the number of windows large tile-size pak set players can have open. Maybe the image should simply be scaled down? (Although since they apparently need to zoom out to do anything useful, the GUI is probably the only place the high-resolution images can show off.)

Leartin

Quote from: Ters on February 22, 2016, 06:32:48 AM
If windows grow in size proportional to the tile size, that would severely restrict the number of windows large tile-size pak set players can have open.

Yes, if the window size doubles or triples, that would be an issue, but not if it gets bigger exactly as much as the preview image grows. That is to say, from the current value, subtract 64 pixels and add the pak size. Thus, no change for pak64, and at most 128pixels more width for pak192.comic.
Actually, that's pretty much how it works for most windows anyway, just not messages and now factories. Maybe some else that are deactivated in p192c (ground info,...)

An_dz

I always thought about those images having a fixed size through all paksets. It makes defining the window much easier. But never thought about scaling the content.

For obvious reasons, I always tested with 96px, and the results looked better than 128.

Ters

Quote from: Leartin on February 22, 2016, 07:46:39 AM
Yes, if the window size doubles or triples, that would be an issue, but not if it gets bigger exactly as much as the preview image grows. That is to say, from the current value, subtract 64 pixels and add the pak size. Thus, no change for pak64, and at most 128pixels more width for pak192.comic.
Actually, that's pretty much how it works for most windows anyway, just not messages and now factories. Maybe some else that are deactivated in p192c (ground info,...)

It looks like it would be double the width and three times the height for pak192. That means that the window would be six times as big.

Leartin

Quote from: Ters on February 22, 2016, 04:13:44 PM
It looks like it would be double the width and three times the height for pak192. That means that the window would be six times as big.

I don't know where you get these numbers from. I clicked on a random building in pak64, and the window was 260*223=57980 pixels large. In pak192, that same building window would have been 328*223 = 73144 pixels large. So that window would grow by about a quarter of it's initial size.
Of course, the smaller the window, the bigger the change. An alert has 196*92=18032 pixels in pak64, it would grow to 324*204=66096 pixels, which is a grow to 3.7 it's original size - that's a lot, but a long way from six times, and only applies to the smallest possible windows, which are rare and just there to be noticed once and closed, not kept around to look at changing values.

Thus, I cannot agree with your assumption that bigger windows would hurt the game in any way. I think you can trust those who play with them on this one.


But if just changing the window size, which should be the easiest fix, is too easy for you, how about getting rid of the root of the problem instead? I'd argue that those images, iconic for simutrans as they might be, are not that useful in the first place. Unless it is a one-tile low building, you won't see it completely - not if it is multitile, not if it is a skyscraper. While you might see the leading vehicle of a convoi, you don't see enough of the surroundings to actually see where it is. Which means there are different solutions for different types of those images:

In most cases, just replace them with a goto-button, since there is nothing interesting to see, and maybe an observe mode.
For factories, replace them with a new "factory Icon", which can be a fixed sized graphic across paksets (64x64) - I intentionally say Icon, because you could use the same parameter for dats, since factories don't need icons otherwise. If no Icon is set, just show nothing.
For vehicles, replace them with the view of the first vehicle of the convoy you get in the depot, and add an observe mode

The observe mode would be the same as the image is now, but at a different scale, filling the window instead of a small corner of it. Thus, even bigger buildings and convois can be seen completely, and with vehicles you get a better idea where they are. Just like with the paksets themselves, you would see more in pak64 then you would see in pak192.

But then again, that's for an extension request, and while something like that would be cool, it's not too important. I'm happy with a bugfix :)

Ters

Quote from: Leartin on February 22, 2016, 06:42:08 PM
I don't know where you get these numbers from.

It was an estimate based on the images in your first post. The pak64 window looked about three times as wide as the image. That would make the window 3x64=192 pixels wide. I then considered the pak192 version to then be roughly twice the width. The window looked like twice the height of the image. I can see I made a mistake here, as a pak192 version would then be only twice the height. That means roughly four times the size.

prissi

It is probably very pakset dependent, as many paks have very large objects and other more 1x1 ones.

A goto button is there for any window with coordinates.

Anyway, the last commit had various errors, the next one shoudl work better.

Leartin

Quote from: prissi on February 22, 2016, 11:23:51 PM
A goto button is there for any window with coordinates.

I am aware of this, but that does not mean there can't be another, more prominent one. The images work as goto-buttons, and vehicles even have a follow-button, all while they have the eye in the titlebar. Since the images are bigger, it's easier for players to click on them instead of a tiny eye. So much so that I don't think most players are even aware of what that eye does. Anyway, if you are used to clicking on an image, it's just convenience to have something else to click there, even if the image is gone.