Vinquisition: The Codebase and Project

Technology Used

Part of the reason I wanted to start this project was to brush up on my NodeJS skills. As such, I’ve written the game into a Node project that runs as a website. The website uses:

  • NodeJS
  • Express
  • AngularJS
  • Bootstrap

I am currently hosting it on Heroku at http://vinquisition.herokuapp.com because it’s so easy to set up and share with people.

Folder and Data Structure

The codebase and game data is all in my GitHub repository. Anyone is welcome to make pull requests to update the game, or the website used to display the game.

For the codebase, what was important for me was to be able to keep the game data all in one place, so that any changes to the game only need to be in one place. For example, if I change Laspistol from 1 weight to 2 weight, I want to do that in one place and have that change show up in both the list of equipment and the starting gear of the Tech-Priest.

To accomplish that I’ve put everything related to game data into a game_data folder. The structure of my node project therefore looks like this:

  • bin
  • game_data
    • classes
    • items
    • skills
    • external_skills.js
    • index.js
    • tags.js
  • node_modules
  • public
  • routes
  • views

I’ve placed items, skills, and classes into folders with individual entries being their own js file in the folder. This was done so that commits to individual skills or classes are easier to make without touching other files.

All game data is stored in an object called game_data, which has its own child properties for each of the different type of game objects: classes, skills, items, tags. This was done to make it easy to add more game data in the future easily (monsters, missions, ammo, etc).

HTML Tags for Items/Classes/Skills

I used AngularJS directives to create new tags to be used that reference other pieces of the game. For example in class starting gear, I can write it out like so:

The Assassin starts with a <item k=”long_sword”></item>.

The AngularJS directive will find that item tag will use the “k” (for key) property to fetch the information at game_data.items.long_sword and replace it with the text “Long Sword”.

Tooltips are also added to the item name, so that on hover you can see a quick breakdown of the tags for that item.

Item tag tooltip

Similar directives were created for classes, tags, and skills.

This setup is working so far, but may change in the future. If you have any thoughts on where this system could be improved, or any caveats I may have missed, let me know in the comments.

1 thought on “Vinquisition: The Codebase and Project”

Leave a Reply

Your email address will not be published. Required fields are marked *