XNA DEBUG TERMINAL - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

XNA DEBUG TERMINAL

Description:

Created By: Kevin Cherry A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods. To understand how this is ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 19
Provided by: cod85
Category:

less

Transcript and Presenter's Notes

Title: XNA DEBUG TERMINAL


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 -gt MSIL Metadata
7
Reflection
  • To query this metadata file, we use reflections.
    This part of the .Net framework provides
    information on the specified objects 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_at_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
Write a Comment
User Comments (0)
About PowerShow.com