I'm making an XNA game, where I often test things that cannot be edited without rebuilding the whole game application (edit and continue doesn't work). Getting to the point where I actually test things can take quite some time, because the game needs to load its resources.
What I'd like to do is to be able to load resources to some backing application and access them from the game app somehow, eliminating the need to reload game assets most of the time. Is it possible in .Net applications, or is there some other approach I should know about?
My XNA game relies heavily on Texture2D
instances, specifically a library class with several Dictionary<string, Texture2D>
objects.
I think what I'd like to be able to do is to have direct access to those dictionaries in the backing app from within the game app. XNA games can only be targeted at 32-bit platforms, and I would like the backing app to be 64-bit, so it could hold more than 1(.5) Gigabyte of resource data (if that's possible).
Unit testing approach (or whatever implies not using some of the resources) won't work for me in this case, since I'm developing visual effects, and it involves every texture I have.
If you want to unload an reload compiled dlls full of resources then you may want to look at Application Domains. i.e. you can unload and reload assemblies with it. But you have to access their contents via a "proxy". You cannot unload assemblies directly, which is why you need domains.
The idea would be to load up a master application that never closes. Then you have a seperate Game.dll that you load up in its own Application Domain. You then load all your resources in your master application. So you would need to make a "proxy" interface for the game to get hold of the resources, but that should be doable.
The good thing about this is that you stop your game.dll, recompile it, reload the assembly and give it the still loaded resources.
One possible route.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With