logoalt Hacker News

netcoyoteyesterday at 3:08 PM5 repliesview on HN

One of the fun features that I developed for Warcraft (the RTS) was to fade the screen to grayscale when the game is paused.

Since the game uses a 256 color palette, it was only necessary to update a few bytes of data (3x256) instead of redrawing the whole screen, so the effect was quick.

I also used this trick when the game stalled due to missing network packets from other players. Initially the game would still be responsive when no messages were received so that you could still interact and send commands. After a few seconds the game would go into paused state with grayscale screen to signify the player that things were stuck. Then several seconds after that a dialog box would show allowing a player to quit the game.

This was much less disruptive than displaying a dialog box immediately on network stall.


Replies

upmostlyyesterday at 5:24 PM

One of my favourite things of being on HN is reading comments like this. Namely, devs who worked on games I played growing up. I absolutely love hearing stories from their past about little technical nuances like this comment. The more technical / specific, the better.

I'd honestly love to compile a book of "war stories" told by devs like netcoyote.

Maybe I will.

Net, if you're interested, hit me up.

show 1 reply
RobRiverayesterday at 4:56 PM

Omg I love this! I have been finding excuses to do little animation engine features that arent on the critical path of development for the sake of creative self-indulgence. Such features shipped was alpha channel based fading using the fundamental opengl fade parameter (under the hood its a linear interpolation of alpha values over 256, pieced together over a provided pair of timestamps).

I tell you what I'll do today on my dev time, I'll try implementing grayscale without aby research on pause and then compare notes (I'm assuming this wc code is available somewhere, which may be a bad assumption)

show 2 replies
KellyCriterionyesterday at 3:13 PM

Palette rotation was also heavily used by Ultima & Origin games up to U8 - Pagan

netcoyoteyesterday at 7:19 PM

Oh, and I forgot to mention that pause had to be synchronized across the network, so the pause button would pause for all players.

And in the "this is why we can't have nice things", that also introduced problems, because we didn't want a player who was losing to keep pausing the game until the winning player quit out of frustration, so I think we kept a per-player pause counter, which would only be restored if other players also paused? (I don't quite remember all the details, just that we had to prevent yet another abuse vector).

show 1 reply
herodoturtleyesterday at 4:17 PM

This was a neat design choice I remember it well.

And also that my “sound card works perfectly!”