2008/12/19

Happy Holidays 2008!

Happy Christmas! Merry New Year! And all that good stuff!

I'm just taking a moment to touch bases with the masses and say that I hope every has some pretty jolly holidays. Each year we celebrate and/or remember the things that mean the most to us - the new year, the coming of spring, history's late and great presidents and notable figures like saints and prophets and actors and activists, fathers, mothers, sons and daughters, the fools, the wise men, the days of thanks and terror, the days of costumes and candies, parties and panties, the days of our youth and the days of our prime, the days of our old age, and the days of our secret crimes. Here's to the days we start off ranting and rambling, and the days we somehow lead to rhymes.

It's fun to be festive, and fun to be alive. If you're a software developer or game developer, it's an especially merry new year coming up with great things just over the horizon and events that will lead to a whole new revolution in technology as well as games. So, take a moment to respect and acknowledge the developments of this past year and take a moment to revel in our prospects for the immediate future.

I probably won't be able to publish another post this month, so I want to thank everyone who reads this blog for their support and encouragement, and I want to appreciate the coming to a close of a great year for me and mine.

Good luck, and take care,
Ahad L. Amdani

2008/11/24

Game Developer Magazine: A great resource.

GD: I absolutely love it.

I figured I'd take the time out of my day today to read the magazine I'd decided to evaluate on a lark: Game Developer. I paid I believe $50 to $60 for a year's subscription and it took a little over a month to process, but I got November's issue. This would be the issue whose cover article is Certain Affinity's Age Of Booty. I had previously not heard of this game beforehand and didn't know anything at all about it.

It just so happens that I have recently been re-interested in game development on a serious level and I was re-evaluating Microsoft's XNA Framework. I wanted to make a strategy game (decision is still being held off on whether or not to approach it turn-based or real-time) for the XBox Live Arcade (XBLA) that I've been designing out and want to prototype soon. Well, as I read the first page of the article, and it's source development tools, I soon realized that Certain Affinity had, with a small group of core designers and developers, done exactly what it is that I wanted to do myself, or at least try out. Except they did it with Capcom, a major publisher, as their backer, and their team consisted of experts in the field; veterans, shall we say, of the Game Development Wars that wage ceaselessly. According to GD, they had (in general) 5 full time developers, 9 shared, and 3 part-time contractors to produce 457 source files yielding 117,000 lines of code with only 2,147 bugs reported (either open, resolved or addressed) with a development time of 13 months: 2 months pre-production, 11 months production. They made the XBox 360 version, contracted out the Windows version, and Capcom took on the PS3 version. These are the same people who make Left 4 Dead. This is now a game I'm going to purchase simply to support them. I'll probably have fun and enjoy it quite a bit too, as I'm an RTS fan and I love board games, which this game is inspired from.

Anyways, I wanted to point out that their post-mortem was an excellent resource and covers the essential ideas and processes that I want to implement myself and how I believe the wave of the indie future is going to run for the immediate future.

Anyone who is interested at all in game development should check this magazine out - it's available both online and in print, and I prefer print editions of most resources, but it allows for some serious flexibility if you're on the road a lot and have only your laptop or digitally-enabled mobile phone to accompany you.

Also, an excellent additional resource I enjoyed was their ads. I tend to hate ads in magazines, but the tools they list and the offers they provide were all things I seriously considered - and they tend to be either full page spreads or out of tabbed to the sides or bottoms of pages where they aren't annoying (*cough*websites should do this more and stop inserting weblinks everywhere*cough*) or distract from the main content.

Thanks and I hope you check them out,
Ahad L. Amdani

2008/11/18

Stage Gates Revisited: Gate Meetings

The PM Hut (specifically, Dave Nielsen) published an article last week that I feel deserves some special attention. The article can be found here: Conducting Successful Gate Meetings

My comments (visible on the article) have been re-published below:

Dave,

Sorry it took a week for me to approve your comment (I never realize comment moderation was on at my blog). I'm glad you pointed this article out to me - specifically because it made me realize a couple of additional points with regards to stage gates.

Primarily, the gate meetings themselves - why they should be held, and when they should be held during your projects.

