Last July I published a version of memapper that you could use to create actual 2D games. That was... actually a pretty cool proof of concept. Unfortunately I've never done anything with it. Java2D is a bit... sluggish as a drawing API, and some of the stuff my engine runs on the CPU is just insane. And that particular insanity tends to half the usage time of the battery in my macbook. Aaand getting rid of that insanity would, according to my highly unprofessional gut feeling, require bindings to OpenGL or somesuch. Bindings do exist on java, but if you're going to learn to use them, it'd require about the same amount of pain to ditch the JVM and start hacking OpenGL on C.
But that'd mean that:
- creating UI DOMs begins to feel like work when you lose the collection literals Clojure has
- you'd lose Clojure's awesome ability to separate the immutable and mutable code
- you'd lose the GC
- you'd be using one of the most stupid syntaxes ever designed
- you'd be using C++ because const char - pointers are stupid
- you'd actually be using the most stupid syntax ever designed
Which is sad, but programming is Serious Business™. That's why I've been toying with opengl for the last couple of years. The latest iteration began with me hosting the whole proof of concept inside a Qt QOpenGLWidget component. Then I hacked c++ for a week or two, and now I have multiplying squares you can move with the mouse (and rotating tool wouldn't probably be hard to create) and re-texture runtime. That particular PoC is a bit ugly, though. It might evolve into a real Game Engine Project, or I might dump it to the opengl_thingie - repository at some point.
But, yeah. Now I know a thing or three of OpenGL and calculating-shit-on-GPU. There are a few places that hurt my brain.
So this project will be (once again, sigh) re-implemented on C++/Qt/OpenGL.
But there's no clojure implemented on C++. Which leads to my second point: I have to create a new lisp, and when that fails, I'm going to learn to embed ECL. However, I don't think it'll fail. I have been dabbling in creating a language/runtime for a reaaallly long time (thank the maker I don't have any of that project's sources anymore) with lousy results. I have enough comprehension of computers that I might be able to pull it off, and after finding and reading enough material of computation, the result might be even not terrible. I'm open to suggestions, and currently running on McCarthy's Recursive Functions of Sumbolic Expressions and Their Computation by Machine and Paul Graham's Roots of Lisp. I have a book of the lambda calculus' basics expecting to be read.
This new lisp will start mutable (with the ability to watch assignments), but if I find a suitable immutable collections library, I won't hesitate to use it. I'll try to make FFI to C as simple as possible so that I can abuse stdlib. Great FFI to C++ wouldn't hurt if I'm to keep Qt as a dependency, but that sounds a really hard problem, so I won't make any promises on it. It also neads an nrepl-like/swank-like server for remote repls and an emacs mode. The GC will probably be horribly inefficient, so I don't know if this engine will ever scale to 3D, but I'm going to iterate on it.
When shall this project be considered of good enough quality? When it has the similar features as the clojure-edition.
- Both write and read the same map files
- multiple tilesets
- multiple layers
- multiple maps
- simple blending between the layers (which will be really fun to implement in a fragment shader <3)
- sprites, both static and animated
- and scripts the engine is able to construct and eval runtime
The first line isn't a hard requirement. I'm afraid that the scripts knowing of the existence of OGL, I'm going to have to create support for shader and texture - assets, which the clojure engine does and will not understand. When the rest of the list is done, I'll have a lisp scriptable two-dimensional game engine that will not kill my macbooks battery. Then I might begin the research on how to scale it to the third dimension.
Or, you know, begin to make a game finally?