Wednesday, January 27, 2010

Bug Alert!

If you're playing a map with a level name longer than 127 characters you can expect DirectQ to crash if you die, bring up the scoreboard, exit the level or finish the deathmatch. Depending on your OS and other factors it might even bring Windows down with it (not confirmed).

This will be fixed in 1.8.2; right now it doesn't warrant an emergency release as (1) these maps are quite rare, (2) they will likely crash other engines too, and (3) the max level name length supported by ID Quake is 40. In other words I currently view it as a map bug rather than a DirectQ bug, but still one that needs fixing for the next release.

The absolute maximum level name for 1.8.2 will be 1023 characters; this is enforced by the map specification, by COM_Parse, and by most compiling tools. If a map somehow manages to sneak past this limit the behaviour will be "undefined".

1.8.2 will also force-truncate level names for display in the scoreboard on one of 3 conditions - whichever comes first of: (1) end of string, (2) a '\n' character, or (3) reaching a limit of 39 characters. This is to ensure that the scoreboard display doesn't screw up visually. The initial server message will still use the full "cute" name.

Level names in saves are restricted to 20/22-odd characters - this is enforced by the Q1 save format. I'm not going to develop a custom (and incompatible) save format.

So far I haven't fully decided on how to deal with "cute" level names in the maps menu, if you're using it. My instinct is to force-truncate to 20-odd, so that will probably be the approach.

0 comments: