Script Analysis Breakdown

Zip File of Breakdown Scripts

Objective

Write up a breakdown of how a script works by reading and analyzing the code. A list of scripts/repositories is included as an attachment. Browse through at least 3 of them before picking one to analyze. The breakdown must include:

  1. A short, abstract, description of the script, what it would be used for/what it does.
  2. What is the interface for using the script? If it exists. What are its inputs?
  3. What does the script do? What are its outputs?
  4. How does this script fit into a larger project? What is it used for? Why might it be necessary?
  5. What unknowns remain? What parts could you not parse? Is there a limit to how much you could understand, why? (i.e.: unknown functions, script complexity, not knowing how the rest of a system works)

Please write your answers in complete sentences and not bullet points.

Submission

Written document, word, .rtf, markdown, or pdf uploaded to Brightspace. Include the name of the script you chose. You may wish to include screenshots/parts of the code in-line in the document. That’s fine.

While your grade is not linked to how “accurate” your breakdown is, any elements that you do not understand won’t be counted against you so long as: 1) They are beyond the scope of what we have covered in class and 2) You are able to identify why you do not understand the elements.

Purpose

This is a very efficient way to learn both specific tricks/techniques, but also get practice reading code we did not write, and reverse-engineering it’s logic. This is a critical skill for debugging.

A lot of our bugs and errors have come simply from having trouble reading code. Not catching missing semicolons, and so on. We need practice with that.

It is not assumed that you will be able to do this without looking code/functions up in the unity documentation. In fact, that’s anticipated and one of the objectives of this assignment.

The assignment is the real life situation of working with a stranger’s poorly commented code. Spend time analyzing it before you get started.

Writing through practice is nice, but it can only get us as far as our own experience. I like to say “I only know how to do what I’ve already done” and, in fact, I often make the same project – or underlying mechanics – multiple times, learning from my previous attempts. This kind of assignment is a different approach, which will ideally allow us to take more steps forward in some elements of our knowledge or ability to imagine what a script could do, while not being held down by syntax skills.

This is a particularly effective assignment in learning low-level scripting techniques.

Getting Started

Scripts to choose from in the zip file with this assignment.

Opening it in Rider or some IDE can provide syntax highlighting you might find helpful.

I have included some challenging scripts and some easy scripts. For the challenging ones, some are challenging because of unknown functions or using unknown libraries, some are challenging because of a lack of clarity with how they fit into a larger project, some are challenging because they’re actually doing pretty complex things. Figuring out what parts of them you do not know is, but still being able to parse the rest, is an objective.

If you don’t completely understand how a function works, you still may be able to understand roughly what it does.