So far the rewrite in THREE.js is going fairly smoothly. I have a very simple random terrain generator and a character model that loads. A simple follow camera follows the character around and the character stays on top of the ground thanks to a raycaster. The Penrith Farmhouse is also loaded and you can walk around (and through) it. I also have fog set up so that anything past a certain distance just fades into the distance as you walk around. This is most of what I had set up in the BabylonJS implementation, but without as much content in the world and without collision detection (other than the ground).
Some things I’m excited about:
- Performance is still good at this point, even on my very low end testing PC. If I shrink the display down to 800 x 600 I can get 60 FPS. This is good news because I would really like the low end hardware requirements for the game to be very low.
- Lighting is going to be fun in THREE.js. I didn’t play around with the lighting much in BabylonJS but I can totally see individual lamp posts actually casting light, and maybe even using shadows for players with beefier hardware.
- No twitching. One of the things that really bothered me about the built-in collision detection system in BabylonJS is that right from the start it made my scenes very jumpy. For instance, just walking around on the terrain made the camera jittery. It wasn’t a huge deal and it was probably something I was doing wrong anyway, but it made the game feel manic and made me nervous that it happened so easily when using that engine.
At this point I need to address the first drawback of using THREE.js as a game engine which is there are no native scene creation utilities. I can’t just model a whole scene in Blender then import it like I can with BabylonJS. Honestly, though, even if I could I don’t think that’s a great process. If this is going to be a real game, it needs a real scene editor so that I can see the changes I want to make as they appear in the engine, not in another piece of software. That being said I will still make heavy use of Blender to create assets for Lyridia, I just need a tool to import those assets into a scene and move, rotate, and scale them in a way that is efficient for THREE.js.
So that will be my project for the next several days, or possibly a few weeks. I’ll need the ability to load and save terrains with height map images, import and position, rotate, and scale assets, and save scene files. If I can get all that working then I’ll start looking at some more advanced options like tweaking materials, adding lights, etc., etc., etc.