The parts dealing with who should attend and how to run the meetings are more political in nature and I feel are different/unique per situation.

> Gate meetings also serve the purpose of validating the Business Case. As the project’s scope, budget, and schedule change throughout its life cycle, your Business Case will change.

Hadn't considered this aspect. I realize that the project evolves, the customers evolve and the business relationship evolves, so we would have to update documentation, but I hadn't considered the need to update the business case for the project. We usually work with technical writers and they take care of this for us - but it's definately something an independant consultant or small team should take into account.

> The Business Case may also be changed by circumstances outside the span of your control such as changes in the market place. The Gate Meeting is your opportunity to have the updated Business Case validated by your project’s executive sponsors.

Yes, another great effect of updating your business case would be its re-validation against the market.

> The second [gate meeting] is critical because this is the meeting where the customer will formally accept the products of the project. It should drive any formal sign offs and final payments that conclude the project.

I've always preached and practiced holding what I now call gate meetings many times over the development cycle of a project, but I don't think I've ever held one before customer sign-off. We had small reviews to ensure whether or not all of the features had been fully completed and tested out, but never to evaluate whether the business case still stood, whether or not to cut the project off or restructure it, etc. I'll have to try it out and see if the sponsors / clients would be interested in changes from what we had originally considered the "final release." I think mostly because since we follow the Stage Gate process, we feel that things are aligned towards a successful completion assuming all coding and functionality are completed for the fully evolved project. But always room to try and it costs no more than a day of work.


The article also goes into the fine points of actually conducting the meetings, deciding who should attend, etc. These are the details that I feel deserve a look at, even though I consider most of these points unique to the situation within a company, because they form good, general advice.

Take care,
Ahad L. Amdani

2008/10/08

MATLAB / C# / VBA Interop

I work at an actuarial outsourcing company in Argyle, TX called The Scruggs Group (or TSG for short). I live in Grand Prairie, TX and primarily hang out in Arlington, TX so I drive around quite a lot. For those that don't know, Argyle is about an hour away from Arlington, whereas Arlington is about 15 minutes away from Grand Prairie. Thankfully, due to my house's location, I'm still only an hour away from work, since I live right off of the major highway, 360. I just mention all of this because I heard on the radio this morning that gas is finally dropping below $3 a gallon in certain places in North Texas, and I hope that extends further down south.

Anyways, this seems like a very random topic, and it is to some extent, but I was tasked with creating a proof-of-concept and figuring out the pipeline to allow a developer to produce a managed excel document using Visual Studio 2008 and the latest VSTO 3.1 runtime while working with the MATLAB Compiler Runtime 7.8 to wrap around and access MATLAB routines for use in the managed excel document. The secondary condition is that we wanted to turn around and maintain access to the MATLAB Compiler Runtime with VBA directly, and also indirectly through managed C#. The reasoning behind this secondary condition is that it allows the actuaries I work with to write temporary VBA routines against the Excel document that feature their own MATLAB routines, and also to allow for more formal and permanent features to be written in via managed C# directed through me and published out to the network via ClickOnce Deployment. There are of course serious performance benefits to utilizing C# to handle file I/O and SQL Server access and data manipulation versus utilizing VBA to do similar operations, so things of a performance-heavy nature, especially if they also incorporate MATLAB, will be written in a MatlabLibrary class and wrapped for use both in the managed excel file via VSTO and if necessary (for whatever bizarre reasons) accessible to calls via VBA.

There are a few ways you can do this, and I was able to locate some good articles online about the simplest of them: creating a dynamic linked library (DLL) in C# in which you reference the MathWorks libraries and the MATLAB exported routines (via MATLAB® Builder™ NE for the Microsoft® .NET Framework) and generating wrapper classes and functions for those routines, ensuring that they adhere to an interface. Then, you take and build this DLL and run regasm against the library with the \tlb option to create a TLB file (a type library) for use in an excel file. You open up or create the excel file in question, hit Alt+F11 to go into the Microsoft Visual Basic Editor, get to the module you'll be utilizing the C# code in, and add in a reference (Tools > References) to the TLB you just generated via regasm from the C# DLL. You can now use simplified code (see below) to make calls against the C# functionality.


