4th of November, 2019


So, I basically redid the randomised item thing entirely. Previously it was an item called the Orb of Secrets which, in normal gameplay, gave you a random misc. item. In a specific NG+ area (or anywhere with the randomiser cheat on) it gives you (almost) item in the game instead. The Orb of Secrets still exists and functions the same way, it's an item you use and it gives you a different item. The main difference is all behind the scenes and optimisation based, so feel free to ignore this if you don't care.

I didn't have a good setup for the item pool before. It was becoming a huge mess because I didn't plan ahead and I still didn't have the item ID's nailed down yet, so I was throwing around items like crazy.

This resulted in... not the prettiest implementation.

Basically, the game generated a random number. I don't remember the ranges exactly, but it was a random number. I then manually created an event for each number, consisting of an if statement, the item actually being added, a sound playing, and a message saying what item it was.

I then had to copy and paste that.

A hundred times.

One zero zero.

And it wasn't done because there were more items that needed implementing. Each time I had to change the if statement to check for the new random value, add the item, and update the message. It was painful.

It was also slow. The game froze for a second every time you used an orb because it had to cycle through such a huge event and go to the if statement it wanted. It was just awful and I didn't plan ahead at all, so I entirely redid it earlier.

My primary goal was to automate the whole process. My initial thought was like this: Generate a number between 1 and 182. If it's between 1 and 99 (the item range), add the corresponding item ID. If it's between 100 and 132, add the corresponding weapon ID. If it's between 133 and 182, add the corresponding armour ID.

One issue with the previous implementation is that the number each item was assigned to wasn't corresponding to ID. Item ID 32 had the designation of 110, for example.

It was a mess.

Changing it this way makes it easier to automate. Anything between ID 1 and 99 can easily be added to the player's inventory, just add the corresponding item ID. Weapons are easy too, just take the random number and subtract 99 to get the weapon ID. Same goes for armour.

That said, as easy as this should've been, it took me... maybe 6 hours to do? I've been trying to work off RMMV's main eventing system where possible but this was too complex for that, so I had to actually do scripting for it. My experience with javascript is very limited so I kept making small stupid mistakes that aren't helped by RMMV not having a proper code editor when adding scripts to events. Eventually I just started testing the code in the debugging console because it actually had syntax, it was so annoying to deal with.

Most of the code I used was taken and adapted from snippets made by Poryg on the RPG Maker forums, I'm so glad he's written posts on stuff like this before because I wouldn't have had a clue on where to start.

So, yeah. I had to do scripting to make the orb implementation work how I wanted, but it's done now. Instead of having to manually add every item to the orb pool, I have to manually remove items which is way easier. I also implemented a system to the orb where it won't give you an item if you have 5 (the max amount) of it. If you have 5 of an item already, it will shift the ID it's looking for across by 1. This means it'll give you the next item you don't have 5 of.

Excluding items from the pool is basically the same thing, it just shifts the item ID it's looking for across by 1 so it skips over it and goes to the next available item instead. It's incredibly efficient too, the brief lag when using it has completely gone.

Because the new system has a loop in place to check for items that aren't at the max amount, what happens if you have the max amount of everything? Well, I thought of that already and... I slightly overestimated how much of a problem it was. If you have the max amount of items and you use an orb, it just gives you another orb (yes, that's a thing that can happen because I thought it would be funny). It turns out that I accidentally made a failsafe, and then developed another failsafe around it.

My intended failsafe was a system where it counts how many times it has cycled through the items, and when it cycles through all the items once and hasn't found an available item ID to give you it will just fail to use the orb.

So um, yeah. I somehow forgot that using an orb... actually... uses the orb... so the game just gives you another one. And I might've wasted a lot of time getting the failsafe to work when it ultimately wasn't needed.

Whoops.

Anyway, the Orb of Secrets is way better now (on the technical side at least). I just need to finish up the final items that will be in the game and then I need to finish up the list of excluded items. After that the only things that need finishing are enemies, bosses, and maps. A fair few bosses have already been made, a fair few dungeons have already been made, and a fair few enemies have already been made - but not enough of them.

To summarise:

  • Technical side of the Orb of Secrets is vastly improved
  • Item database is close to done Enemy database is close to done
  • Most important locations are already playable, just lacking
  • The main quest isn't actually beatable yet, there's still a dungeon that needs doing

Once the single dungeon that needs finishing for the game to actually be beatable is done, I'll be able to focus more on detailing, finishing up side content, bug fixing, and whatever else. I'm like 8 months behind on when I thought this would be done, but I'm getting there. It should almost definitely be finished in the first half of 2020. I'll reach out to some people around a month before I'm fully confident in releasing it to gather feedback and have some help with finding weird bugs I might've missed. And of course, they can stream it too.

Get Aretisia: Tenebris Dominus

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.