Update: Reasoning for previous post (technical)

Blog post referring to: Update: Dialogue System V1.0.0

I just wanted to say that I know I could’ve just copied the function and change the instance code, but I had a valid reason on why I went through the effort of creating an array that worked with a function. Short version is that it improved performance and usability.

The way I did it required an additional 5 lines of code to get the system running, however if I wanted to expand the amount of dialogue boxes, I would only need to add 4 lines of code each time, instead of 33. That allows me to create 8 dialogue boxes for the space of one.

This may not sound like a lot, but if I think of it on a large scale, let’s say 10 dialogue boxes. The total lines of code needed to create 10 dialogue boxes the lazy way would be 330, but the efficient way (the way I did it) would only take 74 lines of code. Meaning it cost only 22.5% of the space for this example.

Results may vary depending on how much dialogue you want per box, but this is a rough estimate.

For usability of the code, it has also gotten easier to explain without being there and is less time consuming per additional dialogue box added.

I might try to improve the simplicity and performance of the code later on, but for now it works amazingly for what I want. I was thinking of reusing instance id in different rooms, but that isn’t allowed, because it would create bugs. To get around this I am thinking of using the Instance_change() command to swap instances over and swap the valuables, however I’m not sure if it works like that.

In short I have done an amazing job to reduce the code needed, but I think it is possible to reduce it further by reusing instances, but I don’t know how to do that currently and it could mess up the system.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s