Assumptions: MatlabTest is the solution name. MatlabLibrary is the class name. You've generated the necessary interface (say, IMatlabLibrary, which doesn't matter in the VBA code) that exposes the functionality you want, and you've followed the above steps to build your DLL, tranlated it to a type library, and referenced it in your VBA code.

Simplified Code:


Public matlib As MatlabTest.MatlabLibrary

Public Function VectorSum(arrA as Excel.Range, arrB as Excel.Range) as Double()
Set matlib = New MatlabTest.MatlabLibrary
Dim
VectorSum = matlib.VectorSumDoubles(arrA, arrB)
End Sub


Also, you have to be aware of the way MATLAB and/or C# return the results to you - in the above example, I wanted to put the returned results of the array function vertically in 5 columns (I used 2 5-column inputs as the arguments) and needed to perform a TRANSPOSE on top of the =VectorSum(A2:A6, B2:B6) formula against the C2:C6 range.

In either case, this serves just fine for regular usage of Excel, but what if you're not using a regular Excel file, but one that is generated via VSTO and managed C#? You want to have the embedded managed functionality be accessible via VBA as well, right? And you want to ensure that every time you publish an update via ClickOnce, that the new functionality you generated is still accessible via VBA without the users having to go through a complicated process (or yourself for that matter) of updates.

This more sophisticated method allows me to write new functionality against my managed excel file in VS2008 and hit publish and everything "just works" - due to steadfast preparation, of course.

Okay, so how do we get an excel workbook with C# functionality and Matlab access that we can have interact directly or indirectly with VBA?

