Got some simple materials working. Struggled for a while because nothing I changed seemed to have any effect. Finally figured out that the problem was that I’m using mesh “instances” instead of actual meshes for each individual object on the screen, and instances can’t have their own unique material. Instances are a technique used to draw lots of copies of the same mesh without hurting performance. Each one can be moved, rotated, etc, but certain things (like the material) is the same for all instances of a mesh.

Here’s an example of BablyonJS drawing a thousand instances of a single cube.

In the image at the top of this post, you can see some transparent materials on those little dots. Those are my bullet meshes. I want them to be much brighter and have a glowy effect. Just need to learn a little more about the material system. It can do just about anything, with one notable exception being lots of independent lights. You’re only allowed eight lights in a scene, which is a really old-school restriction. That was a limitation of graphics cards in the 1990s. Modern engines allow you to have thousands of lights with barely any performance loss. BabylonJS claims to support 16 (on some systems) but it crashes for me if I try to go beyond eight.

Also added pause/unpause via the escape key.

Version here.

Latest version here.

Added a GUI

I learned BabylonJS’s GUI system and added some simple stuff. Like all things BabylonJS thus far, it was easier than I expected. This engine really is refreshing to use after having tried so many cumbersome, restrictive, and just plain tiresome alternatives.

All I’m doing with the menu for now is a “paused…” screen. Pretty important in a browser-based game, because it’s so easy for the game itself to lose focus. The user will frequently switch tabs, reload the page, etc.

Check out version here.

The latest version is here, as always.

A Component-Based System That Isn’t Awful

While bringing Ladon’s code back from the dead, I decided to fix something that has been bugging me from the start.  In fact, it has bugged me in pretty much every OOP project I’ve ever done.  C++ and OOP in general were a revolution in programming that built on top of the traditional “procedural” paradigm.  Instead of endless lines of procedural code that look like this:

Do this!
Do that!
Do this other thing!

Continue reading “A Component-Based System That Isn’t Awful”

Ladon Still Exists!

I apologize to anyone following Ladon for not posting anything in a year.  2016 was easily the strangest year I’ve ever experienced.  It was also easily the worst, but the details of it aren’t worth going into.  I’ll just say that I’m happy it’s over.  Life is crazy.

Ladon survived 2016, too, but just by a hair!  There were several times when I doubted that I would have the motivation or even the opportunity to continue the project.  It’s still here, though, and I’m more determined than ever to finish it.  The code is updated to Unreal Engine’s latest release (4.15) and I even invented a new way to do component-based design.  I’ll do a post about that soon.

If you’re one of the handful of readers of this blog, thanks for sticking around and I hope to have some great news to share with you very soon.  Cheers to 2017.

Are All Programming Languages Created Equal?

Happy 2016, everyone.

So much work to do!  We’re pretty much rebuilding Ladon from the ground up in the first months of 2016.  I’m excited.

I had a nice conversation this morning with someone interested in learning game programming.  He asked me a good question: “Can all programming languages do the same things?”  That’s a pretty important question and the full, “true” answer probably lies hidden underneath many layers of mathematical theory.  The short answer that I gave him was “Almost.”  I think that’s a fair answer, but I decided to elaborate in a blog post, since the real answer is very complicated and might be interesting to anyone looking to be a programmer.

Continue reading “Are All Programming Languages Created Equal?”