GDC 2010 – Day 1
This year’s Game Developer’s Conference felt a little strange to me. For one the conference has been skewed from Monday through Friday to Tuesday through Saturday. Second, Mascone West has been decommissioned due to some other conference going on during the same time. Third this was going to be my first ever #AISummit.
For me the conference really began at Day 0 when I had the opportunity to meet with lots of folks from the AI Guild including the opportunity to finally meet Alex Champandard from AIGameDev.com who literally felt like a celebrity at the event. Speaking of AIGameDev, I got to speak with two very cool contributors from the Sanbox project, Ken Short and Radur (I hope I’m spelling this right since I never got a business card *hint hint*). I met with two long time friends and people who I feel like I already owe a lot to; Dave Mark, and Neil Kirby. While I’ve followed Dave around the states throughout 2009 as well as joined him on some Team Fortress 2 skirmishes, it was a real pleasure to shake hands with Neil Kirby once again. With that being said, Neil introduced me to this year’s Eric Dybsand scholarship recipient Gabriel Deyerle who I felt like I instantly became friends with, and speaking of scholarship recipients I met Victoria Smith for the second time who was the third recipient of the scholarship in 2009. Only missing Andrew Armstrong, Neil was nice enough to take a picture which I hope to post into here once he gets around to uploading it onto flickr. And speaking of flickr do check out the AI Game Programmer’s Guild group at http://www.flickr.com/groups/agpg/. To wrap up Day Zero I met with three other speakers of the AISummit, Borut Pfeifer, Chris Jurney and the great Emily Short.
Day One officially began as I made my from the Union Square Hotel and made sure to get an early seat while watching Dave and Chris go through some last minute set up work.
10am-11am
The first session began with three case studies on recent AI trends. Tara Teich (Double Fine Productions) spoke about the challanges in Brutal Legends when it came to integrating 50+ unit types of various sizes, proportions, attacks combinations with the main avatar, and the design decisions of the AI Avatar character. This reminded me a bit of my own game from full sail when creating Amoeba Sports. Creating a believable AI opponent that resembles that of the human player’s avatar is a very daunting task. Tara explained that for the AI Avatar they kept his behavioral priority to something like the following:
- Retreat if low Health
- Capture Resources
- Defend the Base
- Join a battle in progress
- Hang out with the largest army and look cool
Tara also mentioned their flat state machine that utilized “Utility” functions for transitions.
Alex Champandard gave a talk on Killzone II AI with how they integrated bots into almost everything they did. Killzone II bots’ greatest challenge being the ability to adapt to various maps, and class combinations. This was handle using the standard logic separation between strategy, squad based, and individual AI systems. Alex stressed the heavy use of annotation and referenced several papers on the subject. Something worth noting though is that the annotations never dictated behaviour but instead acted as hints to the AI, such as chock point areas, or good sniper locations. Generally this kept the AI very competitive but did not resolve, what Alex called the third plateau, the ability for the AI to adapt to human tactics that were not accounted for or the evolving beyond expert systems, data mining, and creative AI. For this I followed up with Alex after the session and personally I feel not enough is being done. The only real solutions available are forms of learning and pattern recognition, neither is currently being used in commercial games.
Finally Chris Jurney spoke about Dawn of War II and the challenges faced with transitioning from a game like Company of Heroes that was very impersonal based combat to DoW2 which had quite a bit of melee. Chris summarized the solution to this problem through what he referred to as search based melee. Essentially casting a radius around various units that represented their melee distance, and performing an A* pathfinding to where the their unit radius must be exactly touching the enemies unit radius in order to perform a melee attack. Combined with an additional rule to avoid overlap on a given target created very convincing battle simulations and made the animation bit a lot easier to handle.
11:15am – 12:15am
Behaviour Trees by Alex Champandard, Michael Dawe, and David Hernandez Cerpa began the talk by exclaiming the sheer popularity and flexibility of BTs in video games. For those who aren’t familiar with Behaviour Trees I recommend doing some light reading on AIGameDev.com, but for all intensive purposes they are Hierarchical Finite State Machines that don’t really operate in the sense of states, and use very light and compact nodes to transition behaviours. David opened up by talking about the various node types (Priority, Sequential, Stochastic) and continued with defining slightly more advanced topics such as Event-Driven behaviours (the ability to enable behaviours through events), and Dynamic Behaviours (mostly referring to enticers). Enticers are behaviour trees that attach themselves to actors and detach themselves when finished. These BTs are useful for level behaviour support, and downloadable content. Alex continued by talking about common Design Patterns within BTs, such as scaling up using a HFSM mindset. For this he recommended to not approach behaviour stringing in a linear fashion, but instead chunk BT hierarchies into a blackboard architecture and than create more abstract behaviours that utilize them such as SneakToCover(), PeakAtThreat(), RunToCover(). This of course is hinting at the problem that Alex has been trying to solve and that is the creation of generalized AI. The most important take away from Alex’s bit was to keep BTs decoupled from the problem at hand. Be careful of “state like” behaviours. Lastly, Michael spoke about integrating scripting into BTs, which is quite a common thing to do. BTs are about flexibility and rapid iterations and scripting is usually the ideal solution to the problem. For LUA Michael spoke about a common interface that integrates with the C++ code. They would make sure that no trig was performed in any of the scripts. A tool was created to allow for the designers to rapidly iterate through behaviours, where he himself only created 7 out of the 50+ that were in the game. Lua was optimized by removing floating point math, and prevent mid-frame garbage collection. He typically would spend 10% of his time debugging existing scripts from the designers, and 10% on functionality requests (trig) that were done in C++ and executed using dll functions. He also stressed that BTs need to be periodically reviewed.
1:45pm-2:45pm
The next session was a panel discussion on AI Middleware. I’ll thankfully keep this one brief as it was pretty synonymous that we should continue to be wary of AI Middleware granted the rent at the end of day by the host John Funge was really interesting. Key points of note were:
- We want tools over black boxes
- Integration support by the middle ware company is often moot, due to the precieved benefits
- Evaluating middleware is often difficult due to their inability to simulate production environments during testing
The only success story came from Steve Gargolinski from Blue Fang Games who intergrated Havok Behaviours into their Wii title.
– intermission –
Well I’m already getting very tired as I am already at 1300 words and really need to sleep. I’ll do my best to continue while it may not actually happen until my plane ride home on Saturday evening. After all GDC tends to get busier, and its an event that is difficult to cover in great detail
Inspiration, Motivation, and Fools Gold
I am fairly fond of the title for this post as it does two things. It’s an open invitation to spam crawlers and this is the first blog post in some time with more than a code snippet or two.
In short, it has been almost a year since I’ve graduated Full Sail University and since then I have had a number of experiences that made me on numerous occasions question the validity of my life-choices. This stems from the idea of immediate sacrifice and delayed gratification towards a brighter and happier future. This for most is an accepted part of life and being successful. While ultimately we all strive for happiness and each time we sacrifice and give we hope it to be a means to an end. Of course as we grow older we slowly but surely realize the real cynical nature of human life.
I’ve asked myself on occasion; what makes me happy? Is it having a high paycheck? Is it the process of creating video games? Is it sitting at a bar? While I’ve questioned my motives, I always arrive at the same answer sooner or later. I realize that I simply wish to be challenged and learn. At the core that is what drives me! That is what motivates and inspires me. Still I’ve never been able to make the jump to a full time Indie, or a commit towards academia.
In the near future I hope to reevaluate why I have failed to follow my real agenda. Attain courage, and achieve some closure.
This is essentially a slightly longer twitter post. Thanks for reading.
Wordpress Pagination
Today while striving to wrap up Michael Kofman 2009 I found myself spending longer than I would have liked trying to get a “wordpress page” to loop through all of my blog posts with enabled pagination. The intention was to become familiar with the wordpress framework, install a few plugins and be on my marry way. Sadly things didn’t quite go so smoothly. So to make this a lot less painful for future readers here is a short list of steps and plug ins used as well as a final code snippet. After I’ll discuss some of the alternate methods I found, share my work cited and hopefully put some value into the community.
Wordpress Page Templates
My first question was how to create a new page in wordpress and apply to it my own layout and stylesheets. This was incredibly easy and intuitive.
- Create a new .php page that will serve as a template for your new wordpress page.
- Page templates are easily recognized by the wordpress CMS via a magical comment.
1 2 3 4 5 | <?php /* Template Name: Your Template Name Here */ ?> |
- Navigate to /wp-admin/ and depending on the version of your dashboard click add page.
- Here you can give your page any title you want. And somewhere on the page you should see an option to apply a template to the page (again this varies with wordpress versions so Google or check documentation). If you uploaded your new .php template to the proper location you should conveniently see “Your Template Name Here” as an option.
Installing a Pagination Plugin
I decided to use WP-PageNavi although there are several alternatives I’ve found.
To download and install follow these instructions:
1. Download WP-PageNavi
2. Upload folder “pagenavi” under wp-contents/plugins
3. Activate the plugin
4. Add the following code into your current theme’s php file.
5. Configure the settings under WP-Admin -> Options -> PageNavi
6. Click “Update Options” and you are done.
The Lonely Loop
The reason I titled this lonely loop is because most wordpress documentation will refer to the post entries as “THE LOOP“. The final code snippet that finally got things rolling for me was as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; $my_query = new WP_Query('showposts=5&paged=$page'); $wp_query = $my_query; query_posts("showposts=5&paged=$page"); while ( have_posts() ) : the_post() ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="date"> <div class="day"><center><?php the_time('d') ?></center> </div> <div class="month"><center><?php the_time('F') ?></center> </div> <div class="year"><center><?php the_time('Y') ?></center> </div> </div> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <?php the_content('Read the rest of this entry »'); ?> <p><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> <br class="clear" /> <br class="clear" /> <?php endwhile; ?> <div><?php next_posts_link('Older Entries')?></div> <div><?php previous_posts_link('Newer Entries')?></div> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> |
Obstacles Overcome
One of the first challenges I faced was realizing that the default loop provided in index.php did not properly render posts but instead interpreted function calls like the_title() with regard to the title of the page (template) opposed to individual posts. I later found according to slightly misleading documentation that a new query object is required. I proceeded to create one called $my_query. Where I would prefix function calls as such.
$my_query->have_posts()
and
$my_query->the_post()
This seemed to work, but the next problem was getting pagination to work in synch with this new query. The problem was that WP-PageNavi only listens to $wp_query. I had wondered around for some time trying to resolve this particular delima short of writing ajax and the pagination functionality by hand or maybe trying a different plug in. Thank fully after jumping from link to link I finally stumbled onto the following code block.
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("showposts=5&paged=$page"); while ( have_posts() ) : the_post() ?> <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2> <span class="entry-date"><?php the_time('F d, Y'); ?></span> <?php the_content(); ?> <?php endwhile ?>
This finally got the ball rolling. I had only correct a few errors that sparked from the constant experimentation like a random reseting of the query at the end of the while loop. Conveniently above the pagination caused the current page to always read 1.
Hope this will be helpful to someone in the future. Here is an unordered list of sources.
http://codex.wordpress.org/Template_Tags/query_posts
http://codex.wordpress.org/The_Loop
http://codex.wordpress.org/Function_Reference/WP_Query
http://codex.wordpress.org/IRC
http://almosteffortless.com/2006/12/21/wordpress-pagination-on-a-page/
http://jarodtaylor.com/blog/wordpress-ultimate-archive-index-with-pagination/
http://www.w3cgallery.com/w3c-css/wordpress-pagination-in-pagephp-or-display-subpages-as-paging-under-parent-page
http://wordpress.org/support/topic/256899
http://www.lesterchan.net/wordpress/readme/wp-pagenavi.html
Getting Started with wxWidgets
I wanted to explore what wxWidgets was all about after learning that tool programmers in the game industry commonly use it in their development environment. Getting started with wxWidgets on a windows platform is fairly straight forward.
Download the latest stable release http://www.wxwidgets.org/downloads/
Go ahead and grab wxMSW – installer for Windows. Make sure your visual studio is closed so that the environment variable gets set up correctly.
Next your going to need to compile the library. So go ahead and navigate to installDir\build\msw.
Open up wx.dsw and convert it to your native Visual Studio format. Close visual studio back down and open up each vcproj in the current directory through notepad or notepad++. Search and replace each of the following:
– RuntimeLibrary=”3″ with RuntimeLibrary=”1″
– RuntimeLibrary=”2″ with RuntimeLibrary=”0″
Once your done. Open up the solution again, and right click the solution in the solution explorer. Select Batch Build. Select only the release and debug for each project. Once complete your ready to create your first wxWidget application with the added work of including all the directories and .lib in your project settings.
Here are two good links to help you get through this:
http://wiki.wxwidgets.org/Compiling_WxWidgets_on_Windows
http://wiki.wxwidgets.org/MSVC_.NET_Setup_Guide#Project_Properties
If it doesn’t work out right, go ahead and triple check everything!
What I learned from all this was that while wxWidgets are great for multiplatform development they are probably not a solution for developing game GUIs. I’d love to hear what others think on this subject, meanwhile I’ll move on to setting up my own GUI framework after a few hours of sleep.
New Sandbox
During a casual conversation someone brings up the idea of writing their own game engine. This is usually met rather stern remarks about complexity, lines of code, and a unworthy endeavor. Well for the most part I would say that is a true statement, and let me just say that is not what I’m trying to do. Well I’m trying not to think about it that way. My goal over the course of this week is to assemble together several sub systems I’ve done before, and some that I haven’t into a comprehensive sandbox. Then split it into several plug and play DLLs that I can use in future projects.
What I have so far:
- Math Library
- Event Handler
- Win32 Framework
- Resource Manager
- DirectX Initialization and Callbacks
What I’m tackling this week:
- GUI Framework
- wxWidgets Integration
- Network Framework
- Console Debugger