Jump to content
• entries
8
• comments
6
• views
761

# Video games are kinda physicsy

258 views

Computers are good at math, right? So it follows that video games should be able to do plenty of physics calculations while you run around shooting zombies and stuff, right? Well, the thing is, they have to do a lot of calculations - and they have to do them reallyreally fast. Take, for example, some game based on a large map, with somewhere around a hundred players, all trying to shoot each other to death. Handled naively, every time a player shoots, the game would have to continuously test if the bullet is intersecting any player on the whole map at any given point along its path. And even handling one single player isn't easy! It's gotta check if it hit the player's foot, leg, other leg, hip, abdomen, shoulder, arm, other shoulder, other arm, neck, head... And then it gets even more confusing when you suddenly have an impenetrable pan on your back blocking some bullets. Now, check for all of these intersections somewhere between twenty and a hundred and twenty times per second, for every single bullet, for every single player. Basically, it's kinda hard for even fast computers to keep up, while remaining accurate.

But that's where humans and their fandangled logic comes in! Now, how could a bullet possibly hit someone, if it's practically in a different time zone from them? Short answer: it can't! (Unless you have teleporting bullets, in which case you should be selling the technology for billions, not shooting people with it). So, take this giant map, and split it up into anywhere from a few to a bunch (so specific, I know) of little bitty squares. Now, as players move around, you've gotta keep track of which square they're in, which takes a bit more work. But now, when you have a bullet (or a few thousand) flying through the air, there's no way it's going to hit someone that's not within either its own zone, or maybe one of the adjacent zones. Now you've gone from checking every player in the game, to between zero and a handful! Much easier!

These same sorts of logical assumptions can be made for all sorts of locality-based applications, like virtual lighting (really, do you want to simulate a billion photons shooting around a room?), more advanced collision detection (we've done point-like bullets hitting round-ish parts of bodies, but what about really complex, non-convex things hitting each other?), as well as odd things like splitting up a group of points into non-spiky triangles (or tetrahedra). That actually has applications in fluid dynamics, modelling the density of stars in galaxies, and a bunch of other things way over my head.

## Recommended Comments

Oh like chunks? I remember the days I was really into stuff like this, age kills curiosity though. Also too many blows to the head probably makes lesions on the "curiosity cortex".

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

## Sign in

Already have an account? Sign in here.

Sign In Now

#### Terms of Use

The pages of APlusPhysics.com, Physics in Action podcasts, and other online media at this site are made available as a service to physics students, instructors, and others. Their use is encouraged and is free of charge. Teachers who wish to use materials either in a classroom demonstration format or as part of an interactive activity/lesson are granted permission (and encouraged) to do so. Linking to information on this site is allowed and encouraged, but content from APlusPhysics may not be made available elsewhere on the Internet without the author's written permission.

#### Copyright Notice

APlusPhysics.com, Silly Beagle Productions and Physics In Action materials are copyright protected and the author restricts their use to online usage through a live internet connection. Any downloading of files to other storage devices (hard drives, web servers, school servers, CDs, etc.) with the exception of Physics In Action podcast episodes is prohibited. The use of images, text and animations in other projects (including non-profit endeavors) is also prohibited. Requests for permission to use such material on other projects may be submitted in writing to info@aplusphysics.com. Licensing of the content of APlusPhysics.com for other uses may be considered in the future.

×