Páginas

Mostrando las entradas con la etiqueta Physic. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Physic. Mostrar todas las entradas

Global Game Jam: Resources for Jammers and game developers



Next weekend will be the Global Game Jam (GGJ) 2014. The Global Game Jam (GGJ) is the world's largest game jam event taking place around the world at physical locations. Think of it as a hackathon focused on game development. It is the growth of an idea that in today’s heavily connected world, we could come together, be creative, share experiences and express ourselves in a multitude of ways using video games – it is very universal. The weekend stirs a global creative buzz in games, while at the same time exploring the process of development, be it programming, iterative design, narrative exploration or artistic expression. It is all condensed into a 48 hour development cycle. The GGJ encourages people with all kinds of backgrounds to participate and contribute to this global spread of game development and creativity. (extracted from GGJ's website)

Here you have a list of resources for Jammers and also game developers / designers. This list was created by our friend of Rosario Game Dev. It's not a complete list but a good starting point. Feel free to added more resources in the comments. Enjoy it!


Table of contents

  1. Tools
  2. Vector/Scalar Image & 2D Graphics
  3. Source Control
  4. IDEs
  5. Engines
  6. Sound
  7. HTML5 / Javascript
  8. Frameworks
  9. Assets
  10. SDKs
  11. Miscellaneous
  12. Board games

Tools

Vector/Scalar Image & 2D Graphics

Source Control

IDEs

Engines

Sound

HTML5 / Javascript

Frameworks

Assets

SDKs

Miscellaneous

Board games

Task Management Tools

Unity Ragdoll and Collisions with Rigidbodies with Kinematics

In my last post http://vackup.blogspot.com.ar/2013/11/unity3d-kill-character-and-make-him-die.html I wrote how kill a character (that uses a rigidbody) and make him die like a ragdoll. The solution was simple, just add him a ragdoll with Unity Ragdoll wizard and set all rigidbodies as Kinematic.

This was working great but all characters don't collide and they pass through other objects. Ouch!!

Searching the internet, I found that "If isKinematic is enabled, Forces, collisions or joints will not affect the rigidbody anymore.http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-isKinematic.html

Also I found that someone had the same problem I have "I can't seem to find a specific answer for this. Mainly, I have an enemy rigidbody in my game who, when hit by an attack of some large value, goes ragdoll (isKinematic = false). However, when he is chasing the Player with isKinematic = true, he phases through terrain and such. Is there an elegant way of having an enemy be allowed to go into ragdoll and still collide with the environment?http://answers.unity3d.com/questions/167712/collisions-with-rigidbodies-with-kinematics.html

And the reply was something I don't want to hear "Actually the only two components that can detect collisions are: the CharacterController and a non-kinematic RigidBody without any exceptions (afaik). However the CharacterController uses it's own detection method and is not really part of the physics system.

The only difference between a simple GameObject with a collider and one with a kinematic Rigidbody attached is that the kinematic Rigidbody can wake up other non-kinematic Rigidbodies. Non-kinematic Rigidbodies fall asleep after a few seconds. They can only detect collisions when they are awake. If you move a GameObject with a sleeping Rigidbody it will wake up automatically, no matter what method of movement you're using (transform.position, AddForce, MovePosition).

The only use of a kinematic Rigidbody is that when you move it into a sleeping Rigidbody it will wake up and would perform the collision check. Keep in mind that the collision messages are sent to both objects but only a non-kinematic Rigidbody can produce them.

I'm not sure how your ragdoll-setup looks like, usually you have multiple body parts that are connected with joints. To move the enemy while he's alive you should use either a CharacterController, or a non kinematic Rigidbody. You should remove it when you turn it into a ragdoll.

If you use a Rigidbody you can set freezeRotation to true so the Rigidbody is not rotated by the physics system but you're still able to rotate the object via script. You can also use Rigidbody.constraints to prevent the rotation and / or position change caused by the physics system."

So I started to think what can I do ... I thought that if isKinematic wasn't my solution, it would be great if I could create the ragdoll at runtime using a script.

So I searched the internet and found someone asking how to "Export ragdoll setup to script" (http://answers.unity3d.com/questions/188917/export-ragdoll-setup-to-script.html). The reply was "I created a code generator for C# and released it as open source under MIT license. Further on I wrote an article in my blog where you can find the code as well". He was talking about C# Code Generator As Add-on for Unity3D Ragdoll Wizard

There you can find the code to download and how to use it. I use it in my project and the result is what I was trying to achieve. The results are here: http://bit.ly/1beCGTg


Unity3d: kill a character and make him die like a ragdoll

The other day, I shown a friend of Rosario Game Dev the lastest version of my game where I introduced bombs and explosion. He told me it would be great that when a bomb explodes, characters fly over the scene and that I could achive that by using a ragdoll. You can see a proof of concept here http://bit.ly/17pl47F

So, what's a ragdoll? A ragdoll "is a children's toy. It is a cloth figure, a doll traditionally home-made from (and stuffed with) spare scraps of material" and the same approach is used in video games.

Unity has a simple wizard that lets you quickly create your own ragdoll. You simply have to drag the different limbs on the respective properties in the wizard. Then select create and Unity will automatically generate all Colliders, Rigidbodies and Joints that make up the Ragdoll for you. (something you need to know / guess, as a ragdoll is basically a collection of rigibodies it will be affected by physics, gravity and forces)

Here you have a Unity 3D Ragdoll Easy Tutorial (this all you need to know to make a ragdoll)


This is really easy, but what if the character have any other logic or components like animators, rigidbody, script, etc?

Let's take a look at Ethan from Unity3d Project #01: Stealth. Ethan has a lot of components attached to him.


If I just add the ragdoll to Ethan, It'll be a completly mess (I've already did it, try it by yourself), so what can we do? These are the step I follow (guided by some answers I found on the Internet):
  1. Create a ragdoll to Ethan
  2. Disable all child (ragdoll) rigidbodies (script AnimatorToRagdoll.cs)
  3. When Ethan dies, destroy / disable main components (With a mouse click, Ethan dies)
  4. Eneable all child (ragdoll) rigidbodies 

