Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Let's Build an RPG! A GB Studio Tutorial Series

Follow along on GB Studio Central as we build an RPG Battle System together! · By Lazy Dev Games

A Note About Triggers and Efficiency

A topic by Zone Booth created Sep 23, 2024 Views: 143 Replies: 1
Viewing posts 1 to 2
(+1)

I've been working on a pretty complex RPG system in GBStudio, and my first draft of it used the Trigger based approach you've listed in your first chapter. It is definitely an easy to read approach, but I wanted to share my findings about its efficiency. Triggers activations are limited to the frame rate, and that can really add up if you start to chain them together - which is something I was doing to handle a lot of branching paths.

After a while I settled on a single actor with an on update script I'd stop and start, and an action queue. The script looks at the action queue, and uses the head of it to choose an action from a gigantic switch. That action is able to add more actions to the queue. This let me solve a lot of timing issues, and more importantly it worked with the processor in a better way.  Its definitely more complex, but it handles timing and processing issues very elegantly. It also let me use Triggers for more traditional things like setting a variable when the trigger is stepped on, which made some other types of menu making a lot easier.

It did admittedly have the downside that I needed to make a custom plugin to make it manageable, and there isn't a way to make that plugin generic and sharable. It was just a set of plugins that'd add an action to the queue via name instead of number, and a plugin to make that switch display names instead of numbers. I can't make it sharable because both plugins have a large list of available actions inside of them, and there isn't a way to put that into a configurable area on GBS.

Developer(+2)

Interesting! Would be curious to see that kind of build some time.

The goal of this project is to be an entry level project that gets a new user / first RPG dev into a system with the basic tools available. We’ll be using fairly limited GBVM (just enough to get a feel) and ideally no plugins (to minimize complexity but also keep it evergreen in case plugins become incompatible). 

Hopefully, the systems gets a user’s gears turning so that they can find ways to expand or streamline the system as they go!