Páginas

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: using a resource pool system

One of the biggest problem in game development and specially in mobile game development is memory allocating and deallocating. Some OS like iOs let you take the memory you need but doesn't like the idea allocating and deallocating continuously and makes your app or game to crash.

Always a profiler (eg: Unity Profiler) is needed to see how your game do its job under the hood.

A bad practise is Instanciating and Destroy objects because they are expensive task, they do a lot of memory allocating and deallocating, generates garbage (that the garbage collector needs to collect).

So what can we do if we need to Spawn and Despwn objects in our game? The solution is the use of some kind of resources pooling.... This mean, load everything you can / need when you game is starting - instanciate objects - and mark then as Inactive. When you need one object, just look for one Inactive object in your pool, mark it as Active and use it. When you don't need anymore, mark it as Inactive. That's all.

In the case of my game, I just start using resources pools for bombs and explosions because at this moment, they are the only objects that Spawn and Despawn.

I was looking for a free, open source and easy to install / use resources pool and the solution was Prefactory_v1_0, a simple object pool manager for Unity3d. Just visit Prefactory_v1_0 web site to download it and for instructions how to use it.

I just want to thanks Boon Cotter for his excelent Pool Manager and for sharing it!

Remember, here http://bit.ly/1beCGTg you can see a live version of my game. Also, there is a new dead sound! Enjoy it

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

Epidemic, my new "work in progress" game prototype

Inpired by Zombie Infection Simulation v2.3 - The Original and the movie Contagion, I decided to start developing a game prototype using Unity3d

My game should answer some of these questions (in a funny and challenging way):
  1. How long does it takes to the infection to spread?
  2. What are you going to do to save the not infected humans?
  3. How will they react?
Take into account that you'll only have limited resources, so live or die, make your choice

I don't know how this prototype will end but I'm just starting to develop it (also starting to learn Unity :)

Up to date, I only have a bunch of human running, some are infected and some are not infected. I have a few rules already implemented:
  1. When an infected one "touch" a not infected one, it infect him
  2. The infected ones walk slower the the not infected ones.
  3. An infected human dies some second after have been infected.
  4. With a Mouse click you can "fire" bombs that can kill humans (infected and not infected humans)
Also there are some rules to be implemented, for example:
  1. A not infected human can live some time without food
You can take a look at the last version of the prototype here http://bit.ly/1beCGTg

If you any idea or feedback, don't hesitate in contect me.

NOTE: some models were taken from Stealth Unity Tutorial just for prototyping purpose

SkyDrive in Windows 8.1 pause and resume

Windows 8.1 introduces a new a very improved version of Skydrive. Now we dont need skydrive desktop anymore and it's integrated deeply in Windows.

But, what's going on when we need to pause skydrive sync temporally? eg: Today I'm on an internet call with some clients and I need more bandwith.

In desktop version of Skydrive, we can simple close the app, and sync will stop / pause but things are different in Windows 8.1. It's seems Microsoft forgot to put a pause / resume button in the new Skydrive app.

Searching the internet I found a simple but effective way to pause / resume Skydrive sync. It's all about executing a VBS script to pause Skydrive sync and executing it again to resume Skydrive sync.

Just copy and save this VBS script

'version 1 by Max Grass
strin = inputbox("For resuming type something")
if (strin = "") then action = "suspend" else action = "resume" : end if
strComputer = "."
process = "Skydrive.exe"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = '" & process & "'")
Set WshShell = CreateObject("WScript.Shell")    
For Each objProcess in colProcessList
WshShell.Exec("C:\Path to\ProcessHacker64\ProcessHacker.exe -c -s -ctype process -cobject " & objProcess.ProcessID & " -caction " & action & " ")
Next
wscript.Quit

*Process Hacker is required, please change the path to processhacker.exe in the script (line 13)

Launch and leave it empty, press OK to PAUSE SkyDrive (wait 10-15 sec), launch again and type any symbol to RESUME.

Source and full explanation at http://maxgrass.eu/blog/skydrive-in-windows-8-1-anhalten-und-fortsetzen/?lang=en

