Skip to main content

Grindin on basic game mechanics

This week I learned some more basic game mechanics as I prepare to start iterating prototypes of my first big game project-

I already have some basics like-

Run, jump, push objects, fire projectiles at enemies, melee attacks, player life/item management, use bombs that damage things based on distance, basic enemy ai....

The things on this weeks list were-

Freeze Ray- something like the ice weapon in Megaman 1 as it can freeze level elements like fire and water as well as freeze enemies for a limited time

This freeze water I did this in Playmaker...

So to freeze a pool of water that the player would fall through by default I just added a trigger event so that when the projectile tagged "icebeam" collided with the water it moved it into the freeze state- the freeze state switches the water from the water material to the ice material and turns on the box collider for that object and sets a timer of 6 seconds- so when hit with the ice beam it turns to ice and now the player can walk on it for 6 seconds- then the unfreeze state reverses what the freeze state did

To freeze an enemy in motion I animate a cube to standin for my enemy and did this...

I set a trigger event so that when the enemy is hit with the projectile tagged "icebeam" it goes into the freeze state-The enemy uses the Mecanim animator system for its animation so the first thing I did was use set property to disable the animator component- this stops the enemy animation- the enemy has a rigid body tag so that when you disable the animator physics take over and it falls to the ground- I wanted it to freeze where it is so I used set property again on the enemies rigid body tag and I set it to freeze all constraints- so now the physics system can't make it move/rotate anymore- then I change the material to a frozen material and set a timer to unfreeze after 6 seconds- the unfreeze state reverses the freeze state...

This works really well BUT if I was using Rain AI or another pathfinding/AI solution to control the characters movement I'd have to add another action in there to pause or switch that off- I have to figure out how to do that for the game so more work needs to be done on the freeze ray...

I saw a video on youtube where someone made a hookshot from the Zelda series so I wanted to figure that one out as well- I did a super quick crappy hookshot mechanic using a trigger and the iTween "move to" action like this...

So I had the player fire a projectile tagged "hookshot" and stuck a trigger on the object to be hooked onto- when hit with the projectile it goes to the hook state which uses "Move To" to move the variable "Player" to the position "hitch" which is an empty game object sitting in front of the object to be hooked onto so that the player doesn't try to penetrate the hooked to object- much to my surprise it worked really well- I'm constantly amazed how simple and fun it is to work with Unity and Playmaker...

The latest thing I wanted to figure out was a basic magnet system or the appearance of a magnet system- it doesn't have to be a real magnetics system which are sold on the asset store here and here I just wanted to fake it...BUT even if I had to buy them its only $12 for BOTH.... I ended up using the "explosion" action for the repel and the "move towards" action for the attraction- it works really well making the player stick to or be repelled from my "magnet" objects...

Initially I was having a hard time with this one as I went for a more accurate and complicated route using some equations I found on the Unity forums which used a Vector3 direction- I was trying to use this as part of my repel solution to find the direction to repel the target in....
  1. Vector3 dir = (target.transform.position - transform.position).normalized;
I was able to convert that to playmaker actions but I couldn't get to work right- I was going to buy one of the magnet system assets when I found an easier solution on the playmaker forums- using an Explosion action with the "every frame" function- I did everything I needed to repel the player so I used that...


This stuff I'm doing is really simple compared to thing I've seen other people doing but much to my amazement it works really well for what I want to do... I'm sure it much faster if you do it with straight code rather than FSM's like I am BUT I'm going to keep my game fairly simple- I'm not going to have tons of enemies on screen at all times... 

If you want to get into game development but you haven't because you think it's to difficult...IT IS NOT! This basic stuff like I'm doing is SUPER EASY when you add Playmaker to Unity3d so check those two things out if you want to get started!

So the next stuff I have to figure out for my first game prototype is...

- roll/dodge action for the player
- Have the player run by default and walk with a button press
- charge blast

So seriously this stuff is fun and easy! Get Unity3d and Playmaker and start making your games!

and

If you want to talk game dev with me add me on skype! I'm "mdotstrange" on there ^_^

Comments

Post a Comment

Popular posts from this blog

What format should I render out of Cinema 4d with?

UPDATED 2_27_13!  RENDER USING EXR Lossy Zip16! Since I'm working on a new feature film that will generate over 1500 shots made up of image sequences I need to make sure I choose the right file format to render to lest my hard drives explode. What I need from my format is  at least 16bit, an alpha included and preferably small size. I rendered out a frame from my film tallied up all the file sizes here- their all different types of codecs listed from smallest file size to largest. The render includes an RGBA pass, Depth pass, and Material Luminance pass because thats what I always render out. 1.00mb 8bit-Photo Jpeg %100 1.27mb 8bit-PNG 4.65mb 16bit- EXR lossy ZIP16 5.75mb 8bit-PSD 6.23mb 16bit-EXR lossy PLZ 6.44mb 16bit-PNG 7.94mb 8bit-TIFF 8.50mb 16bit-EXR Lossy 24 9.05mb 16bit-EXR Lossy Run Length 14.6mb 8bit-TARGA 22.4mb 32bit-EXR ZIP16 24.6mb 32bit-EXR Zip1 25.6mb 32bit-EXR PLZ 29.3mb 16bit-TIFF 29.3mb 16bit-PSD 40.0mb 32bit-EXR Run Length 58.7mb 16

Aggregated feedZ

So I totally aggregated all meh rss feedZ...So in this one handy like feed thing you can get... -Meh blog posts -Meh EXCITING Facebook status updates (ex. "I'm so FACE") -Meh youtube videos -Meh Vimeo videos -Meh Blogtalk radio episodes - and much more (actually just like some other xml code that i don't understand) Just subscribe via this link and you can get all that for a low low price of...oh wait it's totally FREE ^ ^

So a guy is trying to take credit for my film...

TLDR- Scroll down to THE THIEVERY My name is Mike- I make films under the name "M dot Strange" and I have done so for the past 10+ years- this is my story as a filmmaker culminating in a recent event wherein a "filmmaker" tried to take credit for my life's work Here's my imdb page with my film credits  My web site Here's a reel with stuff from my original films in which I wrote/created/designed/animated etc everything that you see- I can and have performed all aspects of animated film production on my films- thats sort of how I made a name for myself- by being a one man animated film studio Here's a presentation from 2014 with me discussing the production of my last film My first animated feature film "We Are The Strange" premiered at the Sundance Film Festival in 2007 Sundance archives link Article about the film Link to the film Film's site Because of the buzz that film generated I was given offers to sell the