LuaSTG Pattern Making Tool-What do I Need to Know?

From LuaSTG Wiki
Jump to navigation Jump to search

LuaSTG is a game engine for Touhou-style shmups written by 隔壁的桌子 around the time of 2012. The original engine has included an editor that has the capability of managing assets, creating game objects and levels for the game. Since then a few different versions of LuaSTG have been developed and maintained by other people, one of them is LuaSTG-x by Xrysnow.


There are a lot of differences between the original LuaSTG and LuaSTG-x. First being that the former is based on HGE, which is a game engine in term based on DirectX on Windows OS; the latter ported to cocos-2dx and has multi-platform support, while it is compatible with pretty much all the Apis supported by the original engine and adds some new features. Both engines are open source on Github.


This tool is currently being developed and tested on a branch of LuaSTG-x on Windows platform. This branch drops the editor support and the test stage is done by Lua coding. It takes advantage of the Imgui support of LuaSTG-x to make an in-game user interface. This tutorial will consist of two parts. The first part discusses some maths and programming stuffs that are required in order to understand how it works; the second part provides a guide on how to use the tool.


Prerequisites[edit | edit source]

In the first part of the tutorial, I will use some pseudo-code to describe how the spawn of bullets can be modeled, and describe an algorithm for generating multiple bullets. One step further, Part I will talk about some problems and limitations of this algorithm and their solutions, and argue that a modified version of the algorithm is much more powerful than one would expect in expressing patterns. This part of the tutorial would be written in a way that does not require much LuaSTG programming experiences, but there is some knowledge that is assumed. Here is a list of the prerequisites of Part I:

  1. have learned a programming language before; some knowledge of how tasks (aysnc) works
  2. play a shmup game, or have some understanding of how object/projectile movement is implemented in a game
  3. high school maths knowledge, and optionally it is better if you know about some properties of basic vector operations


The second part of the tutorial is a guide of the in-game user interface. Here I will talk about why you would need such a user interface, and some features available in it. It will contain some tips for making patterns, and since the tool is written on a modified version of LuaSTG-x, I will also talk about some differences that may influence the usage of this tool. A list of prerequisites of Part II:

  1. familiarity with Lua language and somewhat experienced with making levels (stages) on LuaSTG, and
  2. all the requirements for Part I still apply here


Though it is better if you are familiar with LuaSTG-x codebase, it is not quite realistic to expect people to know about all the details. I will try to remedy that for people who have not worked with LuaSTG-x before.

Disclaimer[edit | edit source]

I will have to mention that the tool has only been under development for three weeks (though the planning started several months before). In its current state, there are lots of changes in features and the ui itself, and the aesthetics does not look very polished either. The tool has not been fully evaluated on whether it has enough advantage over the traditional methods of making patterns (though I'd like to say that I hope it will be). I am writing this tutorial early in the development stage in the hope that more people will learn about this tool and help test that if it indeed has some value.

this tutorial page is written on 2021.9.15