A web UI for games or realtime projects

If anybody’s interested I just finished testing a Web UI for the BGE.

To to be clear this is a HTTP server inside the BGE which serves a website containing the UI which in turn communicates with the BGE. Don’t know if it was done before but I’ll release the code as soon as I can. I just needed this so I could use a tablet to control aspects of the BGE.

Rg,

Arnaud

Looks pretty impressive. Good work!

So what exactly does this do?

If you need to control anything from outside the BGE you can by creating a web ui. For instance I have a simple iPhone which can control the camera inside the BGE. I don’t need to install anything on the iPhone. I just open a browser and point it to the machine running the BGE and it will show a UI. I demonstrated that in the movie. I start the BGE and then open a browser which I point to the webserver running inside the BGE. It then gives me a UI made up of all the Game properties of the gameobjects which are available. As you can see in the movie. If I change the checkbox or slider it shows inside BGE. (debug properties). It’s just a proof of concept demonstration. No fancy stuff. I might show something more fancy later for people who don’t get the technical stuff :wink:

Thats neat!

so basically, you can edit the source of the game that you are running via an external htm file?

How are you running the HTTP server from ‘inside the bge’? To me it looks like you are running a server on the same machine and talking to it via urllib or something? Also, if you are running the HTTP Server from within blender, why? Running a full HTTP server, that can only be accessed from the localhost machine to run a UI sounds a bit bloated. Maybe I’m missing the point. I can appreciate the work you have done with this, but maybe you could expand a bit more about what is going on here?

I highly doubt it. Think of it as POST requests communicating with the bge, not actually modifying the source.

edit: After pondering this for a while, I think I can see some potential in it. Could you maybe go into some depth about how you are running the server from within blender, and what capabilities it has? I think to save some more confusion here it would be useful. :slight_smile:

I’m running a http server inside python. It’s actually included in standard python. To make it asynchronous I run the server using the threading module and using a thread safe Queue to communicatie back to blender. So I’m not using urllib or whatever. I’m using a WSGI python server running a simple wsgi app which can communicate with blender directly. The latency is quite good actually and it’s not bloated at all. Most work is done by the browser. I’ll show the code once I’ve cleaned it up.

Ow btw: I just demonstrated it using localhost but it can work on any ipaddress. If my laptop runs the BGE my mobile can control it.