Yeah, I think it's a very useful trick for huds, it can be currently done easily in the engine without distortion if you are using proportions of 200% or 50%. In my case it's harder because I need a hud 30% smaller or the battlefield 30% bigger.
I could even double all my assets size and increase the resolution, but will still need to adjust it by 30%. In addition, I will need to remake the entire game, which can be a pain due to many "at" adjustments in the levels, scripts based on screen size, etc.
However, it sends me to a second idea that could be applied easier than the resample feature. Some time ago I was doing tests in the engine trying to separate the level resolution from the screen resolution, because currently both are always connected. As an example, if both works separately I could double the base resolution in the video.txt and instead of updating all my levels, I can simply define a openborvariant called "level resolution" to half of the main resolution but putting the entire battlefield in a new screen and double it using drawmethod.
May looks confuse in my description but I recorded a video showing it. In the video below I doubled the SORX resolution from 480p to 960p and put the battlefield into a screen with size x2 using drawmethod. However, you can see that some things like camera will act following the 960p behaviour, not 480p, and here is where the separated level resolution variant will act. This way we can easily avoid resizing at least all the level assets, only the ones related to menu, bgs, select screen, etc.
PS: The battlefield is around 30% bigger, you can see the difference compared with the second test in the same video.
Here's the script I'm using as a draft for experiments, in case you want to make some tests. Simply calling it in the updated.c and filtering using openborvariant("in_level") is enough to make it work. Use 0 to apply on hud or 1 to apply in the level.
C:void drawLevel() {//Used to test different HUD sizes void vScreen = openborvariant("vscreen"); int draw = 0; //0=HUD OR 1=LEVEL //CREATE A SCREEN AND SAVE IN A VARIABLE if(getglobalvar("allocScr_levelScreen") == NULL()){ setglobalvar("allocScr_levelScreen", allocscreen(openborvariant("hResolution"), openborvariant("vResolution"))); } if(getglobalvar("allocScr_hudScreen") == NULL()){ setglobalvar("allocScr_hudScreen", allocscreen(480, 272)); } //CLEAR ANY PREVIOUS SCREEN VALUE clearscreen(getglobalvar("allocScr_levelScreen")); clearscreen(getglobalvar("allocScr_hudScreen")); //DRAW EVERYTHING TO THE SCREEN (DRAW HUD) if(!openborvariant("pause")){ //HUD if(draw == 0){ drawspriteq(getglobalvar("allocScr_levelScreen"), 0, openborconstant("MIN_INT"), openborconstant("MAX_INT")/1000000, 0, 0); drawspriteq(getglobalvar("allocScr_hudScreen"), 0, openborconstant("MAX_INT")/1000000, openborconstant("MAX_INT")-10, 0, 0); changedrawmethod(NULL(),"reset", 1); drawscreen(getglobalvar("allocScr_levelScreen"), 0, 0, openborconstant("MAX_INT")-5); changedrawmethod(NULL(),"enabled", 1); changedrawmethod(NULL(),"transbg", 1); changedrawmethod(NULL(),"scalex", 210); changedrawmethod(NULL(),"scalex", 210); drawscreen(getglobalvar("allocScr_hudScreen"), 0, 0, openborconstant("MAX_INT")-4); drawspriteq(vScreen, 0, openborconstant("MAX_INT")-5, openborconstant("MAX_INT"), 0, 0); clearspriteq(); }else //LEVEL { drawspriteq(getglobalvar("allocScr_levelScreen"), 0, openborconstant("MIN_INT"), openborconstant("MAX_INT")/1000000, 0, 0); changedrawmethod(NULL(),"reset", 1); changedrawmethod(NULL(),"enabled", 1); changedrawmethod(NULL(),"scalex", 512); changedrawmethod(NULL(),"scaley", 512); drawscreen(getglobalvar("allocScr_levelScreen"), 0, 0, openborconstant("MAX_INT")/1000000); drawspriteq(vScreen, 0, openborconstant("MAX_INT")/1000000-1, openborconstant("MAX_INT"), 0, 0); clearspriteq(); } } }
This is really cool @Kratus.