Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
SnipeStyle

Reach
Halo Reach: Debug Output For Scripts

10 posts in this topic

What is this?

These are Xex patches which will add debug output to Reach's scripts. At the moment they have two main features. Whenever Reach's "print" script function is called, its message string is intercepted and printed on the Debugger running on your PC. Secondly, these patches can also activate and modify the debug camera. It will now display the last printed message. Even when you are not connected to a debugger, you should now be able to keep track of what's going on behind the scenes.

 

Demonstration:

Spoiler

scripts.png

Capture2.PNG

 

Some possible use cases:

  • Debugging custom scripts:  Just Include some "print" instructions in your script and find out if and when your code is executed.
  • Script Research: Open a complicated, decompiled script file on your PC. Now play through the corresponding mission on your console and watch the debug output. By searching for the messages in the file, you can quite easily follow the control flow and find out which functions are called at what points during the mission.


Disclaimer:

My understanding of PowerPC assembly and the xbox360's inner workings is very limited. Not much testing has went into this project. Even though I haven't encountered any issues so far, it is possible that these patches could negatively impact the game's performance. Please use them at your own risk.

 

Requirements:

  1. A Xbox 360 with debugging capabilities. This means you need a XDK or at least a hacked console running RGLoader.
  2. DevTool, developed by Eaton: https://eaton-works.com/devtool/

 

Usage:

  1. Start your console and connect it to your debugger. I have only tested WinDbg so far, but Visual Studio should also work.
  2. Start Halo Reach.
  3. Open Devtool and switch to the Patching tab.
  4. Copy the entire text of the patch of your choice and paste it into DevTool's Textbox. Please make sure to use a patch corresponding to your games version (NoTU / TU1).
  5. Press the "Compile and Write" button. Wait until a prompt appears, asking you if you want to apply the patch to memory. Accept it.
  6. Optional: In the scnr tag of your .map, set all script globals, which are boolean and contain the word "debug" to true. This will ensure that all your map's print instructions will be called.

Note: In theory it should also be possible to permanently apply these patches to your Xex using XePatcher. Strangely enough I never managed to get the changes to stick, which has frustrated me more than I am willing to admit. If you get it to work, please let me know.

 

Download:

https://mega.nz/#!ogIR3aRA!ExM3UcM3V7h0J6GzS_ZJto5Y3x0hnYkz9YCyE2Qgf9M

  • HS_print_cam = Debug Output + Debug Cam
  • HS_print = Debug output only.

 

 

 

 

 

Akarias and Gamecheat13 like this

Share this post


Link to post
Share on other sites

There is actually an opcode in reach that can print strings from the scenario string table straight to the player interaction feed (Kill feed, weapon pickups etc), It's been my goto for debugging on a retail console.  Zedd shared a handy change that you can make to instead have the opcode write to a unused hud element.

Have a poke around here by the way, its unfinished but will parse everything. AST etc.

https://github.com/TheGuardians/TagTool/tree/master/TagTool/Scripting/Compiler

Not all of my changes to assembly's script generator have been pulled into the dev branch yet as I never finished them. It should throw errors with invalid expressions etc. cant remember if I ever commit those though.

https://github.com/Akarias/Assembly

rafQDkA.jpg

QwRnZ6n.jpgO8TqVHM.jpg

Edited by Akarias

Share this post


Link to post
Share on other sites

IS THERE ANYTHING ZEDD HASNT DONE YET?!!!

That sounds really interesting and like something i originally intended. The solution with the modified debug cam is very hacky and unoptimal. Overly long strings get cutoff for instance. This solution is much more elegant. Please share the files with me, if you don't mind. I would love to take a look at it.

Share this post


Link to post
Share on other sites

I cant remember them nor find the chat log where zedd showed me, I've probs got a few files on the RGH.

 

Im sure zedd will pop in and post them. ;)

Share this post


Link to post
Share on other sites

Zedd delivered once again. Guess I'll have to make some changes and post version 2.0 when I'm done.

Share this post


Link to post
Share on other sites

Not to highjack your question gc but I've never been able to get watson to work correctly with any debug communicator that I have (various sdk versions). There is not something specific I need to do right?

Edited by Akarias

Share this post


Link to post
Share on other sites

0x507 is hud print for reach btw.

hvexvUn.jpgEc0XQpS.jpg

Its being displayed per tick due to the startup type but you get the idea.

 

edit: its stdout so works fine in watson.

 

P7iYt9G.jpg

Edited by Akarias

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0