XNA custom content writer/reader part 4: Dealing with inheritance and derived classes


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

This will probably be the last post in this series, at least for now. In part one I looked at the basics on how to create my own custom writer/reader. If you’re unfamiliar with the process, you might want read that to begin with. In the second part I showed how to load lists of classes by referring to other XML files. In the third part I showed how you can easily use this technique to load textures and other classes. In this fourth and final part, I’m going to show how you can make life a little easier for yourself when you are loading derived classes. Continue reading

XNA custom content writer/reader part 3: Loading textures and other classes from XML files


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

My last post talked about how to easily read XML files with lists of other classes in them. Now the neat thing about this is that you can very easily modify the code to read any kind of class, including textures and sounds. One of the things I find slightly annoying is that you can’t just include a filename in your XML file and have the content pipeline pick up the texture or sound automatically. However, if you’re already writing your own custom writer/reader pair, there’s no reason why we can’t include that functionality ourself. Continue reading

XNA custom content writer/reader part 2: Reading XML files that have classes within classes


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

In the last post of this series I showed how to write a simple content writer/reader pair. That basic example didn’t give you any benefits compared to the automated way of doing it, however it was a simple introduction on how to write a content writer/reader pair. In this post I’m going to take a look at how to create XML files that reference other classes inside of them. This is an alternate way of doing it from my post back in August. Continue reading

XNA custom content writer/reader part 1: Introduction


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

I did a post on automatic xnb serialization of classes within classes a while back. Now while the method works decently enough, I’ve realized it’s probably not the best way of going about doing it. I’m now using a different method. It’s a little bit trickier, as it involves using custom content writers and readers, but I think the overall result is neater code. There’s a lot of stuff to cover here, so I’m going to try and split the content into four parts. This part will just be about how to setup a simple content writer/read pair, in case you’re not familiar with how to do it. Continue reading

Tower Defense prototype update – now with sound!


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/pillageu/sites/aarebrot.net/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

I’ve uploaded another video of my Tower Defense prototype. I’ve managed to fix my audio drivers so it includes sound effects and music this time. Not a whole lot of visible changes since last time, since a lot of the stuff I’ve been working on has been underlying stuff. Continue reading