Bug Prevention

Bug Prevention

Related- Dragonite's Dissecting Error Messages tutorial

Bugs and errors are an annoying constant in game development, but there's some things you can do to make it easier to find a problem and fix it, so an error message doesn't leave you tearing your hair out.

Step 1: Make it easier to retrace your steps

When a bug appears, you're going to have to figure out where things went wrong. If you have to just rely on your memory for every change you've made to base Essentials, you're going to get frustrated pretty fast. Here's some things you can do to avoid that:

  • Keep a dev log. Every day you work on your game, write down what changes you made, and in what script sections.
  • Keep a list of what scripts your game is using. You should already be doing this to give proper credits, but having a list of scripts also helps make it easier to find what might have caused a bug. For example, if you have a script for
  • Keep a regular backup of your game. It might be a little annoying to have twice the file space taken up, but it's (I also recommend Marin's Automatic Backup System, which creates backup files in the event of an accident that corrupts the main files)
  • Comment a specific word into your new scripts. With Ctrl+Shift+F, you can search all script sections for a specific bit of text. If you comment something unique with every change you make, like your username or the name of your project, you can just run a search for that in all script sections, and you can find every change you made to your game.
  • Keep a vanilla copy of Essentials. This is very helpful for comparing scripts and seeing what changes might have affected things.


Step 2: Know some common fixes

Error messages are different depending on the situation, so it's rare that you'll ever have the exact same error message that someone else had. But there's still some fixes that tend to work pretty often, so it never hurts to give them a go!

  • Did you start a new save file? Sometimes, changes in the code can make an old save file incompatible with your current game. (One common error comes up with the PokeDex, which gets an error message if you've reduced the number of Pokémon in your game)
  • Are all of your files named what they're supposed to be? Underscores, capitalization, spacing, all that has to be exact for your game to know which file to call.
  • Are there any typos? A misspelled command, a misspelled variable, a space in the wrong place- just like with files, things have to be exactly right.
  • Are the ends in the right place? It's really easy to just miss that one "end" that makes your game think you're asking for something totally different. Try to match up each end with what it's closing out, and see if anything's in the wrong part of the script.
  • For a missing graphic- is the file path correct? It's easy to put a file in the wrong folder or forget to mention where something is, which can result in your game displaying empty space where your image should be.

Step 3: Know where to go to find answers

  • text-compare.com is a simple tool that lets you compare two pieces of text and see what's different. This is really useful for checking to see if there's any differences in your code and an original script that might have
  • Read through the thread discussing a resource. Has anyone else had a problem like yours? Did the creator respond with a solution?
  • Try googling your specific error message. It's not likely you'll find someone with the exact problem, but googling takes only a few seconds- it couldn't hurt to check!
  • If all else fails, you can always ask on a development forum. Be sure to include as much information about the situation as possible, though!
Credits
None needed
Author
TechSkylander1518
Views
312
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Top