Archive for the ‘Game Dev’ Category

Mechanim

0

If you have Unity 4 you can play around with Mechanim, its a pretty cool system. the basic concept is its a Solid State Machine for animations and it also provides blending, transitions, IK, layering, and body part masking. Cool stuff!

 

I did not work much on Crow today but I did at least lay down the framework code for my solid state machine.

 

If your are interested in Mechanim you should watch and follow along with this tutorial. Honestly when this came out followed along with the tutorial then, made my own scene with it, then I had to watch bits of the tutorial again because I made the wrong assumptions on some of the material, but turns out that just made me better at working with it.

 

 


As the crow flies…

0

Hello again! Well I haven’t posted in awhile and thought if I post about my game development I will post more.  At the Seattle Unity3d User Group, I met a guy who did a project in which he keep a very detailed blog about his development of an iOS game.  He told me that the blog got some traction but the game ultimately fizzled.  I decided to try this out and be pretty transparent on my thought process and what nought.

Introducing….

 

Crow!

Really it is just a working title. How about some more details. It is an adventure game where you play a crow, developed in Unity3d, 3rd person(bird?) controls, little to no combat and other things that i cant think of right now.

Today I edited some of the animations I got from the Crow Flock asset I got on the Asset Store. I have some experience with Unity’s new Mechanim system, so I rigged up the crow to work with that. As of right now I only have 2 animations Glide and Flap. With the way the Mechanim worked the animation can add movement to the model,which is cool, but you need to animate  with that in mind, the crow I got wasnt.  Which means I need to figure out how fast a crow flies, which means….

 

MATH!

 

… or google apparently. One site lists the avg crow speed to be about 30mph or ~13m/s but it had no references, so am I suposed to take this on blind faith?  Hell no! I have a degree in physics I can math this shit out!

Facts people agree on:

Crow{

mass = .5 kg  //easy number to work with. Wikipedia: .316kg to .67kg

totalLength = .5 m  //also an easy number to work with. Wikipedia .4 to .53 meter

tailLength = .2 m  //Wikipedia says 40% of total length

wingSpan =  1 m  //Wikipedia .85 to 1 meter

}

When we look a Free Body Diagram for bird flight we have Weight, Lift, Drag, and Thrust, very simple.

 

Lift is directly proportional to surface area(S) of the wing. Lift also takes into consideration airspeed of course this is less simple than a proportionality constant.  The force from the airspeed is prop. to airspeed (v) times the air mass and the air mass is equal to airspeed(v) times  air density(d).  S0 the force is prop. to (vdv or dv^2 )  this is interesting in that twice the airspeed creates four times the Lift.

L =  (1/2) • C • S • d • v^2  (from NASA)

So to keep the bird in the air  we need enough Lift to counter the Weight, therefore

= (1/2) • C • S • d • v^2  

C in the case has to do with angle of attack and instead of waist more space I’ll let you know its equal to .3 (this mostly based on birds average angle of attack for long distance flight).  The air density(d) at sea level-ish is about 1.25 kg per cubic meter. Weight is measured in Newtons which comes out to be  4.9N. Lastly we need to figure out how much surface area(S) a crow wing has:

First of the the wing span is pretty close but we need to take into account the torso and subtract that from the wing span. Now I am estimating here but from several pictures I am guessing that the torso is about 1/6 the wing span giving the total wing length to about  0.83333333 m, now for the length. If the total length is .5 m and the tail is .2 m, that leaves .3 m for head and torso lets  divide that in half leaving .15 m, lets go with that.

S = .15 * .83333333 ≈ .125 m^2

Now lets throw it all together and see what we get

4.9 = (1/2) * .3 * .125 * 1.25 * v^2

9.8/.125 = .38 *v^2

206.315 = v^2

206.315 = √v^2

14.36 m/s 

Well what do you know it turns out to be pretty close to 13 m/s or 30 mph.

Tomorrow I’ll implement this and figure out the glide velocity.

 


Engineering Animals

0

I read recently a book titled Engineering Animals that I picked up from the library after searching for book on emergent behavior. Within the text the authors shed light on several perspectives and applications within fields ranging from biology to engineering.

Among the topics covered were:


Structure and Movement:

Endo and exo skeletons, habitat building, movement through a medium (e.g. – land, sea, and air), and electrochemical (e.g. – how neurons work)


Sensors:

Chemical (e.g – smell or taste), mechanical (e.g. – hearing) and electromagnetic (e.g. – sight)


Combining the previous topics for more complex results:

