2007
11.09

Doryen in Javascript ?

You may already know this if you read the r.g.r.d newsgroup, but I’m taking some fresh air by prototyping a javascript port of The Chronicles Of Doryen using the recent canvas HTML tag. Javascript has some advantages over C++ :

  • no need to download/install
  • almost no work to port the game to different platform (the canvas tag works out of the box on Firefox and Safari).
  • well, a pure javascript game is sexy, isn’t it ? 🙂

Since my failed attempt to port TCOD to the D language, I’m strongly convinced that any rewrite is a bad thing, so I’m not reassessing the whole project. I definitely keep working on the C++ version. Consider this as a form of relaxation and a technical study.

I have two prototypes for now. If you have Firefox 2 or Safari 2, you can see the real thing by clicking on links below. Theoretically, it should also work on Opera 9, but it’s not. Theoretically, it should not work on IE, and guess what ? It’s not 😉

  • the TCOD flaming title screen which tests the performances when there are heavy changes on the screen between each frame. On a 80×50 console, this represents up to 4000 calls to the canvas drawing API in each frame. Definitely too much for the current implementation…



  • a simple dungeon test trying to reproduce the TCOD look and feel. Here, there are less console cells updated between each frames, but I still had to do concessions. Thanks to Jotaf for suggesting updating the LOS and lighting every n frames.



If you’re interrested in using this framework to create a full featured or 7DRL roguelike, feel free to ask for informations/support/new features/… I’ll keep improving the dungeon prototype to see how far I can go (multiple lights for example).

4 comments so far

Add Your Comment
  1. Those links do not work any more – do you have new links to this experiment?

    Thanks,
    Best regards,

    Matt Davies

  2. Sorry, I don’t have the code anymore. The last time I tried it (years ago), it wasn’t working anymore. It was using some early canvas API that’s not supported anymore by modern browser.

  3. I’d be interested in helping with the javascript port.
    I was considering doing it myself, but did a google search to see if anyone already had, and found this.
    I was looking at using pixi.js which uses webGl, and falls back to html5 canvas of webgl isnt supported.

    If you have any code from when you were working on it, I’d love to have a look. if you are still interested in it, I’d be happy to work together on it. If not, I think I’ll start a github project for it and start adding things in feature by feature.

    I agree that doing a straight port (no actual change) is the only way to go.

    -Brent

  4. well yendor.ts kind of replace this project. Check this post :
    http://doryen.eptalys.net/2014/10/yendor-ts-a-typescript-roguelike-library/