Posts Tagged ‘GameDev’
Introduction to Game Development tips by Walter Rotenberry
Posted by Daniel Rodríguez in Game development on February 15th, 2010
Last month Walter Rottenberry came to Guadalajara to teach us about the very basics of game development. As usual, let me share my notes:
AI:
- Tips from Steve Rabin in “Game Programming Gems 2″
- Use event driven behavior rather than polling
- Reduce redundant calculations
- Centralize cooperation with managers
- Run the AI less often
- Distribute the processing over several frames
- Employ AI LODs
- Solve only part of the problem
- Do the hard work offline
- Use emergent behavior to avoid scripting
- Amortize costs with continuous bookkeeping
- Rethink the problem
Game Theory:
- Prisoner dilemma
- Types of challenges
- Implicit vs explicit
- Perfect vs imperfect information
- Intrinsic vs extrinsic knowledge
- Pattern recognition
Level design:
Level designer responsibilities:
- Create terrain
- Create the rooms
- Add props
- Add triggers
- Look great
- Make it work
Technical limitations:
- The platform
- Affects how the level should be built (not the level itself)
Main factors:
- Memory
- Processing power and frame rate
- Level performance
- Polycount
- Lighting
- AI
- Media format
- Target and minimum specifications
GPUs take care of the eye candy in the game
Special effects consume a lot of processing power instead of RAM
Performance:
- Fast moving games require faster frame rate
- Level designer should be aware of strain on GPU and not frustrate for that
Polycount:
- What really matters is the number of polygons seen on the screen at any given moment
- Contributors
- Too many characters in a single space
- Special effects (smoke, falling leaves, fire, a black hole, etc)
- Emmitters need to be watched closely
- Use LODs (Level of detail)
- Characters: 3 LODs
- Objects: 2-3 LODs
- Environments: distances vary depending on level and game
Lighting:
- Lights and shadows both pulls on the GPU
- Dynamic lights are cool but expensive
- Traditionally had static lights
- Lights and shadows can be baked into textures
Game metrics:
- Happens after the player metrics are known
- Properties of the main character are the biggest factor
- Examples:
- Height and width
- Walk and run speed
- Jump distance
- Jump height
- Interaction distance (how far the player needs to be from an interactuable object to interact with it)
- Character metrics
- The visual size is different from the collision size
- Use collision volumes
- Make doors and corridors slightly bigger than realistic proportions
- Warning: Beware the game designer who gives you a ballpark figure for vital game data
- Get hard data before creating the level
- Level designer should decide the movement speed and jump metrics
Tips:
- FaceFX for facial animation
- Use cell diagrams (also called bubble diagrams) for gameplay
Thank you Walter. This was very useful.
TransformUtilities
Posted by Daniel Rodríguez in Game development, Programming on February 6th, 2010
Hello. I’ve been working on a set of four tools to aid in the Unity3d development. After using Unity for a while I encountered the classic problem of needing to copy the position of an object over and over. This led me to create the “Copy” tool. I’ve found a similar script on the Unify community, but I wanted to extend the tool. It is now possible to copy position, rotation and scale of any axis you want. Also, the values apply to all objects selected in the scene.
After that, and inspired by the tools I found on the Gamebryo Lightspeed editor, I created the Randomize and Add Noise tools. Those tools work almost the same, the randomize the position, rotation of scale of any object selected (or all objects selected). The difference is that while Randomize sets the absolute values for position, rotation or scale, Add noise adds a delta to the current value of the transform. This is useful for example to randomize the Y rotation of all the trees in your level, or to make a bunch of boxes look more natural by not being perfectly aligned.
Finally, after been learning Autodesk 3ds Max, I created the Align tool inspired by a tool in that software. It basically takes a source transform, just like the Copy tool, then uses it’s collider and the collider of the object (or objects) selected to align it. You can align for example, the minimum point of your selection with the maximum point of your source (what you are aligning to) to place an object over another. It let’s you align using the minimum point, maximum point, the center of the object or the pivot point on both the selection and the source. You can align on all 3 axis.
To use these tool, all you need to do is download the script file, and add it into a folder named Editor in your project’s Asset folder. Once compiled by Unity you find the new functionality in Window -> TransformUtilities, or simply press Ctrl+t (Cmd+t for Mac users)
Developed by Daniel Rodríguez (Seth Illgard) in January 2010
Hope you find them useful, and please let me know how can I improve theses tools.
Coroutines in Unity3d (C# version)
Posted by Daniel Rodríguez in Programming on January 23rd, 2010
Coroutines in C# work the same way that they do in Javascript (UnityScript), the only difference is that they require more typing (they have a slightly more complicated syntax). You should see the blog post on Javascript coroutines first.
Here, I present the differences:
Coroutines must have the IEnumerator return type:
IEnumerator MyCoroutine()
{
//This is a coroutine
}
To invoke a coroutine you must do it using the StartCoroutine method:
public class MyScript : MonoBehaviour
{
void Start()
{
StartCoroutine(MyCoroutine());
}
IEnumerator MyCoroutine()
{
//This is a coroutine
}
}
The yield statement becomes yield return in C# :
IEnumerator MyCoroutine()
{
DoSomething();
yield return 0; //Wait one frame, the 0 here is only because we need to return an IEnumerable
DoSomethingElse();
}
Remember that we need to return an IEnumerable, so the Javascript yield; becomes yield return 0; in C#
Also, since C# requires you to use the new operator to create objects, if you want to use WaitForSeconds you have to use it like this:
IEnumerator MyCoroutine()
{
DoSomething();
yield return new WaitForSeconds(2.0f); //Wait 2 seconds
DoSomethingElse();
}
Happy coroutining
Game development facts and tips
Posted by Daniel Rodríguez in Game development on November 19th, 2009
Last month I had the pleasure of finding a new friend in the gamedev community: Ian Masters, a senior game programmer at Sidhe Interactive, creators of the Speed Racer game for Nintendo Wii and Sony PlayStation 2.
While he was in town I managed to compile a list of game development facts and tips. Here they are:
Programming:
- Everybody creates their own internal technology to build games. They modify engines and create frameworks for internal use.
- The technical director is the responsable of selecting technology like the game engine.
- Developing a game engine from scratch could take years and it’s not recommended.
- The most used languages in game development are : C++, Lua and Python.
- It’s common to have a prototyping team.
- Use source control (SVN, mercurial, etc.)
- Have all your projects into a solution, prefer that to link against static libraries (including third party code).
- Have your engine’s source code in your source control system so you can modify it and the changes will propagate.
QA:
- Unit testing is very important (specially for math libraries and core functions).
- Regression testing is important too.
- QA team is different from playtesting. QA test QA, playtesters test fun.
- No QA guys in multidisciplinary teams.
Art:
- Conceptual art should be delivered as soon as possible before programming start (at least a month ahead).
- Work on iterations.
- Artists hate naming conventions.
- It’s not easy to convince the artists to follow naming conventions (normally you need a producer to talk to them).
- Having a lead artist who follows naming conventions is crucial.
- Try to integrate audio as soon as possible. Audio is not a luxury.
- Post effects are often decided between the post effects coder and the art director.
- Camera effects are often decided between the camera scripters and the designers.
- Have metrics with the export tools (poly counts, texture sizes, bone count, etc)
- Should present a visual target.
Design:
- They can’t account for everything.
- Design document should be as detailed as possible.
- Design document should be a live document.
- They define tunable properties.
- Normally use XML files for tunable properties (exported from spreadsheets for extra awesomeness).
- There are co-designers (scripters).
Production:
- Producer’s work is to assure work is being done and cycles are running smoothly.
- Wikis are awesome.
- You can manage a whole project documentation using exclusively a wiki.
- Procedures, knowledge and project management all fit into a wiki.
- Multidisciplinary teams are a great way to work.
- Have a list of features that need to be tested on the prototype.
Recommendations:
- Scrum is the way to go.
- Use Scrum properly.
- Scrum meetings in the mornings.
- Put scrum plans on the wiki.
- Create tickets on Trac or a similar tool.
- Keep things visible and transparent.
- Read a lot. Be proactive and an active learner and problem solver.
- Try to work as close as possible with artists, programmers and designers.
- You need a published title to get into the industry. To get that title you need to be in the industry. Indie titles are a good way to break into it.
- Prototype as soon as possible.
Hope that helps, and a big “Thank you” to Ian for his time with us. I learned a lot.
Introduction to Game Development and Unity3d
Posted by Daniel Rodríguez in Game development on November 19th, 2009
Today I was invited to the UVM University to give a workshop on game development using Unity3d. For that purpose I created a small presentation that you can find in pdf format here: Introduction to game development and Unity3d.
It is a very basic introduction, but I hope you like it.
Mixins in game development
Posted by Daniel Rodríguez in Game development on October 2nd, 2009
Programmers tend to think in the Object Oriented Programming paradigm all the time. We create complex class hiercharies that describe every single entity on the game. Thats what we learn at school, we are programmed (deeply into our firmware) to do that, but there is a whole world of different pradigms and approaches we can use, and the scripting languages are bringing the dynamic style into the game.
Functional programming can be great for game scripting, Lua has beeen a very popular game scripting language for a very long time, and a bunch of game engines uses it (including CryEngine 2.0 and Gamebryo LightSpeed). The ability to attach properties and functions into an object at runtime, for example, is incredibly useful to create high level game logic and even artificial intelligence.
We can talk about dynamic languajes and their benefts here, but I want t focus on Mixins as the modern approach to game entity description:
Mixins are chunks of functionability that can be applied to game objects. You can think of them as little pieces (building blocks) that you use to create a complex game entity. The most basic mixin every game entity is the entity’s transform which defines its position, rotation and scale. Each game engine implements entity’s transform in a different way, but the concept is the same.
Mixin complexity can vary from a simple mixin that lets you name an object (holds a string identifier), to very complex mixins like the one that provides characters the ability to use pathfinding to navigate the scene.
Each engine handles mixin agreggation in it’s own way, some engines even let you use multiple inheritance with mixins. Please note the difference between mixin inheritance and mixin agreggation:
- Inheritance:
- Mixins can be inherited
- You can have mixin class hierarchies just the same way you can with normal classes
- Aggregation:
- Game objects agreggate a number of mixins to aquire their functionability
- Mixins are agreggated (added to game objects) to create entity model descriptions
For example: A mixin called BoomerangTarget provides the ability to be the target of the player’s boomerang. BoomerangTarget is a child of another mixin called Target which provides the generic ability of being a target of a player’s weapon. At the same time, an Enemy agreggates the following mixins: Actor, BoomerangTarget, SwordTarget. Actor lets the enemy play animations, BoomerangTarget is the mixin desvribed above and SwordTarget provides the ability to be hit by a sword. SwordTarget mixin is also a child of Target, thus, both BoomerangTarget and SwordTarget share the basic functionability defined in the Target mixin.
A lot of game engines are using Mixins these days. Mixins have become the standard way to represent game object functionability.
Seth out.
