The Indiefreaks Game Profiler for Xna is here!

I’m really excited with this news as I consider it as a tremendous personal achievement.

I finally made it and I’m pleased to announce the immediate availability of the Indiefreaks Game Profiler for Xna games and it is totally free for use. ;)

You can download it here:
http://downloads.indiefreaks.com/igp/v1.0.0.0/Indiefreaks Game Profiler for Xna Setup.zip

If you want to have a quick view on what you get with it, here is a quick video reminding what it is capable of on all platforms supported by the Xna framework: Windows, Xbox 360 & Windows Phone 7.

It should be a good companion on your games development when looking to optimize things ;)

On a side note, I also just made available a PayPal Donate button on the sidebar of this blog so, if you want to support the efforts I put on this tool as well as the Indiefreaks Game Framework, I’ll be eternally thankful if you participate sharing some dimes so that I can pay the website and domain name hosting, as well as the inherent costs of such software development.

Thanks and let me know what you think about IGP ;)

34 Comments

  1. Gorion says:

    Hey, i tried it out. But i can’t get it working. I am getting a 255 error at the post build event.

    (Error 7 The command ““C:\Program Files (x86)\Indiefreaks.com\Indiefreaks Game Profiler\igp.exe” “C:\code\C#\RocRider\RocRider\RocRider\bin\x86\Debug\RocRider.exe”” exited with code 255.)

    I am running windows 7 64bit with VS2010 and XNA 4.0

  2. Philippe Da Silva says:

    Hi Gorion,

    Such error should be accompanied with some output in the Visual Studio Build Output window. This will be helpful to find out what is going on.

    Thanks

    Philippe

  3. CJ Bailey says:

    Great work once again Philippe! Just downloaded and will be trying it out shortly.

  4. CJ Bailey says:

    Just tried it out. I get the following error when trying to build my project…

    “Error 28 The command “”C:\Program Files (x86)\Indiefreaks.com\Indiefreaks Game Profiler\igp.exe” “C:\Users\CJ Hazard\Documents\Visual Studio 2010\Projects\Tarquin2\Tarquin2\Tarquin2\bin\x86\Debug\Tarquin2.exe”" exited with code -532462766.”

  5. Philippe Da Silva says:

    Hi CJ,

    As I mentioned to Gorion, such build errors should come with details on the Visual Studio Build Output window. Please, report it back so that I can help finding out what is going wrong.

    Philippe

  6. CJ Bailey says:

    Hi Philippe. I think I’ve solved the problem. I had a static class (helper class) that seemed to be causing the problem…

    igp.exe Information: 0 : Processing HelperFunctions.QuaternionHelper
    igp.exe Information: 0 : Processing System.Void HelperFunctions.QuaternionHelper::FaceToward(Microsoft.Xna.Framework.Vector3&,Microsoft.Xna.Framework.Vector3&,Microsoft.Xna.Framework.Vector3&,Microsoft.Xna.Framework.Quaternion&)

    Unhandled Exception: System.InvalidOperationException: Sequence contains no matching element
    at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
    at Indiefreaks.Xna.Profiler.MethodProfilerWeaver.AddProfilerAttributeInitializationToNestedAspectsClassStaticConstructor(TypeDefinition typeDefinition, FieldDefinition profilerAttributeField)
    at Indiefreaks.Xna.Profiler.MethodProfilerWeaver.Weave(TypeDefinition typeDefinition)
    at Indiefreaks.Xna.Profiler.Weaving.AssemblyWeaver.WeaveTypes()
    at Indiefreaks.Xna.Profiler.Weaving.AssemblyWeaver.Weave(String assemblyFileName)
    at Indiefreaks.Xna.Profiler.Program.Main(String[] args)

    … but since I no longer need it, I deleted it and build is now successful! :)

  7. Philippe Da Silva says:

    CJ, that’s what I mentioned in my previous comment but it still is a bug and I’ll get it sorted out soon.

    Since it builds correctly, is it showing up profiling data? Is the game component reacting correctly to input events?

    Thanks

    Philippe

  8. CJ Bailey says:

    Me again! Now I get a message saying there is “No Source Available”. Yikes!

    First I get “The following module was built either with optimizations enabled or without debug information: {my project} … To debug this module, change its project build configuration to Debug mode. To suppress this message blah blah blah”.

    But I have got it set to debug. :-/

    Then I get the “No source available” message with Call stack location:
    Myproject.exe!Myproject.Game.InitGraphicsMode(…)

    which is the first method that gets called in the game.

  9. Philippe Da Silva says:

    The fact that you are getting the “No Source Available” message is totally normal and you shouldn’t be afraid of that.

    The reason is because the Profiler injects code to your generated assembly so that it can profile each methods in your classes therefore making it impossible to run a debug session while profiling the game. This is a feature I want to add in a future release but I want to get this one working correctly first.

    What is the exception raised and its detailed information in Visual Studio?

  10. Philippe Da Silva says:

    I updated the Setup file with the latest release which should fix a set of bugs. Please download the file again and reinstall the Indiefreaks Game Profiler.

    Let me know if you find any other bugs.

    Thanks

    Philippe

  11. filip says:

    Tested your profiler and it’s crashing the game right on the start somewhere deep in the constructor of the main game class. Error is NullReferenceException.

  12. Philippe Da Silva says:

    Hi Filip

    Does your Game class contains an Update and Draw method?

  13. filip says:

    yup, both.

  14. Philippe Da Silva says:

    Filip, could you please share with me your game class definition? Just the Members, not the inner code. Do you have many constructors?
    Could you also give me more details on the NullReferenceException thrown?

    Thanks

  15. filip says:

    Hmm, my game class is actually the same like the StarterGame from Sunburn starter project.
    For some reason it’s crashing on Set of property in one of my classes, which is created in game class constructor. Class is DrawableGameComponent and property is type of SceneInterface.

    public SceneInterface SceneInterface
    {
    get;
    set;
    }

    That’s all I can get.

  16. Corny says:

    I also cannot build after I took your new and updated version, I could with the first one but it was not showing me anything when I pressed the key combos.

    I had an issue where I was calling a private method in my constructor causing a null reference exception when the game was running, I worked around this by inlining the method in the constructor.

    Error 3 The command “”C:\Program Files (x86) Indiefreaks.com\Indiefreaks Game Profiler\igp.exe” “E:\Game\bin\x86\Debug\Game.exe”" exited with code -532462766.

  17. Philippe Da Silva says:

    Filip, I believe I got it. Since I’m injecting code to all methods in your project and this code uses the current object instance to perform its duty, if you call such method or property (get and set are methods in .Net IL) in the constructor, since the Game instance isn’t yet created, it throws a nullreference exception.

    I’ll correct that now and update the setup package.

    Corny, that’s the same issue as for Filip.

  18. Corny says:

    As for my build issue, I am using the IndieFreaks Framework as well, and I was able to solve the build issue by specifying the GameClass as this [assembly: Profiler(GameClass = "Indiefreaks.Xna.Core.Application")] but I don’t get the profiler screen to show up so this probably isn’t right.

  19. Philippe Da Silva says:

    Corny, you shouldn’t set the GameClass to Indiefreaks.Xna.Core.Application but your own inherited class instead. Just make sure to create a Draw() and Update() override on yours that would at least call the base.Draw() and base.Update() respectively.

    The Profiler needs a Draw() method to work. I’ll see if I can get rid of this limitation…

  20. Philippe Da Silva says:

    I made another update to the current setup file. Corny & Filip, could you try downloading it and see if it changes anything on your implementation?

    Thanks

    Philippe

  21. filip says:

    It’s better now. It’s crashing deeper in code, when I’m using singleton class.

    public class GameObjectsStorage
    {
    private static GameObjectsStorage m_GameObjectsStorage = new GameObjectsStorage();

    public static GameObjectsStorage Instance
    {
    get
    {
    return m_GameObjectsStorage;
    }
    }

    public Dictionary Doors
    {
    get;
    private set;
    }

    public GameObjectsStorage()
    {
    Doors = new Dictionary();
    }
    }

    It’s crashing, when code tries to access Doors property – GameObjectsStorage.Instance.Doors.Clear() for example.

    btw CTRL-F12 doesn’t do anything. Looks like my input manager is eating up all keyboard strokes. :)

  22. Corny says:

    At work now, can’t try it any further, will try again tonight. The only reason I did that in the first place was because I couldn’t build. Is the issue of it not building taken care of or is that the part of the override update/draw?

  23. Philippe Da Silva says:

    Filip, thanks for reporting these back. I’ll look at the singleton case now and get it fixed too ;)
    As for the Ctrl+F12 issue, make sure to update the assemblies with the new ones found on the install path directory under Assemblies. You may still be using a cached version of the old ones.

    Corny, I don’t know. normally it shouldn’t raise any issue. The build must be related to the private method call in your constructor and fixed with the latest setup update.

    Philippe

  24. Corny says:

    Nope, as I mentioned earlier I had inlined that method call. That method call also was only throwing an exception on runtime, after build.

    I will try it again tonight and see if its fixed.

  25. CJ Bailey says:

    Installed the new version. Builds ok and runs ok, but doesn’t actually seem to be profiling anything. The profiling overlay shows up but there’s nothing happening.

  26. Philippe Da Silva says:

    CJ, make sure you set the new [assembly: Profiler(GameClass = "YourGameClassFullNameWithNamespace")] attribute. Otherwise, it won’t work ;)

  27. CJ Bailey says:

    Yep, already did that… formatted as….

    {namespace}.{game_class_name}

    as per the instructions.

    Still nothing. :(

  28. Philippe Da Silva says:

    CJ, if you’re using Indiefreaks Game Framework, you may want to compile it with the Profiler() attribute to (no need to mention the Game class here). That should help showing something happening ;)

    Philippe

  29. Corny says:

    Builds just fine, I don’t see the profiling overlay though, when it first pops up I see a glimpse of something but then its gone.

  30. Corny says:

    I disabled the Loading screen and the profiler showed up but once the next LoadGameState happened, it covered it up.

  31. CJ Bailey says:

    Hi Philippe. Thanks for your help with this. I’m not using IGF at the moment so I can’t set the Profiler() attribute. I am setting…

    [assembly: Profiler(GameClass = "{namespace}.{game class name}")]

    …in the Assembly.cs file.

    Like Corny, I too see a flicker of something when it starts up, but then it vanishes just leaving the profiler overlay with no data on it (just the headings). Would having an “internal static class” defined outside of the game class upset anything?

  32. Philippe Da Silva says:

    I believe I found the core issue with the Profiler. It is related to the way it injects the end of profiling code to the end of each method.

    Right now, what I do is grab the last IL instruction for the method which is a Return statement (even if you don’t state it, it actually returns void) and insert the code just before it.
    However, in .Net IL, if you have a switch or if statement or any other code that will make use of “goto” like operations, the end of the method may not be actually the last instruction.

    I now need to find a secured way to find the end of the method and it should solve the whole problem.

    I’ll get back to you as soon as I got it.

  33. CJ Bailey says:

    Excellent work figuring that out Philippe! I’m itching to use your profiler! :)

  34. stephen neiland says:

    Hi Phillipe, Im hoping to use your profiler, but I keep getting the error code -532462766, as mentioned above.

    Is there a way to fix this, as Im not sure what’s causing it specifically in my code.

Leave a Reply