Devlog #03 - New Tile Shapes, Windows Build Testing and much more

The last Devlog was a little over 3 weeks ago and the number of commits has increased by 55. I'm surprised, but a lot has really happened:

Support for all Tile Shapes

It is done, Issue #1 is officially closed and now we can work with both isometric (diamond-shaped) tiles and hexagons in staggered form.

Note that in addition to the two different staggering indices (map origin "pointed" or "blunt"), both staggering axes are also supported. For isometric maps this is more of a gimmick, but for hexagonal maps this means that hexagons standing on its edge or corner are supported.

The implementation wasn't that easy, especially since the rendering order of the X staggering axis was relatively problematic. All in all, I think the code is pretty good. The performance speaks for itself.

Support for all Render Orders

In most scenarios not too relevant, but sometimes absolutely necessary are the different render orders. Relatively primitively implemented by rearranging rows and columns, it does its job without grumbling. Even with all tile shapes, which currently tiled doesn't even support.

Support for mirrored and rotated Tiles

To be honest, I forgot for a long time that Tiled has this feature at all and that the engine refused to work when used in the past. This is now different and both mirroring and 90° rotation are supported.

Tiled signals with the last three bits of the tile ID whether it should be mirrored horizontally, vertically or diagonally. A bit complicated because SDL2 doesn't support diagonal mirroring and I had to "simulate" it with rotation. Furthermore the default size of a tile ID is 32 bit instead of 16 bit.

Terra Australis PreAlpha 0.0.1

Since my focus during the weeks was more on Terra Australis optional features, some assets of our well respected game artist have accumulated unused. Since I couldn't reconcile this with my conscience, we put a pre-alpha before the "actual" alpha release, which has now been released. 

The Thylacine, which was made in the 3D graphics suite Blender, now performs its Walk Cycle, animated collectable shells and in Krita hand-drawn terrain were added and the visuals are absolutely respectable for a PreAlpha. I'm more than happy with the progress!

CMake Improvements

On the one hand, the dependencies have now been completely outsourced from the project. TinyXML2, ZLib, Libb64 and SDL2, -Image, -TTF, -Mixer CMake now searches itself via FindPackage and the corresponding scripts provided in other FOSS projects. This makes building more flexible and less platform dependent.

On the other hand, the default build type is set to debug and there is now a dedicated profile build type to test the performance, instead of always generating profiler info as before.

Windows Builds, aka. No more MSVC Hell

Since I discovered the field of cross compilation, which allows me to build Windows releases on a Linux system, I am finally breathing a sigh of relief. "Microsoft Visual Studio" and its compiler are at least problematic and cost me a lot of nerves. Mingw-w64, the alternative based on the GNU compiler collection makes everything much easier for me.

The dependencies in the Windows variant are still hard to get (since Windows has nothing like Aptitude under Linux) and I couldn't get around compiling all dependencies myself and packing them into a separate repository which is integrated into the engine as a submodule.

TravisCI is now also testing win-32 and win-64 builds, as well as a linux-32 build, which all work nicely together. Thanks to CMake toolchain files, compiling for other systems isn't more complicated than adding -DCMAKE_TOOLCHAIN_FILE="win32-toolchain.cmake" and that's it.

Collision Switch Event

Now it is possible to send a specific event depending on the name of the collision partner and the name of both hitboxes. For our Collectibles it works great, StreetFighter clone, here we come!

Variables as Event Parameters

One of the most difficult tasks solved in the last three weeks. Events can now accept variables attached to the actor, map or game instance as parameters. This makes it possible to link the animation speed to the actual speed, make health bars dependent on a health variable, etc.

Updates Time-dependent

The map now provides a delta time since the last update, with which events can calculate their influence depending on the elapsed time. This enables an asymmetric update render ratio, which can lead to advantages in the movement and collision detection of actors when additional updates are made per frame.

Variable animation speed

Originally intended as a small gimmick, it has led to the code for the animation of tiles being refactored again, now much smaller, but also much more powerful. Now even backward animations are possible, even triggering TriggerFrames and Wraps, which is important for game logic.

Neue Map Memory Formats

It is very practical that the base64 format (in which our maps were previously saved) can now be compressed using zlib, which can save a lot of memory with many maps. For example, the demo map has shrunk from about 2MB to less than 100kb. There is also the CSV format, mainly so that "newcomers" won't be scared if the engine suddenly stops working with the "default" format.

New Project HiBearNation

Born from the thought of showing how a game with a hexagonal map works in the engine, we have launched the next demo game, "Hi Bear Nation". In it the player is a bear, who has to eat a whole lot of food in order to hibernate and often comes closer to civilization than he would like to.

The first tiles are already completed and look absolutely phenomenal. So soon there will be a lot going on on the linked repository.

A bunch of bugfixes and many small things

As always there were also some problems which were solved in the meantime:
  • For example, it took some time until I noticed that the rendering order of hexagonal tiles is not correct, which is fixed now.
  • Also the backward animation was bugged for a long time and led to segfaults. 
  • The default build type simply overwrote specified build types which meant that debug was always active and unfortunately convinced me for a long time that performance was a serious problem with the project. Since the Profile Build Type exists, I see that there is no performance problem at all.
  • I also thoughtlessly pushed the Windows dependencies into the engine before I put them into a separate repository and then deleted them again, and a build folder slipped into my history again. So that these useless artifacts don't inflate the repo any more I did a big history rewrite with the BFG Repo Cleaner, the alternative for "git filter-branch". This has rifled through the graphs of Github a bit, cost me my nice verified and build passing badges on almost all old commits and moreover closed issues were closed again "several times". In the end quite a hassle, but the size of the repo is now under 10MB again.

Comments