Using a virtual machine inside the game?

I am at the stage of development of the 3d game "programming robots". Inspired by games like Colobot, Robot Odyssey, Cholo, etc.

I want every robot in the game to have its own isolated environment / operating system / virtual machine, as in real life. Each medium must be isolated so that it is local to the robot in terms of how it interacts with the rest of the game.

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

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

Ps The language and game engine to be used is not yet resolved, but it will probably be either C # or smalltalk.

+6
source share
1 answer

Hmm .. using a separate image on a robot is a bit redundant IMO. I don’t know the requirements of your project, but why not just run all the robots on the same image using my own process? (You should be aware that smalltalk supports the green thread model).

About HydraVM: This was originally a proof of concept design. Surprisingly, it works well and is pretty stable. But for further development, you need projects that really require such an architecture. And frankly, a small situation at the language level was not ready for this at this moment (I would not say that it is ready today;) Because for this you need better tools such as remote debugging, remote viewing, managing remote images and etc. Etc.

I am really surprised to hear that you were able to run 11 images in parallel. This is amazing. Since I never tried to run more than 2 :) The problem with so many images is that you need another memory management system. And the one used in Hydra is inherited from Squeak VM and is not really suitable for such a design.

+3
source

Source: https://habr.com/ru/post/892485/


All Articles