Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

PowerQuest

A Nifty 2D Adventure Toolkit for Unity · By Powerhoof

Extension: Quest Lens (static code analyser for PQ)

A topic by 13px created May 29, 2024 Views: 177 Replies: 1
Viewing posts 1 to 2
(4 edits) (+1)

What is this?

Quest Lens is a flexible, extendable static code analysis tool for Power Quest games. 
It works by parsing source files, extracting events involving entities of interest throughout your project, and linking them back to files, functions, and specific lines of code.

Where do I set this flag to false? Which props react to clicking with this item? What is going on in this room? How many ways are there to get this dialog option to be "OffForever"? Do I ever check if this item is owned? 

The Quest Lens window is a full-featured browser for all this data.

The system is modular under the hood, allowing you to easily write your own parsers to extract any project-specific data you might be interested in.


Features:

  • Built-in entities and events
    • Global Flags — Set value, Check value;
    • Dialog Options — turn On, turn Off;
    • Inventory Items — Add, Remove, Owned?, UseInv interactions with every Prop, Hotspot, Character or Inventory;
    • Misc. — // TODO comments, Sections;
  • Scanner:
    • Automatically rescans with each domain reload (in a background thread, and typically <1s);
    • Links points of interest to specific classes, methods and lines of code;
    • Analyses if-branches with mentioned items
    • Is hella smart (sometimes!)
      • it will try to deduce what "item", "option", "thisItem", "I.Active", "D.Current", etc. refer to;
      • if (item is Apple, Orange or Peach) item.Remove()? It will know what's up!
  • Browser:
    • Badges to indicate potential problems or just properties, e.g.:
      • a "red" inventory item is removed but never added; 
      • a "gray" dialog option is never turned on or off;
      • a "red" variable is checked somewhere but never assigned to;
    • Preview actual code of every found point of interest;
    • Search & Filters;
    • Cross-links between entities with navigation History;
    • Links to actual code — click a method name or a line of code to open it directly in Quest Editor;
    • Links from actual code — when editing code in Quest Editor, click "From editor" and drill in;
  • Customization: extend provided classes to easily extract your own data.
    • For the adventurous!
    • Define entity collection — like from enum values, files, prefabs, predefined lists, etc;
    • Describe entity appearance — names, rules for status badges, color-coding;
    • Extract data from code — using simple interfaces to assign tags to found events;
    • Misc. entities — quickest way to find arbitrary points of interest in the codebase, like comments, uses of a particular function, etc.

Version history:

Installation:

  • Download PQQuestLens.unitypackage
  • Add it to your project via Assets > Import Package > Custom package...
  • Open from Game > QuestLens

Notes:

  • Current version wasn't tested with verbs or tuned for them, but it can be done;
  • Detection of global variables relies on naming convention by default (m_ prefix). Detecting variable access without any convention can potentially be slow (depending on the number of global variables in your project), but possible (just test every line against every variable name, yoohoo);
  • If your naming convention has structure (like prefixes for quests, chapters, types, etc) it can be used to render headers in the entity list;
  • It's big and wasn't initially planned for publication. I hope it's stable. Seems stable...

Support:

  • Reach out in PQ Discord (@13x666) if
    • It refuses to work for you
    • You found a bug or an oversight
    • You have an idea for a great new feature
    • You really want to add a project-unique feature but not sure how
(+1)

This is a great tool. Thanks!