Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    6
  • comments
    15
  • views
    970

ProjectCastle How I got so many physics. Files for free.

Sign in to follow this  
Scouting Ninja

960 views

So just got online when I noticed a few emails asking me how I got so many physic objects working in Unity.

The answer to that is nothing special. On average there should only be a 1000 physics objects on screen. The physics is also a lot more strict on making objects sleep.

The way this is done is the same most AAA games work with art. In a AAA game it isn't rare to have a static duplicate of a skinned mesh. As a example take the players gun, often the gun will be a skinned mesh, playing it's firing animation while the player presses fire.

However skinned meshes have an extra cost just to be in a game, so because exporting the static model only takes a click of a button and the code for swapping them is very fast you can just change your animated model into a static model. Some engines even turns a animated into a static when it's done with the animation.

 

So in Project Castle I did what most games would do with a destructible wall. First I made a object using physic blocks, then I took there meshes and generated a new mesh. The blocks are disabled and the new mesh is displayed. When any object that can hit it is near the static mesh is swapped for the rigid bodies.

 

Now at this point of the blog I thought I would share the code, although @Avalander says my new build still doesn't working so I realized I could just upload the Unity pack. Everything, except Unity, was made by me for this game so you can use it as is.

Import the Unity pack as a custom pack. The layer for shooting is "Water" because the Unity pack doesn't export layers. Space key will swap physics for static meshes, causes a kind of freeze time effect.

 

I would like criticism on my code if anyone has time for it.

 

ProjectCastleFiles.unitypackage

Sign in to follow this  


1 Comment


Recommended Comments

Now I could finally play it! It looks cool, I really like what you've done with the buildings falling apart. It's a pity that you couldn't add the aliens, it would have been such a great game!

Unfortunately, I can't provide feedback on the code, I don't have much experience with Unity nor C#.

Share this comment


Link to comment

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 LonelyStep
      PROGRESS
      Thought I'd reach out for some feedback on my little project. This is an android two-player game for top-down boxing matches. The core mechanics are all that I have accomplished thus far, later I want to add different configurations for your boxer (special effects, increased health or damage, etc) and maybe even a single player AI to practice against.

      SCREENSHOTS
      #1

      *****************************************************************

      #2
       
      FEEDBACK
      Right now the gameplay feedback I'm looking for is on the fundamental mechanics of the game.

      One area of particular concern is the window of opportunity for a player to block after their opponent has begun a punch. Currently that window is one-tenth of a second, otherwise you will be to late to counter their blow. I want it to be difficult to successfully pull off a block and have it be something that requires real attention to accomplish. I'm wondering though if it isn't too difficult right now, which may encourage mindless button mashing, which is certainly not what I want to condone.

      Another consideration is whether having three main actions (block, attack, charge) provides a good balance. My idea with having three main areas is that your two thumbs will have to leave one section uncovered at all times. This should result in hand movements that telegraph actions to the opponent.

      Aside from these, any other constructive criticism is very welcome.

      LINK
      My game can be found at the Google Play Store here:
      https://play.google.com/apps/testing/com.meatandgrain.PunchABunch

      NOTE There is a known graphics error when performing a special punch. There are no doubt other unknown errors as well.

        Thank you for your time, I hope you'll be able to find some fun in this little game!
    • By Vandallord
      Link: https://www.kongregate.com/games/Vandallord/idle-stone-history

      A wicked witch turned the main hero into the stone, you need to find a way to break the spell.
      INSTRUCTIONS
      Click on the objects and they will open.
      Click on the stone and its skill to attack the animals will grow as well as a the losses from clicking on animals.
      Click on the river to improve the function to manage time and clicks on the animals will be more precise.
      Click on the tree and it will give you things from animals and the level of luck will grow which give you an opportunity to Harder hits.
      The higher the level of monsters the more animal can visit the stone and give presents which are essential to make a portion.
      Screenshots:
       
    • By Znippy
      Hello everyone!  
      This is my submission for the Frogger challenge.
      The final build for the project can be found here!
      I hope I have fulfilled all requirements for this challenge. Sadly, I do not have time to create a gameplay video. I am not sure if this is a must. I have added a couple of screenshots from my blog series.
      My post-mortem post will be done next week. 
      As I already mentioned on the project page, I also could offer a Linux build if somebody needs one!
      I hope you like it and I am excited to see your high scores!
      Please tell me if there is anything missing!
    • By horror_man
      Hello, I'm currently searching for a talented and passionate programmer to create a small but great horror game that would take around 3 months to be done.
       
      About the game: The game would be a sci-fi/post-apocalyptic survival horror 3D game with FPS (First person shooter) mechanics and an original setting and story based in a book (which I'm writing) scene, where a group of prisoners are left behind in an abandoned underground facility. It would play similar to Dead Space combined with Penumbra and SCP: Secret Laboratory, with the option of playing solo or multiplayer.
       
      Engine that'd be used to create the game: Unity
       
      About me: I'm a music composer with 4 years of experience and I'm fairly new in this game development world, and I'm currently leading the team that'd be creating this beautiful and horrifying game. I decided that making the book which I'm writing into a game would be really cool, and I got more motivated about doing so some time ago when I got a bunch of expensive Unity assets for a very low price. However, I researched about how to do things right in game development so I reduced the scope of it as much as I could so that's why this game is really based in a scene of the book and not the entire thing (and also that's why it would take 3 months). Also I'm currently learning how to use Unity and how to model things with Blender.
       
      Our team right now consists of: Me (Game Designer, Creator, Music Composer, Writer), 3 3D Modelers, 1 Sound Effect Designer, 1 Concept Artist and 1 Programmer.
       
      Who am I looking for:
      - A programmer that's experienced in C# and with Unity.
       
      Right now the game is very early in its development (GDD is completed and all 3D Items, Music and Sound Effects are completed).
       
      If you are interested in joining, contributing or have questions about the project then let's talk. You can message me in Discord: world_creator#9524
    • By Nilmani Gautam
      Welcome every one from this section we are going to develop a new 3D game Cube Race
       
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!