New to unity - 1st project!

Gday everyone!

just a short introduction, my name is David, I’m 19, I live in Australia and I’m a 1st year Computer Science student (moving into 2nd year)… Currently, I only know Java and PHP (as programming languages).

I recently jumped into Unity3D after I accidentally found out that there is now a free version offering… and unfortunately, I cannot afford the pro version :cry:

I have been experimenting with UnityScript for a few weeks now, and have managed to create a simple prototype of Destructible buildings. I hope to eventually perfect these scripts and add these features into an FPS/3rd person shooter game i’m working on.

Before downloading, please note that this is a very very simple prototype, only a few building that the user can shoot.

Controls are
WASD to move
Space to Jump
key 1) activates minigun
key 2) activates Rocket launcher (only 60 ammo… use wisely!)

Most of the scripts (except for the destruction scripts) have been modified from the FPS tutorial.

Please have fun and all feedback is appreciated!

http://rohonora.webs.com/PhysTest_1.3_Web.html (Old version)

http://rohonora.webs.com/PhysTest_1.41_Web.html (MRM Prototype test, only large objects in this demo =[)

*The MRM is my “Multiple Room Manager” which manages the destruction of extremely large buildings.

That was fun, great job. Continue developing and be great.

Haven’t got that much fun for a while - Did you stack your bricks procedurally or manually in the editor? Would be nice to have the mini gun barrel rotating and see the casings ejecting - seeing the actual rocket would be cool as well.

Thank you for the reply’s :smile:

The bricks have been (unfortunately) stacked manually… however I’ve planned the system in a very flexible manner, which means I can create any building of any shape or size… The only time I need to re-stack is when i’ve developed a new script and I need to attack it to every little brick.

Originally I had some scripts that were used to stack the bricks for me during runtime… however this sometimes caused the editor or the game to crash and created horrific lag.

At the moment i’m working on Version 1.4 (this one was V1.3) which should make the simulation more efficient. In the next demo, i’ll have the player in the a city filled with skyscrapers! :lol:

I’m testing and developing this on a system with a 3Ghz Core 2 Duo and an Nvidia 8800GTS (640mb version)

Oh… the walls are made of individual bricks.
Can I suggest another approach?

You have the wall or ceiling made of ONE object and when you explode it you first replace it by a “bricks composed wall/ceiling”.

Wouldn’t this permit you to have a whole city with only static objects and they are dynamic only when you need it?

You could even imagine an algorithm that takes an object of any shape and decompose it in multiple debris. Even better depending on the “material” composing the object (i.e. different debris depending on wood, stone, …).

lazalong, the wall is a single object, bricks are created when the wall takes enough (building) damage or if it falls or collides with an object of certain velocity.

I’ve also written a script which removes objects that are not in use (ie, lying on the floor) and forcefully removes older objects if/when there are too many in the scene.

I’m working on improving these scripts to make things more efficient and realistic :wink: . I’ve made some nice progress since I’ve built this demo… It would seem that now I can create an entire destructible city and still have it run on decent frame rates. I’ll probably post that demo next week :smile:

Thankx for taking your time playing!

Very sexy. Although, I’m confused on the minigun’s existence, since it’s really all about the rocket launcher.

I can’t wait to see more.

This was wonderful. Looking forward to the next release!

Hi everyone again… apologies for bumping this old baby up…

Since I’ve started developing past Version 1.3 (Demo above), i’ve come across multiple problems such as how to manage the destruction of extremely large buildings/objects… for example, when I tested large buildings with Version 1.3, not only did I get horrific lag, but also some objects would fail to be destroyed and stayed in mid-air!

With This prototype of the MRM (Multiple room manager) I hope to place a foundation to solve that pesky little problem… It does not work at 100% and there are many problems to be fixed.

What I hope to achieve with the MRM is to manage destructible objects by Groups rather than individually. This way I can create massive destructible cities and not have a major impact on performance. Due to script incompatibility issues, the building objects do not shatter on this demo =[. I can post more info about it if people are interested. Please enjoy the latest demo and post your thoughts/opinions :smile:

Looking good, if you can make it better with the physics and performance it would be superb.

First of all, great job, very interesting to see early prototypes of destructible cover.

My humble suggestion would be to mix up the different types of debris. The problem with the first version was that the amount of debris was just a bit too much, so obviously you are going to have penalties. However the new one is a little bare and too much info gets deleted and looks incomplete. Also, the structures arent crumbling properly.

My suggestion would be to make some sort of randomizer as to the size and shape of each block. If its possible to do some back-face calling so you can get rid of those debris pieces that are behind the big pieces, you would greatly improve the performance while getting the best visual effects.