Jump to content
  • Advertisement
  • entries
    11
  • comments
    4
  • views
    2197

Week #07 - Breaking stuff and Explosion !

Gon'Interactive

814 views

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 Comments


Recommended Comments

There are no comments to display.

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
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By zuhane
      Hello people!
      Thanks for taking the time to read this post. I've been using Unity for a while now and I must say that I'm very impressed with it. Definitely a jump up from XNA. However, something that I've noticed that leaves a lot to be desired is the 2D tile-based collision. Below is a little video of a game I've been working on with a friend which demonstrates my problem. Essentially, games that use huge open planes and polygons don't seem to have many problems with collisions, but when a game consists of lots of small tiles stacked alongside each other, objects tends to get stuck in-between the gaps. For example, if I have a horizontal strip of little tiles, and the player runs along the top, sometimes he'll come to a standstill and have to rebuild his momentum, However, this is much more noticeable for the ball. The ball seems to consistently bounce around randomly by hitting into edges, due to the nature of how fast and random it moves, making it very hard for players to line up shots and make meaningful choices in how they attack the ball.
      So after doing a little Googling, it seems like there's absolutely nothing on this topic. It baffles me, because tile-based platformers seem to be everywhere on Steam! So after some more digging, I saw that many people were using composite colliders, so that after the level is generated, the tiles all merge together into one polygonal/composite collider. However, I've found that this problem still occurs even when using this method, especially near corners. Am I possibly overlooking a simple solution here? This has been giving us grief for months now!
      It's also worth mentioning that composite colliders create another problem within our game world. The blocks within the levels are meant to be damaged upon contact with the ball. However, when these are nested inside an object using a composite collider, none of these collisions fire off any more, essentially making all the blocks in the level indestructible. Is there a way to cycle through all of the colliders inside of a composite collider to check them individually? Any help would be mundo appreciated.
       
       
       
       
    • By ProximaCities
      Hey Guys,
      We are a group of students working for a school project where we decided to develop a mobile Game Using unity. We would love to hear your opinions and feedback about it.
      Here is the link to our website (any feedback about the site is also welcome): https://proximacities.com/games.php
      Our game is for now only available for Android devices, here is the link to our APK: https://proximacities.com/dl.php?file=proxima_dev.apk.
      Gameplay
      Proxima Cities is a city building game, playable with two different views, both 2D and AR with a different kind of development strategy. Focused on ecology principles to teach and educate the youth and every single player about the importance of ecology in our lives.
      The player will manage his city via 2 main screens. A 2D screen menu, where he will be able to manage his city from a top simple view, to construct and sell buildings, like in old SimCity games. And most importantly an AR scene to view his city in 3 dimensions, in which the player could get more information and visual feedback about his city and citizens' status. The player’s goal is to make his city grow, caring about keeping his citizens and city healthy.
      Here is an old teaser we did to see how the game is like: 
       
      We are trying to get as much feedback as we can, so please feel free to fill our form so that we can get better: https://proximacities.com/Feedback.php 
       
      Thank you so much for your time,
      Proximacities,
       
       
    • By Stocke
      So I've been trying to use OOP where I need polymorphic behavior. I know that a lot of people have problems with it but it has worked out so far for me. I've tried to avoid using inheritance too much and tried to use composition to make bigger classes out of smaller ones.
      This is my situation. I have an attack class like
      abstract Class Attack{ abstract void execute(vector3 Dir); } And melee and  ranged attack classes like
      class MeleeAttack{ override void execute(vector3 Dir){//do stuff} } class ProjectileAttack{ override void execute(vector3 Dir){//spawn stuff} } I need player specific attack behaviour so I have a player attack class that I use for the player.
      class PlayerAttack{//does not inherit attack since I need more parameters in execute Attack meleeOrRangedAttack; void execute(vector3 Dir, random params....){ //do meleeOrRangedAttack while obeying player rules dir = calculateDirTBasedOnInputOrSomething() meleeOrRangedAttack.execute(dir) } } And a different enemy Attack Class because enemies need to target a player.
      class EnemyAttack{ Player target; Attack meleeOrRangedAttack; override void execute(target){ //do meleeOrRangedAttack while targetting player dir = calculateDirToTarget() meleeOrRangedAttack(dir) } } This works well and I can reuse melee or ranged attacks both for players and enemies.
      But say I need a homing Attack for enemies. If I make it a subclass of attack then I can't just override execute(). I need some way to pass in a target. Is there a better way to structure this code while keeping composition(not writing separate enemy homing attack, player homing attack classes)?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!