Game
The Cardinal Crusade
7 years ago

Technical Devlog: Custom Timelines


Hey, welcome to a technical devlog for all you people out there who like to read about code! Wait, most player’s don’t like reading about code? Too bad because I like writing about code!

What you talkin’ ‘bout?!

Today I’m talking about a sweet new framework I made for dealing with more complex enemies and systems that revolve around state machines in an easier to manage way.

Please keep in mind this game is made in Game Maker. So I’ll be using Game Maker terminology.

What’s a state machine?

A state machine is as it sounds. A machine that runs based on states. Typically these machines run in one state at a time. They do a thing while they are in a state, then they change states and do a different thing. It’s a pretty common way of programming and works well.

K, so what’s this framework thing?

Well to answer that I first have to describe the issue I sought out to solve; and to do that I have to talk about Game Maker’s “Timelines”.

In Game Maker, a timeline is a resource type that allows you to set up timed code. You add a time to the timeline, then you give it some code to run at that time. The timeline automatically and continuously counts up until it reaches the latest time you’ve added. It’s a good way of creating sequential actions. They are also really useful for making state machines because you can repeat a single time by changing the time index of the timeline. This effectively allows you to treat each “time” or step, as a state. This is something we do in most of the enemies in The Cardinal Crusade. So that’s a basic summary of normal timelines.

The problem is that you can only run one timeline at a time within any one object. So if we wanted two sequential actions to happen at the same time. Aka, run two states at once. We can’t do that or at least not neatly. At first this was fine and I found a work around every time. I simply didn’t use timelines for the more basic tasks. This new boss however required a fair bit of sequential steps to be happening at once and the code was getting really messy, really fast.

The solution (The Framework)

The solution to our problem was to build a framework which effectively emulated the standard Timeline system in Game Maker; but without actually using timelines. See if it’s not technically a Timeline I can make the code do whatever the hell I want. So that’s what I did.

I made a framework which allows me to set up a virtual Timeline, and add scripts to certain time steps within those virtual Timelines. They can do everything a standard Timeline can do but I can run as many as I want.

For this boss we have a timeline for each cannon, timing the cannon shots, getting hurt, and more. I can turn these on and off in a single line of code at any time. The code for the boss is now WAY neater, easier to follow, easier to debug and simply better all around.

Best of all, as this is a framework I can use this at any point in this project. For example future bosses. I can also import it into a different project and use it there too! It’s very cool.

That is all.

So that’s about it for this devlog. I dev’ed a cool thing which allows me to dev more cool things; and I think that’s cool :)

Thanks for reading!
Let me know if you like technical devlogs by choosing a pole option below. If it’s mostly yes I’ll write them more often. I like them :)

  3 votes Voting finished



1 comment

Loading...

Next up

Its finally time to announce a release date!

Eldritchvania will be available here on Game Jolt, Steam and Itch.io at 12am(AEDT) on the 10th of February!

\/ Read the article for more \/

Joining the 10Y club

The Last Five Months in The Cardinal Crusade

Bug Fixes!

Since the last Eldritchvania update we've been reading feedback and watching game play videos; which lead us to witnessing and fixing more bugs.

Check the article for the list of fixes

A transformation Hello, in this devlog we’re showcasing an animation where the player character transforms into a smaller, flesh monster. Why is this in the game? What purpose does it serve? Perhaps more will be revealed soon…

Woah!

Thanks all!

Don't forget to Wishlist Eldritchvania!

https://store.steampowered.com/app/2423710/Eldritchvania/

We're back with another update to Eldritchvania!

The focus here was accessibility, namely the flashing effects included throughout the game.

We've added the option to turn off flashing effects!

The Cardinal Crusade Demo release!

A look at a new enemy: The Core Guards Today we would like to show off one of the new enemies that you will encounter in world 3. These large, brutish soldiers are well armoured and will surely put up a fight! … Even if they have apples for heads.

The Control update!

We've update the controls in Eldritchvania to make it more enjoyable.

Check the article for details!