Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow orange, bright red and black colors #1014

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

osm
Copy link
Contributor

@osm osm commented Feb 1, 2025

There was a version of qwcl where you could use black and orange colors, but I haven't been able to figure out which version included them or when they were removed.

The current color selection algorithm works like x * 16 + 8, where x is a row in the Quake palette (as seen here: https://quakewiki.org/wiki/Quake_palette).

So, color 0 is the same as 0 * 16 + 8, which maps perfectly to the white color in the palette. The same goes for the other colors between 0 and 13.

I'm uncertain about the exact shade of orange that was possible to use, but my guess is that it was 14 * 16 + 8 == 232.

color 14:
color14

color 15:
color15

Old screenshot that demonstrates the black color:
https://www.quakeworld.nu/w/images/4/4c/RFVSSC1.JPG

@osm osm force-pushed the add-black-and-orange branch 2 times, most recently from 5b3d420 to 8d42c1c Compare February 1, 2025 21:36
@Calinou
Copy link
Contributor

Calinou commented Feb 4, 2025

In the long term, I wonder if arbitrary(-ish) colors could be supported. What's the maximum value color can hold? If it can hold at least 232 values, then we could probably map values 16 and above to web safe colors which is a collection of 216 colors (so it can fit within a 8-bit value and keep the existing 16 colors as-is).

@osm
Copy link
Contributor Author

osm commented Feb 4, 2025

Quake uses 1 byte to store both the bottom and top colors (4 bits for each), if I read the code correctly. So, supporting more colors would be a breaking change, at least if we want to maintain compatibility with the original Quake engine. However, if we only care about QuakeWorld, we can most likely use all 255 colors available in the palette without breaking anything!

This PR, however, is just an attempt to revive the old colors that were possible to use in that old qwcl version.

There was a bug in the following client versions that allowed players to
use more than the regular colors.

- qwcl-1.50
- qwcl-1.55
- qwcl-1.64
- qwcl-2.00
- qwcl-2.10
- glqwcl-1.64
- glqwcl-2.10

The bug was fixed in:

- qwcl-2.20
- glqwcl-2.20

Both the software and GL clients correctly restricted colors to the
range of 0 - 13 when using the color command. However, the developers
forgot to apply this restriction to the bottomcolor and topcolor cvars.

The behavior differed slightly between the qwcl and glqwcl clients. In
the software version, only two additional colors were available: color
14 (orange) and color 15 (bright red). In the GL version, players could
select from the entire palette.

This commit aims to reintroduce the most popular colors used during that
time:

- Orange (color 14, mapped to palette index 232)
- Bright red (color 15, mapped to palette index 248)
- Black (color 16, mapped to palette index 0)
@osm
Copy link
Contributor Author

osm commented Feb 19, 2025

I have finally figured out how more than the regular colors could be used in QuakeWorld back in the day.

The bug exists in the following versions:

  • qwcl-1.50
  • qwcl-1.55
  • qwcl-1.64
  • qwcl-2.00
  • qwcl-2.10
  • glqwcl-1.64
  • glqwcl-2.10

The bug was fixed in:

  • qwcl-2.20
  • glqwcl-2.20

Both the software and GL clients correctly restricted the colors to 0 and 13 when using the color command; however, the developers forgot to restrict the bottomcolor and topcolor cvars.

The behavior in the qwcl and glqwcl clients was, however, a bit different. In the software version, you could only use two more colors, color 14 (orange) and color 15 (bright red). In the GL version, you could select from the entire palette.

I have been experimenting with the old clients and captured the following screenshots. The software client displays orange and bright red colors, while the GL client displays black.

The following screenshots displays the orange and bright red colors in the original clients (the entirely blue screenshot is how it is rendered in the fixed version)
qwcl-1 50
qwcl-1 55
qwcl-1 64
qwcl-2 00
qwcl-2 10
qwcl-2 20

And these this is the GL client showcasing the black color, the last screenshot is from the fixed version which just rendered the color as white:
glqwcl-1 64
glqwcl-2 10
glqwcl-2 21

I have updated my pull request to be more aligned with the original bug, so instead of just black and orange, you can now also select the bright red color.

  • Orange (color 14, mapped to palette index 232)
  • Bright red (color 15, mapped to palette index 248)
  • Black (color 16, mapped to palette index 0)

orange
brightred
black

@osm osm changed the title Allow black and orange color Allow orange, bright red and black colors Feb 19, 2025
@osm osm force-pushed the add-black-and-orange branch from 8d42c1c to 639c1c5 Compare February 19, 2025 17:14
@tcsabina tcsabina merged commit f3096a0 into QW-Group:master Feb 19, 2025
6 checks passed
@osm osm deleted the add-black-and-orange branch February 22, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants