On 2/14/2021 at 12:51 AM, SlithyMatt said:
A game engine would not work very well written in BASIC. It's already an interpreted language, and adding another layer of interpretation would be too much for the X16.
I get where Matt's coming from, but I disagree in this case. I think you can make an 'engine' for the kind of game you describe, right in BASIC, without really adding another 'layer' of interpretation or slowing things down too much. (Keep in mind, speed doesn't matter much for a text-based game like this.)
In BASIC, your 'engine' would be a bunch of subroutines that handle the common tasks of your roleplay system. For example, if your game has combat, you might have some subroutines that handle what happens when a player attempts to attack an enemy. One for handling how the player selects what kind of attack to do, another for handling how the player selects which enemy to target, another that resolves the attack and assigns damage, etc. Other subroutines might handle buying from a shop, equipping armor and changing the player's stats accordingly, branching with dialogue trees, navigating from room to room, etc.
Then when you go to write a new chapter of the game, you re-use all those same subroutines, but have new enemies, equipment, room descriptions, etc. Admittedly this may not be what's typically meant by an 'engine'. But it would be a set of tools that you could use over and over to make new games in this genre.
Of course, this is exactly how you would do it in Assembly as well, but BASIC will be easier to learn as a programming language. The downside to BASIC is that it will always run more slowly compared to Assembly, but for a text-based game like you describe, speed really won't really matter. Speed starts to matter when you want to have graphical gameplay.