dev in the making

game development, maya and code by brainzizi

Posts Tagged ‘framework

zAnimation – on codeplex

with one comment

zAnimation is finally on codeplex. You can find it here: http://zanimation.codeplex.com/.

It’s all very basic for now, no samples or documentation yet. The code is somewhat documented. I believe experienced people will have no problem using it. It’s just a matter of selecting the right content processor, checking out my past blog entry to write a definitions file, and writing model.Play(“Walk”); I won’t be working on the documentation or samples the next 2 weeks, my exams are still more important.

Written by brainzizizi

11.22.2009 at 12:57

zCamera Save/Load

leave a comment »

Hi!

On my zCamera project, I’ve added basic support for saving and loading.
The zBaseCamera, the base class of every camera provides this interface:

public virtual SaveSettings(string path);
public virtual LoadSettings(string path);

Save is done using the IntermediateSerializer, and load is done using XmlReader to support raw .xml loading.
See, the IntermediateSerializer output needs to be compiled at runtime in order for you to load it during your game. So no save/load sessions using just the serializer.

        /// <summary>
        /// Saves the camera settings.
        /// </summary>
        /// <param name="path">The path of the file to write, without the extension.</param>
        public virtual void SaveSettings(string path)
        {
            XmlWriterSettings settings = new XmlWriterSettings { Indent = true };

            string fullPath = manager.Game.Content.RootDirectory + "\\" + path + ".xml";
            if (File.Exists(fullPath))
                File.Delete(fullPath);

            XmlWriter writer = XmlWriter.Create(fullPath, settings);
            IntermediateSerializer.Serialize(writer, this, null);
            writer.Close();
        }
        /// <summary>
        /// Loads the camera settings.
        /// </summary>
        /// <param name="path">The path of the file to read, without the extension.</param>
        public virtual void LoadSettings(string path)
        {
            XmlReader reader = XmlReader.Create(manager.Game.Content.RootDirectory + "\\" + path + ".xml");
            while (reader.Read())
            {
                if (reader.Name == "Name")
                    Name = reader.ReadElementContentAsString();

                if (reader.Name == "Debug")
                    Debug = reader.ReadElementContentAsBoolean();

                if (reader.Name == "FocalDistance")
                    FocalDistance = reader.ReadElementContentAsFloat();

                if (reader.Name == "FieldOfView")
                    FieldOfView = reader.ReadElementContentAsFloat();

                if (reader.Name == "AspectRatio")
                    AspectRatio = reader.ReadElementContentAsFloat();

                if (reader.Name == "NearPlaneDistance")
                    NearPlaneDistance = reader.ReadElementContentAsFloat();

                if (reader.Name == "FarPlaneDistance")
                    FarPlaneDistance = reader.ReadElementContentAsFloat();

                if (reader.Name == "Position")
                {
                    string vector = reader.ReadElementContentAsString();
                    Position = zCameraHelper.ParseFromIntermediateSerializer(vector);
                }
            }

I’ll release the complete source next week.

Written by brainzizizi

08.11.2009 at 07:09

zCamera

leave a comment »

I’m having a blast playing with camera code in XNA. This is the third time I’m writing my own camera, and after I experimented a bit with various camera implementations including Quaternion rotation, Matrix rotation, frame-by-frame rotation, I can now say that I get the basic principles of every camera. And my goal is to make a light camera framework, with a couple of build in cameras and code for easier writing your own camera. Last night was really productive, as I wrote some messy debug code using the vector renderer component from Ziggyware which I’ve tweaked a bit to draw bounding frustrums and alike.

I’ll release the source when I write some more camera types, but first a couple of screen shots:

The package will consist of two projects: zCamera and zCameraPlayground which uses an early version of zGui, my gui framework for debugging purposes.

PS.
The model I used is the model from XNA’s Normal Map sample. If you see a problem in that, please leave a comment.

Written by brainzizizi

08.08.2009 at 12:22

Posted in xna

Tagged with , , , , , ,

2 projects: zGui and PuzzleCMS

with one comment

Now that the exams are over and I can forget about school for 3 months, I started doing what I was looking forward to doing whole year long. In fact, I got so overwhelmed now that I’m starting 2 separate projects. One using XNA and C#, other using PHP. I learned a lot about software development in the past year and I intend to use that knowledge.

zGui
zGui is going to be a lightweight GUI framework for XNA, with support for themes, and various other cool stuff I can’t really remember right now. I’m doing this by myself as a part of a larger project. The thing is that I have so many great ideas about games, but most of them are too time consuming and a bit too much for one person to handle. So I intend to patch up several frameworks for use in games. After I get it reasonably working I’m gonna release it and publish the code.

PuzzleCMS
Puzzle is just a work-in-progress name for what seems to be the most extensible and flexible CMS ever. It’s like having Adobe Dreamweaver directly aimed at your site with no need to upload files. We aren’t aiming at the level of user friendliness Adobe Dreamweaver has, our tool (as I see it) will be best for using with mostly static pages with the need to publish something every now and then. It was my good friend’s Danijel’s idea, him being a web designer and he knows what sort of stuff typical web designers want. You will have to know HTML and CSS if you want to achieve good results with our CMS.

The most important thing about both of these projects is that I took the planning phase very seriously. I started doing some graphs for PuzzleCMS in Microsoft Visio which I’m using for the first time, and I have to say that it’s very straight-forward, and has nice and useful templates. These graphs resemble Architecture or Data Design graphs you might find in a Software Design Document. Just helps me keep the big picture in mind. For zGui I started off by adding a class diagram item in my project. It feels just like programming but without that much typing going on! I don’t know how could I live without he class diagram all these years.

A word of advice: Never start programming something bigger than 5 days work without a class diagram.

Written by brainzizizi

07.15.2009 at 15:14

Posted in xna

Tagged with , , , , , , , ,