One of my favorite things to code are spawners in video games. Not overly difficult, but not overly easy. They acquire both knowledge in game design and code to effectively challenge the player, but not frustrate them with stupid spawn points or infrequent/frequent enemy spawns. When I started this course, I knew Maya (or whatever other 3D program the artists are using) was an important part of video game design, but now I understand it is an absolutely critical component, and today's blog on Maya locators will prove exactly why.
What Maya allows game developers to do is tie the jobs of programmers and artists together so that they both create a game. Maya has many tools that work hand in hand with our current engine, TwoLoc, so that they artists can help create effective components of the game.
Spawning
A good example of this is enemy/item spawners. In Maya, we can set locators throughout our level. These are simply just (x,y,z) points in space. We can give them a name like, EnemySpawnerLoc01, EnemySpawnerLoc02, ItemSpawner01, etc. What this allows an artist to do is design the level and exactly how it will function. Where will the bad guys spawn, where will the items spawn, where will triggered events be, where will the destructible objects be, etc. All of those can be determined by an artist and easily communicated to a the programmers.
So, how can a programmer utilize these locators? Well, TwoLoc provides support for FBX loading and we can export the level as a scene. Then all the programmer needs to do is nab the nodes by using Ogre functionality, store their positions in a vertex buffer for enemy spawn locations and a vertex buffer for item spawner locations, then simply grab a random locator's position and spawn the tank at that position. If you remember from my last development blog, the spawner is simply down by moving an an object from the inactive vertex buffer to the active vertex buffer.
Camera functionality
Another great use of Maya locators is being able to make quick and dirty cinematics. While I would use rails more for this method, this can still be a highly effective method for making cinematics. You can place locators in a scene to represent what a camera will look at and where the camera will be when looking at that.
In this Maya scene, we see a green cube, green cones pointing towards it attached to a blue spine, and red cones circling around the street also attacked to a blue spline. The green cones all point towards a green cube. The cones are labelled: cSpire_Cinemat_00, cSpire_Cinemat_01, etc, and where they look at as cSpire_LookAt_00. The cSpire_Cinemat cones are children of the lookAt so we know that they belong to that lookAt, and will move if we move the lookAt. The red cones follow the same method, but we don't have a look at as we just want it to showcase the street level of the level.
What this is good for is that we can load the locator positions into vertex buffers, or arrays since we know how big the size will be. Then, we simply need to lerp between their positions. We can pre-define this animation in a hard-coded function, but the preferred method would be to have it done fully in Maya then load in the animation into the game and play it when we need it.
Conclusion
These are just a few methods that artists can use to really help programmers. As for Iron Heart, we'll be using these locators for cinematic cameras and spawners. While there are more things we can, such as play with the Havok Content Tools to create Rigid Bodies and vehicles, that is a discussion for another time. Thanks for reading, hope you liked it!

No comments:
Post a Comment