Switched From Corona SDK to Godot

Around the middle of last year I decided to try making an action RPG in Corona SDK. I was frustrated with some of the tools I was using but stuck with them due to familiarity. One big issue I had with Corona is the lack of tilemap support. When I developed Mega Hasan I used a tilemap library for Corona called Dusk. It worked well enough out of the box but it was hard to modify any of it’s behavior due to lack of documentation. If I wanted to do anything beyond the basics I would need to make questionable edits to a very large and scary code base.

Another issue I had was coding complex behaviors in my AI. I picked up the state machine pattern which greatly helped in keeping the code cleaner.. but I still had a large amount of code related to random graphical effects that was cluttering things up. I tried making my own component system to add things like blood, flashing, and other visual add ons to my entities. It was okay, but still very hard to keep things from being tightly coupled. Reorganizing or changing the project was becoming a nightmare.

My Corona RPG in Action

Despite all this, my project was coming along pretty nicely overall but I felt like I was just not going to be able to manage the project as it got larger. I realized that I haven’t seen very many large scale projects done in Corona SDK and maybe it was time to give another game engine a shot. I was always told to try Unity but I spent some time with it and I’d find myself having bugs and unable to find them buried in the GUI. I really preferred having the game running 100% in code. Programmers are allergic to GUIs and I was no exception.

A friend recommended Godot which was much lighter-weight than Unity. It was also free and open source. It still had the crazy GUI but I was willing to give it a shot. I quit working on my project and took a few months to follow Godot tutorials until I felt I had a reasonable understanding of it. I ended up really loving it and marveling at some of the things it could do out of the box. Some stuff straight up felt like cheating.

I actually made a Mega Hasan clone (just one level) in about 2-3 hours. I did have all the assets of course but it was crazy that Godot could do such good platformer physics right out of the box. Most game engines have a physics engine but theyre not suitable for platformer games. Everything is floaty and you can’t stick to moving platforms etc. With Godot there are many good solutions to these common problems. When I created Mega Hasan I created all the physics from scratch which was incredibly brutal.

It ended up being a great time to switch engines because Corona Labs is now going out of business. It served me well and had very helpful documentation but was very bare boned and missing important features. Godot solved most of the problems I was experiencing with Godot. I did have one more big issue though..

Pixel Art Scaling

I initially had some issues with this in Corona SDK as well. It took me a while to realize that pixel art and floating point numbers don’t mix. The shimmering and distortion that occurs when you move pixel art around with floating point numbers drives me crazy. I’m not sure if most people notice it but I definitely do.

Slight Shimmering on Tileset While Camera Catches Up

I ended up solving this in Corona SDK by turning filtering on and using oversized pixel art and scaling it down. Instead of using low resolution sprites I decided to treat pixel art as high resolution graphics. That’s blasphemy, but it totally works.

Unfortunately, in Godot I couldn’t find a good way to repeat this strategy. Godot doesn’t really want you to scale graphics. It asks you to just build the game at a target high resolution and let the engine handle scaling. You can see my first attempt at my port had a LOT of issues.

Jitters in My Godot Port

I spent a very few days banging my head against the wall trying to figure this out. How could Godot be so advanced and not have a good solution for pixel art scaling. Most of the answers I found revolved around not moving anything in the game in floats and never rotating the artwork. Generally speaking thats good advice that I can’t really argue with. It’s just annoying to always have to keep track of those things or deal with shimmering and distortion. I obsessed a little more and messed with a ton of sample projects and hated how complicated it all was.

Eventually I settled on this pixel art shader I crashed into on youtube. It’s been working for me but today I wondered again if I could find a way to downscale oversized pixel art. I did a little experiment and this is what I found.

My Pixel Art Scaling Experiment

Left: no filtering, original size

Middle: filtering, 4x size at 0.25x scale

Right: filtering with pixel art shader

You can see the left sprite really jitters a lot, the center one is so-so, and the right one is very minimal. I guess I made the right choice with the shader. It’s working well for now. I’m still wondering if this is the best solution, but it’s simple and allows me to focus on more important things. I wish this was a pre-existing option in the engine settings as a kind of cheat code for people who don’t wanna deal with all the configuration stuff for pixel art.

Now I just have to try and finish this project. Not sure I’ll ever get there. I keep refactoring and changing the way I’m doing things. I’m constantly moving sideways and rarely moving forward. I suppose I have to finish at some point. I hope?

comments powered by Disqus