Alt-tCRASH

Publication date: 20 March 2011
Originally published 2010 in Atomic: Maximum Power Computing
Last modified 03-Dec-2011.

 

Hey, gang! Let's list the things we all expect to see in a bad console-to-PC game port!

Limited graphics options, of course. Poor-to-no control configuration, too. Some idiotic checkpoint game-save system, an installer that tries to downgrade some drivers, DRM so bad you suspect it was created to promote The Pirate Bay... Oh, and no support for alt-tabbing back to Windows!

That last one's a doozy, ain't it? And the weird thing is that you don't just see it in console ports. It shows up in all sorts of games. Even after multiple patches.

You know what I'm talking about. You're playing your new game, everything's great, then someone sends you a Skype message or something and you want to reply so you pause, alt-tab to Windows, and... oh, boy. Now you've done it.

You're looking at a black screen, or you get to the desktop successfully but the game is now some sort of invisible window you can't switch back to. Or it all falls in a heap and you get a "Your program crashed, sucker!" dialog box that you can't click on because the mouse pointer is invisible.

(Solution: Either wave your invisible pointer around clicking blindly until you hit the right button, or ctrl-alt-del, Task Manager, which may make your mouse pointer reappear so you can click the original error-dialog's button. Or you can kill the game process in Task Manager itself, possibly via keyboard navigation.)

You might, fairly, wonder why the hell this still happens.

When we were playing Command & Conquer over IPX/SPX in 1996, we didn't like the fact that pressing one of those new-fangled Windows keys would freeze the game for everyone until, and unless, the unfortunate key-presser managed to switch back to the game.

(If you were born in 1990, and you're wondering why old farts pop Windows keys off the keyboard or superglue 'em solid, now you know.)

But back then, we knew that Windows was just pretty flags and bunting hung on scaffolding made out of DOS. Lousy multitasking like this was par for the course.

Back in the days when "Never Gonna Give You Up" was played unironically on major radio stations, the Commodore Amiga had really, really nice multitasking, including party tricks like letting you grab the top of a program's screen and pull it down, to reveal some other program running behind it. Almost all Amiga games were much worse at multitasking than games on modern Windows PCs, though, because they were written to run on Amigas with 512 kilobytes, or at most two megabytes, of memory, and orders of magnitude less processing power than a modern mobile phone. So most games monopolised the whole system, booting their own bare-bones code from floppy and never loading the main operating system, needed for multitasking, at all.

Every modern personal-computer operating system (Windows, Linux, Mac OS, FreeBSD...) has serious, robust multitasking capabilities. Mainstream Windows flavours have been based on the DOS-free NT kernel since Win2000 came out. So you'd think there'd be no excuse for a program that won't let you switch to some other program, and back.

But the problem is still rampant. If you're playing Peggle, alt-tab works fine. Also, probably, if you're running a "proper" game in windowed mode. Fullscreen is a whole other story, though.

The reason for this is that modern games are the most demanding software that most PCs ever run. And big games need a lot of memory.

So when you run a standard fullscreen 3D game, Windows makes as much room for it as possible. The video-card memory that was being used for the Windows desktop, and the main system memory that was keeping track of all the desktop stuff, is paged out to disk. (Or the data's just dropped on the floor, to be recreated from scratch whenever it's needed again.) This frees up memory - possibly a very important amount of memory, on marginal systems - for the game.

Pretty much everything that was running in the background is still going to be running along with the game, which is why you can receive that deadly Skype message. But the little men inside the computer whose job was making the desktop visible now all have other jobs. They are now handed 3D model and texture data, sound data, and the many other things that the game needs to have on call at a moment's notice, so your game's frame-rate doesn't go to hell every time you turn around.

And then you go and press alt-tab.

The game now has to let go of whatever precious data is taking up Windows-desktop memory. If it does that, you'll be able to switch back to the desktop. If it doesn't, it's black-screen time.

If you want to be able to alt-tab back to the game, the game has to be able to re-fill all of the memory with the stuff that was in it before. If it does that, you'll be able to continue playing. If not, not.

Windows can manage this RAM-shuffling for a game, if the programmers just put all of the relevant data in the DirectX "Managed pool". But this reduces performance and eats more system and graphics RAM, so in practice it's not much use for full-fat games that already make the computer work hard.

If the programmers don't use the DirectX managed pool, they have to write their own code to handle the shuffling. This is not easy to do. Especially if the programmers are making their own game engine, or if they've licensed an engine that doesn't happen to support alt-tabbing well, or at all.

Windows does of course tell a program when the user's trying to alt-tab, whereupon you can be pretty confident that the program will stop playing sound (possibly after every current sound effect has finished playing), and will also stop intercepting input. Both of those things are pretty easy to do. But beyond that, it gets hairy. If the programmers don't use the low-performance built-in DirectX function, then they'll probably need to hunt many strange things down by hand to get alt-tab to work right.

(Note that this also explains why a game may support alt-tab while you're playing, but crash if you alt-tab - or if Some Damn Window pops up and steals focus - while the game is loading. Alt-tab support when the game proper isn't actually running yet is a whole separate thing the programmers have to allow for, and it's likely to be pretty darn low on the priority list as Release Day bears down upon the coding team.)

It's always easy to tell if a game supports the new Interspatial Fourier-Convolution Vertices v11.3 that're the unique selling point for the new nVidiATI RadeForce THX 1138 graphics card. You won't be able to tell by playing the actual game, of course, but this very important information will always be right there on the game's bullet-pointed feature sheet, along with proud declarations of the game's support for Migraine3D monitors, and more information than is readily justifiable about its mediocre original soundtrack.

I hope, one day, to see such a feature list proudly headed by an entry that says "Alt-Tab Bloody Works".

Other columns

Learning to love depreciation

Overclockers: Get in early!

Stuff I Hate

Why Macs annoy me

USB: It's worth what you pay

"Great product! Doesn't work!"

The virus I want to see

Lies, damned lies and marketing

Unconventional wisdom

How not to e-mail me

Dan's Quick Guide to Memory Effect, You Idiots

Your computer is not alive

What's the point of robot pets?

Learning from spam

Why it doesn't matter whether censorware works

The price of power

The CPU Cooler Snap Judgement Guide

Avoiding electrocution

Video memory mysteries

New ways to be wrong

Clearing the VR hurdles

Not So Super

Do you have a license for that Athlon?

Cool bananas

Getting rid of the disks

LCDs, CRTs, and geese

Filling up the laptop

IMAX computing

Digital couch potatoes, arise!

Invisible miracles

Those darn wires

Wossit cost, then?

PFC decoded

Cheap high-res TV: Forget it.

V-Pr0n

Dan Squints At The Future, Again

The programmable matter revolution

Sounding better

Reality Plus™!

I want my Tidy-Bot!

Less go, more show

In search of stupidity

It's SnitchCam time!

Power struggle

Speakers versus headphones

Getting paid to play

Hurdles on the upgrade path

Hatin' on lithium ion

Wanted: Cheap giant bit barrel

The screen you'll be using tomorrow

Cool gadget. Ten bucks.

Open Sesame!

Absolutely accurate predictions

The truth about everything

Burr walnut computing

Nothing new behind the lens

Do it yourself. Almost.

The quest for physicality

Tool time

Pretty PCs - the quest continues

The USB drive time bomb

Closer to quietness

Stuff You Should Want

The modular car

Dumb smart houses

Enough already with the megapixels

Inching toward the NAS of our dreams

Older than dirt

The Synthetics are coming

Pr0nBack!

Game Over is nigh

The Embarrassingly Easy Case Mod

Dumb then, smart now

Fuel cells - are we there yet?

A PC full of magnets

Knowledge is weakness

One Laptop Per Me

The Land of Wind, Ghosts and Minimised Windows

Things that change, things that don't

Water power

Great interface disasters

Doughnut-shaped universes

Grease and hard drive change

Save me!

Impossible antenna, only $50!

I'm ready for my upgrade

The Great Apathetic Revolution

Protect the Wi-Fi wilderness!

Wi-Fi pirate radio

The benign botnet

Meet the new DRM, same as the old DRM

Your laptop is lying to you

Welcome to super-surveillance

Lemon-fresh power supplies

A>B>C>A!

Internet washing machines, and magic rip-off boxes

GPGPU and the Law of New Features

Are you going to believe me, or your lying eyes?

We're all prisoners of game theory

I think I'm turning cyborg-ese, I really think so

Half an ounce of electrons

Next stop, clay tablets

A bold new computer metaphor

Won't someone PLEASE think of the hard drives?!

Alternate history

From aerial torpedoes to RoboCars

How fast is a hard drive? How long is a piece of string?

"In tonight's episode of Fallout 4..."

How hot is too hot?

Nerd Skill Number One

What'll be free next?

Out: Hot rods. In: Robots.

500 gig per second, if we don't get a flat

No spaceship? No sale.

The shifting goalposts of AI

Steal This Education

Next stop: Hardware piracy

A hundred years of EULAs

The triumph of niceness

The daily grind

Speed kings

Alt-tCRASH

Game crazy

Five trillion bits flying in loose formation

Cannibalise the corpses!

One-note NPCs

Big Brother is watching you play

Have you wasted enough time today?

The newt hits! You die...

Stuck in the foothills

A modest censorship proposal

In Praise of the Fisheye

Filenames.WTF

The death of the manual

Of magic lanterns, and MMORPGs

When you have eliminated the impossible...

Welcome to dream-land

Welcome to my museum

Stomp, don't sprint!

Grinding myself down

Pathfinding to everywhere

A deadly mouse trap

If it looks random, it probably isn't

Identical voices and phantom swords

Boing!

Socialised entertainment

Warfare. Aliens. Car crashes. ENTERTAINMENT!

On the h4xx0ring of p4sswordZ

Seeing past the normal

Science versus SoftRAM

Righteous bits

Random... ish... numbers

I get letters

Money for nothing

Of course you'd download a car. Or a gun!

A comforting lie



Give Dan some money!
(and no-one gets hurt)