Including Intelligence, emergent behavior, navigation, and communication

The chapters on the aforementioned subjects were the most salient to game design, particularly those on emergent behavior and navigation.

Please note, I am not going to summarize the entire chapter but am instead selecting the points that the exposed that which I found most intriguing to my study of Artificial Intelligence (AI).

Emergent Behavior

Most animals have three goals in mind; sustenance, security, and sexual drive, and it turns out the cockroach is no exception. Recently cockroaches have been studied as an analog for autonomous robots. Yet when scientists tried to model the cockroach they had difficulties in making the models match the manner in which the creatures behave in the real world.

Why? Scientists were using the wrong approach, originally working from a top-down model, they were asking themselves complex questions about the creatures goals, “What do cockroaches achieve?”. After numerous failed attempts to using this complex study to generate a realistic replica, the scientists changed their approach to the problem, by instead using bottom-up approach asking; “What do cockroaches do?”. The truth is not much, as cockroach behavior can be broken down into these simple rules:

  1. If they are awake and next to a wall, they follow it
  2. If they sense food, they head towards it and eat until full
  3. If they are ready to mate and the sense a potential mate, they head towards it
  4. If they are threatened, they run away
  5. They avoid bright lights
  6. If none of the previous cases occur then they wander aimlessly until something happens

What I find really interesting is that by linking all these simple rules together a remarkably accurate model of a cockroach was simulated. And it turns out that the same bottom-up approach can be applied to most types of eusocial insects (with few exceptions). The authors discuss termites, ants, bees, and wasps as well the original cockroach model.

I was particularly intrigued by a complex study on Ant bridges.

Here is the Ant Bridge Algorithm:

  1. Avoid obstacles
  2. Wander randomly but show preference to pheromone trails
  3. If you encounter an edge, stop with half your body over the edge. Wait for some time. If nothing happens go back to wandering
  4. If you find a stationary ant, climb on top of it and keep moving forward
  5. If there is another ant hanging off of you don’t move, and emit a pheromone to call for help

Turns out that this simple algorithm is all that is needed to get ants to build bridges across gaps or streams. Talk about a cool upgrade to Sim Ant!

Birds of a Feather Flock Together

Flocking behavior is also surprisingly simple as can be seen with European Starlings flocks (which are often seen in North America and Europe). As an observer the patterns of the these birds appear to be very intelligent; the birds instantly change shape and direction.

But how do they do it?

The answer is another very simple series of rules that each bird follows:

  1. Avoid obstacles (e.g. – trees, light poles, etc.)
  2. Separation: avoid crowding neighbors by maintaining a minimum separation from each other
  3. Alignment: steer toward the average heading of neighbors
  4. Cohesion: steer toward the average position of neighbors

These limited rules at first appear to be almost too simple, yet as the book points out nature often chooses simplicity over complexity.

The rest of this chapter was on wolf pack tactics, which I didn’t find very compelling as wolves only have about a 30% success rate. The authors very briefly mentioned the subject of Cape Hunting Dogs, which have upwards of a 90% success rate. However, the listed information on the tactics of these hunting dogs is scarce on the web, so I have emailed around to see if I can get more information.

After reading it all, this book is a pretty good study for anyone interested in engineering, biology or game design. Particularly, those attempting to better understand the qualities that create the unique behavior of animals.


What Happened?!? Somebody Set Up Me The Bomb!

0

So that was a pretty long posting drought! I had a lot of college projects that had been taking up most of my time. But I am back because I have only have one quarter left until I graduate and it is time to kick into high gear.

What I am working on now:

Unnamed RPG

Why: To highlight my 3D modeling talents.

Tech: I am using a Unity engine and 3D Studio Max for my modeling.

