11 April 2008

Sharing Is Good - The Open-Source Insomniac

Insomniac Games who are behind Ratchet & Clank and Resistance: Fall Of Man have recently decided to start sharing knowledge. Gaming is a notoriously secretive industry and is not well renowned for its open-ness, and Insomniac think its mad that developers keep reinvenhttp://www.blogger.com/img/gl.link.gifting the same core pieces of functionality that don't even make up the bread'n'butter of gaming.

First up is the R&D section on their website. This section contains presentations and papers about various subjects including graphics, gameplay, memory and performance.

Next up is the open-source BSD-style licensed code. The section is called the Nocturnal Initiative and is a wiki. There are links to community forums which aren't busy yet.

At the moment some of the source code available is:
  • C++ Delegate/Event System
  • Pointer to reference counted objects
  • Pointer to heap allocated arrays
  • Endian conversion code
  • Insertion ordered std::set
  • Reversible key and value std::map
  • Interprocess Communication
    • Fast non-blocking message-based design
    • Works over BSD-style sockets (TCP) or Named Pipes
    • Windows platform included, additional platforms are easily added
  • Debugging Helpers
    • PDB-based symbol information querying
    • Capture stacks within your program making heap object tracking and leak debugging easier
    • Give your application automatic crash reports dispatched via email that contain handy user/machine informaton, call stack, and memory page allocation stats
  • Console Output Manager
    • Log console output to one or more trace files
    • Color code the console output based on Error/Warning/Debug print statements
    • Throttle output verbosity (configured via command line arg or environment variable)
    • Outline nested stages of processing performed by your application (for builders/exporters)
    • Augment crash reports with the current outline state of your application (very useful for tracking down new crash bugs)
  • Instrumenting Profiler
    • Cross platform (Windows and PS3 currently)
    • Macro-instrumented stack timer based profiler
    • Concise profile report printed out at program exit
    • Logs instance data out to human readable log file (Profile Analyzer is in development)
  • C++ Reflection
    • Instrument your application classes and register them with the type registry
    • Can serialize object instances to XML or our (faster) custom binary format
    • Flexible parsing mechanics allow you to read in old versions of your class
    • Handles renaming member variables as well as changing member type (within reasonable limits)
    • Supports serializing std::vector, std::set, and std::map containers with primitives or pointers to other reflect objects
    • Supports serializing enum and bitfield members using string representation (supports reordering enum elements)
    • Provides for automatic object comparison and cloning
    • Implements introspection using a visitor interface

Some of it looks pretty good. I hope this means that there is more sharing of C++ code which is always a good thing, maybe even some of the libraries could be Boost-ified...