Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access objects from another process

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.

like image 441
user1306322 Avatar asked Mar 12 '13 06:03

user1306322


Video Answer


1 Answers

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.

like image 167
Meirion Hughes Avatar answered Sep 29 '22 11:09

Meirion Hughes