Kari and I watched this TED Talk recently. The gist of it is to do something every day for thirty days. Her challenge to me was to work on Ladon for thirty days. So I did! I added something new to Ladon every day. The net result is that Ladon went from this to this. I’m really surprised and happy with the result of a month’s work. I added the pause menu, ship building, new tile types, mining, resource types, loading and saving, and some really significant performance improvements. Thanks, Kari.
Today is my first update after the thirty day challenge plus a week off, and it’s mostly just a code clean-up, but in honor of the month of progress, I’m bumping up the version to 0.3.0.0.
I cleaned up some code, fixed some minor bugs, and improved performance a little more. With these changes, I think it’s safe to say that the “foundation” of the game is done. It’s time to start thinking about the bigger picture. I need to dig up all my old documents that I worked on years ago. I had worked out all the different weapons and upgrades I wanted, as well as the different enemies and bosses. This is a fun and challenging part of game design. It’s where the actual “game” starts to take shape.
Play it here.
I’m really happy that I was able to fix the performance issues that had been creeping into the game. It now runs at a steady 60 FPS even on my 10-year-old laptop. I added lots of performance measuring in the last release, and that combined with having all the old releases available made it possible to track down exactly the source of the slow-down. It turned out to be something totally unexpected — the text rendering.
As long as I don’t update the text on the screen more than a few times per second, performance is great. Before, I was updating it on every tick. This prompted me to do something I’ve been needing to do anyway, which is to separate things that need to be done on every tick from things that don’t. Text rendering, for example, can happen 3 times per second. I scaled collision testing back to about 20 times per second, as well, since it’s fairly expensive.
It’s running great and I’m really relieved. Give it a try here.
I’ve reached a point where performance is something I have to start watching. I have an older laptop that I sometimes use for development and I’ve seen the frame rate drop to 15 or so at times. That’s partially because it’s an old and slow laptop, partially because Firefox released a new version that really slowed things down, and partially because there’s starting to be a lot going on in each frame.
Continue reading “Performance”
The mouse wheel now zooms in and out. It’s a lot easier to find those rocks.
Play it here.
I added a new type of turret (cleverly called “turret2” for now). I just wanted to get different tile types working. You can cycle through the available types with the left/right arrow keys while paused.
I added some actual resource types. Now, instead of collecting just generic “resources,” you’ll see things like iron, silicon, and oxygen. I tried to distribute them randomly in a way roughly representing what real asteroids contain. I doubt we know with any accuracy what real asteroids contain, though, since we’ve never actually mined one.
It’s a really fun update, in my opinion. I made the on-screen text a little more helpful, too. If you don’t have enough of a particular resource to build a particular tile, you’ll see that. For now, though, the only type of tile you can build is a turret. More of those coming soon. The very simplistic universe of Ladon is starting to get interesting.
Play the game over on the releases page.
Got some fonts working in BabylonJS. It made me think back to how difficult that was in other engines. I really struggled with it in Unreal. In BabylonJS, you just add the font to the page, just like you would for any other page, and use it. I did add a little extra code just to make sure the font is loaded before everything else. Aside from that, it was easy, like just about everything in BabylonJS.
Play the new version here.
I put in the most basic type of ship building I could imagine. It feels like a huge step forward. When paused, you’ll now see some circles around the ship. Click one to build a new turret there (if you have enough resources). Give it a try on the releases page. It’s fun.