Monday, April 30, 2012

Comp Fight

 Summary
The project that I did for my final consisted of a fight sequence between a player and their computer using the Kinect to track punches as well as blocks. What my project would do is simulate a game between them and the computer because like the player, the computer will fight back as well as block.

Technical
To make this work I had to first track the users skeleton using a Processing Patch written by Jesse Gilbert (my professor) that tracks the the body basically from head to toe (Here is what is needed to use this, there are instructions on the page for a simple install of OpenNI: Install Steps. Use this so that Processing could interact with Max OSC Download ). Once this was completed we used an OSC object to get the information that is being detected on the Kinect by the processing code.

After that I created a sub patcher that holds the information of the range like x and y as well as z which is depth. For y patcher I used primarily the Z range because that detect how close a fist is to the Kinect. After I was able to set a range that sends a bang every time a fist goes beyond 0.2 of range.

To mimic a fighting game, I set a beginning time that does not allow the player or computer to hit until after  5 second. another way to mimic a game, I was able to create a life bar that decreases every time the Kinect detects a punch. After I was able to establish how the life bar would deplete (by subtracting 10 from from the life bar when a fist is in range) I wanted to create a blocking system so that it would even further be like a game. To do this I again used the Z depth but this time to detect how further is the leg. My blocking system is detected by putting your right leg back. I saw that wen people were playing this they were blocking ad punching at the same time and I believed that that was not fair so I used a ggate object to switch from blocking to hitting so if someone tries to punch while hitting it would not be possible to do damage. After I established everything that needed to be done for the user I started on the computer.

The computer was a lot less complicated in terms of creating punches and blocks. The computers runs of a metro which is basically a digital metronome which means that it could determine how fast bangs are given out. These bangs would be sent into a random number generator that is set to 50 so that it outputs 50 random numbers from the range of 0 to 49. In order to send out a punch I used what is called the select object which is an object that only sends out a bang when the random number generator (or whatever its connected to) reaches a specific number. I did this for both punches and blocks and like the user if the computer blocks it cannot hit you.

Once I had the fight system going, I created visuals so that the patch isn't plain. These visuals consisted of street fighter gifs that were turned into mov's (so that Max could read it). Each action had a corresponding video. For instance, a right punch would trigger a right punch video and so on. A problem with this is that I had to use a Rate atter UI to make the video play faster the reason that I did this is because people would punch so fast that the action on the video would not play all the way through. same thing goes for the computer which is still something I was not able to fix.

Something that i wanted to do with this patch was make it realistic and to do that I wanted the video to go back to a regular stance when either the computer or the player or doing nothing. which means that after a punch or a block the video would go back to its a original stance. To do this the toggle button was used. the toggle button has to numbers in it 0 (off) and 1 (on) using these 2 numbers I switched between an action and a stance pretty easily.After all the videos were fixed I recreated an end game that would not only stop the game but also play an  end game mov. since the life bar has numbers for a range I used a select object for when the slider reaches 0. when the slider reaches 0 the patch stops by closing (setting to 0) all ggates and toggles but playing a video on both sides that is triggered only when the slider reaches 0. along with this a message with a 1 in it is sent to the Rate atter UI so that the end game is played at normal speed.

Inspiration
I was inspired by this Street Fighter Kinect Hack because this person was able to do everything that I was trying to do but he used something else. He was able to fight with his body and create super moves and i wanted to do that to but i do not believe that I would be able to do that at least not yet. But thanks to this I was able to get the ball rolling into creating my patch. Which I called Comp Fight, Enjoy.

Future
For the future I want this patch to be able to support imported 3D characters like from Maya. I would like to see people use my patch to import there characters that they created and play using my patch and also i would want to make this a 2 player game. To do this I would have to find the range of the arm and legs using the model itself and the person themselves as well as create a completely separate patch for the second player which i do not know how to do yet. This was originally the idea for my project but proved to be too problematic due to changing conditions of the patch but ultimately this is my goal and I would wish to see it through.

Monday, March 26, 2012

Kinect Control

http://kinect.dashhacks.com/kinect-hacks/2011/01/19/street-fighter-iv-kinect-hack-plus-faast-key-bindings

This video has what I basically want to do for my project to be able to control characters movements and use specific movements for characters all of this done on a 2d platform

Wednesday, March 21, 2012

Kinect Proposal

The Idea I have for my final is to create some sort of interactive gameplay using max and the Kinect camera. The idea that I have for this is to use a created character brought from a Maya model to be used as a playable character on the Kinect interface. Using the rig that is place on the Maya character I would mimic it to the kinect using skeleton tracing to allow the rig and the skeleton to become one allowing the player to move the character with there own body. Once this is done I have the idea to allow the players to fight each other using the characters brought in by Maya. The perspective during the fight will vary as I have the idea to allow for a shifting camera. Along with the fighting aspect I want create a majority of games which will be created if time allows it. For Instance, I want to be able to create multiple games not just the fighting one which will all be on the same patch. The way they are selected is by having a player hover there hand over the desired option.

Wednesday, February 1, 2012

Midterm Paper Pitch: The Wonder of the Electric Guitar

For my mid term paper I wish to write about the Electric Guitar. What makes me want to write about this wondrous instrument is because I myself am a musician more specifically a guitarist. The thing is that I only played the guitar I never bothered to care what is the story, the movement, or the inspiration behind the guitar. It is not just noise it is a voice for the voiceless, it is what makes life tolerable (in my opinion). The guitar has a large history with many stories and I want to explore them.

Wednesday, January 11, 2012

What Technology Is To Me

Technology is a very complicated word to define and for me it’s even harder to understand but besides this fact pin pointing the reason why I am interested in the technology is hard. Technology in my definition is a tool society uses that simplifies and benefits life; this simple tool does necessarily have to work with electronics but it could actually be anything like a soda can that has been hollowed out to become a trash can, the possibilities for technology are endless.

Based off of this definition I got interested into technology, the thought of society using a tool that I created to benefit their lives to make their lives easier and worry free. See making the world more manageable and livable is a dream I have. Seeing people obtain joy from the use of my products I created is something that keeps me going but yet that is still a dream not and not a reality. With the second part of the definition I feel I can create a reality.

Technology never ends and something new will always come out that would be better than previous inventions and that’s where I can prosper because I can create. My dream is to create; I love creating people, places, etc. and with technologies advances I will be able to create. In games, people like to create characters based off of themselves' or who’d they like to be. If people create using my games or technology I created and have joy from it then I know that I benefited in making someone’s life pleasant in some form.