Opened 10 months ago

Closed 3 months ago

#14524 closed defect (fixed)

GRAPHICS: Wetlands (and possibly others) use own cursor palette

Reported by: mikrosk Owned by: mikrosk
Priority: normal Component: Engine: Hypno
Version: Keywords:
Cc: Game: Wetlands

Description

I have noticed that at least in the Wetlands demo's shooting sequence its cursor has own palette.

This makes it problematic on backends with 8-bit rendering only (with cursor palette disabled). From my quick check it seems that *all* colours used in the cursor are present in normal palette so maybe it's enough just to note down the color indexes instead of creating new colors?

Attachments (1)

grab0001.png (205.3 KB ) - added by mikrosk 10 months ago.

Download all attachments as: .zip

Change History (24)

comment:1 by neuromancer, 10 months ago

Hi,

Thanks for this report. This is certainly doable, but first I need to check exactly how the the palette can be shared between the screen and the cursor one, since I don't have a lot of experience with that.

Btw, which 8-bit backends are you targeting? I'm wondering if they are fast enough to run these games.

comment:2 by mikrosk, 10 months ago

Cheers! From what I have seen, the most interesting stuff is in hypno/cursor.cpp. There you have colour indices into your own palette (0-3). So what needs to be done is to check what palette(s) are used in what screen(s) and replace the 0-3 indices with real palette indices from given screen (and basically avoid calling any of the set cursor palette functions).

Of course, it's very well possible that multiple screens use the same cursor shape but require different palette mapping and/or colour scheme (i.e. one would need to provide multiple per-screen cursor definitions). This alone is the reason I didn't want to mess with the engine I have no literally zero knowledge about the game so I wouldn't be able to guarantee that I don't mess something up.

I tested the behaviour in 'atari' backend but it's generic to any engine, incl. SDL should you choose 8-bit rendering there. On 66 MHz machine Wetlands demo was more than playbable. :)

If you need some help with palette stuff or just with testing, feel free to reach me at Discord (@mikro).

comment:3 by neuromancer, 10 months ago

Very interesting, I will be more than happy to see the hypno games played in Atari. Let me take a look to some of the wetland palettes to see if the needed colors are always in the same position (SMK videos can have different palettes changed from frame to frame). If that's the case, we can have a quick fix for this that will reduce the complexity of the code.

Btw, if you can, please test the private engine in Atari, since it only requires to point and click, and it should be playable in 8-bits backends.

comment:4 by mikrosk, 10 months ago

Strangely, 'private' is marked as a 16-bit engine, despite its description being a 256 colours game? (https://wiki.scummvm.org/index.php?title=Private_Eye_(1996)) ('atari' has all 16-bit engines disabled by default).

comment:5 by neuromancer, 10 months ago

Uhm, perhaps it is a mistake. Can you try to downgrade it to 8bits and check if it fails?

comment:6 by neuromancer, 10 months ago

An update on the private engine. It was downgraded to use 8bits, but it is still high resolution, since it requires a 640x480 screen resolution. Is this a blocker for the Atari backend?

by mikrosk, 10 months ago

Attachment: grab0001.png added

comment:7 by mikrosk, 10 months ago

Thanks for taking a look (didn't have much time today). Now I could try Private Eye Demo as well, it works all right, even the intro scene is fine.

I guess the reason you asked me to try is the same issue - a lot of setCursorPalette calls which unfortunately fall onto deaf ears in 8-bit backend. :) (see the attached screenshot)

comment:8 by neuromancer, 10 months ago

Thanks a lot for the testing. It makes sense to fix both engines, since these were created by me (so the same issue in both is not a surprise).

comment:9 by tag2015, 6 months ago

Summary: Wetlands (and possibly others) use own cursor paletteGRAPHICS: Wetlands (and possibly others) use own cursor palette

comment:10 by mikrosk, 4 months ago

Any news on this by any chance? :) I'm thinking that maybe in the meantime we should mark both hypno and private engines as 16bit if you are busy with other matters? (as was the case with private previously)

comment:11 by neuromancer, 4 months ago

Hi!,

I'm still planing to do this change sooner than later. I was waiting for the release. I prefer to keep them as 8bit for now, until I fix this.

