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 marvelling 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. In constrast I coded all those same physics by scratch in Corona SDK which was a long and painful process.

I guess my intuition was correct because Corona Labs is now going out of business. It's was a great little engine with amazing documentation but unforunately it was missing many important features. Godot solved most of the tight coupling and code organization problems I was experiencing with Corona SDK. I did have one 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. But I guess if you keep going then you have to finish eventually.. right?

comments powered by Disqus