Skip to main content

Lacking Structure, I Strive For Unity

On second thought, lets not chicken out and return to GameMaker simply because I was intimidated by the awkwardness of using a powerful open source API like LibGDX.  I have decided to try the middle ground of another specialized game making IDE that still has a WYSIWYG editor, but a lot more robust code support: Unity.

Half of the deciding factor was discovering Timber and Stone, a game made in Unity.  I looked for examples of GameMaker games that could handle large maps made of interactive tiles, and could not find any.  Yet, several such games were created in Unity, with Timber and Stone being a significant example to me.  It suggests to me that GameMaker just can't handle as much data as an interactive tile engine requires.
Timber and Stone, a well wrought hybrid of Dwarf Fortress and Minecraft, currently in early release.
I did think of a workaround that might work in GameMaker.  Basically, I would circumvent the limitations on the number of GameMaker objects that can be instanced (as custom interactive tile objects) by utilizing a "chunk loading" system, similar to what's seen in Minecraft and Cataclysm: Dark Days Ahead.

Under such a system, I would be perpetually deleting and recreating GameMaker objects as needed, potentially swapping their data to disk, with a goal of keeping the area utilized by the player populated with tiles at all times.  This would work well with most of GameMaker's integrated functions, which are built to be utilized with instanced GameMaker objects.

However, this "workaround" actually just manifest the other half of the deciding factor that made me decide to go to Unity.  Because GameMaker lacks custom data structures, it has a critical limitation in doing the kind of variable work involved in a "chunk loading" system, making one needlessly difficult to implement.

Data structures are basically several variables that are grouped together for easier handling by the developer.  In the case of a game with interactive tiles, it's vital to lump everything about that tile together in an easily-retrievable package.  So I am going to need some kind of data structure to keep track of all of this.

When it comes to data structures, GameMaker would appear to offer only two choices:
  • A selection of a few premade data structures with a robust selection of built-in methods.
  • Objects, which can technically become custom data structures because you can define your own variables on them, but they need to be instanced into rooms in order to hold data.
A critical limitation of GML is that neither of these choices allow you to create custom data structure methods/functions.  However, you can write your own scripts that can essentially be those methods.

