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.
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.
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….
… 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:
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.
So to keep the bird in the air we need enough Lift to counter the Weight, therefore
W = (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
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.
So I got a paying gig YEAAH! I am programming for an indie start up, Nectar Games. I have been working in Unity and we just moved into our office. Not much else to talk about, check out my boss’s page for more info on what he has worked on.
Last Sunday, my friend, Alan presented me with the opportunity to Volunteer at the International Game Developer’s Association (IGDA) Summit starting the next morning.
I spend majority of the first day running panel sessions, including the keynote from Kim Swift.
Prior to the keynote I met Kim, Ed Fries, and Dustin Clingman and spoke briefly to them before Kim took the stage. Kim’s talk, titled “A Love Letter to Games”, covered how she got into game development, how the Super Nintnedo (SNES) shaped her relationship with the industry, and her counter to the Joe McNeilly article on GamesRader, “Portal is the most subversive game ever“.
Next up I ran the panels listed under a track called “Advocacy”. These panels covered topics including game industry law, marketing within the industry, and the role of venture capitalism in game development. I found Kristen Lindsay‘s panel on the positive impacts of video games and the industry with helping sick youth, through the charity Child’s Play, particularly interesting.
After the conclusion of the “Advocacy” panels, I spent the next few hours running the panels in the “Intro” track. Within that track my favorite speaker was Luke Dicken, who discussed the basics of Artificial Intelligence (AI) in games. Luke mentioned that the goal of AI is to function like a “good dad”. When a parent plays a game like checkers with their child, they naturally from years of experience and intellectual development have an advantage and could easily win every time. However, a good parent sees the value in the exercise for their child and will let the child win. Under the “good dad” principle AI seeks to let the player feel like the interaction was a challenge even though the AI will inevitably loose.
In finished the day up as runner and then attended the pre-Casual Connect networking party where I ran into some friends who work at PopCap. Additionally, I had a short conversation with David Edery of SpryFox on game development. I also ran into Sean who keyed me in to the Seattle Indie Expo event happening in Redmond (which I will heading too as soon as I finish this post).
Most of my volunteering the next day was spent assisting the registration desk, however I did get a chance to check out some of the panels on the “Writing” track. During the break between some of the writing sessions I had a chance to speak with James Portnow regarding his suggestions for increasing my industry exposure. Justin suggested that I may want to write an article on my history as a design and code Wizard for an old Multi User Dungeon (MUD) in the 1990s. I am currently drafting that article and hope to share it with you soon.
The convention ended with some time spent networking at Casual Connect and the GREE party at The Garage.
Overall this past week was a great example an opportunity appearing when least expected. I look forward to the Summit next year.
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)
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).
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:
If they are awake and next to a wall, they follow it
If they sense food, they head towards it and eat until full
If they are ready to mate and the sense a potential mate, they head towards it
If they are threatened, they run away
They avoid bright lights
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:
Wander randomly but show preference to pheromone trails
If you encounter an edge, stop with half your body over the edge. Wait for some time. If nothing happens go back to wandering
If you find a stationary ant, climb on top of it and keep moving forward
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:
Avoid obstacles (e.g. – trees, light poles, etc.)
Separation: avoid crowding neighbors by maintaining a minimum separation from each other
Alignment: steer toward the average heading of neighbors
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.
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:
Why: To highlight my 3D modeling talents.
Tech: I am using a Unity engine and 3D Studio Max for my modeling.
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.