Tuesday, October 23, 2012

Here is another update on the level editor I'm making. I had some struggles with the WinForms and XNA combination, because I couldn't use the Content Pipeline the way I was used to.

When you ran the program, it build all the assets with MSBuild in a temporary directory and removed those when you closed the program. This did allow me to use the assets, but the loading time became higher and higher if I added more assets. 

Changing the build directory

I figured, if I changed the build directory of the ContentBuilder-class (the one that handles the MSBuild-stuff), which I used from the WinForms example, it would build the files to a directory that wouldn't be deleted and was easy to find back. This gave me a folder of .XNB's which I could load directly using Content.Load<>(). Much faster!

But it was still rebuilding the files over and over. After some thorough investigation I noticed that the .XNB's get removed from the build-directory as part of the MSBuild-process. There wasn't a way to stop MSBuild from removing the files that already exist. So I still had long loading times. 

Moving the files

After some fiddling and thinking I came up with the idea to move the .XNB's to another folder just after the buildprocess. It worked! And it was one of the first times I've used recursion for something useful! (looping through the directories and finding the files that need to be moved.)

Keeping it up to date

The next problem was keeping the files up to date. If I change a file, I want it to be built to an .XNB for immediate use. I made a Console-app which updates every three seconds to see if files are changed. It uses an XML-file that saves the assets with information such as the path to the file, the type of the file (model, texture, shader), the last update time and the last build time. If the build time is earlier than the last update time, the file needs to be rebuilt and it will do just that.

The Clockwork Asset Builder is a Console-app that runs in the background with a little log that shows errors and which files get rebuilt. The "removing build-folder" is the removal of the temporary folder which gets cleared by MSBuild anyway. 

This program will be used in the background during the use of the level editor. I will build in functionality to make it automatically reimport adjusted assets, so you can see the changes immediatly!
You can check the code on GitHub if you're curious how it works. If you have any suggestions, let me know!

Monday, October 22, 2012

Instead of making an entire site to show some videos about projects I've done so far, I will post it here. Much more user-friendly and compact!

Most of my work was made at the USAT, during my two years of enrollment. That's where I picked up programming (so that means I've started programming two years ago!), by making a Flash game. Which I unfortunately lost due to a human error on my FTP server. If anyone reads this: MAKE BACKUPS and not on the same server as the site itself. Pressing delete from your root folder is almost never a great idea.

Anyway, back to the projects. I will show you the top 5 of the games I made that I like the most.
I've done the most of the programming of these projects. In some situations there was another programmer 

1. Fins of Liberty

Deadline: December 21st, 2011
I like this game the most humor-wise, but not code-wise. I had a lot of trouble to get the movement of the fish to work properly and the collision was a pain as well. When you were swimming, you could swim into a corner and break the collision. Which happened very often.
The audio consisted of three layers. The volume per layer depended on a factor in-game. For instance the drum-layer depended on the distance between the waiter and the fish. 
The game was made in Unity by the way.
The movement of the waiter was done by another programmer, which started as an ambitious path-finding project but became a waypoint-to-waypoint system. 

2. Garuda (Global Game Jam 2012 entry)

Deadline: January 27th, 2012
Garuda was a GGJ-entry of which the theme was Ouroboros. After a brainstorm that took way too much time we decided to make a game where the goal is to die and reincarnate as many times as possible. You can do that by flying in the trail the other player leaves behind when hunting for your trail. This game was made in Unity and the idea was to make it a LAN-game, but due to a lack of knowledge and time at that moment, we decided to make it 2-player splitscreen. We had problems with the movement at first, because we included the Z-axis rotation, which became incredibly confusing and annoying. We looked at Diddy Kong Racing and used the flying movement that they had.
I didn't do all of the coding in this project, but I've worked on the movement, the collision trail, the GUI. Basicly everything that's left to do when using Unity.

3. Tiny Knights

Deadline: May 11th, 2012
Tiny Knights was my first game made in XNA. This was also my introduction to shaders. I made a little directional light-system, made a GUI-system and made some basic gameplay. The game is based on plants vs. zombies, only simpler. The goal of this version of the game is to repel the enemy attackers until you have enough cash to be practically invincible. This is because I didn't have enough time to make a better AI and a destructible castle for the enemy.
This is one of my cleaner coded projects, because XNA forces you to work in a more Object Oriented way and Unity just lets you drop scripts on objects. I still have the code and the executable for this project, to be found here; http://www.2shared.com/file/Cz6_tHAu/Tiny_Knights.html

4. C-Pew-Pew (Asteroids clone)

