Hey! Finally some News about Game Development again. All this Silverlight and VS2008 stuff is nice, but XNA has become pretty popular recently (lots of posts in blogs, more articles everywhere and a lot more news).
Anyway, I wanted to release the Dungeon Quest Source Code for several months now, but I never found the time to package everything up, do some cleanup and release it. Recently some people have requested the source code and emails keep coming in. To finally make everyone happy, here is the new Dungeon Quest version with some nice additions, much cleaner code with quite a lot of refactoring and some nice unit tests (see below). This version also does not require PS3.0 anymore, you can now run Dungeon Quest on a PS2.0 graphic card!
First of all: The downloads, all of them can be found on XnaProjects.net too:
Here is the good old YouTube video from the game to give you a first view if you don't know about Dungeon Quest yet.
- DungeonQuestSetup.exe (40 MB): Game installer for Windows with everything you need to play.
- DungeonQuestSourceCodeAndContent.zip (103 MB): Full Dungeon Quest source code with all content files.
Please note that the collada files (xml text format) and the sound/music are very big (extracted ~200 MB).
This download also contains the full game in the bin/debug/ directory, you only need to download this file
for development and testing.
Contains solution and project files for VS2005, VC# Express (XNA Express) and Xbox 360!
- DungeonQuest.wmv (21 MB): Higher quality version of the YouTube video below
If you want to drive into the source code I highly recommend starting all the unit tests in Program.cs after checking out the directory structure of the project:
Show the graphical user interface of the game (boxes for health, player values, rpg levels, etc.)
Test the normal mapping shader, for more shader tests check out the XNA Rocket Commander and XNA Racing Game projects.
This tests the big cave collada file (80 MB) and renders it with the cave shader. Looks very nice.
This is straight from the SkiningColladaModelsWithXNA project from February. This test show shows a static collada model.
Also from the SkinningColladaModelsWithXNA project. This shows the player or the goblins running, dying, staying, etc.
This is a useful unit test to test animations for skinned collada models.
Test post screen glow, more details can be found in the Rocket Commander tutorials and most of my XNA projects.
Test to render a plane on the ground, which is also used in some other tests. Also good for testing shaders.
Test Shadow Mapping unit test, pretty complex stuff, but kinda nice for this game. More details can be found in my book, this is a complex topic and involves a lot of finetuning to get it right.
Since DungeonQuest uses some effects for fire, smoke, blood, etc. it has a simple effect system build in. Use this test to see whats possible and to extend the effect system.
An example of a dynamic unit test, which can also be started from NUnit or TestDriven.Net (right click if you have the addin installed).
And another test to play the sound effects used in the game, just press A, B, 1, 2, 3, etc. to play sounds.
This test shows how the engine supports split screen support, but it was never fully implemented into the game itself yet.
To finish this the game logic + handling input from 2nd player has to be implemented.
Some Screenshots from the last post on my blog about Dungeon Quest:
Ok, let's get started. What is this guy doing there. He doesn't look very friendly, maybe it is better to hit him in the head!
First quest completed. This key is important to open the door to the second level.
Nonstop fighting action. Well, at least if you don't lose your way.
This is how it looks like after I got angry. I told those guys, don't start any fights!
Ohh no. I did not use all my skills (see right side) and this Ogre killed me too quickly. I guess I have to start over.
The credit screen when the game ends. Notice my book :)
No reason to stop, let's start over and try again. The fight is
continuing. The game is not that hard, you just have to use all skills
and avoid being hit by fireballs or big enemies when you have low hit
I hope you like Dungeon Quest and that the source code can be useful for your XNA projects. Enjoy!
Using a webservice in silverlight can be very problematic. It does not work out of the
box when you just add a web reference and try to use it. You will get a lot of
501 - Internal Server Errors, WebException - Error invoking service, etc.
Instead of repeating what so many people have already reported for Silverlight
and Web services I will just link to them and give you a small comment about
each link. My solution is below (it was something completely different than
the links I present here, but maybe I did not read all of them carefully).
- Silverlight documentation about using remoting and webservices. Two solutions are presented, but the help is very short and if you have not done it before there can be many problems that are not discussed here. But this two ways are the standard solutions that almost everyone uses.
- I used another solution to put all websites, web services and silverlight projects onto my IIS 7 server in Vista x64, but I had troubles debugging them. I moved also to IIS because it was annoying to test the website with the fun crashes VS Orcas gives you from time to time and it also has the advantage to show a working version on your colleagues computers by pointing to your computer's IIS.
In short this is what I had to do to get debugging and executing working for web sites and web services in IIS7 with VS Orcas:
- Install IIS (Internet Information Services) first, you can find it in the Control Panel -> Programs/Features -> Turn Windows features on or off.
- Open the IIS tree and select the Web Management Tools (just install all of them). Also make sure you install ASP.NET in World Wide Web Services/ Application Development Features, it will also select all the other required components.
- Last but not least select the Basic, IP, URL and Windows Authentications in the Security tree below World Wide Web Services.
- After installing it you probably need to restart (it did not work without restarting at my colleagues computer). With the IIS Manager (in Computer Management) navigate to your Default Web Site and go into Authentication. Only Anonymous Authentication will be enabled, also enable Windows Authentication (and whatever else you need). You should also switch from the Default AppPool to the Classic .NET AppPool in the Default Web Site -> Right Click -> Advanced Settings -> Application Pool, else debugging will probably not work (Ctrl+F5 works fine even when you do not do this).
- All websites you create from now will use the Classic .NET AppPool, if you already have websites in IIS, make sure to change them too if you want to debug them.
- If you still cannot debug you probably do not have sufficiant rights for the user account that is used in IIS. I usually create a new account with Admin rights (plus password), set it to the IIS (Anonymous Authentication, click edit to select a new user) and then downgrade the Account until it does not work anymore, then you can set the appropriate rights (directory access, etc.) to the account. If you only use your IIS for yourself, you can also use your own user account for testing and debugging.
My problem however was the inability to access the web service via HTTP.
You can access it via SOAP and call the main page and execute the methods,
but directly calling Service.asmx/Method?Parameter=Value was not possible
and lead to the:
WebException - Error invoking service
and Internal Server Error
exceptions (depending on the mood and the way I used web services, I used
mainly the first method (Plain XML Requests over HTTP) as described here:
To test this I called the website directly the way described in the article
I used something like this:
This returned a 501 Internal Server Error (IIS7) or 404 The Page cannot be found
(IIS6), which means this kind of HTTP gets is not supported in this web service
right now. To fix this you have to activate HTTP get in the web.config file with the following code:
From the MSDN Help on activating HTTP Get and HTTP Post for web sites and web services.
Hope this helps, make sure to read the articles mentioned above in detail if you still have issues.
Update 2007-07-14: BTW, if you are interested in webservices for ajax and silverlight,
check out this new project from microsoft live labs:
From the astoria website: "The new wave of web applications are built on technologies such as AJAX
and Microsoft Silverlight that enable developers to build better,
richer user experiences. These technologies bring a shift in how
applications are organized, including a stronger separation of
presentation from data.
The goal of Microsoft Codename Astoria is to enable applications to
expose data as a data service that can be consumed by web clients
within a corporate network and across the internet. The data service is
reachable over HTTP, and URIs are used to identify the various pieces
of information available through the service. Interactions with the
data service happens in terms of HTTP verbs such as GET, POST, PUT and
DELETE, and the data exchanged in those interactions is represented in
simple formats such as XML and JSON.
We are delivering this first early release of Astoria as a Community
Tech Preview you can download and also as an experimental online
service you can access over the internet."