Week #07 - Breaking stuff and Explosion !

Published March 17, 2018
Advertisement

Breakable object physics

Let's talk about physics in the game. We will introduce breakable glass, door and wall to the game to make things not only more alive but also give you more choice about your path to reach each level goal. A building is locked down ? Maybe you just jump through a window to get in ! A door is lock and you haven't found the key ? Maybe you just blow that thing out of your way ! There's no exit ? Well crank your energy up and destroy that wall ! This is the kind of choice you will be able to do as long as you live with the consequence of making a lot of noise and attracting more attention to you and potentially increasing your awareness level. Remember that your global awareness is what make your next level harder and harder. Physics will allow for more interactive game play and better replay-ability. Let be honest to, when a game require you to keep a certain level of stealth, you will eventually want to go destroy everything and play careless so why not make this fun !

 

Frag, IEM and Gravity bomb

The player, depending on the active character, will have access to a limited amount of grenade. You get a sneek peak about it in the video below. Frag grenade will allow you to destroy glass, door and wall too. 1 character have access to frag, another one have electromagnetic device that will shut down most electronic device and the last one will have a devastating black-hole type of grenade that will serve as a way to grab item at a remote distance or to simply make things vanish in another dimension ! More to come on those soon !

C# Break in parts

Our script rely on unity internal physic engine, which is quite good. Physics can become very CPU intensive so a lot of testing will be required to ensure smooth gameplay. I don't intend to go to far away into destruction. This is not a procedural "red faction" destruction system ! So destruction will happen, but in a limited amount of location. Destroying everything to get through is NOT an option. That said, i'm happy with the script performance and how it work.

Magnitude of an impact

For of all, the script take into account the magnitude of a hit. If the hit is too weak, the object won't break. Each object have their own breaking point which me require to walk into, run into, shoot at it, trow a grenade or use a special ability.

Parts physics

Once an object is broken, it fracture into multiple parts. The glass in the example video is make of 160 rigidbodies and it still perform well. Each part take into consideration their surrounding. Depending on how many piece stick together, the script determine if the piece can hold in place. The system also check for "framed" part. For a window, the framed parts are the object around the edge that would be hold in place by its frame, for a door it would be the part connected to the hinge. Those part don't fall by them self since they are hold in place by another object. Those part need to be hit again to fall and each sets of broken part need to be connected, within a certain range, to a framed part to be considered structurally stable. Basically that mean that a broken part cannot float in the air if it's not link to enough pieces and that a large glass would break realistically even if you hit limited area because the weight and size of the part would make them fall in real life. Then again, this is not a fracture simulator and we can't go too far into reality. It remain a game, so the main goal is to have fun with the system and to have smooth gameplay. The focus is about the gameplay feature or having more choice, more path and more replayability.

Explosion shock-wave !

Each explosion in the game come with a shock-wave effect. The shock-wave, in my own unscientific terms, is the air getting compressed and the explosion expanding over time. That mean that an object closer to an explosion will get hit faster than an object located further. On top of that, we take into consideration the distance between the explosion and the object to determine the amount of force received by the affected object. Obstruction is also considered, if something explode and there is object between you and the explosion, you will receive less damage.

The shock-wave introduce a very important time factor to the game-play. Making thing explode at a distance and have a split second to get out of the way may be a life saver for you or the AI.

See and be seen

The video showcase a turret being able to see you through glass and it shoot at the player destroying the glass. This behavior will of course be extended to AI but be aware that militarised zone or city will benefit from upgraded unit that may have heat sensor and a turret may just decide to kill you through a wall or a door if you are not cautious enough ! Soldier may also be equiped with those special google.  The game AI have nightvision and heat sensor to track you down. More to come on that in a futur post.

Let me know what you think about the feature or share your though about current game that use physics such as RB6  ?

 

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement
Advertisement