The result is here http://bit.ly/17pl47F  With a mouse click, Ethan dies

You can download the full project here: http://bit.ly/1dYsO1I


Epidemic update, bomb and explosions

Detonator Explosion Framework for Unity makes incorporating good explosions easier for all types of developers. At its most basic level, Detonator is a component that can be attached to any GameObject. At runtime it then creates an explosion with configurable color, size, duration, detail, and sub-elements like sparks, smoke, and shockwaves. The Detonator Parametric Explosion Framework has been developed by Ben Throop for the Unity Summer of Code 2009.

You can play with a running example of Detonator here: http://variancetheory.com/detonator/

Thanks to Detonator, I could include astonishing explosions in a really easy way.



Just add a component script to my bomb object (eg: a sphere). My script has a public gameobject variable so I can assing the explision prefab I like most.


And only in my script, I just wrote code for OnCollisionEnter:

 void OnCollisionEnter(Collision collision)   
 {  
       // Instantiate a detonator game object where the bomb is  
       Instantiate (this.detonator, this.transform.position, Quaternion.identity);  
       // Destroy the bomb (because it exploded lol)  
       Destroy(this.gameObject);  
 }  

Remember, you can take a look at the last version of the prototype here http://bit.ly/1beCGTg

Of course, there are a lot of things to improve but I'm just starting

BEPUphysics (physics library) for Monogame

Last night, I was looking for a 3D physics engine for Monogame and I reached BEPUphysics.

BEPUphysics is a 3D physics library by BEPU.  It’s fast and has a bunch of cool features like constraints, terrain, static and instanced meshes, continuous collision detection, custom collision rules, vehicles, easy multithreading, yadda yadda yadda.  Full support for XBox360 and WP7 too!

Investigating BEPU website, I found that there's a work in progress version of BEPUPhysics for Monogame (the clue was a one blog post called "BEPUPhisics and XNA" and said The most likely target frameworks for the rewritten demos will be either SharpDX or, for wider use, MonoGame.) and also a twitt form the BEPUPhysics that said "The new demos application is indeed almost certainly going to be MonoGame based"

So I decided to take a look at BEPU source code repository and community-contributed forks.

I saw a monogame fork of BEPUphysics at http://bepuphysics.codeplex.com/SourceControl/network/forks/StephenOC/MonoGame and quickly download it, but my surprise was when I found that It's a windows version of BEPUphysics. But I far as I know I read it's posible running BEPUphysics on Monogame so I decided to try.

First, I openned Visual Studio and create a Windows class library. Then, I references Monogame Dll (to this test I use Windows OpenGL version) and put all BEPUphysics classes. Dont forget to set your project build propertis symbols to WINDOWS;ALLOWUNSAFE;CHECKMATH;MONOGAME


After a few build trys and removing some unuseful files, my build was succesful!

Then I create a Monogame Windows OpenGL game to test the BlocksExplodeYourCastle BEPU Demo game and I (almost) everything works out of the box! I say almost because the Monogame version of BlocksExplodeYourCastle was a lot of slower then XNA Version, but that's another history.


Also, I found a monogame build on the Monogame brach of PloobsEngine (https://code.google.com/p/port-ploobsengine/source/browse/PloobsEngine/PloobsEngine/Dlls/BEPUphysics.dll?name=MonoReach), but the BlocksExplodeYourCastle monogame version is still slow.

PS: I just run BlocksExplodeYourCastle monogame version and It runs at an acceptable speed! so I just need to make some more tests

XNA Projectile Motion

Actualmente me encuentro programando un juego en XNA y tenia que hacer que un personaje lance por el otro a otro personaje.
Buscando en internet me di cuenta que lo que necesitaba hacer era lanzar un proyectil o "Projectile Motion".
La verdad me senti medio decepcionado porque no encontre un ejemplo sencillo sobre esto asi que gracias a un par de formulas y ejemplos, pude hacer lo que queria y lo comparto con ustedes... devuelvo a la comunidad un poquito de lo que ella me dio. Espero que les sirva!!!

Aca les dejo un video en el cual me base:



Las fuentes que consulte y me sirvieron fueron:


Download (XNA 4.0 - VS2010):