15
Content Pipeline Ivan Suhinin

Xna content pipeline

Embed Size (px)

Citation preview

Page 1: Xna content pipeline

Content Pipeline

Ivan Suhinin

Page 2: Xna content pipeline

What content is?

• Something that defines your game• Bad content ruins the game• Good content can save the worst

game

Page 3: Xna content pipeline

What content do we use?

• Images– Textures– Backgrounds

• Fonts• XML– Levels– Players– Objects

Page 4: Xna content pipeline

Content

Image

Font

<Entity />

ContentPipeline

Game Content

Texture2D

SpriteFont

Entity

Why do we need Content Pipeline?

Page 5: Xna content pipeline

Content flow

Importing

Processing

Writing

Reading

Build

Runtime

Page 6: Xna content pipeline

Build: Importing

• The process of reading initial content data

• Converts input data to an object• XNA has default importers for many

content types• But you can always create a custom

one

Page 7: Xna content pipeline

Demo: Default XML Importing

Page 8: Xna content pipeline

Build: Processing

• The process of processing • Can change object type• XNA has a set of default processors

Page 9: Xna content pipeline

Demo: Custom object processing

Page 10: Xna content pipeline

Build: Writing binary data

• Serializes object to a binary file• Usually objects are serialized by

default• But you can always create a custom

writer• …which requires a custom reader!

Page 11: Xna content pipeline

Runtime: Reading binary data

• Reading .XNB (usually) file into an object

• Custom readers are supported

Page 12: Xna content pipeline

Demo: Custom serialization

Page 13: Xna content pipeline

Debugging Content Pipeline

• http://bit.ly/xna-cp-debug• Template allows you to debug

content pipeline• Extremely useful for complex content

objects

Page 14: Xna content pipeline

Demo: Debugging Content Pipeline

Page 15: Xna content pipeline

Questions?

i.suhinin

suhinini

suhinini