Jump to content


Turn-based system framework

  • This topic is locked This topic is locked
No replies to this topic

#1 Tsukihime


    Advanced Member

  • Ace Member
  • 6,652 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 01 May 2012 - 02:34 PM

This script will act as a base template for any systems that require turn-based movement.

Posted Image
Source: Fire emblem: Path of radiance

Posted Image
Source: monopoly

There are more uses for such a movement system than just a full-blown system.
It is also kind of pointless for scripters to have to re-invent the wheel and re-write how movement is done on the map.

People should be able to take this script and extend it with whatever they want.

-any board game would be able to make use of this template
-any TBS game would also be able to make use of this template.

Keep in mind one thing when you're writing this:

The system is designed to be an extension to the default engine. As such, the turn-based movement must be optional (that is, users should be able to enable or disable it). Since the goal is to develop features such as a board game mini-game, this system should not override any of the existing scripts so that you don't have the option of returning to the default engine.

This is not a custom battle system or a custom engine. This is simply a framework to write additional scenes without having to do it from scratch.


The basic functionality that needs to be supported are as follows

1: All game character movement is controlled by specifying which tile you want to move to.

The general use case would be

Prompt player to select a tile to move to
Move the character to that tile (using some pathfinding algorithm for optimization)
Wait until completion (this is turn-based, not real-time)

When you think about it, that's pretty much what the default system is, except it waits for keyboard input rather than a "confirm" trigger and only moves one tile at a time in the direction that you specified.

2: The game player will just be an icon. Like a cross-hair or highlighting that you move from tile to tile. When you press "confirm" on a tile, it will check if there is an event there. An event may be an actor or an enemy, or some misc object like a chest or something.

It may be an arbitrary event on that tile. Your job is to just write logic that will essentially check whether there is actually an event there, and then execute the event.

3: The script should provide basic "turns" functionality and define a set of phases.

The bare minimum phases required is

Loop {
   turn_start phase
   player phase
   enemy phase
   turn_end phase

The turn counter will be incremented by 1 during the turn_end phase.

4: Define a scheme for events for "game_actor" objects. These will be special events that are directly binded to the appropriate game actor. It may use a comment in the event list, or maybe based on the event name. Ideally, you should implement this in the game_battler class because you should have a way to bind enemy events to game_enemy objects in a similar way.

Your basic implementation should be fully usable in the default system.
Users should be able to just drop it in their project and experience a turn-based movement system, where the game actors are drawn as events and you can control them under the turn-based system.

You don't need to provide any sort of additional game logic like battles and stuff.
You just need to provide the framework that allows others to build on top of it.

Edited by Tsukihime, 01 May 2012 - 02:51 PM.

My Scripts. Go here for Bugs and Requests.

Want to write a tutorial? Submit a community tutorial!
Need improved security? Try the FEUX encryption system

Like on Facebook: HimeWorks
Follow me on Twitter for the latest updates! @HimeWorks
I also make RPGMaker and gamedev videos on Youtube

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users