Skip to content
View in the app

A better way to browse. Learn more.

APlusPhysics Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Video games are kinda physicsy

(0 reviews)

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.

2 Comments

Recommended Comments

HegelBot153

Members

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".

This is Breaking Bad tier dialogue in the best possible way.

Guest
Add a comment...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.