Running VCMI in 480p

Yes, I am aware of that 9 year old thread 800x480 resolution
However I have successfully played VCMI on Ubuntu on 800x480 screen with lots of dirty hacks. However it would work better with some small assistance from VCMI.

Basically:

  1. I took RaspberryPi
  2. slapped 7’’ 800x480 touchscreen on it
  3. Forced 800x600 resolution by runnning cvt 800 600 60 and xrandr --newmode "forced600" [cvt output]
  4. messed up with scaling and transform until everything fit on screen

Windowed works fine by just scaling down until 800x600 + header bars fits in 480p xrandr --scale 1.5x1.5

Not-true fullscreen got hit by 600px * 0.8 = 480px, but it kept rendering on center of 800x600 canvas so I had to offset view with xrandr --output DSI-1 --mode forced600 --transform 0.8,0,0,0,1.00,+60,0,0,1 (0.8 vertical scale, offset 60px up, rest are default values)

…buuuuuut…

just resetting back to native resolution xrandr --output DSI-1 --mode FIXED_MODE --scale 1.0x1.0 while game is running this weird not-true fullscreen resulted in letterboxed game, with fully accurate touchscreen.

Basically you can get game to run in 480p with:

xrandr --output HDMI-1 --off
xrandr --output DSI-1 --mode forced600
( sleep 10; xrandr --output DSI-1 --mode FIXED_MODE --scale 1.0x1.0 ) &
vcmiclient

It works by:

  1. Disable external screen, because even disconnected screen can be present in Linux because reasons.
  2. Force 800x600 resolution
  3. With 10 second delay revert to native resolution
  4. Run game
  5. In few seconds game will shrink to fit screen
  6. Watch how game draws itself to fill screen while keeping aspect ratio.

And it works in letterbox (with some artefacts from previous resolution on border, which could be removed with clever abuse of transforms in forced600 stage).

So, basically, I’d like VCMI to:

  1. Stop with that pesky resolution check at start in Windowed and Not-True Fullscreen, because its not needed (or check scaled resolution instead of physical, Launcher actually displays it in screen selection)
  2. Have option to draw screen to fill, without keeping aspect ratio. But due to nature of this UI it would probably require same scaling applied to mouse clicks