GML mainly lacks in object oriented encapsulation.
Under this limitation, big data work starts to get complicated really fast:
  • Creating script files to get around the lack of object oriented encapsulation (and other limitations of GameMaker's "imitation" objects) creates a lot of file bloat and opens up the programmer to be confused about which script goes with which object.
  • Objects need to be instanced in a room to hold data but, under GameMaker's design, you cannot access instances from other rooms.  The only way to preserve the use of the object as a custom data structure is to set it persistent, which means it will follow you from room to room, but this creates a number of potential logistics problems, such as:
    • Errors related to nullified object variables that were referring to things in the previous room.
    • The potential to accidentally create redundant persistent objects by returning to rooms where they were first created.
    • If you assigned a sprite to the persistent object you were using as a data structure, you need to make sure it's moved out of the way of the players' view when going to the next room, and move it back when you return.
  • Because objects must be placed in the room to be instanced and hold data, its presence in the room will keep it in scope.  This means if you destroy whatever was using that object as a data structure, the object will hang around and take up hardware resources unless you remembered to delete it. 
In the end, GameMaker would seem to be designed to deliberately discourage its developers from creating custom data structures.  If they wanted developers to have custom data structures, they would have made a way to do in variable form.  The only thing that can be a reasonable stand-in data custom structure, GameMaker's imitation objects, are greatly limited where they can be instanced and accessed.  Further, by hard coding what functions are directly associated with these objects, they have forced developers to utilize them in specific manners.

That said, it is not that what I was trying to do was impossible in GameMaker.  The scripts do offer a lot of potential flexibility.   In all fairness, a good programmer can manually implement something like a custom data structure by just keeping all of the involved variables and functions straight in their head.  However, just because it's possible does not mean it is easy, and the way GameMaker seems built to encourage use of its built-in functions is what suggests to me that I am in the wrong to try to go outside of that.  It's probably to try to encourage good coding practice or something.

Unfortunately, I can't figure out an elegant way to do a large-scale interactive tile game with these limitations, so I guess I should move on to something that does not want to resist the scope of my project.  Unity probably can, as the C# implementation of its scripts is very much capable of supporting custom data structures.  If that does not work out, I could always try an API such as LibGDX, based on JAVA, a language all about object orientation.  For now, I've been taking a Udemy Course on Unity and, the more I dabble, the less alien it seems to me.

My Gaming Lately.

On an unrelated note, I should probably apologize for my last entry (about Elite:Dangerous) because I'm still playing a fair amount of it.

I traded my Python in for a Fer De Lance, and the specialized combat ship is preventing my min/maxing sensibilities from returning immediately to boring mining.  It is definitely a more entertaining game when I stick my neck out in space combat.

Although the most efficient way to make money would probably be to hunt the endless pirates who spawn in hazardous mine fields, I find it more entertaining to play a valiant space hero, on the lookout for distress calls.  Either way, I find myself limping back to a space station with a blown out canopy quite often, which is great for the adrenaline.

I still have a hard time recommending the game on account of how much of a content-thin grind it is, many of the newly added bulletin board missions are bugged, and it's probably still a valid critique that the capital ship encounter teaser video (not to mention the launch trailer) is far from what's being delivered in game.

Basically, this is a game I play to get away from reality, because its attention to immersion is incredible.  However, what a sad little reality it is until they can start adding more substance to it!


Popular posts from this blog

Ancient Warfare - What Is It Good For?

The Ancient Warfare mod for Minecraft threw me for a loop.  I was looking for "villagers" that would perform useful tasks while simultaneously resolving the glut of food with a need to eat, thereby turning Minecraft into a bit of 4X game you can play from the inside.  Millenaire wasn't quite there, partly because recent updates to Forge had broken its compatibility with Minecraft 1.7.10, and Minecolony's development is not quite fast enough to keep up with the state of mods in general (they probably need to make a core API).
In comes Ancient Warfare, which does indeed provide workers and soldiers who need to eat, you can even order around a little army of them to defeat your enemies.  It has working waterwheels and windmills, something I thought was awesome in Resonant Induction.  It has a warehouse with a built-in sorting system, as well as courier NPCs that can move things from building to building, and crafting NPCs that can create things for you automatically - w…

Resonant Induction Really Grinds My Gears... In A Good Way

From about 2pm yesterday until 8pm today, I've been dabbling with my latest custom mod mix for Minecraft 1.6.4, which is this time very much Universal Electricity focused.
Aside from the usual GUI enhancers and Somnia, the primary contenders in this mix were:
Calclavia Core - Of course: this is the base of the Universal Electricity system.Resonant Induction - This seems to be largely focused on increasingly more advanced methods of refining ores divided across 4 ages of technological progression.  It also includes some really cool things such as assembly lines.  I'll primarily be talking about just a few blocks out of this mod today.Atomic Science - A mod dedicated to generating more of those lovely universal electricity volts via the power of splitting the atom.  Build your own nuclear reactor!  Deal with nuclear meltdowns!  You maniac!ICBM - A mod dedicated to generating more destruction using those lovely universal electricity volts (and more than a little gunpowder), it cer…

Stars Above, Earth Below

Now Playing: Stellaris This week saw me revisiting Stellaris, which just released a major overhaul which primarily made it so you have to path through stars in a certain order, allowing for better fortification.  Aside from that, though, how much has the game played since I last played it?
Honestly, maybe it is the fact that the only major game-changing DLC I have is the Utopia expansion, but I feel Stellaris not changed enough; Stellaris remains an excellent storyteller, but only lackluster 4X game.  Some standout gameplay impacts I noticed:
The new emphasis on starbases, their building and upgrading, is a major game changer.  You now have a whole extra source of food and energy that can be generated by them, and an upgraded starbase with defense platforms is basically a doomstack that thwarts invasion through that chokepoint node.Warp travel is so slow that it takes years for my fleets to get anywhere.  Perhaps, once I unlock the warp gates, things will speed up a bit.  As a result…