Insomniac Games have recently released another update to their Nocturnal Initiative. This update boosts a number of cool new libraries which I haven’t yet had time to take a look at, although I certainly plan to at some point.

Something that I have been looking at is using their ‘EShell’ script for one of my personal projects. ‘EShell’ is a small perl script for setting up a development environment. This seems like a simple task but is key to providing a stable environment for developing a piece of software. I have worked on numerous professional game projects now and have worked on both projects that handled the environment setup very well (Rare’s Build Lab did an awesome job for Banjo for example), and other projects that didn’t handle this so well (which will remain anonymous).

To illustrate the problem (and how an environment setup process improves the overall experience for the developer), I present two scenarios:

A Good Environment Setup Routine

  • I am a developer and I want to work on my project
  • I sync up to the latest version of the code base
  • I run the environment setup tool
    • The environment setup tool prepares my machine so that I can build and run the latest version of my code
  • I build the latest version of the code
    • It was successful
  • I run the latest version of the code
    • It ran without any problems

Without A Decent Environment Setup Routine

  • I am a developer and I want to work on my project
  • I sync up to the latest version of the code base
  • I try to build the latest version of the code
    • It fails because its missing the ‘PROJECT_ROOT’ environment variable
    • I open up my Environment Variables settings (in Windows) and add the environment variable
      • This new environment variable leaks into any other project that I might want to work with
  • I try to build the latest version of the code again
    • It fails because the latest version of the DirectX SDK isn’t installed on my machine
    • I download and install it
  • I try to build the latest version of the code yet again
    • After waiting 30 minutes for the project to build, it tries to execute a post build step, and can’t find fxc.exe as the DirectX SDK’s Bin directory hasn’t been added to my ‘path’ environment variable
  • Getting more and more frustrated, I try to build the latest version of the code once again
    • It finally builds without any problems
  • After hours of setting up my machine by hand, I am now able to run the latest version of the code

So where does EShell come in? Well, it allows you to define a project settings file containing all of the environment variables that your project requires in order for you to build your project. Furthermore, it supports different configurations, includes, and an array of options for running the shell (either creating a command prompt or running a single command under the environment - quite handy for Windows shortcuts).

One thing that it is currently lacking I think is the ability to execute commands. This may be because this is beyond the responsibility of EShell however as it could itself be executed by a larger script (which I am planning on doing for my project). Apart from that, everything’s going well so far!

And here’s a quick tip for people getting started with EShell. I am developing on Windows, and have a batch script for executing EShell in ‘shell’ mode (so that the command window stays open with environment variables set up). Something that Windows does is automatically close the command prompt window if an error is generated whilst running the EShell script. This is quite annoying because you cannot see the error message generated by EShell. So, I modified my batch file to look like this:

@echo off
perl Tools\EShell\eshell.pl -settingsFile "ProjectSettings.xml"
IF %ERRORLEVEL% == 0 GOTO END
pause
:END

This generates a “Press Any Key To Continue…” message if an error occurs whilst running EShell which is quite handy for tracking down errors…