top of page

Cheating physics in a physics based game

  • Writer: Clinton McCleary
    Clinton McCleary
  • Sep 4
  • 3 min read

It’s no secret that physics in video games are wonky and usually very prone to bugs. I thought of playing Cyberpunk when it first ‘launched’... because the car I was driving was suddenly launched into the stratosphere. This entertained me to no end… But I’d hate to be the dev on the other side of that issue trying to resolve it. So what did I do… became a dev on the other side of physics trying to solve their many buggy quirks. There are several issues I’ve had to tackle thus far and I'm sure there will be 100s more. I’ll just cover the major ones and lay my crimes bare for all to see.

First of all, I have a magnet power in this game. The player can lift and move some objects around, stack them up, place them, or launch them. This mechanic isn’t new… I’ve seen it used in quite a few games. My inspiration for this game was The Legend of Zelda: Breath of the Wild. I have the objects wake up their physics simulation when they’re grabbed, hit by another object simulating physics, or interacted with by the player. There are some issues I need to iron out but it works well. The biggest issue I had with this mechanic was launching the objects. They’d often just go through walls due to the collision being unreliable at high velocity. I tried to fix this for many months but nothing was working. I tried lowering the velocity… This helped but only marginally. I eventually wired it up so it would use a setting that I enable only if the object is simulating physics. CCD or Constant Collision Detection checks collisions constantly… but it is expensive. This worked really well. In fact… since enabling this setting I am yet to be able to break the collision. 

Magnet mechanic in use

On to the next one… I think this solution is an interesting comment on the importance of feedback. Another feature of the launch is that you can charge it up and have sharp objects embed into some surfaces. Initially this was fully physics driven but there was a big problem. At the velocity it needed to be for this to make sense, the object would sometimes sail right through the wall never to be seen again and breaking the game completely. CCD didn’t fix this and I assume it's because the collision on these sharp objects are narrow and smaller… but I'm not completely sure. I wrestled with solutions for this until I recalled my time playing overwatch. How in that game some ammo is a projectile. Like a rocket launcher has its ammo fly at a slow speed that you can track with your eye. Same thing with grenades. The other type of ammo is hit scan. These ‘bullets’ don’t actually go from the barrel of the gun to the destination. Instead… there is no bullet. You pull the trigger, some sound and VFX of a bullet hole appear on the target. We are fooled into thinking the bullet is so fast that we can’t see it… but it was never there. I tried implementing this into my launch for sharp objects. Now, when you launch, it checks the target surface to see if it can embed. Next it simply takes the object and teleports it to the target destination. A few visual effects, sound effects and animations later and the illusion is complete. And it works very well. In fact, when I have told people how I’m doing it they’re stunned. 

Hit scan launch in use

The last issue I'll discuss here is gravity. When I drop a heavy object it floats to the ground like it's underwater. Even if I set the mass to 1000kg, the same result. It behaves a little differently but it doesn’t look heavy. Gravity in UE is a force of -980 (i think) by default. I set this to -2000. Fixed that issue and created new issues. I can’t jump higher than 1 cm off the ground, my projectiles are now weighed down. I bumped all these forces up and now I have what feels like correctly weighted objects. 

Example of floaty physics

There are a ton of other minor issues I’ve had to deal with, but these are the ones that stick most in my memory. Ahh game physics! Players are going to break the game wide open and I have to account for all the ways in which that might happen. But emergent gameplay is so much more fun to develop and physics play a massive role in that equation. If I’m having fun playtesting… surely the game will be fun for players… right?


2 Comments


Aileen Abela
Aileen Abela
23 minutes ago

Love this breakdown of “cheating” physics. Sometimes the illusion truly is the mechanic. Your approaches to CCD and hit scan style embedding are smart and surprisingly elegant, and it is refreshing to see a dev embrace problem solving over brute forcing realism. Reading this makes me think about how transparency like this can actually boost gamification summit ticket sale effectiveness because people love seeing how the magic works behind the scenes.

Like

Margarett
Margarett
Sep 22

When developers bend or break the rules of physics, it often makes games far more exciting. That unpredictability is what keeps players hooked, and platforms like the mostbet download app capture a similar thrill in real time.

Like
bottom of page