Sign in to follow this  

XNA Book

This topic is 2413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello All!I am a long time ( like 6 years… ) lurker and one time poster, although I have long since forgotten under which alias. Anyways, I feel this is perhaps the perfect forum to share my project with.Many years back, I worked professionally as a tools provider for the game industry. I have loved game programming since typing out BASIC on my Atari 800XL ( guess I just dated myself.. eh? ). However over the last few years I just sorta lost interest. With the recent release of XNA I rekindled my interest with a passion. Myself, I don’t really want to create games professionally anymore ( something about 60 hour work weeks at my age just isn’t appealing ). That said, as a hobby I love it and strangely, educating others became just as, if not more so, satisfying then actually creating something myself. That discovery coincided with a need in my professional life ( you know… the one that pays the bill ) to be able to communicate highly technical terms in plain English. I scoffed at the idea at first, then realized its a lot harder then it sounds. So, I have mixed the two desires together to form my current project.I am writing an XNA book. Perhaps most exciting to you, the reader… a free XNA book! ? At least in electronic form. I am targeting relatively new game developers with the only assumption being you have passable C# coding experience. Sadly, trying to teach programming and game development in one book seems to be a fools errand, as far to many game book’s on my shelf will attest! The goal is to teach game programming concepts, using XNA, in as simple and plain English as possible. If you are a die hard game programmer, frankly I don’t think you will get much out of what I am writing, I will be honest about that upfront. However, if you are new to programming games ( but not programming in general ), I hope this is the perfect book for your introduction. You will learn the basics of everything you need to know to program a game by the time you finish reading it, at least I hope.Also, its written by me as a not for profit thing and as such, I am not constrained by traditional publisher issues. I haven’t got a deadline, I don’t have a page limit nor an agenda. I want the community and community feedback to guide how the book turns out. For example, if you read a chapter and didn’t understand something… I failed. Yet nicely, if you email me, I can revise the chapter to make it clearer. The same, should you find yourself not knowing how to do something, I can look at adding a chapter on it. In essence a community driven book.Thus far, the first three chapters are done. You can download each, with full source code and get more as they are written. The more feedback I receive, the better tuned the book will be and hopefully the more effective your experience will be as well!Chapter 1 is pretty much an introduction to XNA, runs you through downloading everything and getting up and running.You can download it at:[url="http://www.netsalesmanager.com/xna/Chapter1.pdf"]Book:[/url] [url="http://www.netsalesmanager.com/xna/Chapter1Src.zip"]Source:[/url]Chapter 2 is an introduction to 2D rendering, as well as using Microsoft supplied tools to create transparent sprites.You can download it at:[url="http://www.netsalesmanager.com/xna/Chapter2.pdf"]Book:[/url][url="http://www.netsalesmanager.com/xna/Chapter2Src.zip"]Source:[/url]Chapter 3 is about Keyboard, Mouse and Xbox 360 gamepad input.You can download it at:[url="http://www.netsalesmanager.com/xna/Chapter3.pdf"]Book:[/url][url="http://www.netsalesmanager.com/xna/Chapter3Src.zip"]Source:[/url]Finally, LearnXNA.com is hosting all the chapters as they are released, in addition to merging them all into one book. Its also a great place to get started with XNA development.You can visit it at:[url="http://www.learnxna.com"]LearnXNA[/url](BTW, if it is against policy to advertise other gaming related sites, feel free to edit that out. Sorry. )If you download it, please let me know if it was useful to you, what you would like to see changed, what you would like to see added, and the future direction you would like to see the book take!I am averaging about a chapter a week, and hope to cover audio then 3D shortly in the future.Cheers,Mike



EDIT: All the above links are dead. After being informed LearnXNA has joined the dodo in nowhere land, I managed to find these documents and posted them again. They are hopelessly outdated at this point, but hopefully you can learn something from them. Also the unreleased source for the unwritten chapter5 has also been included.

[url="http://www.gamefromscratch.com/post/2011/05/03/A-blast-from-the-past.aspx"]Download files from GameFromScratch.com[/url]

Share this post


Link to post
Share on other sites
Quote:
Original post by Crazyfool
Gives me errors when I open it.


Argh, ive run into this with a handful of people. Is the error when you try to open a PDF directly in a web browser?

If thats the case, it has something to do with the combination of software you and I both have on our machines ( I havent figured out what combination sadly... ) I am authoring it in Office 2007 beta, then saving to PDF. I think its the presence of Office 2007 on your machine that causes the exception.

However, if you right click -> save as, it will work fine.

