Experimental client with user interface scaling

Forum for alternative clients, mods & discussions on the same.
ElSid
Posts: 29
Joined: Sun Jul 26, 2015 9:45 am

Experimental client with user interface scaling

Post by ElSid »

Playing H&H on a 15" 4k monitor with default interface scaling is a pain. I've seen on the forum multiple questions about it but so far no straight answer would it be actually done. So before I can give this game another round I've decided to spend some time on UI scaling. I know there is a solution to use OS scaling but it doesn't support proper fonts scaling. This means code change is required but the main problem is that almost everything related to a widget position and size is hardcoded. For now I try to adjust the most recent default so called "render" client but the changes should be portable. Except all new widgets added in custom clients using the same hardcoded position and size approach will break. Work is not done yet but all UI that can be visible for a new character is scaled. And since I don't have a skilled character I just can't simply test all the widgets now.

I made this post to get some early feedback. I don't share the code yet because I don't think it's in the proper state. I'd like to see the change in the default client because it can benefit all other clients. But if there is something going on I can just stop. Anyway I'm open to cooperation. Also if for some reason it's not desired to have it in the default client I will start to port it into amber. I want to start to play at last.

Here is the current state:

2.83x UI scaling:
Image
To compare 3x OS scaling:
Image
And the painful default scaling:
Image
Update:
  • After playing for several weeks I think the first version is ready for a wide testing. Some widgets may still be somehow broken in a scaled state. If you find such, please report.
  • I started to port changes to Amber but after old resources are gone there is no much point to do any changes there until it will support new ones.
Here is a client version to try:
https://github.com/elsid/hafen-client/releases
Last edited by ElSid on Mon Aug 24, 2020 1:15 am, edited 5 times in total.
User avatar
loftar
Posts: 9093
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Experiments with user interface scaling

Post by loftar »

Interesting experiment. Just out of curiosity, would I be right in assuming that you only support integral scaling factors?
"Object-oriented design is the roman numerals of computing." -- Rob Pike
ElSid
Posts: 29
Joined: Sun Jul 26, 2015 9:45 am

Re: Experiments with user interface scaling

Post by ElSid »

Floating point scaling is supported. The UI scale factor is a double and where it was possible I've used round to int closer to the result of the expression. Still some artifacts are possible due to the fact that all widgets coordinates and sizes are ints. Maybe it's worth to change this and use float or double.
AtoB
Posts: 189
Joined: Sat Mar 01, 2014 12:38 am

Re: Experiments with user interface scaling

Post by AtoB »

loftar wrote:Interesting experiment. Just out of curiosity, would I be right in assuming that you only support integral scaling factors?
Would not matter.

Please, please, fucking please: pull his code to make the official client feasible for the ones with modern equipment.
ElSid
Posts: 29
Joined: Sun Jul 26, 2015 9:45 am

Re: Experiments with user interface scaling

Post by ElSid »

I've updated a post and added a link to a first experimental version including the source code.

Return to “The Wizards' Tower”