16BPP.net
 
RSS Feed
Views on Godot (3.1)
Godot Logo

If you want to go ahead and skip to the game I made, it's over here.

About 4+ years ago I heard about a new(-ish) game engine called Godot. I thought that it was kinda neat to have another open source one around, but I didn't think too much of it. In the past few years I'd hear about it again from time to time (e.g. when it gained C# support, making it a Unity contender). I was kind of interested in making something with it, but at the time I had no ideas.

Recently, I thought "It has sure been a while since I worked on a personal (technical) project. Not to mention a video game. I'm kinda itching to try out that there Godot thingy...". So about two-ish months ago, I decided to build something with this engine. Thinking about what could be small, short, but good enough to get my feet wet, I settled on reimplementing my Linux Game Jam 2017 entry Pucker Up.

Lemme take a brief aside to tell you about Pucker Up. As stated before, it was for a jam. My first Jam in fact. At that time, I was a bit more into tinkering with the Nim language. I kinda wanted to be a bit more HARDCORE™ with my approach in the jam. Luckily the only restriction was "Make a game that runs on Linux". No theme whatsoever; quite nice. We had 72 hours to finish and submit it. Then it would be live streamed by the jam creator.

I originally planned out a much more complex game (i.e. what was a tower defence). Then being HARDCORE™ I set out to grab some GLFW bindings, write my own game engine/framework, graphics/shaders, physics, etc. At the end of the first day, I realized how much of a difficult decision that I had made. All I got done were the initial windowing and input management, being able to draw flat coloured debug circles, and circle intersection algorithms; it was absolutely piddly. Realizing the pickle I had put myself into, I reevaluated what I could do with the toolkit I had made from scratch. I threw out my 99% of my original idea. Thinking instead about some sort of arcade-like game. The result was a sort of Pong with the goal in the center, where you had to keep the puck out of it. The QWOP control scheme happened by accident (I swear). Turned out it was kind of fun.

After the Jam was over, leveraging Nim's compile to JS feature, I was actually able to make a web browser playable version of the game in a short amount of time. I didn't have to force users to download a sketchy executable which was nice. That took me about two weeks since I needed to also add some extra Nim to JS/HTML5 bindings and work out a few kinks and bug or two. But it actually was quite simple. (Speaking about Nim, it also has some Godot bindings too.)

I've been looking at that JS/HTML5 version of Pucker Up for the two-ish years, discovered some bugs here and there, I thought it would be best to give it a little refresh. So instead of trying to wracking my brain to think up a new game, I settled on renewing something old I had.

Back to Godot-land. What I would say that originally drew me to the engine is it seemed like a nice professional project that was very liberal with it's licensing and it is openly developed. Linux being a first class citizen for the project is very sweet too. I tried out the Unreal engine on Linux and wasn't too happy with it. I've also had some serious issues with playing Unity made games on Linux.

I'm a person who has probably made more game engines than games. I don't know why this has been the case for me, but it just has. Maybe it's that feeling of being closer to what's going on in the whole program, or rather knowing 100% how something was made. Looking at the source for Godot (and the docs, which has A+ tutorials), I appreciate how easy and hackable this engine is. And to boot, the community is quite friendly.

Godot's built in source editor

I originally wanted to make my game in C#, as I prefer the more structured languages. I soon found out that it was a no-go for me. My desire is to target the Web as my main platform. As of writing this blog post, C# only has desktop support. Therefore, I would have to use Godot's built in language GDScript. I wasn't too adversed to trying it out. It had a very Pythonic feel to it. This also helps too if I want to bring Pucker Up to any Android or iOS platform. It definitely feels a little odd a times. In the sense that I feel that I'm writing Python code, but some of the APIs are completely different. I also miss the safety of explicitly typed languages. They offer some more preflight checks. Godot has some (Python is even worse), yet I am not completely satisfied. In the future, if I make a serious Desktop game, I'm going to use C#. But for jams and any non-Desktop platforms, I'll reluctantly use GDScript. I really don't like writing JavaScript though I want to target the web, so I'm willing to make this small compromise.

Javascript Makes Me and Milhouse want to cry

The tutorial section of the Docs are quite good, but the API docs don't feel like they are fully here right now. For example if you look at much of Microsoft's C# docs, many methods usually have an accompanying example with them. This isn't always the case with Godot. For instance, to spruce up Pucker Up, I wanted to add some directional sound. Doing some googling I was led to the docs for AudioEffectPanner. Looking through, it's super sparse, and doesn't have a simple example of how it can be used. Not nice.

The main draw of using any engine is "Look at all the stuff we provide for you." When I started make games, it mostly was only a set of APIs. Tooling was something you had to do on your own. Godot provides a pretty nice editor (UI, level, animation, etc...), but it does take some learning.

I'm also a pretty big fan of Animation (go look through some of my other posts to see). The builtin framework for Animation that Godot provides I think is nice, but the editor isn't the most intuitive. I've used programs such as Flash (R.I.P.), Moho, Clip Studio Paint, and even Unity. They were always pretty easy to get started with. In Godot, I had some trouble figuring out how to key properties. I didn't know what kind of interpolation I was initially using. And the curves editor was difficult when it came to zooming it's viewport(.e.g I needed to work on a value in the range of [0.0, 1.0], it was a bit of a struggle). One of the other things that drove me nuts: If you didn't reset the playback head to `0` before running your game, the animation would start where the head was left in the editor. I can see how this is handy for Animations that are longer (.e.g 5+ seconds). Though if you notice in video games, many actions/effects are on the quick side (e.g. 1/4 of a second). When you're doing this, you tend to what to see the whole thing. I will admit that my digital animation experience it a bit lacking (I think I've spend more hours with a pencil and paper than with a Wacom tablet), but some stuff didn't feel that natural. I also ran into a bug: when tabbing through options to adjust properties, sometimes the editor would freeze. Not fun.

