Procedurally generated upgrade system for rogue-likes by Max Pera

Table of Contents

  • 1 Introduction
  • 2 First itteration
  • 3 Second itteration
  • 4 Third itteration
  • 5 Implementation

1 Introduction

1.1 Motivation

The motivation for this research is that i have been wanting to make a Rogue-like action RPG for a while now, but have been strugling to find a way to make it unique. With this procedural upgrade system I am hoping to find a way to make it special in its own way without redefining the structural back bone of a rogue-like. The biggest inspirations I have been looking at are: the Borderlands games which procedurally generate all of the possible weapons you can unlock, and I am also looking at player behaviour recognition software so i can give the player the most fitting upgrades according to their playstyle.

1.2 Goal

The goal of this research is to make an upgrade system that takes the player behaviour into account and gives upgrades accordingly. For example, if the player were to use only the fire based attacks the system should be giving the player a fire based upgrade, however if the player were to use 2 different elements which both are of type close range, the system should reward the player with an upgrade of said type.

2 First itteration

2.1 Calculations

For the first iteration of the project i made it so that the upgrade for the player would be selected purely on the amount of times the player used an attack and then it would grant the player the next upgrade in that upgrade branch.

2.2 Setting it up

First I needed to set up the attacks so they could be used in all the calculations. To accomplish this we needed to create something that keeps track of all the attacks, the amount of times they have been used and on which frame they have been used, I created a class that keeps track of all these things called “Actions”, every action like explained before has a string that checks the name, an integer that keeps track of the amount of times an action has been used and a list of integers that stores every frame the action is used.

The Actions are managed first by creating an Action for every single Attack in the project.

After which timesUsed gets increased when you hit an enemy with an attack.

3 Second Itteration

For the second itteration of the project i wanted to at more restraints and conditions to the algorithm. I had already set up all the attacks with an “Element” and a “Attack Type” which determine so of the attacks stats when i created the attacks. I decided to use the “Element” and “Attack Type” as parameters for the algorithm when determining which upgrade to give to the player. To do this i wrote some methods to determine the possible calculation value’s of the “Actions” , “Elements” and “Attack Types”, after which I also made some floats which determine the weight of the values in the calculation.

Elements and Attack Types

New calculations

After the calculations have determined which Attack should be upgraded it unlocks the upgraded attack and replaces the old attack with the upgraded attack and then removes the old one from the list “actionNames” so it can no longer be used for future calculations

4 Third itteration

For the third itteration and final one for this research i decided to disect all the different values and determine the most used ones for each value so you would get the most used: type, element and style and create an entirely new attack based on the outcome.

So for instance if your most used values would be element: fire; type: close; and style: hybrid, your new attack would be a close ranged hybrid fire attack.

Next the code will check which attack is the least used and will replace this attack with the newly created one.

Every attack is also generated with a random name detemermined by the element and the type

5 Implementation

To demonstrate the project I downloaded one of the assetpacks i own and put a player and a enemy in the scene which are used to use the attacks and grant the upgrade to the player.

After the player defeats the enemy they are rewarded with an Upgrade

Possible improvements

I myself have to main improvements in mind for the project, the first being: Improving the player behaviour recognition. By making the player behaviour recognition more in depth and maybe even going as far as to use machine learning for this i think the system could become more rewarding and pay out with even more replayabilty.

Second of all I feel like would have liked to make all the starting abilities randomly generated so that each and every single play through could an probably would be different. I would also try adding more different elements, types and styles to make the variety even bigger.

Sources

At first I intended to make a more in depth player behaviour recognition software using Machine learning but in the end the I ended up not making this so for the reason the sources regarding that will not be included

  • Borderlands 3: How They Made (Literally) A Billion Guns Possible – IGN First -https://www.youtube.com/watch?v=bFLhcoFAJMQ
  • Should Roguelikes Have Persistent Upgrades? | Game Maker’s Toolkit – https://www.youtube.com/watch?v=eXEQ8VBqXBY&t=2s