quixo 3d game programming in net quixo3d ui
Download
Skip this Video
Download Presentation
Quixo 3D: Game Programming in .NET Quixo3D.UI

Loading in 2 Seconds...

play fullscreen
1 / 26

Quixo 3D: Game Programming in .NET - PowerPoint PPT Presentation


  • 869 Views
  • Uploaded on

Quixo 3D: Game Programming in .NET Quixo3D.UI. Mike Hodnick www.kindohm.com Jason Bock www.jasonbock.net Twin Cities Code Camp - October 27, 2007. On the docket…. [email protected] www.kindohm.com. Show the game Strategy for drawing the board Third party tools

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Quixo 3D: Game Programming in .NET' - Sharon_Dale


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
quixo 3d game programming in net quixo3d ui

Quixo 3D: Game Programming in .NETQuixo3D.UI

Mike Hodnick www.kindohm.com

Jason Bock www.jasonbock.net

Twin Cities Code Camp - October 27, 2007

on the docket
On the docket…

[email protected]

www.kindohm.com

  • Show the game
  • Strategy for drawing the board
  • Third party tools
  • Strategy for game piece behavior
  • Neat features
  • Improvements
  • Giveaways…

National Quixo3D Team

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

show the game
Show the game

demo

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

strategy for drawing the board
Strategy for drawing the board
  • WPF App
  • Use WPF 3D features
  • Cube grid of game pieces

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

slide5

Y

4

3

2

1

0

X

2

3

4

0

1

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

slide6

Y

Piece Size = 1x1

X Translation = X CoordinateY Translation = Y Coordinate

4

3

2

1

0

X

2

3

4

0

1

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

slide7

Y

Piece Size = 1x1

X Translation = X Coordinate * X SpacingY Translation = Y Coordinate * Y Spacing

4

3

2

1

0

X

2

3

4

0

1

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

strategy for drawing the board8
Strategy for drawing the board

code

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

third party tools
Third Party Tools
  • 3DTools
    • www.codeplex.com/3DTools
    • Trackball decorator
  • Petzold.Media3D
    • Charles Petzold (www.charlespetzold.com)
    • 3D model generation

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

using the trackball decorator
Using the Trackball decorator
  • Reference the _3DTools CLR namespace in your XAML:
  • Wrap the Trackball around a Viewport3D in XAML:

xmlns:tools=“clr-namespace:_3DTools;assembly=3DTools”

<tools:TrackballDecorator> <Viewport3D /></tools:TrackballDecorator>

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

leveraging petzold media3d
Leveraging Petzold.Media3D
  • CubeMesh
    • Creates a cube
    • Used to represent an empty game piece
  • TorusMesh
    • Creates a “donut”
    • Used to represent a placed “O” game piece
  • SolidText
    • Creates 3D text
    • Used to represent a placed “X” game piece
    • Used for axis labels
  • WirePath
    • Draws lines in 3D space
    • Used to outline a valid source piece
  • Cylinder
    • Used for X,Y,Z axes

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

petzold media3d
Petzold.Media3D

code

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

strategy for game piece behavior
Strategy for game piece behavior
  • GamePieceVisual class (GamePieceVisual:ModelVisual3D)
  • A composite visual model containing:
    • Cube mesh geometry
    • Torus mesh geometry
    • 3D Text visual model
    • Wireframe visual model
  • Changes appearance based on public properties:
    • Highlighted (mouse-overs)
    • IsValidSource (shows wireframe, indicates it can be clicked)
    • HighlightedAsValidSource (shows that you clicked it)
    • HighlightedAsValidDestination (shows you can click it)
    • PieceType (shows/hides the cube, torus, or text geometries/models)

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

game piece composite model challenges
Game piece composite model challenges
  • Cube and torus are “geometries”
  • SolidText and wireframe are “visual models”
  • Hit testing when an empty or “O” piece is shown will result in the GamePieceVisual being returned
  • Hit testing when an “X” piece is shown will return a PlanarText object that is rendered by SolidText
  • Hit testing when the wireframe is shown will return a ModelVisual3D object.

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

slide15

GamePieceVisual : ModelVisual3D

Hit testing produces a ModelVisual3D!

Content

Children

Model3DGroup

xModel : ModelVisual3D

wireFrame: ModelVisual3D

emptyModel : GeometryModel3D

oModel : GeometryModel3D

When these visuals are shown, they themselves are the first ModelVisual3D objects found in the tree.

When these geometries are shown, GamePieceVisual is the first ModelVisual3D found up the tree.

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

gamepiecevisual hit testing code
GamePieceVisual hit testing: code

code

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

gamepiecevisual ui effects
GamePieceVisual UI Effects
  • Highlighting: change scale and color
  • Select as valid source or destination: change color
  • Show winning lines: change scale
  • System.Windows.Media.Animation.Animatable
    • Brush (SolidColorBrush)
    • ScaleTransform3D
  • Animation Types
    • DoubleAnimation
    • ColorAnimation

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

animation examples
Animation examples
  • void AnimateBrushColor(SolidColorBrush brush)
  • {
    • Color startColor = Colors.Blue;
    • Color endColor = Colors.Red;
    • TimeSpan duration = TimeSpan.FromMilleseconds(200);
    • ColorAnimation animation = new ColorAnimation(startColor, endColor, duration);
    • brush.BeginAnimation(SolidColorBrush.ColorProperty, animation);
  • }
  • void AnimateScale(ScaleTransform3D scale)
  • {
    • double startScale = 1;
    • double endScale = 1.5;
    • TimeSpan duration = TimeSpan.FromSeconds(2);
    • DoubleAnimation animation = new DoubleAnimation(startScale, endScale, duration);
    • scale.BeginAnimation(ScaleTransform3D.ScaleXProperty, animation);
      • scale.BeginAnimation(ScaleTransform3D.ScaleYProperty, animation);
      • scale.BeginAnimation(ScaleTransform3D.ScaleZProperty, animation);
  • }

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

ui effects code
UI Effects: code

code

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

neat features
Neat Features
  • Move history data binding
  • Axes
  • Trackball enabling/disabling

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

future improvements
Future Improvements
  • Make the game (framework, engine, UI, tests, etc.) size-agnostic
  • Create a Game class

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

future improvements22
Future Improvements
  • Algorithm optimizations
    • Parallel computations (FX/System.Concurrency?)
    • Trimming the tree
    • Opening book

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

future improvements23
Future Improvements
  • Algorithm optimizations (con’t)
    • Principal variation
    • Transposition tables
    • Iterative deepening
    • Evaluation improvements (genetic algorithms?)

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

future ui improvements
Future UI Improvements
  • Multi-threading
  • Skinning and configuration
  • Use of dependency properties
  • VS 2005 vs. 2008
  • Board and piece representation
  • “Up direction”
  • Support “undo”

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

resources
Resources
  • http://www.codeplex.com/3DTools
  • http://www.charlespetzold.com
  • http://www.kindohm.com/technical/toc.htm
  • http://rhizohm.net/irhetoric/
  • http://blogs.msdn.com/wpf3d/

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

slide26

Quixo3D: Game Programming in .NET

Jason Bock – http://www.jasonbock.net

Mike Hodnick – http://www.kindohm.com

Quixo3D.UI - Twin Cities Code Camp - 2007.10.27

ad