Step Zero: However you obtain your Matlab routine (my actuary provided it to me using MATLAB Builder NE), ensure you have a deployed/exported Matlab routine (we're going to use VectorSum) and the necessary runtimes to develop with. These include:
Matlab Compiler Runtime (I used v7.8)
VSTO (I used 3.1)
Visual Studio (I used 2008 Professional Edition)
Microsoft Office (I used 2007 Professional Edition)

The exported routine we called PhilipTest.dll and it deployed with the PhilipTest.ctf file as well. It deployed with PhilipTest_pkg.exe which I used to install the "DLL" and the MCRInstaller runtime to my machine.

Step One: Create yourself a new solution (go ahead and backup your other solution or remove it) in VS2008, a managed C# Excel 2007 Workbook solution called MatlabTest, naming the actual workbook MatlabVectorSum, ensuring that it is a macro-enabled workbook, thus having the ".xlsm" extension. Add references to the MWArray.dll from where you installed the compiler runtime (should be in C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v78\toolbox\dotnetbuilder\bin\win32\v2.0, disregard the (x86) if you're not on a 64-bit OS) and the MATLAB DLL (PhilipTest.dll) file.

Step Two: Add a class and an interface to your Managed Excel project called MatlabLibrary [MatlabLibrary.cs and IMatlabLibrary.cs] and ensure the class contracts to that interface. Code in the functionality you want; I stuck with making sure my using directives were in place, to make typing simpler, and had Excel.Range as inputs to the function, converting them to MWArrays, calling the PhilipTest.VectorSum(arrA, arrb) function, and returning the result set as an array of values. Add into your ThisWorkbook.cs file the following code under the ThisWorkbook_Startup event:

matlib = new MatlabLibrary();
// this will start "CallbackReg" macro in the workbook using matlib
ThisApplication.Run("MatlabModule.CallbackReg", matlib, missing, missing, missing, missing, missing,
missing, missing, missing, missing, missing, missing, missing, missing,
missing, missing, missing, missing, missing, missing, missing, missing,
missing, missing, missing, missing, missing, missing, missing, missing);


Step Three: Register your project for COM interop (Project Properties) and ensure that your platform is specific to x86, sign your ClickOnce manifests, include your prerequisites and setup your publish options, update the AssemblyInfo.cs file to make sure the COM visibility is true, and mark your MatlabLibrary class and IMatlabLibrary interface with the [System.Runtime.InteropServices.ComVisible(true)] directives.

Step Four: Go into your Excel view inside of Visual Studio 2008, click "View" on the Office Fluent Ribbon, Click "Macros" > "View Macros" and create a new Macro called CallbackReg (found this little gem on the internet as well). Update your module name to "MatlabModule" and erase all code you see in it. Now, add in at the least the following code:

Public matlib As MatlabTest.MatlabLibrary

Public Sub CallbackReg(callback As MatlabTest.MatlabLibrary)
Set matlib = callback
End Sub

Public Function PMTVectorSum(arrA As Excel.Range, arrB As Excel.Range) As Double()
PMTVectorSum = matlib.VectorSumDoubles(arrA, arrB)
End Function


Step Five: Test. I created a button control in the excel view inside of VS2008 through the Toolbox, generated an event handler, and wrote code in C# that utilized the MatlabLibrary class to make sure that C# itself could talk to MATLAB. I also used the above VBA function and an Office shape assigned to a macro that called the VBA function with specific arguments to prove that the VBA could call my C# function. And then I made a third button that proved VBA could talk directly to Matlab.

Step Six: Publish. This is where I had the biggest issues. ClickOnce typically works extremely well for me, but with this project I had issues. 2 files (the PhilipTest.ctf.deploy file and a CPPAPI.netmodule.deploy file) would not publish so every time the end user tried to install from the VSTO manifest or the setup file, it would fail. I placed them manually into the Application Files folder, under the v1.0.0.2 folder, and when the users tried installing it after that, it worked fine. However, I need to figure out how to get all the necessary files to publish. VS2008 reports the publish succeeds just fine, but as witnessed by my end users, this is not the case. If anyone finds a solution for this, please let me know!

I know the above tutorial doesn't show every little step and all of the code, but it's specific enough that a C# or VB.NET developer shouldn't have any real problems following along on it. The biggest steps are understanding what's going into the Matlab routines and what's coming out of them so that you can write your code efficiently and understand and document what's going on.

Good luck, folks.

2008/09/24

Agile and Stage Gate Development

I've long been a proponent of small teams of individuals working together in a fast-paced development environment, reminiscent of "xp" (or extreme programming), and I came across another great article from Lost Garden, Rockets, Cars and Gardens: Visualizing waterfall, agile and stage gate, which described a succinct and clear development platform and management methodology that I already embrace and didn't have any name for and simply believed to be "agile best practices."

It's called Stage Gate and consists of cross-breeding portfolio models and iterative development. I worked at Lockheed Martin Missiles & Fire Control over in Grand Prairie for about 7 months in an internship, and they believe strongly in following the waterfall method for their projects, although they were at that time also researching agile practices and methods. I subequently worked at L-3 Communications Link Simulation & Training for roughly 10 months in 2 separate terms, first as an intern, then as a Software Engineer I, and their ethic was more of an iterative development approach with constant integration of the coding platform, so it was a bit closer to achieving that agile best practice method for such a large company.

Both of these work experiences enriched my belief in the iterative system, especially since in between the two, I worked at a small company called FoodTronix. FoodTronix is a great company, but during my tenure there, the company was expanding faster than it could handle and hadn't looked into these techniques, falling into that haphazard pattern of developing whichever feature was being demanded most by the customers without a rigorous testing process or any thought into documentation, alongside being severely understaffed. These problems are typically considered huge, but the company was able to handle the fires primarily because they were in a constant dialogue with their customers. FoodTronix is a Restaurant Point of Sale system. I've seen better and worse. What sticks out with this company is their customer service and their adaptation to changing and evolving customer needs - they always handled their customers with care and immediately helped them address their issues and resolve their problems, putting out patch after patch until the biggest fires were extinguished acrossed the board for all of their customers.

To summarize, I learned from these experiences that an iterative development model worked very well for me as in individual and for large companies, along with agile and xp practices such as continuous integration, adaptation early and late into development. I had also seen that I worked better across multiple projects with a selection process of picking which ones to proceed with through a series of comparisons, which I can now call kill gates, in which I examined each project, its pros and cons, its required estimated time left, its original purpose and its final, intended result.

I hadn't heard of portfolio models until I read the post, but it seems like a very logical solution - that of spreading and managing risk via multiple projects in parallel. Now, I don't work on multiple products at a time, but I love the breakdown of how even an individual product can be compartmentalized into several isolated projects with focused teams on a susbet of features or some sort of a divisional area. Of course you have to have overall management, but the Cabal method described by Valve in the Gamasutra article he referenced seems to impart to me a singular philosophy of involving everyone in a project from each of the individual areas in a face-to-face meeting of brainstorming, understanding the individual areas a bit better, and learning how to work with each other better, overall.

I think I'm going to put together a post, eventually, that summarizes my exact philosophy and posit if it can be beneficial to others to follow along and see what intuitive changes they make to the process. As an independent consultant and a typical nine-to-fiver in a small team at a mid-sized company, I find that I don't have to necessarily adopt separate methodologies of work in order to fully harness and focus my energies. In fact, having this one, tight philosophy of adaptation and managing your time across multiple projects with constant customer interaction allows me to state that the focal point is in organization, management and preparation of the overall product in conjunction with the rest of your team and your vested customers, whether you're a project manager, a software developer, a customer, or an external party relying on a completed component for your own development or use and aren't originally invested in the product.

Yes, you have to get the work done, and you have to test, and you have to ensure that everything is consistent, visually, functionally, etc. - but the focus isn't on making sure you're meeting some deadline and writing x amount of source lines of code, or writing tons of documentation or trying to "design" and "architect" the perfect end-all solution, but rather that you're achieving the customers' current and immediate needs with a look ahead (but not a project) to the future, and that you, your team, and the customer all understand that as customer needs evolve, the product evolves, the project schedules evolve (be it a delay or a cut in time), the team evolves, and the business relationship evolves.

Either way, some of the great resources I've come across that I prefer to read and take a look at whenever I have some spare time include:
Free To Play,
Lost Garden,
Agile Game Development,
Extreme Programming,
Gamasutra.

Also, if you're ever bored, check out 8-Bit Theatre, CAD the Series, and Pandora.

2008/09/23

An old post to a great article by LostGarden

I was perusing once again one of my favorite blogs out there, http://www.lostgarden.com, and since he's recently re-tagged his entire blog and updated his directory listing, I was reviewing an old article Danc had written, called The Chemistry of Game Design (which was also featured on Gamasutra).

I like to read the comments the users post in response to his article, as Danc also tends to reply to these remarks, and I'd made a post with respect to his article that I had forgotten about and that I think is still worth noting. The link to the Wikipedia article about game design no longer features the Psychological Profiling section, but some googling about on your own should give you a nice insight on what you're looking for with regards to that.

Here's Danc's article:
http://lostgarden.com/2007/07/chemistry-of-game-design.html

Here's my post:

Great article Danc. A few things I noted, since I just got a chance to reading your article in its entirety:

Psychological Profiling / Player Model:

The player described in the player model is limited, in that it describes a specific subset of the set of players: those that are "driven," usually to learn or dominate (and to dominate, they must learn first). Due to the fact that a psychological model is called for, the player model described contains the following player subsets: Timmy Power gamers, Timmy Diversity, Johnny Combo, Johnny Offbeat, Johnny Uber, and all the Spikes, who, evidently, this player model is perfect for. [See Game Design in Wikipedia, specifically Psychological Profiling: http://en.wikipedia.org/wiki/Game_design]

So what about the Timmy Social, Timmy Adrenaline, and Johnny Deck profiles? One could argue that they aren't the mainstream of gamers, because they aren't "hardcore" gamers - however, Timmy Adrenaline would disagree vehemently, as witnessed by DOOM3's and F.E.A.R.'s success, and The Sims is proof that Timmy Social is a very large demographic that can't simply be ignored. Johnny Deck's profile, in my honest opinion, represents those players that build or generate some sort of expression of themselves or their experiences in the game, such as a guild or clan, a house or empire, etc. And they're usually rooted into the other player profiles on some level as well.

The reason I mention this is to ask if maybe there isn't a player model that abstracts out a bit further to include a more involved psychological model. The purpose of your original abstraction was to focus on the core that is the player - but if the player is too loosely or too strictly defined, then it degenerates a critical component of the chemistry of game design. In this situation, the player is too strictly defined.

On that same note, I believe the Wiki should be updated to include your article on game design and your blog in general, as there is a wealth of game design information available here.

Pre-Existing Skills:

Shouldn't the general assumption be, of every game, only that a player cues in to the screen for some sort of visual feedback, and that they know that pressing buttons or moving analog sticks is supposed to do SOMETHING, as opposed to nothing? With this same thought process comes the need for every game to have at least a very simple tutorial, if not more involved for more complex games, which defines and describes the game controller and its general actions, and the capability to learn advanced skills by utilization of mastered basic skills, thus teaching even a non-gamer that mastery and utilization of certain skills leads to game advancement and skill advancement.

Most games today do provide a tutorial, but not all of them, and often times the "New Features" or "Tutorials" sections are nested into sub-menus that aren't necessarily clear in the first place (Example: Madden '08 by EA Sports). And in some cases, the tutorials are demonstration-based (see earlier: Madden '08, which provides nice video and audio tutorials showing exactly what to do) but don't allow the player to interact there directly to try a skill-set out and see if they can't get the basis for it down outside of actual gameplay instead of possibly trying it out during gameplay, messing up, and costing yourself time to re-load from a game death, etc. As such, these games are less effective in delivering the message to non-gamers or gamers who like directly to "jump into the action" and there's no built-in game-based tutorial. Obviously, advanced gamers may want to skip a built-in tutorial, and so they should be given that capability, just as newer gamers may want to listen/interact with the built-in tutorial and given that capability. (This goes with what you state in the Pre-Mastery of Skill Taught In The Game section regarding feelings of boredom and frustration for advanced players.)

Skill Atoms & Skill Chains: (Objectives, Future Topics)

Proposal: an artificial intelligence analysis framework, in comparison with the MDA game analysis framework for game analysis that you mentioned, that utilizes Skill Atoms and Skill Chains as they are progressed throughout the Player's Gameplay Life Cycle (as I like to call the fundamental game play, skill mastery and burnout flow described by your Chemistry of Game Design). If some sort of CGD architecture is built into the game itself and actively monitors a players partial mastery, full mastery and burnout of Skill Atoms, then it can eventually generate data by which an adaptable artificial intelligence can play against the player, allowing for variable levels of interaction and difficulty for the player, constantly providing a challenging stimulus without leading to frustration or boredom. Such information would be tremendously useful in any number of applications within the gameworld itself, and as a preferences experience for future game titles (and has numerable applications in the marketing world as well). In addition, this analysis could clue players into how using certain previously burned-out atoms may advance their skill-set later on during the game, by knowledge of their usage history with the skill atom in question and the necessity of learning the skill atom further down the chain for completion of their current objectives.

Just some food for thought. I do apologize that it took me as long as it did to read such an excellent article, and I'd love to hear your reply.

-Ahad

It's an interesting read, and my post reminds me of some of the more interesting notions I had regarding AI.

Take care,
Ahad L. Amdani

Echo Consulting, Small Business Consultations, Software Automation and Development, and Business Efficiency... in a big way!

Welcome!

This site is about everything the title of this post entails, along with some articles and links here and there about game design and development. I might throw a little light in on things such as software algorithms, the struggles of a young, independent game developer (myself! -- that is, if you can count a 22-year old full-time employee with his own small business who plays video games most of his spare time and wants to make a game of his own one day an indie), the small business advice I receive or give, the books I've read to come to the conclusions I've come to in the present time, and a bunch of other content that probably has no bearing whatsoever on anything important except that I find it interesting or special in some way.

I have extensive ramblings and rants on a wide variety of topics, I just seem to lack the proper time frame to focus all of the daily knowledge I come across into a textual format, properly edited, and publish it on the internet in the form of a blog.

In any case, I welcome you and hope you get something positive out of this, or even if it's just a waste of time and a way to kill that ever-present and sinister calamity: monotony.

Good luck, good hunting, and good gaming!

Thanks,
Ahad L. Amdani

Latest 5 Entries.

Ahad L. Amdani

    follow me on Twitter