Tuesday, September 21, 2010

Emscripten, Now With More Clang

Emscripten can now work with Clang. It turns out that the llvm bitcode that Clang generates is slightly different from that of llvm-gcc, which uncovered various minor bugs and missing elements in Emscripten (for example, the 'phi' command).

All the tests now pass both llvm-gcc and Clang, and with both optimization and relooping on (however, relooping has been weakened, due to some bugs that were discovered).

The benefits of allowing Clang to be used is that having two sources of LLVM bitcode is better than one - more chances to catch bugs (but even more important would be to add non-C/C++ sources of LLVM bitcode as well!). Another benefit is that Clang is simpler to build so it will allow more people to play with Emscripten.

The wiki has been updated with full instructions, so you can get Clang and try it out with Emscripten right now.

Saturday, September 11, 2010

CubeScript on the Web

Emscripten 0.2 is out, and here's a silly demo: the CubeScript engine from Sauerbraten, compiled from C++ to JavaScript, and running in a web page. Finally, you can use a script language on the web ;P

A few more details about the demo appear on that page. Other details about the 0.2 release are in the changelog.

After successfully compiling the CubeScript engine (which was mainly to see if Emscripten could do it - fixed a lot of bugs on the way), I think most C/C++ stuff should work (but there are probably a lot of minor corner cases left). The next steps are something like this:
  • Version 0.3: Optimize the compiler for speed. Right now compiling CubeScript, about 2,500 lines of code, takes a minute on my (slow) laptop. The goal is to compile large projects, so this needs to be much faster.
  • Version 0.4: Optimize the generated code for speed. Some radical solutions for making it faster are possible, but might take a lot of time, so maybe post-1.0. But some straightforward optimizations should be done in the near future.
  • Version 0.5: Tools and integration. Make it easy to build multi-file projects, and to connect the generated code to web JavaScript (calling functions both ways).
  • ???
  • 1.0!

Sunday, August 29, 2010

Emscripten

As mentioned in the last post, I am checking out ways to bring Syntensity to the web. As part of that, I just put up Emscripten on Google Code. Emscripten is an LLVM-to-JavaScript compiler. Combined with llvm-gcc, it lets you compile C/C++ code into JavaScript, and run that on the web.

Emscripten is still in an early stage, but can already compile some benchmarks. At this point I think I will start to try to port code I am interested in, and fix bugs along the way as I find them. I'll probably begin with a tiny subset of sauerbraten (probably one out of command.cpp, rendermodel.cpp, or physics.cpp) and see how that works, then continue from there.

The long-term goal is to run Syntensity, or a smaller version of it, on the web. Aside from Emscripten this will require some other tools, and probably a lot of hard work, so I can't say when I expect this to be done. Also I am working on it in my spare time, so that will vary depending on other stuff I'm doing. But now that Emscripten is in good enough shape to start using, the fun part can begin.

Side note: I'll post updates on this blog regarding using Emscripten for porting Syntensity to the web. I'll probably post stuff about Emscripten itself, that isn't related just to Syntensity, on my more general blog, here.

Saturday, August 14, 2010

Update on Where Things are Going

It looks like the Syntensity codebase (and community) is going in two directions:
  • A few community members (quaker, BiosElement) have started CubeCreate, a fork of Syntensity that is not afraid of breaking compatibility with Sauerbraten, in that they will rewrite Sauer code and add major new features. It definitely looks very interesting and they are putting a lot of effort into it. For more details, visit their IRC channel (#cubecreate on FreeNode), or forums.

  • As for me, I have been thinking about something sort of in the opposite direction. I think gaming should move to the web - like everything else pretty much already has or is in the process of doing. To do that, things need to be - at least in the near future - lighter and simpler, to make moving to the web easier. So I've been working in my spare time on tools for that. One tool is an LLVM-to-JS compiler, which lets you run (some) C++ code inside of a web browser, by compiling it to LLVM and then to JavaScript. My goal is to move existing C++ code - Sauer, Syntensity, Bullet, etc. (or maybe simplified versions of those) - to the web that way. The tool is far from finished but already can run various benchmarks, I'll probably put the project up on some open source hosting site soon.
So those are the main directions in which things are going. They sort of go in opposite ways, but of course there's nothing wrong with that. The more the merrier ;)

Sunday, June 20, 2010

Plan for Next Release: Metallblech

gk has a great concept for the next game, which you can see here. That game will be part of a new release.

Help from community members would be great, and let us get to the release faster. Stuff we will need help with includes
  • Coding the new gk game linked to above. Mainly we will use existing scripts and customize them, but there will also be a few new things as well
  • Testing that game
  • Need to decide if to merge from the development branch for this release - if so, will require more testing time. Opinions?
  • Making binary builds for Linux, Windows, OS X
There is no timeline, it really depends on how much help we get. But it will be awesome when it arrives! :)

Sunday, June 13, 2010

Development Update

After the recent changes, we have been working out how to move forward. This is what makes sense for now.

Regarding code branches:
  • The main github repo will remain as the stable branch. It will always be in sync with the running servers at syntensity.com, so if you want to connect to there, you should run that code.
  • quaker66 has been doing excellent work on his branch, which is now the official development ('unstable') branch. quaker66 has worked very hard to port all the recent features from sauer svn (lots of great stuff that eihrul has been doing there) as well as awesome new features like flashlights, better cutscene management, etc. You can see videos of that stuff on his YouTube channel. In addition, T7g and BiosElement have been doing very interesting work as well, some of which has already been merged into quaker66's branch. New stuff should likewise be added to that branch.
Regarding versioning: The current version is still 1.1.6. For a new release, we would merge from the development branch, bringing all the changes from there. To do so, we would need:
  • For the code to be stable and well-tested - after a reasonable code freeze. We might also want to wait for a short while after a new sauer release.
  • At least one new cool game, to showcase the latest features
  • To update the syntensity.com servers
  • To have binaries for people to download

Friday, May 7, 2010

Short Absence - Almost Over

I just wanted to clarify why I haven't been around much the last 2 weeks. I relocated to Mountain View, California, and I started my new job at Mozilla. All very exciting stuff, but also kept me very busy.

However, I still would have been on IRC etc. on the weekend and possibly evenings, but I have had some trouble in getting my apartment connected to the internet (in silicon valley - somewhat ironic, heh). But that should be resolved in less than a week and I will finally be internet-enabled.

EDIT: AT&T fail - I am still without internet. They hope to get it working next week though.