Enjoy it

Upload file from URL to Google Drive, the safely way using IFTTT

Today I was trying to save some  PDF documents to my Google Drive (gDrive) that were uploaded to a website but I didn't want to download them to my computer and then upload them to my gDrive, I wanted to upload them from their URLs. So I searched the Internet but no solutions seemed to solve my problem safely.

I started to think what could I do and IFTTT, a great service, came to my mind.

For those who don't know IFTTT, IFTTT is a service that lets you create powerful connections with one simple statement:

Recipes are a combination of a Trigger and an Action from your active Channels. Basically you "put the internet to work for you". For more information please visit https://ifttt.com/wtf

Going back to how to "Upload file from URL to Google Drive (gDrive)", I'm going to create an IFTTT recipe to do the trick. Just click the CREATE button.

First, you have to select what is going to Trigger the Recipe, I mean, what event has to happen.


Click on THIS and select the "Date & Time" icon. 


The "Date & Time" trigger lets us to specify a date when the recipe should be fired. In this case, we are going to select the "Every day at"


Now, just select the time you want the recipe to be fired (if you want to download now the file, just select any time in the next minutes)


Now that we have selected the Trigger of the recipe, we have to select the Action that this recipe should do. To do this, just click on THAT.


As we did with the Trigger, just find and select the "Google Drive" icon


The "Google Drive" action lets us to execute some command on Google Drive. In this case, we are going to select the "Upload file from URL" action.


Now, just enter the URL of the file you want to download and click CREATE ACTION


Here is a resume of the recipe you have just created. Just give it a description and click on CREATE RECIPE to definitely create the recipe



That's all, here you have a recipe to save a file from a URL to Google Drive. Once you file is downloaded, you can disable or delete the recipe to avoid the file been downloaded every day :)

Laziness is the mother of invention and IFTTT is an easy and free way to put the internet to work for you. 

Just leave me a comment to tell me what do you think about this post an IFTTT.

24/08/2013 Nueva fecha para Game Work Jam en Rosario

Después del duelo que sufrió la ciudad de Rosario debido a la explosión que conmocionó a todo el país, la Game Work Jam Rosario tiene nueva fecha y folleto.

La nueva cita para encontrarse y crear videojuegos es el sábado 24 de agosto de 2012, cuando a las 11:00 Hs comience su primer sesión en el SUM del Centro de Expresiones Contemporáneas. Entrada gratuita, previa inscripción.



La Game Work Jam es un programa de emprendedorismo creado por Gamester en Buenos Aires, traído a la ciudad por el grupo Rosario GameDevs. En este espacio los interesados en el desarrollo de videojuegos pueden reunirse cada dos semanas con el fin de colaborar y recibir asistencia para llevar a cabo sus proyectos.

¿Cómo participar?

Cualquier persona puede inscribirse entrando a www.gameworkjam.com.ar, no se requiere experiencia previa. Quienes tengan ya un juego empezado pueden presentar sus proyectos, ya sea con un equipo formado o sin él, y en cualquier etapa de desarrollo (desde sólo la idea inicial hasta el juego terminado y listo para ser publicado).

El evento es gratuito y solo es necesario inscribirse para participar. Si bien la primer reunión será el día 24 a las 11:00 hs en el CEC, nuevos participantes pueden integrarse luego a los proyectos en curso en cualquier momento.
  • Rosario GameDevs (RGD) es un grupo de personas reunidas con el objetivo de promover y divulgar el desarrollo de videojuegos en la ciudad de Rosario. (http://rosariogamedevs.com.ar/rgd/)
  • Gamester se desarrolla en la planeación de eventos propios o propuestos por terceros relacionados con la industria de los videojuegos desde la pre-producción, comunicación y post-producción hasta la generación de material audiovisual e interactivo. (http://www.gamester.com.ar/)

Más información

  1. Sección Rosario de la página de GWJ: http://gameworkjam.wordpress.com/category/rosario/ 
  2. Evento en facebook: https://www.facebook.com/events/205686862927842/
  3. Página de RGD en facebook: https://www.facebook.com/rosariogamedevs