Show HN: 2D Game engine and editor for Windows and Linux
github.comHello HN,
Just wanted to show this little 2D game engine that I've been working on for some time (around 2 years on the editor part, longer on some of the components).
It's quite full featured but obviously this a project of such magnitude already that the work never really ends. That being said it's definitely already at a point where games can made and published. The editor runs natively on Windows and Linux using Qt5. The games can run on both Win and Linux as well as on WASM with WebGL.
Feature wise there's a bunch of the stuff you'd expect.
Audio, graphics, scripting, animation+entity+gameplay systems, physics and UI are all there. Scripting is through sol3 + Lua, physics with Box2D. Audio, graphics, UI and game play stuff is all done by me.
License is currently GPL.
Source code is on github https://github.com/ensisoft/gamestudio
Some games are available on my site at
https://ensisoft.com/games.html Fantastic work, I would be curious to hear more about your experience writing the editor in Qt. Tooling is such a hard part of game development and not many people talk about it. How was using Qt? Were you happy with the decision? Any issues? Hi, you're absolutely correct. Tooling and the whole content pipeline is super important. I chose Qt because I'm already very familiar with it and I know that it can do so much stuff out of the box and I want the editor to work as any other app as much as possible, i.e. tooltips, shortcuts, cut/copy/paste keyboard focus etc. So everything works fine (as long as you know Qt's quirks) except that: OpenGL support is kind of a mess. You have QOpenGLWidget, QGLWidget,QOpenGLWindow, QGLwindow which can all support OpenGL rendering. The problem is that while QOpenGLWidget works nicely with the rest of the toolkit ( context menus etc) the Performance is very suboptimal. I found it to be an magnitude of order worse than just using a window. I'm sure there's something else going other than just FBO overhead. Another problem related to this but not unique to Qt is how to render to multiple window surfaces but to keep to a nice framerate. If you use vsync on each surface your framerate will be your display sync divided by the # of your surfaces. If you don't vsync then you're running a busy loop and burn cycles in a busy loop. I've tried many ways to do this nicely and haven't found a perfect solution yet. Would be very happy to hear some suggestions. Currently I'm just adding a little thread delay to cap the CPU use but this creates little hiccups in animation sometimes. Have you tried Qt 3D or Qt RHI for your woes ?
I had the same experience with QOpenGLWidget, there are a few bug reports open about its performance especially with multiple viewports. See also this thread on the mailing list: https://lists.qt-project.org/pipermail/interest/2020-Decembe... Thanks, that link seems interesting and relevant! Well, ... the Qt3D is a higher level framework that isn't really relevant to the stuff I'm doing considering that I'm basically running my own "framework", i.e. my game engine that renders to my rendering surface. In my use case what I really need is just to have Qt provide me a rendering surface with good performance (and ideally with working integration with the rest of the widget system) and then get out of the way. How big are games exported for web? I am currently looking for something that exports to html5, but Godot builds are at least 20MB with heavy optimizing (I'm ignoring the size of assets here). Then there is Phaser3 of course, but I have my troubles with it, partially the docs, partially because JS. I used to write quite a bit of Lua in the past, so the choice of language is mostly welcome, and if your binary sizes are nicely small, I only have to wait for the support of grid-based top-down. Since you have some example games, how big are their downloads? Currently the game engine .WASM is about 12mb. The demo games have Emscripten filesystem images that vary from 6mb to 100mb. These sizes reflect the combined size of the raw game resources (i.e. fonts, textures, audio files etc) Defold may be a good choice for your needs: Lua, small build sizes also check out bevy https://bevyengine.org/ Amazing work. I have to ask, however: what does your engine do better (or plan to do better in the future if it's not there yet) than any of the existing 2D engines, like GMS2, Defold, etc? That is, why should a developer consider choosing your engine? Hi, thanks. Honestly.. I haven't compared. I've built this as a passion project not as a "product" with a product/market fit or competitive landscape in mind. I mean there are already so many engines out there that you can't even give them away for free. So i built it with the features that i had in mind and what i have needed for my demos and what i need for my games. Fair! Good luck with wherever you decide to take it. So here OP is showing what he managed to build, and you have to ask how his project is better than some of the most established projects in that field? You are demotivating OP who never claimed to compete with what you brought up. Grow up. ? I am just politely asking a perfectly reasonable question that anyone who embarks on a 2+ year project needs to spend a solid chunk of time thinking about & trying to give OP a chance to practice articulating their value prop vision. After explicilty acknowledging how impressive their work is. Presumably OP is an adult and is not just posting for backpats but (also) to get constructive feedback. So, no, YOU grow up. Being able to discuss such things is normal in mature, healthy conversation between people. Also, Hacker News is hosted by YCombinator, a culture fundamentally rooted in innovation. This reminds me of Gamemaker by Mark Overmars except modern and multiplatform and best of all, OSS. Worth me to take a look! Way to go! It's incredible. Very impressive and inspirational. I'm blown away by this. Great stuff. Any chance for MacOS support? If you’ve got Linux support it shouldn’t be too difficult? They'd need to support a second graphics API, which is certainly non-trivial. The licensing permits anyone to do the work themselves if it's that big of an interest, though. The macOS backend can probably use OpenGL as of now, it's deprecated but still there (and will probably remain for a long time because of legacy applications that cannot abandon it, hell even they added M1 chip support for it!). And if things aren't rosy then you can probably migrate to ANGLE (implementation of OpenGL ES on the Metal API), which should be pretty reliable since Chrome and Safari are already using it for WebGL support. A good summary of the current state of OpenGL in macOS: https://stackoverflow.com/questions/65802625/develop-using-o... Sorry no. Never developed for Mac and juggling Linux and Windows is already a lot. The big question: are there any shipped games (ex. on Steam) with it? This is probably the most important thing when advertising your game engine. Tech demos (like Arkanoid) are easy to make with any engine, but actual games less so. Even modest indie game releases can include tons of assets and scripting, complex workflows and custom tooling (depending on the game and the team structure), and all kinds of platform-specific tweaks. Developing a full-blown game often exposes the actual glaring problems of the game engine. And I think dogfooding is incredibly important in fixing these issues (developing a full game alongside with a game engine).