Like video games? Learn how to create them from scratch using the XNA framework. Also learn how to make money from your games and why you should be writing them in the first place.
Generative Artificial Intelligence: How generative AI works.pdf
Creating Video Games From Scratch Sky Con
1. 1 m TH3 L33t M45t3r. J00 H34R M3? J00 12 901n' d0wN.
1 W1ll 34t j00R n3w8 50ul PH0r 8R34kF45t.
(I am incredibly skilled. Do you understand that? Your
attempts to defeat me will fail. I will gorge myself on your
inexperienced soul this morning.)
8. Why Games? Why Now?
● Developing Games is Hot!
Whether it’s casual games, XBox360 games, PC games, adver-
●
gaming, people are interacting with games more now than ever.
● Developing Games Makes Money!
Just a few years ago, the games industry overtook the film
●
industry: now the games make more than the movies.
● Developing Games is Fun!
Duh!
●
● Developing Games is Free!
Tools for XNA are all free, the only thing you might need to pay for
●
is the Creators Club membership.
8
12. What are Community Games?
XBox LIVE Community Games is a new gaming service
that is complementary to XBox LIVE Arcade.
Launching this holiday season for the UK!
Provides consumers with the best and broadest
selection of gaming content available on ANY
console.
Xbox 360 is the first platform to democratize game
development by allowing developers to distribute
their games to more than 12 million Xbox LIVE
members and offering them the opportunity to
benefit financially from their creations.
12
13. How does Community Games Work?
• The setup? Simple.
• The payments? Cash.
• As a Premium member of the XNA Creators Club, you
can submit any game you’ve created.
• Other Premium members can check your game to
make sure it’s safe to play.
• If it is, you’ll set a price point, between 200-800
points, for people to pay to download your game.
13
14. How you make money with
Community Games
• Once the game is reviewed and the price is set,
you’re finished.
• The game is now available on the XBox LIVE
Marketplace.
• You get a cheque every quarter for up to 70% of the
game’s total depending on your own currency.
• Depending on your game’s success, you may even
have your game advertised on XBox360 and other
Microsoft online properties!
14
15. Want an Example?
• The latest example:
Jonathan Blow, developer of the game Braid, an
XBox360 game that's somewhat similar to early
'Mario' games for Nintendo.
His game had only been on sale for a week, but
he estimated it had already sold 55,000 copies for
the Xbox360.
At $15 per game, that’s $825,000 in first week
gross sales.
15
16. XNA Overview
Let’s learn some XNA basics:
● What is XNA?
• “XNA’s Not Acronymed”
• Unified platform for game development
• Runs on XP, Vista – Sits on DX
• Targets PC or Xbox 360 or Zune
• Most boilerplate engine code already included
• FREE!
16
17. XNA Overview
What can you make with XNA?
● Some ideas:
• 3D or 2D games
• First person shooters
• Real-time strategy games
• And more!
17
18. What Else Can You Do With XNA?
•Topics •Programs
Create games Secondary & Post-Secondary
Computer Science
Game design
Fine Arts
Multi-threaded / Multi-core
Computer Graphics
Physics simulations
Inter/multi-discipline
Mathematics
Research
Visualization
Senior projects / Capstone
Networking
Outreach programs
AI
Team projects
19. Some Assumptions
Are there any prerequisite skills I need to have before I
get started with XNA?
● Math skills
• A basic understanding of 2D and 3D coordinate
systems
• Data structures, such as vectors and matrices
● Programming skills
• Familiarity with the .NET platform and the C#
language
19
20. XNA Game Studio
Content
XNA Visual Studio Device
2008 Management
Pipeline
Game Studio
Application Model Content Pipeline
XNA Graphics Audio Math
Framework
Gamer
Input Networking
Services
Windows Xbox 360 Zune
Platform
21. Game Flow
Load
Start
Content
Update
Draw
Unload
End
Content
23. Custom Hardware
• 3.2 GHz triple-core custom CPU
• 500 MHz custom GPU
• 512 MB unified memory
• 12X dual-layer DVD drive
• 20 GB removable hard drive
• USB 2.0 ports
• 10/100 Mbps Ethernet
• IR receiver
• Wireless peripheral support
• High definition video out
24. Hardware Overview
I/O
CPU DVD (SATA)
Chip HDD port (SATA)
Core0 Core1 Core2
Front controllers (2 US
L1D L1I L1D L1I L1D L1I
Wireless controllers
1MB L2
SMCXMA Decoder
MU ports (2 USB)
Rear Panel USB
Memory GPU Ethernet
MC1
BIU/IO Intf IR
512 MB Audio Out
FLASH
DRAM 3D Core
System control
MC0
Video
10MB
EDRAM Analog
Out Video Out
Chip
26. Creating Assets
● Graphics
• DCC (Digital Content Creation) tools
• Maya, 3DS Max, Lightwave, Photoshop etc.
• XNA provides importers for .x, .fbx and other file
formats that can be produced by most DCC tools
• Audio
• MP3 & WAV sounds produced in traditional ways
• Foley is the process of creating sound effects
26
27. The Content Pipeline
● Allows separation of artist and developer work
● Reduces engine / DCC format interdependencies
• Many standard importers and processers are
available for your content
• Importers put your DCC content into the
game, processors deal with it in the game
• Extensibility: You can write your own importer
for a custom file format
● Simple interaction from game to pipeline
• ContentManager.Load(…)
27
28. The Content Pipeline
Lifetime of an example asset:
1. Artist creates an oak tree in Maya
2. (Optionally) Animator adds an animation of the
oak tree exploding violently
3. Developer receives this file in Maya format and
imports it into the content pipeline
4. Compiler packs asset into a binary format tightly
coupled with XNA (not designed for use elsewhere)
5. At runtime: The content pipeline processes the
exploding tree
28
29. Let’s Get Started!
Prepare your development environment.
● Not much is required to get started!
• Windows XP or Vista
• Visual C# Express
• Install XNA game studio!
29
30. Which Version Should I Install?
• Game Studio 2:
• Works with Visual Studio 2005 & Visual C# 2005 Express
Edition
• Can deploy to Windows XP, Vista or XBox360 now
• Game Studio 3:
• Works with Visual Studio 2008 & Visual C# 2008 Express
Edition
• Can deploy to XP, Vista, Xbox 360 or Zune
30
31. What’s New in GS 3?
• Xbox 360
• Xbox 360 project templates (You will not be able to
develop on the Xbox 360 until our final release. We
felt this was important to include so that you could
get projects converted over and look at the system,
even if you are not able to run the games, yet).
• Support for the Big Button Pad.
31
32. What’s New in GS 3 (cont.)?
• Framework & Visual Studio Features
• Enumerate and play back media on your Windows computer or
Xbox 360.
• Simple sound effect support on Windows computers and Xbox
360.
• Support for Rich Presence (lets friends know what’s going on in
your game).
• Support for Invites (ask your friends to join you in a multiplayer
game) and Join Session In Progress (after you see what your
friends are doing, you can join their current session with just a
couple of button presses, even if that’s a different game to the
one you are currently playing)
32
33. What’s New in GS 3 (cont.)?
• More Framework & Visual Studio Features
your content and save space with the new content
Compress
•
compression features!
• ClickOnce packaging support for distributing your XNA Framework
games on Windows.
• Upgrade your project from XNA Game Studio 2.0 using the Project
Upgrade Wizard!
• Take screen captures of your game running on Zune through the XNA
Game Studio Device Center.
• Support for .NET language features like Linq
• Create multiple content projects and leverage cross project
synchronization in Visual Studio.
• FBX importer improvements: read materials containing multiple
textures, and export custom shader materials directly out of Max or
Maya.
33
34. Full mini-game Starter Kits
Can be final destination or starting point
Growing library of genres over time
Focus on several key educational topics per
Starter Kit
34
35. The Structure of an XNA Game
How does the game run?
● Initialization
• Load assets and set initial values
● Game Loop
• Fixed number of frames per second
• Frame: an individual stage of the game’s
animation
• In each frame, look for KB input, update world,
run AI, etc.
• Disposal of objects / Cleanup
35
36. Important Methods
In your Game’s class file:
● LoadGraphicsContent
• Pushes assets into the content pipeline
● Update
• Realtime processing happens here
• Updates to world data
• In each frame, look for KB input, update world,
run AI, etc.
• Draw
• Redraw scene 36
37. Accepting Keyboard Input
Polling the keyboard is easy.
● Poll the keyboard as part of the Update process
● XNA exposes a list of pressed keys
● Check those key presses and handle them
accordingly
37
38. Collision Detection
Collision detection is easier than before.
● Like other processing, happens in the Update
method
● Use a BoundingBox object.
• Normally used for 3D meshes, just set Z to 0
• Create a BoundingBox for every object you want
to detect collisions between
• Use the BoundingBox.Intersects method to
determine if 2 objects collide.
38
40. Summary
● About XNA – what it is, and architecture
● Assets & the content pipeline
● Anatomy of a game
● Creating and moving 2D sprites
● The game loop
● Simple collision detection
40
41. Q&A and Resources
Some XNA Resources
● http://msdn.microsoft.com/directx/XNA
Official XNA Website
● http://creators.xna.com/Education/Tutorials.aspx
Official Creators Club tutorials
● http://www.xnadevelopment.com
Third-party XNA tutorials
● http://www.learnxna.com
Third party XNA video tutorials
● http://blogs.msdn.com/martharotter
My Blog
41