Page 1 of 1

Attempt at supporting double-sized images

Posted: March 28th, 2016, 5:12 pm
by David
Here is my first attempt at supporting double-sized images.
Code: https://github.com/NagyD/SDLPoP/tree/double_size
(Such new graphics is not (yet) included on GitHub!)
Mac graphics is attached to this post.

Unfortunately, it looks like the Mac graphics are organized a bit differently from the DOS ones...

Re: Attempt at supporting double-sized images

Posted: March 29th, 2016, 3:02 am
by Andrew
SDLPoP with support for original Mac version sprites? Nice! Looking forward to the bugs being ironed out, David.

Re: Attempt at supporting double-sized images

Posted: March 31st, 2016, 9:33 pm
by salvadorc17
David wrote:Here is my first attempt at supporting double-sized images.
Code: https://github.com/NagyD/SDLPoP/tree/double_size
(Such new graphics is not (yet) included on GitHub!)
Mac graphics is attached to this post.

Unfortunately, it looks like the Mac graphics are organized a bit differently from the DOS ones...
Yes, i have worked with mac graphics and those have different size and scale, so your algorithm to draw tiles in room will need to change a bit, i have resized all them to 128x148 for better usage.

Re: Attempt at supporting double-sized images

Posted: April 2nd, 2016, 11:28 am
by David
Another solution would be to rearrange the Mac graphics so that it becomes similar to the DOS graphics.

From: https://github.com/NagyD/SDLPoP/issues/61
myself600 wrote:My goal is to improve the original PC version using SDLPoP and the sprites from the Mac version, not to convert SDLPoP to the Mac version.
Or just start with the DOS graphics scaled to 2x, and let modders change them as they will.

Re: Attempt at supporting double-sized images

Posted: April 3rd, 2016, 9:54 pm
by salvadorc17
David wrote:Another solution would be to rearrange the Mac graphics so that it becomes similar to the DOS graphics.
Will be cool to see that done, you can use as alternate graphics for the game...

Re: Attempt at supporting double-sized images

Posted: April 4th, 2016, 2:38 pm
by Falcury
Very nice work! It will be interesting to be able to play with high resolution graphics natively. And perhaps sometime in the future we may have modders creating mods with modified Mac graphics.
I would love to try to help with this, unfortunately I don't have a lot of free time at the moment...

Re: Attempt at supporting double-sized images

Posted: April 10th, 2016, 8:25 pm
by mYse|f
Falcury wrote:It will be interesting to be able to play with high resolution graphics natively.
Sadly, this it's going to happen anytime soon. It's been a week since I've heard back from David, and I'm unable to continue my work until the issue is there. If this isn't going to be resolved soon, I'm afraid I'll have to abandon the effort. :(

Therefore, any help regarding this is very much appreciated!

Re: Attempt at supporting double-sized images

Posted: April 15th, 2016, 3:39 pm
by Falcury
Well, sometimes things just take some time...
In my own experience it often doesn't hurt to leave a challenging project alone for a while, and come back to it later. :)
I'm sure that the problem can be solved somehow!

Welcome to the forum, by the way!

Re: Attempt at supporting double-sized images

Posted: April 17th, 2016, 7:19 pm
by mYse|f
Falcury wrote:Well, sometimes things just take some time...
In my own experience it often doesn't hurt to leave a challenging project alone for a while, and come back to it later. :)
I'm sure that the problem can be solved somehow!

Welcome to the forum, by the way!
I wanted to spur the interest in the issue by remaking the background of Princess's room, but before I finished it, David has provided a workable solution, so now I'm able to continue where I left off.

Thanks for the welcome! :)

Re: Attempt at supporting double-sized images

Posted: November 25th, 2016, 9:00 pm
by Sance
I hope this feature will get implemented, it's just the extra that SDLPoP needs to be an important port that offers significantly more than the original DOS version. Also: it would be awesome as hell to play the game on the speed of the DOS version with Mac graphics, in my opinion that's the best of both worlds (DOS for gameplay, Mac for graphics). :)

Re: Attempt at supporting double-sized images