Please, let me know if you are running any (or all) of the three following programs. Office 2007 Beta, Vista or Visual Studio 2005. Also, are you using IE? Sorry, im just trying to narrow down what causes that annoying crash. Damn MS beta software :(

Share this post


Link to post
Share on other sites
Quote:
Original post by Serapth
Please, let me know if you are running any (or all) of the three following programs. Office 2007 Beta, Vista or Visual Studio 2005. Also, are you using IE? Sorry, im just trying to narrow down what causes that annoying crash. Damn MS beta software :(

Second pdf crashed on me when opening in Firefox 2.0b2. I am not running Vista and I dont have Office 2007. I do have most of Visual Studio 2005 Express installed but I don't see how that could have anything to do with it [cool]

Will have a look through the pdfs at some stage (when I have time) and I hope you won't need to rewrite too much when the XNA framework is no longer a beta [wink]

All the best,
ViLiO

Share this post


Link to post
Share on other sites
Quote:
Original post by ViLiO
Quote:
Original post by Serapth
Please, let me know if you are running any (or all) of the three following programs. Office 2007 Beta, Vista or Visual Studio 2005. Also, are you using IE? Sorry, im just trying to narrow down what causes that annoying crash. Damn MS beta software :(

Second pdf crashed on me when opening in Firefox 2.0b2. I am not running Vista and I dont have Office 2007. I do have most of Visual Studio 2005 Express installed but I don't see how that could have anything to do with it [cool]

Will have a look through the pdfs at some stage (when I have time) and I hope you won't need to rewrite too much when the XNA framework is no longer a beta [wink]

All the best,
ViLiO




Yeah, thats the downside, I am aiming at a moving target. The content pipeline release is definatly going to cause some huge changes.

I just downloaded the Beta 2 refresh for office, ill try to republish after that, hopefully it will fix whatever the bug is.

Share this post


Link to post
Share on other sites
I saw your post on the XNA forums and briefly went through the contents as I already have a grasp of what was introduced. I'm really looking forward to when you get into the 3D stuff and the design behind XNA (GameComponents, Services, etc). Keep it up!

Share this post


Link to post
Share on other sites
Quote:
Original post by Rob Loach
I saw your post on the XNA forums and briefly went through the contents as I already have a grasp of what was introduced. I'm really looking forward to when you get into the 3D stuff and the design behind XNA (GameComponents, Services, etc). Keep it up!


Thanks for the encouragement. I am kinda stalled at the moment, as beyond the next chapter, there needs to be a bunch of tools created. Im working on those at the current time. The biggest of which is to make up for the lack of a content pipeline at the momment. I am writing an ASE importer ( to keep with my theme of using the Mech Commander 2 assets which are all in ASE format), which is about 90% done. Plus im writing a sprite tool as we speak, to finish out the chapters on the basics. Hopefully I will finish both in the next few days.

Share this post


Link to post
Share on other sites
WOW I'm so glad I saw this post! First of all great book so far Serapth - it's very clear, well written, and from what I have heard/read your code works... I have heard about XNA but seen nothing really substantial until now, and now I want to learn it. I'm glad your books are there to help. Keep the book going! I want to read the next chapter! :)

btw you should try to get this stickied or have your book posted as a resource somewhere.

Share this post


Link to post
Share on other sites
Quote:
Original post by kooooo
WOW I'm so glad I saw this post! First of all great book so far Serapth - it's very clear, well written, and from what I have heard/read your code works... I have heard about XNA but seen nothing really substantial until now, and now I want to learn it. I'm glad your books are there to help. Keep the book going! I want to read the next chapter! :)

btw you should try to get this stickied or have your book posted as a resource somewhere.


There seem to be quite a few stickied threads in this forum. Hopefully feedback and new chapter announcements will keep it accessable to anyone that cares.

Thanks for the great comments.

Share this post


Link to post
Share on other sites
It crashed on me when I opened it in Firefox as well (v1.5.0.7, Adobe Reader 7.0.8, Old version of Office). But anyway it opened just fine when I saved to my desktop then opened outside of browser.

Will let you know how I like it once I get the chance to work through the first couple chapters.

Good Luck.

Share this post


Link to post
Share on other sites
Just finished Chapter 1 ... not a bad little start. One thing I wanted to mention was that I think your "Legal Stuff" section has a minor problem:

Quote:

Now for some closing legal bits. All respective terms and copyrights are those of their owning companies. I, Mike Fleischauer, do make this document available to the public domain. Feel free to host this file and distribute it in any manor you desire. However, do not make any modification without prior written consent. Reselling or profiting from this document is strictly prohibited, with the exception of advertising related revenues of the hosting site(s). As a courtesy, please cite the author when posting. I reserve the right to revoke this license at any time.


Problem is your use of the term "public domain". Public Domain has a very specific legal meaning, and it is the opposite of your use of the term. You have released this document freely for public use, according to a specfic set of rules, listed by you ... that is not the "public domain". Public domain is released to all people for any and all use, without restriction, forevermore. Releasing something into the "public domain" is the 1 and only way to give up your copyright control of that property. Licenses, by definition, are not ever releasing items into the public domain, since they use copyright law to protect your interests / wishes. When something is released into the public domain by the legitimate copyright holder, no previous license will have any further meaning for that document.

You should change this line: "I, Mike Fleischauer, do make this document available to the public domain" to something like: "I, Mike Fleischauer, do make this document available to the public, some rights reserved."

As for the "revoking" the license at any time, I don't think that will stand in most situations in a court, but it might protect you in certain limited circumstance (for instance if you want to revoke the license against a party with which you have some other legal injunction - for instance if they owe you money and have not paid).

Share this post


Link to post
Share on other sites
Quote:
Original post by Xai
Just finished Chapter 1 ... not a bad little start. One thing I wanted to mention was that I think your "Legal Stuff" section has a minor problem:

Quote:

Now for some closing legal bits. All respective terms and copyrights are those of their owning companies. I, Mike Fleischauer, do make this document available to the public domain. Feel free to host this file and distribute it in any manor you desire. However, do not make any modification without prior written consent. Reselling or profiting from this document is strictly prohibited, with the exception of advertising related revenues of the hosting site(s). As a courtesy, please cite the author when posting. I reserve the right to revoke this license at any time.


Problem is your use of the term "public domain". Public Domain has a very specific legal meaning, and it is the opposite of your use of the term. You have released this document freely for public use, according to a specfic set of rules, listed by you ... that is not the "public domain". Public domain is released to all people for any and all use, without restriction, forevermore. Releasing something into the "public domain" is the 1 and only way to give up your copyright control of that property. Licenses, by definition, are not ever releasing items into the public domain, since they use copyright law to protect your interests / wishes. When something is released into the public domain by the legitimate copyright holder, no previous license will have any further meaning for that document.

You should change this line: "I, Mike Fleischauer, do make this document available to the public domain" to something like: "I, Mike Fleischauer, do make this document available to the public, some rights reserved."

As for the "revoking" the license at any time, I don't think that will stand in most situations in a court, but it might protect you in certain limited circumstance (for instance if you want to revoke the license against a party with which you have some other legal injunction - for instance if they owe you money and have not paid).


God catch! Legalese is not my strong suit! I threw that bit at the end mostly to cover my ass for using the Mech Commander 2 assets. I however, did not want to lose my copyright on the project ( for two reasons... one, I dont want any one else to publish it for profit and 2) If offered, I have no issues with profiting :) ). I will be revising that section shortly ( I want to put a number of chapters together into mini book form with an actual table of contents and page numbers ). At this point I will re-write the legal disclaimer.

Thanks alot.

Cheers.

Share this post


Link to post
Share on other sites
Chapter 4 is now online.

This chapter covers all things audio. Split about 50/50 between using the XACT tool and the code required for sound effects and music.

For now, you can download it at:
Chapter 4 PDF
Chapter 4 Source
Chapter 4 Sound Data ( warning 18 megs in size )

Of course, shortly it will be available at its primary hosting site:
LearnXNA.com

The sounds file is completely optional if you wish to provide your own .WAV data.

As always, feedback appreciated.

Share this post


Link to post
Share on other sites
Quote:
Original post by ViLiO
Quote:
Original post by Serapth
Please, let me know if you are running any (or all) of the three following programs. Office 2007 Beta, Vista or Visual Studio 2005. Also, are you using IE? Sorry, im just trying to narrow down what causes that annoying crash. Damn MS beta software :(

Second pdf crashed on me when opening in Firefox 2.0b2. I am not running Vista and I dont have Office 2007. I do have most of Visual Studio 2005 Express installed but I don't see how that could have anything to do with it [cool]

Will have a look through the pdfs at some stage (when I have time) and I hope you won't need to rewrite too much when the XNA framework is no longer a beta [wink]

All the best,
ViLiO

Same here acrobat 7 horrible crash trying to directly open pdf in firefox!
Have VS 2005 installed but don't see why that would cause acrobat reader to crash?

Share this post


Link to post
Share on other sites
Quote:
Original post by daviangel
Quote:
Original post by ViLiO
Quote:
Original post by Serapth
Please, let me know if you are running any (or all) of the three following programs. Office 2007 Beta, Vista or Visual Studio 2005. Also, are you using IE? Sorry, im just trying to narrow down what causes that annoying crash. Damn MS beta software :(

Second pdf crashed on me when opening in Firefox 2.0b2. I am not running Vista and I dont have Office 2007. I do have most of Visual Studio 2005 Express installed but I don't see how that could have anything to do with it [cool]

Will have a look through the pdfs at some stage (when I have time) and I hope you won't need to rewrite too much when the XNA framework is no longer a beta [wink]

All the best,
ViLiO

Same here acrobat 7 horrible crash trying to directly open pdf in firefox!
Have VS 2005 installed but don't see why that would cause acrobat reader to crash?


Im really at a loss on whats causing this one. Its only when Acrobat is embedded in the browser too. If you right click, save as the pdfs, you are fine. It only seems to occur with certain versions of Acrobat too.

Share this post


Link to post
Share on other sites
Ok, I need opinions for an upcoming chapter ( then one after the next ).

This is when I intend to start covering 3D programming. I am having a bit of difficulty deciding how to write it. Till this point, the topics have been self contained enough that I can basically go into as much detail as needed to make someone with no game programming experience capable of programming a game.

With 3D that is no longer the case. I don't want to cover 3D math as it would take up a huge amount of space ( and explaining math in plain english is by no means easy, if even possible). Yet, at the same time, someone who doesnt understand the math required isnt going to be very successful. Im at a bit of a loss as to how much detail to go into or not go into.

Thus, im looking for opinions. How deeply should I go into explaining 3D math. Should I even bother at all, just assume the user knows or can learn the required math?

Also, can you think of any beginner friendly math sites that I can reference for further user information. If I can get enough supporting material I can point people towards, I may be able to gloss over alot of the math.

Share this post


Link to post
Share on other sites
Hi,

I've not read these yet as I've just found this thread.

I think you might want to put off the 3D stuff for a bit. There's plenty of other topics that can be covered: AI, scripting, resource management, network gaming, tool chain design. I think physics (at least, complex physics) is too specialised for this project.

Personally, I've written a couple of articles about mophun (mobile phone) programming that had 2D and 3D parts and I found that having a final chapter/section whereby all the ideas of the previous chapters are brought together to create a playable game worked really well. Starting with a game design, I then had a framework to work with in deciding the various sections leading up to the final game.

Skizz

Share this post


Link to post
Share on other sites
Quote:
Original post by Skizz
Hi,

I've not read these yet as I've just found this thread.

I think you might want to put off the 3D stuff for a bit. There's plenty of other topics that can be covered: AI, scripting, resource management, network gaming, tool chain design. I think physics (at least, complex physics) is too specialised for this project.

Personally, I've written a couple of articles about mophun (mobile phone) programming that had 2D and 3D parts and I found that having a final chapter/section whereby all the ideas of the previous chapters are brought together to create a playable game worked really well. Starting with a game design, I then had a framework to work with in deciding the various sections leading up to the final game.

Skizz


Well, my next chapter is about putting all the stuff learned sofar together to create a playable game ( including a bit about tool chains ). Intro to 3D is the chapter after that, mostly because it has been by far and away the thing I have been emailed about the most.

I doubt I will be covering physics to any major degree, since well frankly thats a project in and of itself. I will cover the basics, like collision detection and perhaps a few things like simulating gravity and usage of particles.

Scripting and Networking I cant cover, atleast not yet. It is unclear if the Xbox will be capable of hosting a scripting language. There are alot of security restrictions on what you can do in XNA ( as to prevent Xbox hacking or so the theory goes ), so something like embedding Python, even Iron Python, into an XNA application just isnt going to happen. It may be possible to script using the runtime itself, that has never been confirmed or denied. As to Networking, no (and I mean NO ) details about XNA support for networking exist. I could cover it from the PC side, but then the game would stop being portable to Xbox.

As

Share this post


Link to post
Share on other sites
Scripting is possible on XBox (or any platform for that matter) if you've got the source code for the scripting language. Just compile it into your app and away you go. I know LUA has been used in many games (XBox included!)

As for the intro to 3D, I'd start off by covering the basics for 3D: world, camera, viewports and (untextured) models. Next, go into matrix manipulation - avoid Euler angles but don't head off into quaternions. Get a rotating / moving mesh / camera. Possibly do something with object hierarchies. Maybe a terrain system, start with fixed grid, then quad tree with dynamic loading and maybe SOAR.

Skizz

Share this post


Link to post
Share on other sites
Quote:
Original post by Skizz
Scripting is possible on XBox (or any platform for that matter) if you've got the source code for the scripting language. Just compile it into your app and away you go. I know LUA has been used in many games (XBox included!)


That is true with the full XBox SDK, but XNA is limited to only managed code. So unless for example, you were willing to port LUA (runtime) over to C#, or find another completely C# based scripting language, your kinda SOL. Additionally pInvoke isnt supported, so you cant simply wrap a C based dll with C#.

Share this post


Link to post
Share on other sites

This topic is 2413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this