That's extremely cool!! I'm always stoked to have other programmers involved with the project. Web development is cool as sin, and it's among the most practical skill sets in the universe.
Being facinated by roguelike (simulation) games like dwarf fortress and don't starve and the endless procedural content they provide I wanted to create something along by myself. I have quite a nice vision in my head but I was worried that java could handle it.
It's really interesting, because you're right - there's a widespread perception in the industry that Java performs poorly. I think it's largely a remnant from very early / primitive JVMs of the late 90's that did have serious performance issues, but many of the world's most performance dependent systems today are built in Java.
The first thing I try to remember when designing software is that, in nearly all practical cases, the performance difference between mainstream languages doesn't matter at all. As a high level, object oriented language, Java provides a framework for abstraction that makes code vastly easier to write, maintain, and extend than lower level languages like C. Most of my undergrad courses were taught in C, and while a person certainly could
write a game like Outer Colony in C, I don't even want to think about all the pain involved in doing so.
Well written Java reads like a functional specification. It consists of objects that model real world entities running routines that often correspond to real world activities. You're building an object oriented model of something, and making the objects interact like they do in a real system. Only at the lowest level of Java code, inside atomic methods and when defining class member structures, are you concerned with implementation details. Object oriented programming lets a developer worry less about data structures and algorithms when implementing high level functionality. You can achieve some minimal degree of abstraction with C, by way of structs, well organized code, and sensibly designed functions, but you can't write the same kind of code without proper classes, interfaces, and other OO structures.
the advantage of an object oriented language. It's easier to write Java code that's simple, which lends itself to easier optimization. Well written code in virtually any language will outperform poorly written code in another. This is why many of the world's most complicated, performance-dependent systems are written in Java. Hardcore web backends, ultra-high-throughput banking systems, high fidelity weather models, drug research systems that simulate protein folding and molecular interactions - they're generally written in Java, because Java facilitates this kind of extremely complex modeling.
With that said, does C++ lend itself to optimizations that Java does not? Absolutely yes. When you manage memory allocation yourself, you can do things that aren't possible when you're stuck relying on the garbage collector in Java. But it's a double edged sword, and it's all about trade-offs. The benefit of being able to optimize memory allocation comes at the cost of having to do all the memory allocation and de-allocation yourself. Whenever I'm designing software, I always try to decide on the best approach for a particular project. Most of the time, in my experience, there's just no need for the optimizations that are possible in C++.
That being said, game development is an extremely performance dependent domain. I'd love to talk more about language choices for game development, and how they specifically relate to Outer Colony! Stop the world garbage collection is
an extremely serious problem that any developer will face when trying to build a game engine, because a 1/2 second pause is noticeable and annoying to game users. I've run into some really interesting situations with Java and Outer Colony's performance, and if you'd be curious, I'd love to talk about some of the things I've had to do to ensure that performance remains acceptable.
In some ways, Outer Colony is one of the most extreme cases I can image, though, due to the incredibly large, complex nature of a world's object tree. Uncompressed, naively implemented worlds would take terabytes of space, and I've needed to do some pretty wild things to make the game work. Initially, a naive implementation of Outer Colony world spaces did
overwhelm the garbage collector, and I actually replaced the first world model with one that uses compressed byte arrays for most of a world's primitive structures. The game's rendering framework is written on top of JavaFX, and while there's a ton of room to improve performance further, I'm pretty happy with how well it's all running at this point.
Even with all the work that was required, I personally can't imagine building Outer Colony in any other language. At its core, Outer Colony is so dependent on Java's robust concurrency libraries, and without them, I don't even want to think about trying to design its engine.
So I recently tried to learn c++, but man that is a pain. Learning is slow, very slow, escpacially now that my time is limited having a toddler running around
I hear that 100%. The time requirements involved in building a roguelike or highly procedural game are astronomical. I think the key is persistence. Lots of Outer Colony was built in evenings and on weekends, while I worked as a consultant during the day. When building Outer Colony full time, I lived like a weird hermit, cloistered in a room, doing pretty much nothing but programming for months on end. I think the key is to just stick with a project for as long as it takes. If you can put in an hour here on a Tuesday night, an hour on a Saturday morning, you'll see that a project can come together over time. And I think that's kinda' awesome.
Congratulations on having a toddler, by the way! Haha, maybe someday, your son / daughter can contribute ideas or code to your project. That
...would be awesome!
Maybe I go back to java as I am in the early stages anyway. Outer Colony has quite convinced me that it is possbile to handle a big simulation with a decent performance.
Again, thanks for the warm welcome!
Give it some thought, man! If you want to talk about the pros and cons of different approaches, I'd be glad to share anything you want to know about my experience building Outer Colony in Java. It's been 90% great, but it's not all roses, and there are some specific aspects of the language that can cause trouble.
If you'd like to share any details about your project, talk about game design in general, or anything else, feel free to post in the game development forum
. I always love talking about this stuff!