My Inspiration:

  • The game Wizardy (one of the first successful role-playing games coded for the Apple 2 (but was later ported to all kinds of machines)
  • A MUD I have coded on for about five years called Leviathan.

Death Take a Holiday v.1

0

This is going to be a short post (as I am in the zone).

I did some work on Death Takes a Holiday today:

    - Rewrote the enemy code
    - Fixed the emitters
    - Added more emitters
    - Changed the test level
    - Figured out the basics on how Monster Debugger works
    - Working demo

“Bam said the lady” and here is my working demo.

Back to the Dev,

-Justin


PaxDev Day One

0

Wow, this last week was completely inspiring!

Wednesday and Thursday I spent at first ever PaxDev. The short of it is that the conference was super awesome. And as if that weren’t enough Friday, Saturday, and Sunday I spent at the infamous PAX (Penny Arcade Expo)!

PaxDev:

Dev was exceeded my expectations, everyone I spoke to were nice and receptive and I learned a ton about a wide variety of industry topics.

During Dev I also created a small game for myself. I had printed out one hundred business cards with the goal to hand out as many as possible.

I set a point value +1 for every card given away and +2 for every card received.

Here are my end of Dev totals:

    50 Given Out.
    30 Received.
    —————–
    110 Points Total!

Maybe I will keep this up. It might be a good motivator for future networking events.

Wednesday:

Daniel James gave a talk about the non-fiscal costs related to game development. Serious, friendly, open, and while still lighthearted the talk really set the mood for PaxDev. Next up were two of the people from Trendy Entertainment who talked about their game Dungeon Defenders. The panel began with the four representatives playing the game together, one on the iPad, one on the Android phone, one on the PC, and one on PS3. All four representatives used GameSpy for the networking. At first, I wondered if it was a not-too-subtle advertisement from GameSpy. However, after awhile I realized that Gamespy was the only option for this kind of cross-platform networking.

The next three panels were filled with surprises. ‘The Art of Story’ panel was primarily about cut scenes, so I am excited to have some good guidelines for whenever I am tackle that.

Here are my two favorite takeaways from “The Art of Story”:

    - Even if a player never sees the information, it is critical to have a backstory.
    - Every player is naturally anti-dramatic meaning they want the easiest path to their intended goal. However, to create drama requires creating hardship.

Jason VandenBerghe gave an unexpected but highly insightful talk called “The Four Types of…” . While I am really not sure what I had expected from this presentation, it ended up being my absolute favorite event within PaxDev. He was an engaging speaker who presented content that was truly well presented. Many ideas were things I had encountered previously but this streamline approach gave me some new ideas about Player psychology and design.

The last lecture that I went to was “A Strategic Approach to Game Design” led by Geoff Zatkin from EEDAR. Honestly, I was not the intended target of this panel which was created for Directors, Producers and Team Leads. Nonetheless I gained some interesting knowledge.

My favorite part of that talk was a relative statistic of how marketing and reviews work together to effect sales:

    A game with bad reviews and bad marketing the game earns X
    A game with good reviews and good marketing the game earns 11X to 13X
    A game with good reviews and bad marketing the game earns 1.5X to 1.7X
    A game with bad reviews and good marketing the game earns 3.5X to 4X

It was one of those statistics that blew my mind, even though the reality is not that shocking!

That was Day One of PaxDev, Day two wil be coming up soon.

Off to eat mac and cheese,
- Justin


New Blog/Old Posts

0

So I have a full website finally!

It has been awhile so here is a fast update. I am working on: write an ajax implementation for making my posts easier, adding comments, figure out sql, and continuing work on “Death Take a Holiday”.

Speaking of “Death”, I’m changing the game from being a top down to a platformer. The premise remains the same but I am altering the gameplay.

Edit: for now I have just installed WordPress I’m using the Html5press theme.

gigaBlam!

- Justin



Death Takes a Holiday alpha1

2

A quick update! Working on the demo of movement for “Death Takes a Holiday”. So far this is really basic, which is to say that it is not a game yet but just a demo.

Here is a demo of movement for “Death Takes a Holiday”:

http://www.swfcabin.com/open/1278742734

Off Again.

- Justin


What Have I Been Doing?

0

School and unfortunately not much else. Physics and Math, it turns out, take a lot of time but the Summer is coming and that means there will be an increase in my free time.

I’ve been working on something different, a new Flixel game called “Death Takes a Holiday”. The game is a prototype for general flixel game ideas to get a feel for the system.

The idea for “Death Takes a Holiday” are simple: The player is ‘Death’ or rather a Contractor for the organization Blackwater which now does all the work the the old Death used to do but for less money. The character ‘Death’ has decided to take a vacation day off and his goal is to get to the beach, however unfortunately if ‘Death’ touches anything with a soul it dies and the player collects the soul. If ‘Death’ collects too many souls he is teleported back to Deathco, Inc Headquarters to turn them back in ( for the sake of this game that is to say the Player dies). Once the player is returned to HQ they must start the attempt for the beach all over again.

Here are some basic screens:

This was a basic tile map. I made it so that I could see how everything looked… currently, not so good:

I spent about two hours learning how to adjust it and am now at this point:

Well worth the time, thing looks much better!

Finally here is the main character:

Sure he is  a little small but packs a mighty scythe.

Maybe I should go to the beach…

- Justin


Post navigation