Deadline: June 14th, 2012
In a mission to learn C++, I made a game in SFML (SDL, only easier to use in my opinion). It's an easy game made in a short amount of time. You simple shoot asteroids, they disappear, new asteroids spawn and you shoot those as well. I didn't have enough time to implement the splitting of asteroids, but that's perhaps something for the next game.
Download of the code (you will need SFML and VS2012 to run it, but the .cpp's are readable);

5. Clockwork Age

Deadline: None, just started this two weeks ago.
Clockwork Age is a steam-punk RPG that I am making with a friend of mine, Luc van de Mortel. I will make a level editor (as seen in this picture and on many posts on this blog) and a third-person-like gameplay. I can't give any details, because there aren't any yet. This project is made to expand our portfolio and make something awesome. We will make as much as possible before we start our study in September 2013. 
I use Git and GitHub to keep track of my code and to show people the code I make.

And the rest?

The rest of my work includes lost projects(like my first Flash-game), barely working experimental games involving an installation, mostly made to create an experience more than a game. I also make websites, but I don't really find that relevant enough for a Game Programmer portfolio. I also want this to be a short overview of things that I want to show. If I finish other projects, I will make a new portfolio-post with a link to this one as well.

Saturday, October 20, 2012

I finally got the camera controls to work properly. The orbiting, panning, zooming, scrolling and keyboard-movement now work the way I planned. All the movement is done in the CameraMan-class, a member of the Camera-class.

The problem was that I couldn't get orbiting around an object to work without messing up rotations. After a lot of googling I found a useful way to accomplish this. The idea of setting the position to a transformed Vector3.Backward and scaling it by the distance of the actual position and the target works like a charm.

I begin the orbiting by determining the amount the camera should rotate. I use the relative mouse position and divide that by 500. I add those numbers to a Rotation-vector3 saved in the Camera-class. When that is done, I use Matrix.CreateFromYawPitchRoll with my Rotation-vector3 to get my Rotation-matrix, which is also saved in the Camera class.

After that I create a float called 'dist' which is the distance from the actual camera position to the target.
Then I transform the position with Vector3.Transform(Vector3.Backward, Camera.rotationMatrix);
I am using Backward to easily reposition my Camera. After the transform, I scale the position by the 'dist' and voila. I have a rotated camera. It only assumes the cameraTarget is 0,0,0 at the moment. So just add the cameraTarget-vector to the camera's position.

The rotation matrix will be updated whenever the camera is rotated, so you will always have a good rotation matrix for transforming the up-vector and the right-vector. This makes panning the camera very easy. It's nothing more than Camera.Up = Vector3.Transform( Vector3.Up, Camera.rotationMatrix );

Now that this is settled, I will work on the caching/storing of the assets built by the XNA pipeline and Picking/Selecting objects.

The answer on this question helped me to fix this situation; http://gamedev.stackexchange.com/questions/25448/orbiting-a-specific-point-orbiting-camera

Friday, October 19, 2012

Clockwork Age is a project I am doing with a friend of mine, as preparation for the study we want to do at the NHTV in the Netherlands. I am aiming for the Game Programming-direction and Luc is aiming for the 3D visual art. We both stopped our study at the Utrecht School of Arts & Technology, because we both disliked the way the school treats its students, we both wanted to specialize something. We chose to do this after completing two full years at the USAT.

Clockwork Age

Clockwork Age is going to be a third person RPG-like game in an era called the Clockwork Age. This era is  a Steampunk-inspired environment in a post-medieval setting. The world will include at least one small village, a big city, lots of terrain and the room to add more. 
We do not aim to complete this project, we only aim to get as far as we can and learning as much as possible during this project.
I will work on the tools we will use to do so, including a level editor (with a terrain editor), an asset-builder, for combining assets like models, textures and effects into a usable asset in the editor and the game.
I will also focus on building the game itself. The character movement, the physics, the particles, the shaders and everything necessary to make something awesome. I am currently using XNA to achieve this.

This is what I have so far:

It is a Windows Forms-application running an XNA View. Clicking the assets on the left will currently import  it to position 0,0,0.
You can save the scene and you can load other scenes. The scene-files are simple text-files with a reference to an asset in the asset list, a position, rotation and scale. The rotation and scale are currently not implemented, but will be in the near future. 

Upon starting the Editor, the Asset List will build. It will gather all resources from a .assets-file and add them to the content pipeline. This is quite inefficient, due to rebuilding every asset at every run and I am going to fix that. The problem is that I do not have access to the Content Pipeline as easily as in an XNA Game-application. It will not save references and all .xnb files are saved in a temporary location until the application closes.

I will try to fix this, right after I fix the camera-controls. 
I am having problems with them, because I can't decide whether I want to use a direction  relative to the -position as a camera-target or an actual target.
Using an actual target makes it easy to orbit around, but makes movement a bit harder. Using a direction makes it hard to orbit around, because the direction should be normalized and orbiting around a Vector that is 1 unit away from you isn't really useful.

More will follow soon!
Yay, my first post on my very first devblog!

First of all, let me introduce myself. I am Eric Polman, a student of at the moment of writing 19 years old. I live in the Netherlands in a small town called Eemnes. My interests lie in computers, games, game design, game programming, web development, web design, 3D art, listening to music and partying. That's practically everything I do, apart from my basic needs.

I will use this blog to keep readers up to date about my current projects including Clockwork Age (a project I'm doing with a friend of mine to prepare for our study next year), Web Development (I make sites.), Coursera classes (free education!) and more.
I will also posts things I find interesting, lovely, helpful and also things I dislike.

Subscribe to RSS Feed Follow me on Twitter!