1 / 18

XNA DEBUG TERMINAL

XNA DEBUG TERMINAL. Created By: Kevin Cherry. What is XNA Debug Terminal?. A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods. How Does it Work?.

alanna
Télécharger la présentation

XNA DEBUG TERMINAL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XNA DEBUG TERMINAL Created By: Kevin Cherry

  2. What is XNA Debug Terminal? A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods.

  3. How Does it Work? To understand how this is possible, we need to examine some basic and .Net specific concepts

  4. Compiled Vs. Interpreted • Interpreted languages evaluate source code at runtime • Code is not compiled but rather parsed and evaluated as needed. • Examples: JavaScript, PHP, Python, Ruby • Compiled languages compile to assembly or special/proprietary intermediate language losing type information in the process, making arbitrary code execution at runtime impossible. • Examples: C#, C++, Java, VB

  5. MSIL And Metadata • Why it is possible to interpret strings containing code at runtime with a .Net language • .Net converts code into Microsoft Intermediate Language and a metadata file. The metadata file contains all the information obtained from parsing the source types and MSIL contains the instructions for execution. Querying this metadata we can obtain links to type members.

  6. Source Code -> MSIL & Metadata

  7. Reflection • To query this metadata file, we use reflections. This part of the .Net framework provides information on the specified object’s type which can be used to retrieve fields/properties or invoke methods.

  8. So, How Does XNA Debug Terminal Work? It converts your expression into subexpressions, then parses and evaluates them using reflections.

  9. Sample Expression Parsing

  10. Sample Arithmetic Parsing

  11. Basic Layout Pressing custom set key shows/hides display

  12. Example Invoke method for restoring health of player

  13. Currently Allowed Expressions • Casting • Enums • Identifiers • Literals • Methods • New • Object chains • Types

  14. Not Yet Allowed Expressions • Anonymous Types/Functions • Array indexing or initialization • Arithmetic • Collection initialization • Conditional logic • Generics • Keywords: • as, base, default (e.g. default(int)), fixed, is, out, ref, sizeof, stackalloc, this, throw, typeof, unchecked, unsafe • Lambda Functions • LINQ • Logic Operators (&, |, ^, &&, ||) • Property indexers

  15. Version Priorities • Bugs in expression parsing • Common/Frequently used C# expressions • Bugs elsewhere • Common/Frequently used C# keywords • New Terminal commands • Terminal UI improvements • Speed optimizations • Other improvements

  16. Getting Involved • Email me at: kcherr1@tigers.lsu.edu • with subject “XNA Debug Terminal Source Code" to obtain the source code • Look over code and decide on a single task to undertake • Email me details of the task (what it is and about how long it will take you) • Email back the original source code with all of your changes when done • All contributors will get name in Authors file and Getting Involved, News, and Download webpages

  17. Guidelines For Contributing • Document all types, fields, properties, and methods you add using the "///" xml documentation • Add test cases to the test project that cover your newly added functionality and ensure that each one passes. All previous test cases must pass as well • Try to follow the coding convention used by the existing code • Only change existing code when it concerns your single task

  18. XNA Debug Terminal Website http://www.protohacks.net/xna_debug_terminal

More Related