Author Topic: crazy proof of concept : inject 640x480 graphics into a 320x200 game, natively  (Read 1188 times)

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
if you're familiar with AGS, you know that under specific conditions (running a 320x200 game with Direct3D) you can have high-resolution characters in a low-resolution game. Some consider it a glitch, some like it, and at the end of the day the causes of that peculiarity is very well known (it has to do with allegro and all that).

But now, WHAT IF I did this :
- creating a 640x480 DynamicSprite (and of course drawing anything i want into its drawing surface)
- putting a dummy character in the bottom-middle of the screen, with the appropriate walkable area (which could be : no WA at all, or with a 50% scaling -- in this thought experiment i'm not sure what would work, i'd need to try)
- setting the view/loop/frame of that character to point to the dynamic sprite i mentionned earlier

...wouldn't i get high-resolution graphics in my low-res game? Now imagine that this would be a window of text or something that's better in high resolution (like a console or anything required in some special debug mode). Wouldn't that work?
« Last Edit: 01 Oct 2017, 23:54 by Monsieur OUXX »
 

if you're familiar with AGS, you know that under specific conditions (running a 320x200 game with Direct3D) you can have high-resolution characters in a low-resolution game. Some consider it a glothc, some like it, and at the end of the day the causes of that peculiarity is very well known (it has to do with allegro and all that).

Ok, just to elaborate.
The effect you are talking about is caused by following:
1) running a game in higher-resolution display mode. E.g. you have 320x200 game and you run it in 1280x720 window, or you have 800x600 game and you run it in 1920x1080 window, and so on.
2) when engine scales particular sprites it does so in the window pixels rather than native game pixels.
3) it has nothing to do with Allegro, BTW. This was simply caused by a mistake in drawing algorithm in Direct3D renderer.

The p2 is a core reason for this effect, because it makes it possible for pixels of a sprite to end up being of smaller size than the pixels of rest of the game, so the final sprite is rendered in higher res.

Not completely sure how result will look like, but I believe what you describe may worth a try: if you scale 640x400 sprite down 50% to 320x200 using this effect, it actually may keep higher-resolution (or even gain more resolution). One thing to remember though, this effect depends on display mode. That is, the lower display mode is, the less effect you gain.
Also, in 3.4.1 there is a switch in setup to turn it on and off.
« Last Edit: 01 Oct 2017, 22:52 by Crimson Wizard »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Thanks a lot for clarifying in such a condensed way.


Are characters the only in-game "entities" affected by this?
« Last Edit: 02 Oct 2017, 00:08 by Monsieur OUXX »
 

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
OK so here is a quick, functional proof of concept

DOWNLOAD
 

eri0o

Hey! This is awesome! I love this possibility. I think higher resolution text is good for eading. :shocked:

Are characters the only in-game "entities" affected by this?

Characters and room objects.
Well, this is rather a misuse than a feature.
Normally there should be a way to define render resolution for different layers, e.g. one for room and another for UI, but AGS just does not have this.


Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Well, this is rather a misuse than a feature.
Yes totally. If I use it I'll use it for very specific purposes. Not to mention this can only be behind GUIs and can be animated only in repeatedly_execute_always, not repeatedly_execute


At the moment the only thing that annoys me is that the nearest-neighbour downscale is not uniformly 50% even though the dummy character's scaling is 50. It creates artifacts.
« Last Edit: 02 Oct 2017, 10:26 by Monsieur OUXX »
 

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
What scaling are you running your game at? If you're running at 3x, for example, you won't be able to do perfectly regular 50% scaling.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
If you're running at 3x, for example, you won't be able to do perfectly regular 50% scaling.
That's exactmy what I was doing (3x) and you're absolutely right.