Indiefreaks Game Framework
Overview
The Indiefreaks Game Framework is a set of .Net libraries compiling a few years of experimenting and prototyping design patterns developing games for Microsoft Xna Framework using the SynapseGaming SunBurn graphics engine.
The goal here is to share with the community what I consider as best practices so they can avoid going through the same steps as I did. The Indiefreaks Game Framework is totally free (like in free beer) to use but it still requires you to acquire a SunBurn engine license (learn more here).
The Indiefreaks Game Framework binaries & source code is hosted on codeplex.com If you want to get straight to the download section, just follow this link.
Release Notes
v0.9.2.0: 22 March 2012
- Feature: Added SunBurn engine v2.0.18.7 support (doesn’t support versions below).
- Feature: Added GammaCorrection Post processor to allow developers or even players to tweak the Gamma of the game depending on their screen (courtesy of bamyazi)
- Feature: Added Windows, Xbox 360 & WP7 enabled StorageManager (based on Nick Gravelyn’s EasyStorage) to read/write files for player or game data.
- Feature: Added VirtualGamePad feature for WP7 allowing developers to define Touch areas on screen and mapped gamepad controls.
- Feature: Added IndieCityManager for Windows allowing developers to easily plug IndieCity SDK within their game such as DRM, Achievements and Leaderboards (more information about IndieCity http://developers.indiecity.com)
- Feature: Added support for IGF’s Project Mercury Effect Editor content files. Developers can now create their particle systems in the tool and load them through their Content Projects.
- Feature: Added BEPUPhysicsRenderer manager to IGF Physics assembly allowing developers to see physics debugging information in their game (contacts, islands, physics’ bounding boxes, etc…)
- Bug: Fixed a bug in Goal driven AI where the implemented code wouldn’t get processed in rare occasions.
- Bug: Fixed a few trigonometry issues in AutonomousAgent and Steering Behaviors.
- Bug: Fixed a bug on FadeIn/FadeOut transition effects where they could be called at the same time.
- Bug: Fixed a bug in Lidgren Session Client code where SceneEntities and Commands wouldn’t properly register themselves with the server.
- Bug: Fixed a bug in Lidgren Session to allow the creation of 1 player LAN games (previously, it required at least 2 players which wasn’t possible since the session needs to be created to create a lobby).
- Bug: Commands and Behaviors now properly unregister when their Agent’s ParentObject is removed from SunBurn ObjectManager (accross network too).
- Bug: Fixed a bug where some GUI controls wouldn’t get properly refreshed once loaded.
- Bug: Fixed a bug where GUI controls would throw an exception on WP7 if not using a power of 2 size.
- Misc: Added ClearDevice management on the Application class so developers can control when calls to GraphicsDevice.Clear() are performed.
- Misc: Added Application.Run<T>() enabling automatic Exception report on Xbox 360 (useful for Exception tracking on Xbox 360 builds of your games).
- Misc: Developers can now tell their GameStates if they should use a local ContentManager to load content or use the global Application one.
- Misc: Slight performance increase on games using multiple Layers.
- Misc: InputManager can now return useful Keyboard and Mouse helper methods through its KeyboardInputState and MouseInputState properties.
- Misc: Layer.IsVisible property is now set as Virtual allowing developers to override it and react to property changes on their inherited Layer classes (i.e.: GUI transitions)
- Misc: All session implementations now have an additional Starting state set when the StartSession() is called to allow games to setup and synchronize players, scenes, entities and commands before the actual session really starts.
- Misc: Added an Enabled property on Agent, PlayerAgent and NonPlayerAgent classes to allow easy activation/deactivation of their Behaviors and Commands (useful for game pauses or the like).
- Misc: Performance improvement on Behavior and Command processing.
- Misc: Particle assembly is now splitted in two: Indiefreaks.Game.Mercury.dll for Project Mercury implementation and Indiefreaks.Game.Particles.dll for actual SunBurn engine integration (no breaking changes to the API, just internal design).
- Misc: Small performance improvement on ParticleSystem update and rendering.
- Misc: GUI Image controls now set their rendering size based on the texture size (Scale is applied to Texture width and height)
- Misc: GUI Label control has now a readable Font property allowing developers to access Font properties.
- Misc: Added WP7 touch support to GUI.
v0.9.1.0: 22 December 2011
- Feature: Added a new BloomPostProcessor to add some glow & bloom effects to your scene without the HDR provided by the SunBurn post processor.
- Feature: Added 4 statistics to SunBurn Statistics system: Session_PlayerAgents_Count, Session_NonPlayerAgents_Count, Session_BytesPerSecondReceived, Session_BytesPerSecondSent.
- Feature: ParticleSystems can now be created based on ProjectMercury particle system editor.
- Feature: BEPUCollisionMove and its inherited classes can now be Enabled or Disabled so that you can control when physics should be applied.
- Feature: GUI Controls can now be rotated.
- Bug: Fixed an InvalidOperationException that could be randomly thrown when a GameState was getting loaded asynchrnonously
- Misc: Agent now inherits from BaseComponentManualSerialization<ISceneEntity> to prepare support on the SunBurn Editor.
- Misc: Added the Serializable & EditorObject attributes to PlayerAgent & NonPlayerAgent classes to prepare support on the SunBurn Editor.
- Misc Now PlayerAgents and NonPlayerAgents get automatically removed from the Session when their ParentObject get removed from the ObjectManager to avoid them to be processed.
- Misc: Added a Queue base system to the Processing of PlayerAgent and NonPlayerAgent Behaviors to avoid a Collection changed exception when they retrieve themselves from the Session (also prepares for Multithreading support).
- Misc: Added a check on Session update to avoid processing PlayerAgent and NonPlayerAgent Behaviors if they are not attached to a SceneEntity or SceneObject instance.
- Misc: BEPUCollisionMove now automatically adds or removes their associated SpaceObject or Entity to the BEPUPhysics Space instance when their SceneObject is submitted or removed from the ObjectManager.
- Bug: Fixed a bug where BEPU Entities wouldn’t be properly initialized.
- Bug: Fixed a bug where StaticMeshCollisionMove instances would always throw an exception when colliding with another object.
v0.9.0.0: 12 December 2011
- Feature: Implement SunBurn 2.0.17
- Feature: Implement new Lidgren network library based Session system for Windows (supports SinglePlayer & LocalAreaNetwork sessions: WideAreaNetwork session currently under heavy development)
- Feature: Implement ArcBallCamera3D (courtesy of bamyazi) to orbit your camera around a given target.
- Feature: Added Vibration to PlayerInput (courtesy of bamyazi) supporting multiple vibration events.
- Misc: Upgraded BEPUPhysics to v1.1
- Misc: BEPUPhysicsManager now has a UseInternalTimeStepping property which enable/disable BEPUPhysics optimized internal time stepping for games that have their Game.IsFixedTime property set to false.
- Misc: Upgraded all WP7 projects to WP7.1 (Mango)
- Misc: Removed obsolete IRenderEntity interface, DeferredRenderer & ForwardRenderer related managers since SunBurn latest release provides Alpha and Additive Blend support as well as custom rendering pipeline.
- Misc: Sessions now have different SessionStates: Lobby, Starting, Playing, Ended & Closed and their companion events: Session.Starting, Session.Started, Session.Ended & Session.Closed.
- Bug: Corrected a design pattern misconception where BEPUCollisionMove instances weren’t created until the 1st BEPUPhysicsManager.Update() call was performed.
- Bug: Fixed an issue where the collision trigger event were never raised.
- Bug: Added a generic Scale property to BEPUEntityCollisionMove class to allow precise control on Entity scale matrix when applied to ParentObject.World
- Bug: Fixed an issue where Commands were executed at the wrong Frequency.
- Bug: Fixed an issue where models in WP7 projects weren’t lit properly (Added LightMapManager instance by default on WP7.1 IGF Application class)
- Misc: Now, all IGF Managers are retrievable from the SceneInterface.GetManager method using an interface based type (i.e.: ICameraManager, IInstancingManager, IBEPUPhysicsManager,…) so that you can create your own overriden managers.
- Bug: Fixed a small bug in GameState not using the proper ICameraManager interface to grab the related manager
- Bug: Fixed an issue with non Power of 2 RenderTargets used within the UI library on WP7.
v0.8.0.0: 06 October 2011
- Feature: Splitted IGF in multiple assemblies. You can now choose which feature(s)you want in your game.
- Feature: BEPUPhysics v1.0.0.0 integration as a SunBurn CollisionManager replacement (You still can use both if you want)
- Feature: Depth Of Field Post Processor (courtesy of bamyazi, Thanks
) - Feature: Added new ChaseCamera3D class (courtesy of rc183, Thanks!
) - Misc: Changed GuiManager.ManagerProcessOrder value to 15 so it gets rendered after PostProcessManager by default.
- Bug: Fixed an issue with GuiManager and Xna 4 effect bug with SampleStates.
- Misc: Added ContentLoadingException to provide clearer explanation to the developer when an error occur during the asynchronous content Loading process
- Bug: Fixed bug on Xbox PlayerInput not being updated correctly introduced in v0.7.0.0 when adding support for WP7
v0.7.0.0: 19 August 2011
- Feature: Windows Phone 7 support: v0.7.0.0 now supports WP7. Note that this is to be considered an alpha support as I couldn’t fully tested it.
- Feature: Added Local Session system for Single Player games while working with the Logic namespace
- Feature: Added Project Mercury Particle Engine support as placeable entities in code or in SunBurn Editor.
- Misc: Application now exposes the current running Application instance statically.
- Misc: Application now exposes its ContentManager statically.
- Misc: Agent Add & Remove Behavior methods have been made virtual to override how they are added & registered with the current session.
- Misc: Behaviors and Commands now support an ExecutionFrequency property which tells the Session how many times per second they should process. This gives developers a much better control on optimizing their AI & networking code.
- Fix: v0.6.0.0 introduces a bug where Server Commands would also execute on the client side.
- Fix: Refactored Goal Driven AI due to a defect causing wrong Goals being processed on clients.
- Misc: Added ForceVelocity to AutonomousAgent class allowing developers to force the current velocity of a given entity if required.
- Fix: Set SmoothRotation property in AutonomousAgent class public so that developers can modify the steering forces when applied to their entities velocity
- Fix: Added a simple Enable check on steering behaviors to avoid them being called when not used.
- Fix: Fixed a bug where when using ContextualSteeringBehaviors, the considered & ignored entities wouldn’t be correctly processed in some cases.
- Misc: Added an AllowPenetration property to ObstacleAvoidance steering behavior (defaults to 0).
- Fix: Fixed a bug in ObstacleAvoidance steering force computation which was staying in Local system thus uncorrectly pushing back the resultant force.
- Misc: Changed OffSetPursuit.Leader name to Target.
- Misc: Removed NetworkIndexPlayer from IdentifiedPlayer as it wasn’t used anyway.
v0.6.0.0: 18 July 2011
- Feature: Implements SunBurn engine 2.0.16.15
- Feature: Added Steering Behaviors for Aunotomous Agents that work on both 2D & 3D worlds: Alignment, Arrive, Cohesion, Evade, Flee, Hide, Interpose, Obstacle Avoidance, Offset Pursuit, , Pursuit, Seek, Separation, Wander.
- Feature: Added Finite State Machine AI structure for you to easily add intelligence to your game entities
- Feature: Added Goal Driven AI structure for you to add complex AI behaviors to your game entities
- Misc: Added new signatures to Application.FadeIn and Application.FadeOut static methods to let you define how long it should wait before actually fading in or fading out. Useful when you need to fade in or out when the loading gamestate ends loading.
- Misc: Changed IRenderEntity.Visible property to IRenderEntity.Show to avoid confusion with SceneEntity.Visible property
- Fix: v0.5.0.0 introduced a structural bug on the Agent class with the static CreateBehavior method: replaced it back with the Add static method.
- Misc: moved Microsoft.Xna.Framework.Game.Draw() base call inside Application.Draw() at the end of the method for better control on rendering.
- Misc: moved all collections to dedicated namespace: Indiefreaks.Xna.Collections.
- Misc: Network Session now automatically registers and synchronize SceneEntity and SceneObject instances over the network so that Commands and Behaviors get processed correclty
- Misc: Moved PlayerAgent and NonPlayerAgent networking processing code from Session class to these classes directly since they are network independent.
- Misc: Added a default OnInitialize() implementation to Behavior class so that each behavior registers automatically its ParentObject (SceneEntity) on the current network Session if not registered.
- Misc: Behavior class now implements IDisposable to ensure they get disposed properly.
- Misc: Command class now implements IDisposable to ensure they get disposed properly.
- Misc: Replaced all Func<> and Action<> generic delegates in Command class to specialized Condition, ClientCommand, ServerCommand and ApplyServerCommand delegates to ease understanding
- Misc: Added an abstract Clone method to Gui Control class as well as all inherited classes to create controls from an existing one.
- Misc: Added a RemoveAll method to Screen class to allow direct removal of all Controls added to it.
- Misc: Changed InstancingFactory to support new SunBurn 2.0.16.15 RenderableMesh.Build() method
- Misc: Changed all samples to reflect corrections
v0.5.0.0: 18 May 2011
- Feature: Added GUI System (Label, Image and Button controls)
- Feature: Added Menu System (based on GUI System)
- Feature: Render both GUI and Menu either directly to screen or to texture (to use in 3d models for instance)
- Samples: Added new Menu Sample to demonstrate GUI and Menu system
- Misc: Added GameState property to Layer classes to enable easy access (breaking change: all Layer classes require now a valid GameState on their constructor)
- Misc: Changed static Application.GraphicsDeviceManager property to Application.Graphics to differentiate with local property access
- Misc: Added static GameState property to Application pointing to the current active GameState to ease its access from anywhere in the code
- Misc: Now, each GameState has an individual ContentManager instance. It is now the default ContentManager used to load content instead of Application.Content (you can still use it for content that should be available across the game’s life but you’ll have to manually call it).
- Misc: Agent Behaviors can now be accessed through a ReadOnlyCollection
- Misc: Improved Behavior Commands memory through a set of small optimizations
- Misc: Added specific PlayerBehavior<T> and NonPlayerBehavior<T> Behavior inherited classes to avoid usual casting. You can now access your specific PlayerAgent or NonPlayerAgent inherited class and its members without having to cast from Agent.
- Misc: Changed AddBehavior(Behavior behavior) to CreateBehavior() using the Factory design pattern (Breaking change)
- Misc: Added a virtual Initialize() method to Behavior to initialize inherited classes outside of the constructor
- Misc: Added specialized CreatePlayerAgent<T>() and CreateNonPlayerAgent<T>() methods to Session to create and register your own PlayerAgent and NonPlayerAgent specific classes
- Misc: Added Visible property to IRenderEntity used to cull your custom SceneEntity and SceneObject instances
- Fix: Fixed a bug where Application FadeIn/FadeOut rendering code was always executed when not required
- Fix: Fixed default VirtualKeyboardMouseMapping where Mouse Left and Right clicks weren’t mapped to the good KeyMaps
- Fix: Fixed a bug throwing an exception when an IGF game used the LiveSessionManager and SunBurn Editor.
- Samples: Modified all samples to support v0.5.0.0 API changes
v0.4.0.1: 14 April 2011
- Feature: Implements SunBurn engine 2.0.14.2 (Click here for release notes)
v0.4.0.0: 13 April 2011
- Feature: Implements SunBurn engine 2.0.13.1
- Feature: Added a new Sprite system
- Feature: Added Network Abstraction system
- Feature: Added Xbox Live Networking implementation on top of Network Abstraction
- Feature: Added Logic components with support for player and non player behaviors (works on Single player or Multi player mode independently)
- Fix: Now Application.LightingSystemPreferences are applied to SunBurn SceneInterface when created
- Fix: GameState constructor now correctly calling the default optimized 1152*640 SunBurn FrameBuffer constructor which was preventing Deferred renderer to work
- Fix: InputManager.PlayerX could return wrong PlayerInput when using Keyboard & Mouse input in one as one of the PlayerInput instances
- Fix: RandomGeometry.GetRandomPointInSphere() do not lose its polar coordinates anymore
- Fix: ForwardRenderer and DeferredRenderer now sort SceneEntity instances from back to front as it should always have been
- Misc: Asynchronous Loading now throws an exception in the main thread when an exception raised while loading content
- Misc: Added a GetPlayerInput(PlayerIndex playerIndex) method to InputManager to allow you to retrieve the corresponding PlayerInput
- Misc: Added IsVisible property to ILayer interface and implementations to enable/disable each Layer rendering
- Misc: Removed IUpdate dependency on Layer class
- Misc: Added BeginDraw(GameTime gameTime) and EndDraw(GameTime gameTime) to ILayer interface and its implementations
- Samples: Modified all samples to reflect SunBurn engine and IGF changes
- Samples: Added new Pong Net Sample to demonstrate Sprite system and SessionManager usages
v0.3.0.0: 19 February 2011
- Feature: Xbox 360 support
- Feature: Implements SunBurn engine 2.0.12.2: Benefits from all the optimization and additional features
- Feature: 2D cameras: this version prepares the framework for a new upcoming Sprite System (already works with SunBurn SpriteManager & SpriteContainer classes)
- Misc: GamePad DeadZone: You now can specify PlayerInput which GamePadDeadZone should be used to retrieve GamePad state (Defaults to IndependentAxes)
- Misc: Merged Indiefreaks.Xna.Framework & Indiefreaks.SunBurn.Framework into one unique assembly
- Misc: Merged SunBurnGameState into GameState
- Misc: Moved ILayer, Layer, SunBurnLayer and SunBurnSplashScreen to Indiefreaks.Xna.Rendering namespace
- Misc: Moved all Camera classes & interfaces to Indiefreaks.Xna.Rendering.Camera namespace
- Misc: Moved all Instancing related classes & interfaces to Indiefreaks.Xna.Rendering.Instancing namespace
- Misc: Applied the structure changes to both Indie & Pro samples
v0.2.0.1: 07 February 2011
- Fix: Mouse blocked when using SunBurn Editor and Keyboard/Mouse centered input: Now, when using the SunBurn Editor, the InputManager is deactivated to use the Editor input behavior
v0.2.0.0: 04 February 2011
- Feature: Implements SunBurn engine 2.0.11.8: Benefits from all the optimization and additional features
- Feature: Easy Hardware Instancing: The InstancingManager allows you to add hundreds of similar meshes to your scene with low framerate impact using SunBurn geometry instancing while allowing you to control each created instance world transform.
- Feature: ThreadPool: The Application class now contains a Threads property which allows you to launch long background tasks while updating and rendering your main game loop. Optimized to create threads per Core processor available (Xbox360 ready).
- Feature: Asynchronous Preloading: You can now load a GameState using a LoadingGameState instance that will update & render itself until the desired GameState is fully loaded. Allowing you to create static or animated sequences while the content is loading to notify the player on current progress.
- Feature: Keyboard & Mouse input device support: Each logical player in the available InputManager Player properties (PlayerOne, PlayerTwo, PlayerThree and PlayerFour) have now a Virtual GamePad mapped to keyboard and mouse keys, buttons and axis that can be easily customized to fit your needs. Also provides optimized access to pressed keys and held keys.
- Feature: Fade In/Out effect at GameState level: You can now easily fade in and out your entire GameState instances through a call to their FadeIn(Color startColor, float length) and FadeOut(Color endColor, float length) methods for smooth transitions.
- Feature: RandomGeometry helper class: First helper class to help developers randomly retrieve Vector3 within or on the surface of spheres and inside a cube.
- Feature: Interpolator & Timer helper classes: (Courtesy of Nick Gravelyn) Easily interpolate between values or execute code on custom timer ticks without the hassle of handling state updates.
- Fix: Cannot sort alpha blended entities on first Render call: Fixed a bug that occurred when SunBurn overriden renderers were trying to sort entities supporting alpha blending because the SceneState wasn’t initialized in certain circumstances.
- Fix: Base GameState.Update() and Draw() methods aren’t called in SunBurnGameState: Forgot to add the base.Update() and base.Draw() calls in the SunBurnGameState class. My bad
- Samples: Added AlphaBlending Sample: Demonstrates how to create custom SceneEntity classes that support Custom rendering as well as AlphaBlending and add them to the SunBurn rendering pipeline (forward and deferred).
- Samples: Added Instancing Sample: Demonstrates how to create thousands of Boxes with fewer draw calls using the builtin InstancingManager and SunBurn shaders.
- Samples: Updated previous samples: Previous releases samples now support Keyboard&Mouse input device uncommenting a few lines and also include an asynchronous loading mechanism to demonstrate its usage.
v0.1.1.1: 28 January 2011
- Fix: TargetCamera View Matrix bug: The View Matrix now uses the camera position for its LookAt calculation.
v0.1.1.0: 25 January 2011
- Fix: Now logs events on core classes: Application, GameState, InputManager, and SunBurnPlugin.
- Fix: SunBurnLayer now contains a ContentRepository and Scene property; in order to use them, you must call the new constructor SunBurnLayer(string contentRepositoryPath, string scenePath) and both lights and objects will get all loaded and added to SunBurn.
- Fix: Moved SceneEnvironment instance from SunBurnLayer to Camera. It made more sense to get the SceneEnvironment there as there is only one camera per SceneInterface instance used and allows to plug the SceneEnvironment.VisibleDistance property with the Camera.FarPlane property for Projection Matrix updates.
- Fix: SunBurnSplashScreen class has now a new constructor SunBurnSplashScreen(bool showDuringDevelopment) which allows developers to tell weither they want or not to display it when launched from Visual Studio reflecting the normal behavior.
v0.1.0.0: 21 January 2011
- Initial release

