Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a virtual machine inside of a game?

I am in the design stage of making a 3d "robot programming" game. Inspired by games such as Colobot, Robot Odyssey, Cholo, etc.

I want every robot in the game to have it's own isolated environment/operating system/virtual machine just as they would in real life. Each environment should be sandboxed so that it is local to the robot in terms of how it interacts with the rest of the game.

Originally I was going to implement the HACK VM as described in the book "Elements of Computing Systems", but then got curious as to whether there is a better solution in terms of performance for this style of game.

So my question is: Is there a virtual machine architecture already existing that would serve my purpose well?

P.s. The language and game engine to be used has not been decided yet, but will probably be either C# or smalltalk.

like image 632
zenchess Avatar asked Jul 11 '11 12:07

zenchess


1 Answers

Hmm.. using a separate image per robot is a bit of overkill IMO. I don't know the requirements of your project, but why just don't run all robots in same image using own Process? (You must know that smalltalk supports green threading model).

About HydraVM: originally it was a proof of concept project. Surprisingly it is worked well and quite stable. But for further development you need a projects which really require such architecture. And frankly, smalltalk language-level infrastracture was not ready for it at that moment (i wouldn't say that it is ready today ;) Because to leverage that, you need a better tools like remote debugging, remote browsing, remote image management etc etc.

I am really surprised to hear that you were able to run 11 images in parallel. That's awesome. Since i never tried to run more than 2 :) The problem with such many images, that you need a different memory management system. And one which used in Hydra is inherited from Squeak VM and are not really fits with such design.

like image 139
Igor Stasenko Avatar answered Nov 24 '22 06:11

Igor Stasenko