Godot's Animation editor

Godot also has a minimal UI framework is built in. Adding custom skinning can be quite the hassle though. A CSS like way to skin the UI would be wonderful (which is that the Qt and Gtk frameworks already do). This might be a time sink for the engine (and would add much extra complexity) for what is only a minor feature. I can dream though...

After about two-ish months of work, I had a more sophisticated version of Pucker Up ready. I had some extra animations, more sound variation, smoother movement, improved score reporting; I could go on for a while. Without Godot, these would have taken much longer. There was one last hurdle to overcome: Exporting to HTML5. I was hoping for this to be a few clicks and done, but it wasn't quite that easy. Retrieving the HTML5 export was simple enough. IIRC, there was a one-click download button. Export prep was a breeze too. The issue arose when I then went to run the game in my browser. When I loaded up the game.html file in my browser, the scaling and placement of my assets were not where I expected them to be. Even across browsers (and different machines) it all appeared vastly different. I got some of my other friends to help me test this out. I did file a ticket on the Godot issue tracker about my problem. I also asked the Godot Reddit community for their experiences with targeting HTML5. From there, someone was able to suggest I tinker with the "Stretch" settings for the project. Voila! It gave me the result that I wanted and order was fully restored. This was quite the frustrating experience and I think it could be remedied by mentioning these "Stretch" settings in the "Exporting for the Web" doc page.