Posted: November 25th, 2016, 10:35 pm
by Norbert
David wrote:Or just start with the DOS graphics scaled to 2x, and let modders change them as they will.
This sounds like the easiest solution. If all PNG images are scaled 2x without interpolation - ImageMagick can do this in bulk - then even scaling it back to 1x with SDLPoP ("nearest" SDL_HINT_RENDER_SCALE_QUALITY) should give the program an unchanged appearance. After that, mods that use DAT files can be assumed to use 1x and for mods that use PNG files SDL_QueryTexture() could be used to check the height of a PNG image to determine the scaling factor.

Re: Attempt at supporting double-sized images

Posted: January 22nd, 2018, 12:48 pm
by Falcury
I just took a look at this. I checked out the double_size branch, fast-forwarded to the latest master and added the data files that David attached to the first post. I also removed the .DAT extensions from the data folder names.
I noticed that only the top left quadrant was being rendered. I managed to fix this by multiplying the surface dimensions by SCALE in make_offscreen_buffer().

Some observations:

Images that are not there in the DOS version:
PRINCE.DAT: res174-183 are added (potion bubbles for green and poison potions, apparently)
PV.DAT:
* res931 is added (princess standing)
* res963-965 are added (alternate torch frames, just for the princess cutscene?)
VDUNGEON.DAT: res220-229 are added (are these rough tile edges?)
VPALACE.DAT:
* res220-229 are added (rough tile edges?)
* res244 and res245 (blue stripes) have part of the tile below them (as opposed to res324-325)
* res348 added (don't know what this is)

Other differences:
* Level door (res233) is in one piece.
* The font does not seem to distinguish between small and capital letters.

Bugs:
* Naturally, SDLPoP isn't aware of the extra resource images that exist in the Mac graphics.
* Lots of objects are drawn slightly in the wrong place.
* Guard palette changes do not seem to be working correctly.
* The leveldoor is buggy: can see a slur of the image above the door (doesn't get redrawn properly).
* Transparency isn't always working. This seems to happen because the non-transparent blitter is used for some images, whereas the Mac version apparently uses transparency for that same image.
* Potion bubbles do not get drawn properly.
* Health flasks and text at the bottom of the screen are drawn slightly too low, causing them to partly fall off the screen.
* The health flasks are drawn too close together.
* The shadow is a bit weird.

Another thing I noticed:
Animations are sometimes a bit 'wobbly', e.g: look at the kid's feet during the turning animation, or the kid's y-position during standing jump animation. (If I remember correctly, the original Mac version has this as well)
Norbert wrote: November 25th, 2016, 10:35 pm
David wrote:Or just start with the DOS graphics scaled to 2x, and let modders change them as they will.
This sounds like the easiest solution. If all PNG images are scaled 2x without interpolation - ImageMagick can do this in bulk - then even scaling it back to 1x with SDLPoP ("nearest" SDL_HINT_RENDER_SCALE_QUALITY) should give the program an unchanged appearance. After that, mods that use DAT files can be assumed to use 1x and for mods that use PNG files SDL_QueryTexture() could be used to check the height of a PNG image to determine the scaling factor.
Upscaling the DOS graphics to 2x would of course work (whether by preprocessing the images beforehand, or by upscaling while loading the 1x image), but it may cause some other inconveniences. For the 4:3 aspect ratio and integer scaling features, I expect that we would need twice the monitor resolution to get the same effect. Another disadvantage is that we would pay the CPU cost for double-resolution rendering, even though this is really not necessary for DOS graphics.

Also, modifying the Mac data files will not really help much to get the Mac graphics working properly, because the differences between the Mac and DOS files still need to be accounted for: extra images that are not in the DOS version, transparency differences, potion bubbles, possibly negative image drawing offsets, all that. It is looking like the best thing to do is to simply account for the remaining DOS/Mac differences in the source code.

Maybe in the end there should be a setting that specifies whether DOS-style or Mac-style graphics are used? (Maybe distribute the Mac data files in a separate folder?) Then modded images could be assumed to be 2x when Mac graphics are specified.

Re: Attempt at supporting double-sized images

Posted: October 10th, 2020, 6:48 am
by Sance
Any news regarding this? Still would be great to have this option as a feature.

Re: Attempt at supporting double-sized images

Posted: October 10th, 2020, 7:08 am
by Sance
Well I tried:
Image
Yeah... I guess this feature isn't working yet. :D