https://wiki.scummvm.org/index.php?title=Stark/TLJ_Debugging&feed=atom&action=historyStark/TLJ Debugging - Revision history2024-03-28T11:07:09ZRevision history for this page on the wikiMediaWiki 1.36.0https://wiki.scummvm.org/index.php?title=Stark/TLJ_Debugging&diff=31580&oldid=prevMetaFox: update for ResidualVM merge2020-12-02T03:51:15Z<p>update for ResidualVM merge</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 03:51, 2 December 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l38">Line 38:</td>
<td colspan="2" class="diff-lineno">Line 38:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===Debugging===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===Debugging===</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Most debugging features are accessed through <del style="font-weight: bold; text-decoration: none;">ResidualVM</del>'s console. Some of the notable commands are :</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Most debugging features are accessed through <ins style="font-weight: bold; text-decoration: none;">ScummVM</ins>'s console. Some of the notable commands are :</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* listLocations: Lists all the locations in the game</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* listLocations: Lists all the locations in the game</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* location: Display the current location</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* location: Display the current location</div></td></tr>
</table>MetaFoxhttps://wiki.scummvm.org/index.php?title=Stark/TLJ_Debugging&diff=31295&oldid=prevAquadran: Created page with "==Getting started== ===The resource tree=== A level is a place in the game. It can have several viewing angles called locations. TLJ's game resources are organized in a tree..."2020-10-14T11:43:26Z<p>Created page with "==Getting started== ===The resource tree=== A level is a place in the game. It can have several viewing angles called locations. TLJ's game resources are organized in a tree..."</p>
<p><b>New page</b></p><div>==Getting started==<br />
<br />
===The resource tree===<br />
A level is a place in the game. It can have several viewing angles called locations.<br />
<br />
TLJ's game resources are organized in a tree structure.<br />
The root contains all the levels in the game. Each level contains the locations that are specific to that level. Each location contains items for that location, ect ...<br />
<br />
Each resource (tree node) has at least the following properties:<br />
- A type<br />
- A sub-type (which meaning is type-specific)<br />
- A name<br />
- An index (its order in the list of the node's parent children -- Often used to locate resources in the resource tree)<br />
<br />
Being tree nodes they additionally have a parent resource and a list of children resources.<br />
<br />
Each node can have more type-specific properties.<br />
<br />
There is a C++ class for each resource type. The engine instanciates a class with the appropriate type when it loads a resource-subtree. These classes are used to store the type-specific properties, to store the resource state, and define the associated behaviors.<br />
<br />
===Resource references===<br />
Game resources are referenced by other resources by their address in the resource tree. Addresses are made of a list of pairs (Type, Index). The list contains all of the ancestors of the target resource as well as the resource itself.<br />
The designated resource can thus be retrieved in the tree by walking it down, consuming a list element in the address for each tree level.<br />
<br />
Example reference for an item :<br />
(Level, 10) (Location, 0) (Item, 5)<br />
<br />
This designates the Item with index 5 in the location with index 0 in the Level with index 10 in the tree root.<br />
<br />
===Game events===<br />
The engine calls event handlers for currently loaded resources on some occasions:<br />
* Once per gameloop<br />
* When the player enters the location the resource is in<br />
* When saving the state<br />
* ...<br />
<br />
The resource classes must implement these event handlers in order to provide features to the game.<br />
<br />
===Debugging===<br />
Most debugging features are accessed through ResidualVM's console. Some of the notable commands are :<br />
* listLocations: Lists all the locations in the game<br />
* location: Display the current location<br />
* changeLocation: Jump to another location<br />
* chapter: Display the current chapter -- Some scripts are conditionned by this value<br />
* changeChapter: Set the current chapter<br />
* dumpLevel: Print the current level's resource sub-tree to stdout<br />
* dumpLocation: Print the current location's resource sub-tree to stdout<br />
* dumpGlobal: Print the global level's resource sub-tree to stdout<br />
* dumpStatic: Print the static level's resource sub-tree to stdout<br />
<br />
The dump* commands are especially useful when trying to correlate the game data to behaviors.<br />
<br />
===Scripts===<br />
Scripts are resources in the resource tree, just like everything else. They are made of a list of command resources. Each command has a subtype designating an operation code in the game engine, as well as a list of parameters for that operation.<br />
<br />
The script execution flow depends on the current opcode 'kind':<br />
* After executing a 'standard' opcode, the script execution continues to the command which index in the script is the value of the current command's first argument.<br />
* After executing a 'branch' opcode, the script execution continues to the command corresponding to either the first or the second argument value.<br />
* After executing a 'suspending' opcode, the script execution is paused until a suspending resource has completed playing (such as a sound resource)</div>Aquadran