I've also noticed that the performance of Pucker Up is much smoother in Chrome(ium) than in Firefox. That isn't good. The later browser has some semi-choppy movement of the puck (and high speeds), and the sound effects (such as the bounces) weren't playing at the exact moment that they should. They were off by a few milliseconds. While this doesn't grandly impact the game (as it's still playable), I don't like having to add a "Plays slightly better on Chrome based browsers." footnote to my game page.

All in all, it may seem that I'm be a little extra critical of Godot here, but in earnest it's been a very pleasant experience (re)making Pucker Up with it. With were it stands right now, things can only get better with the framework as time goes on. I'm looking forward to the next game jam I'll enter because I'm sure enough to use this tool. Or maybe I go on with a more grand idea. Godot only knows. :P

You can find the Godot version of Pucker Up over here. Please enjoy.


Tags: Video Games, Projects

Book Review: Unreal Engine 4 for Beginners

I like to call myself a "hobbyist game developer."  One, because I'm very interested in video game design (mechanics, art, story, structure, etc.) and development (software implementation, physical hardware, etc.).  Two, I don't do it professionally.  And three, I kind of always approach things the wrong way.

One of my game design "documents."
One of my many fantastically
detailed game design docs.

Sure, I do like to draft up design documents of how I'd like the game to function.  But I have this really bad notion of "I'm going to do everything by myself, and do it The Hardcore Way!"  Which always ends up (probably,) being that wrong way.  What is The Hardcore Way™ you might ask?  That's the little evil voice inside my grey matter saying such adorable things like "You should build your own game engine & framework around low level libraries!  It would be way more efficient and fun!!"

Well, I don't think he's completely incorrect.  But it's something I need to stop doing if I actually want to make games.  A few weekends ago I was participating in the Linux Game Jam 2017 where I made Pucker Up.  I decided to build the thing in Nim w/ SDL2 and raw OpenGL calls.  And since Nim is quite young, I also had to make things for myself like a geometry and collision system.  There's a common joke in the game dev scene, is that when you're at that tier, you're not even making a game.  For a good two thirds of the jam, that is what all I was doing; no actual game mechanic implementation, just framework stuff.  It sucked.  And because of that time sink, I had to forgo adding a lot of content to Pucker Up that I wanted.  All I could do were the basics.

I've always had the idea of sitting down and taking some time to learn an off the shelf game engine.  But my experiences with the LGJ2017 is what prompted me to actually now try that.  I know Unity is very hip and hopin' with the young and popular cool kid indies.  Though playing games made with the engine, I have always had some issue with it running under Linux.  So: pass.

What other engine has a massive following, loads of documentation, spectacular tooling, great performance, works on Linux and commercial success?  Unreal.  As a bonus, Epic Games is nice enough to let people peek into the source!  Pretty cool.

Unreal Engine 4 for Beginners Book CoverI'm also someone who likes to learn from taking classes or reading books.  I'm not totally adverse to reading online tutorials, but I don't mind paying money for words.  After taking a few minutes to query the Amazon for "Unreal Engine 4 book,"  I found this; Unreal Engine 4 for Beginners.  It's written by a David Nixon.  He looks quite young and it seems like this is his first book that he has ever written.  Props to him doing that so early in his life.  I couldn't find too much more about him online except for this snippet:

David Nixon is a professional software developer and amateur game developer who holds a degree in Computer Science from Florida Atlantic University. He started his career developing websites and providing SEO services for companies nationwide. He then dove into the world of mobile gaming. Recently, he worked as a web developer for a major SaaS company.

It was $50 for a print copy or $10 for a kindle.  Being cheap, I went for the later option.  Here's a special feature about the Kindle Edition of this book: You cannot read it in the Amazon Cloud Reader; you have to use a physical device.  Normally when I'm reading a book that I assume has code samples, I like to read it on a computer and have it side by side with my text editor.  I tried using emulation systems such as Shashlik and ARChon, but none of them worked.  I wanted to try to contact the author, asking him why this was so or if he could provide me with a non-kindle copy, but he doesn't have a personal website setup or any public email address.  I'm lucky enough to have a tablet where I was able to read this on, but this really sucks for programming books.

Anyways, so what is actually in the book?  Here is the table of contents:

  1. Getting Started
  2. Basic Concepts
  3. The Level Editor
  4. Actors
  5. Blueprints
  6. Players & Input
  7. Collisions
  8. User Interfaces
  9. Audio
  10. Additional Topics

All of the chapters have the same structure:  Introduce the chapter topics, divide into sections, then divided into further subsections, maybe a small example, and a quiz at the end.  That's it.  Rinse and repeat nine more times for nearly five hundred pages.  That many pages might also seem like a lot but to be honest, I think I read the entirety of the book in less than an hour and a half.  If you're wondering how I did that so fast, take a look at page 20:

 

Page 20 of Unreal Engine 4 for Beginners
This page can be freely read on the Amazon page via the "look inside," thingy.

 

I think this page is the one that has the most text on it, and it's not that much.  Many of the other pages contain a lot of spacing for headers, paragraph breaks, images, section spacers, etc.  If this book were to be in something like pt. 12 font size Times New Roman, I think it could be pegged at 150 pages maximum.

As for the actual quality of the content, there is not that much I can really say for it.  It was an underwhelming read for me.  Aside from the quizzes there was no engagement with the reader whatsoever.  Sure there were some examples but they were sparse and all of them were with using the Blueprints Visual Scripting (more on that later).

I bought this book expecting it to be a sort of in depth tutorial.  Every other game development book I have bought in the past 10+ years has been walkthrough where you build a game from the ground up.  Unreal Engine 4 for Beginners left me with nothing other than a few common mechanisms (e.g. how to do simple character movement).  Most of the content too was just mentioning what something does for you; not really much how to use it along with other things.  The entire time I felt like I was reading simplified reference documentation.  Nothing was detailed or highly constructed.

Now about the Blueprints.  I'm not going to lie and say I'm fond of visual programming languages; I am very much so not.  All of the entire code for this book was with Unreal's Blueprints.  I was hoping to do some of that C++, but nope.  It was dragging nodes and connections all of the way.  I can understand the importance of visual scripting languages for people who work with Unreal yet don't have a traditional programming background but it was a real disappointment for me.   On top of that Chapter 5, which is dedicated to introducing Blueprints was 1/6 of the entire book.  And by no means is it a good introduction to how programming works.  Most of the sections of this chapter would simply state "This is an <x> node, it functions like so."  Most sections didn't have an example tied to them to better explain how the statement would work.

And… That's all I can really say about the actual content of the book.  There was nothing that really made me a massive impression on me or gave me a good insight on how the Unreal Engine works or good practices with using it.  Most of the information presented could have been scoured from the official UE4 documentation.  In fact, I would say that this book was nothing more than a light reference manual than an actual tutorial.  I really wanted to have this book show me how to build a game with Unreal; it did not do that.

I don't feel as if I got my money's worth out of this purchase.  It was only $10 so it's not too much out of my wallet.  But do avoid dropping $50 on the hard copy.  I will cut Nixon some slack because this is his first book and does seem like a recent graduate.  I wish him the best.  He does also offer a course on Udemy about UE4, but I have not paid for it so I can't judge the quality of the content.  

My conclusion is that I don't recommend getting it.  I'll be looking for a different Unreal book in the future.


Tags: Computer Graphics, Video Games, Book Review

Masala, A ChaiScript game engine

Over the last semester, I've been working on a game engine.  It was meant to be a personal challenge for myself,  to see if I could make my own game engine with some bare materials.  Those being C++, OpenGL, and Qt.  I wanted it to be more though.  Seeing as most professional game engines these days (developed by community or company) feature some sort of scripting engine, I decided to make my own scriptable game engine.

After some troubles with trying to embed Python & Lua inside of a C++ dummy projects, I discovered this thing called ChaiScript.  The tl;dr is that it's a scripting language for C++ that's dead simple to use.  I decided to use it for my project since it gave me a no hassle way to add scripting features to my project.  It was dead simple as "include the headers," and "give me a pointer to your C++ function/variable, and tell me what you want to call it."

Of course with simplicity, comes some cost.  One of the first things for example are the long build times.  If you statically include ChaiScript (which is the simplest way of using it), expect to take a small break when compiling.  This can be easily remedied by dynamically linking ChaiScript's standard library and including a .dll/.so file alongside your executable.  I did this when developing Masala.

I also ran into performance issues with ChaiScript.  At the current version (5.8.1), the language is executed using an Abstract Syntax Tree.  While this is necessary for parsing a language, using it to run code is much slower than it could be.

Enough about ChaiScript, let's talk about the engine itself, Masala!

Masala was built using C++ (14), Qt 5.x, ChaiScript, and OpenGL.  I had the goal of trying to create a reusable game engine where you write all of your logic inside of ChaiScript files.  It follows a very lose XNA/MonoGame-like pattern.  Right now it features:

  • 2D
  • Cross platform (Built with Linux)
  • Featureful sprite object (with animations!)
  • Tilemaps (Flare maps)
  • Basic sound effects
  • Keyboard Input
  • Interactive debugging terminal

It's pretty simple.  I mean, very simple.  I don't think it stands up well to other engines that are out there, so I really consider it to be an experiment in using ChaiScript for a game engine.

I implemented two simple games, one being a clone of the classic Atari Pong:

Pong is (c) Atari Inc.

And another more original one I've dubbed "Grab n' Dodge:"

It's more difficult than it looks, but not too fun.

I would say that I accomplished my goal in writing a game engine.  Something that I have never done.  As for the cross-platform part, I was able to get the code to compile on OS X and Windows, but had some trouble upon running it.  One of my friends said that he was able to get it working on OS X, but I haven't seen the proof.

If anyone wants to help me getting this running on Windows or OS X, contact me.  Since it was made using cross platform tools, it should work on all of the OSes Qt & OpenGL support.

And last, you can find the official code repository over here on GitLab.  It's GPLv3 licensed.


Tags: Computer Graphics, Video Games, JavaScript, C/C++

This site uses cookies.