Age of Yore

A web and mobile RPG at a low resolution

Play the Game | Forums | Twitter | Dev Plan

Validation of Quests, Items etc

- Posted in Development by

One of the many time sinks in Legends of Yore was making sure everything was consistent across all the different data files and that everything worked. Basically, QA.

While QA is always going to be important, with a game the size of Legends (and the bigger size I'm aiming at for Age) the best possible thing would to have as many automated tests and cross checks as possible.

Enter VSCode - I'm lucky enough to now be writing in Typescript inside VSCode which among other amazing features is extremely configurable. Using the most basic of extensions are now have my data files being cross checked in real time as I define them. It's a wonderful sense of confidence that I can't make any obvious mistakes because the system will catch me.

This works essentially by running a Bash script that in turn runs some Javascript files through Node.js. Why do it like that? Well the benefit of coding it all in Javascript is I can make use of the main game code to validate things and load data files - simply by bringing in the output JS from the main game. This means not only my data files are getting check but the core code gets exercised at the same time. Triple win!

What sort of things do I check now?

  • Is the Javascript in the quests and actors valid? This is done by actually executing the scripts against the main code.
  • Are all item references in loot, shops and quests actually defined as items (theres a catalog for items and identity references linking those items)
  • Are all quest variables that are checked, also set somewhere?
  • Are all items that are checked for in quests also able to be obtained somewhere?
  • Does every actor put onto a tile map have associated definition and scripting?
  • Does every sign, gate etc in the game have associated messages etc?

Now remember this is all checked as I save files, so it's really like working with a full IDE - even to the point where issues that are detected appear in the problem panel and get red-lined in the file editors.

This approach is also now running automatic translations for all strings in the game code and data files - so everything is being translated (although poorly via Google Translate) in real time.

And there's one more thing.. where these validation scripts do find issues and where it's possible they generate placeholder data structure with TODOs for me to fill in.

So for instance, if while writing a quest script I just reference an item thats part of the quest - if it doesn't already exist a place holder item gets created and problems prompt me to fill in the associated name, description and tile.

It really is rather neat. Next up - how to template quests so I don't have to hand type the boiler plate every time.