Zapper: GameMaker Studio Debugging Tool
A downloadable tool
What is Zapper?
Zapper is a debugging tool that I (Prrz) have been working on for awhile now. I made it with the goal of making a tool that could not only be useful for myself, but for others as well.
So far, it has proven to be useful for my own projects - so I felt it was time to start sharing my progress. Although, keep in mind it may still contain bugs of its own, so if you run into any issues please let me know so I can resolve them as soon as possible.
What does Zapper Do?
Zapper allows you to view and isolate instance variables while your game is running to see how they may be changing and if they are behaving how you expect them to!
Further, Zapper tries to help detect memory leaks in your game by comparing how much your games memory usage has changed over a specified interval.
Not only that, but Zapper comes with some built-in commands and some additional features:
NOTE: All Arguments are Separated by SPACE
Brackets indicate arguments but are not included in the command input.
- zapper set var_rate [frames] (how often Zapper refreshes instance variables)
- zapper set fps_rate [frames] (how often Zapper refreshes the FPS value)
- restart room (restarts the room)
- restart game (restarts the game)
- goto [room name] (goes to specified room)
-- Don't worry, Zapper will populate and update a list of available rooms as you type
- spawn [obj] [x] [y] OR spawn [obj] mouse (spawns object at specified x/y position or allows you to place it with your mouse)
-- Fear not traveler, Zapper will populate a list of available objects for you, oh, and update it automatically when you type.
- destroy [id] OR destroy mouse (destroys an instance of a specific ID or allows you to click on one with your mouse to destroy it)
-- I have to know the instance ID to destroy an object?! Nope, Zapper gives you all the instance ID's that you could ever hope and dream of.
- instance [id] [variable] [new_val] (allows you to change the variables of instances on command)
-- Again with the instance ID... Well, Zapper has you covered.
--- Note: Zapper is not smart enough to know if you are trying to illegally set a variable and it may crash your game - be careful about what you are changing and how you are changing it (if requested, an additional parameter titled 'type' can be added to specify whether it's a string, bool, real number, etc.)!
- Use zapper_add_msg("string", [bool]); to show messages on screen, where the bool is optional - true means the outline is red, indicating an error! This could be a useful replacement to show_debug_message() as it outputs directly to screen instead of the console [Zapper v1.0.1].
- Use zapper_start_benchmark() to begin a rough benchmark test of how long your code takes to run. Make sure to also call zapper_end_benchmark() at the location in your code that you would like to stop the test [Windows Only for now, Zapper v1.0.1].
How do I use Zapper?
Using Zapper is simple, just download the yymps from the link at the top of this post and import it into your project. By default, Zapper will automatically be enabled when you import it!
Make sure to take a look at the "ZAPPER SETTINGS" folder, it contains not only customization options but also important settings to get Zapper up and running (Zapper actually works without any setup though).
Zapper Settings:
__ZAPPER_REQUIRED_CONFIG: This contains a few important settings that you can alter, including enabling and disabling Zapper. However, Zapper will work out-of-the-box without changing any of these settings.
__ZAPPER_INPUT_SETTINGS: This contains settings relating to how you interact with Zapper via keyboard strokes and mouse inputs.
__ZAPPER_RESOURCE_THRESHOLDS: A new file as of the initial release, this contains a bunch of thresholds for tracking the resources your project is currently using. In a nutshell, Zapper compares resources between two game cycles to help determine memory leaks and what may be causing them.
__ZAPPER_CONFIGS: The bread and butter, this contains a bunch of settings and values you can manipulate and change to help Zapper suit your needs. Generally, Zapper should be ready-to-go without any setup but if you would like to tinker, Zapper allows you a ton of control over how it looks, where it goes, and what it shows to you!
FAQ:
Q: Why does it take a second or two for the variables to populate when I scroll through them?
A: Zapper only updates values that it can see, so when scrolling it may take a second to update. To make it update faster, use the zapper set var_rate command or change the default setting in the included settings file! By default, this value is every frame, so you should only see a delay if you have changed this setting..
Known Bugs:
- Trying to set an instance variable to something that contains a space produces a Zapper Error.
Pending Suggestions:
- None! Please provide any suggestions for improvements or features you would like to see - I would like this to be an ongoing project that is continually improved, but I can only do so with feedback from the community.
Download
Click download now to get access to the following files: