6

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.

Seki
  • 11,135
  • 7
  • 46
  • 70
zenchess
  • 411
  • 4
  • 11
  • Use the Smalltalk VM of your implementation itself, and have the nodes communicate over IP? – Marcin Jul 11 '11 at 12:11
  • I was investigating this idea with the smalltalk HydraVM. I ran into some problems, and then forgot about the whole thing. I'll see if I can figure out what went wrong. – zenchess Jul 11 '11 at 12:19
  • 2
    Well, I managed to load 11 smalltalk images in HydraVM side by side...unfortunately the image crashed on trying to load the 12th. 200 megabytes of memory were used. Time to look into shrinking those images. :) – zenchess Jul 11 '11 at 13:47
  • I was thinking independent VMs, each running in their own process (or, potentially, you could run Hydra for better IO). – Marcin Jul 11 '11 at 15:05
  • Actually, what resources did you use to learn about Hydra VM? I've never had the pleasure of using it. – Marcin Jul 11 '11 at 15:06
  • The latest discussion I found on the topic is here: http://forum.world.st/squeak-dev-ANN-Hydra-now-can-do-mitosis-td80087i20.html I was using a squeak 3.9 image. – zenchess Jul 12 '11 at 12:20
  • Marcin, how would I go about loading a second VM from within squeak/pharo? This sounds like a good idea for my project =) – zenchess Jul 12 '11 at 12:23
  • One doesn't load VMs from squeak or pharo - pharo or squeak run in the VM. You would spawn a new process for the VM. – Marcin Jul 12 '11 at 16:35
  • So are you saying load a 2nd Vm + Image (2 vm's, each running its own image?) Or just one image (running the game), and multiple vm's running that were started outside of existing vm+image? If you mean the latter, how do I run a VM without a corresponding image? (Sorry for my confusion). Until your reply, I'll try running 1 croquet image for the game, and a seperate cuis vm + image for each robot). (cuis chosen for small size). I'm guessing when spoon is released that could be useful as well. – zenchess Jul 13 '11 at 12:24
  • I'm suggesting the approach you are taking. – Marcin Jul 13 '11 at 14:14

1 Answers1

3

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.

Igor Stasenko
  • 1,037
  • 5
  • 8
  • So I don't know if running the robots in the same image using seperate processes would work for my game idea. The thing is, I would like the user to be able to program the robots, i.e., each robot has an underlying 'operating system'. Ideally they could program the robot in smalltalk, but any scripting language would be fine for me. The reason I don't think processes would work in one image is that if you write a script for one robot, this script should not have access to any other robots in the image, or be able to change the game state beyond what is locally possible for that robot. – zenchess Jul 12 '11 at 12:17