comment:12 by neuromancer, 4 months ago

I did some investigation. I'm close to have a fix for Private Eye and Wetlands, but the Spiderman game and Soldier Boyz will be more difficult. They feature several pointers that are loaded with particular palettes in specific files. While it is not too hard to find the colors in the frames of the videos they play, remember that they use SMK videos, which features dynamic palettes :O

In the future, I think we can try to work towards a more generic code that scan the SMK palette frames from time to time and remaps the colors of the cursors if necessary.

comment:13 by neuromancer, 4 months ago

The Wetlands fix is here: https://github.com/scummvm/scummvm/commit/d28712dcf40b290b1e1a5fd407afd5d47c5d281a

If possible, please test the demo and the full game (it only costs a few dollars in Steam/GOG). Each level should be tested to check that the cursor will not unexpectedly change color because of a palette remapping (also, the game will benefit from testing in general, so if you found any other issues please let me know).

comment:14 by mikrosk, 4 months ago

I've given it some testing. Definitely looking good! A few observations:

  • full Wetlands (DOS/English (US)) prints a lot of "WARNING: Adding \0 to String. This is permitted, but can have unwanted consequences. (This warning will be removed later.)!"
  • some demos do that, too
  • neither the full version nor the demos can be returned to the launcher, the option is greyed out
  • Wetlands (Demo/DOS/English (US)) has different cursor colour in the welcome screen - on Linux it is black with white outline, on Atari 8bpp it is light green with white outline. Frankly, I can't decide which looks more correct ;)
  • not sure if bug but the options (1-Play Demo 2-Cinematics 3-Exit) doesn't seem to respond to 1, 2, 3 keys, is that normal? Mouse clicks work.

comment:15 by neuromancer, 4 months ago

Thanks for the testing, let's take a look:

  • full Wetlands (DOS/English (US)) prints a lot of "WARNING: Adding \0 to String. This is permitted, but can have unwanted consequences. (This warning will be removed later.)!"
  • some demos do that, too

I need to investigate these. Probably something in the parsing..

  • neither the full version nor the demos can be returned to the launcher, the option is greyed out

This should be easy to fix.

  • Wetlands (Demo/DOS/English (US)) has different cursor colour in the welcome screen - on Linux it is black with white outline, on Atari 8bpp it is light green with white outline. Frankly, I can't decide which looks more correct ;)

The wetland demo never used mouse for that, so can be actually any color (but white makes more sense?). However, since it is not the same color, that is a bug. I will favor the green one, since it matches the color of the text.

  • not sure if bug but the options (1-Play Demo 2-Cinematics 3-Exit) doesn't seem to respond to 1, 2, 3 keys, is that normal? Mouse clicks work.

Actually, this was never implemented, IMHO mouse was easier to use. I should finish this someday.

For other issues, please open new issues (except if they are very small).

comment:17 by neuromancer, 3 months ago

Is this still happening:

Wetlands (Demo/DOS/English (US)) has different cursor colour in the welcome screen - on Linux it is black with white outline, on Atari 8bpp it is light green with white outline. Frankly, I can't decide which looks more correct ;)

comment:18 by neuromancer, 3 months ago

Uhm. I cannot reproduce. Which OS exactly are you using?

comment:19 by mikrosk, 3 months ago

Hey, I should have some time to take a look tonight. What exactly you cannot reproduce so I can try on my end?

comment:20 by neuromancer, 3 months ago

I cannot reproduce the fact that the cursor in the welcome screen has different colors. It is always green, as it is supposed to be.

comment:21 by mikrosk, 3 months ago

Indeed I can confirm that. Now both cursors have the same colour so I guess this issue can be closed unless you want to keep it open until fixing private engine?

comment:22 by neuromancer, 3 months ago

I already created another issue for the private here: https://bugs.scummvm.org/ticket/14863, I think we can close this one (we should move any unrelated issue discussed here to other tickets)

comment:23 by mikrosk, 3 months ago

Owner: changed from neuromancer to mikrosk
Resolution: fixed
Status: newclosed

Fixed by @neuromancer, closing. Much appreciated.

Note: See TracTickets for help on using tickets.