Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

About this blog

A Beginning Game Developer's Thoughts

Entries in this blog


WOA III - Postmortem

Army of the Undead Postmortem

How did you hear about the competition?
I originally read it in the lounge but some things with work were in play that wouldn't allow me to participate so I forgot about it. I lurk the journals every morning as part of my startup routine and that is when I saw a bunch of entries about the theme.

What made you want to participate after the theme of "Death is Useful" was announced?
After reading the journals I was flooded with ideas and after messaging a few friends, one (MusiboxDancer) talked me into participating and said she'll learn and do the art. After that I was sold as my biggest demotivation with my games is the art. They are always fun, but the art is horrible.

Tell us about your team??
My team consisted of me, who hadn't game programmed in over 3 years and Susan who has never created a game before. I took care of the programming end of things primarily and the sound effects, Susan handled the art and I helped where I can. Susan also made sure I still ate throughout the competition, she is a great friend.

What is "Army of the Undead" about?
Army of the Undead is basically a story about a a crazy war-bent general who has died and wants to continue his reign by taking over the underworld by amassing an undead army. Unfortunately the actual story boards never made it into the game.

What are the core mechanics of the game?
Under the hood there are several core mechanics at work (or attempting to work in the case of FOV - more later on that). The most useful for the player is the disappearing. This mode allows you to travel around the world undetected and allows you to initially attack. Furthermore, the ghost can use his fading abilities to pull enemies apart. This mechanic was working well but we broke it when we hacked the FOV fix. Other than that, the player needs to plan the levels moves, plan what each ghost is going to do, which ghosts he wants to take to the next level with him

What went well during development?
Having to not worry about the art because Susan was learning and handling it was phenomenal, it did great things for my spirit.
Programming wise, it was nice when I started using my XNA game engine again, that I hadn't touched in 3 years and the fact that it was still so easy to get things running was great.
I completely redesigned the way we manage the state in the game via a state machine, and it worked increadibly well and was a lot cleaner than my previous games.

What was the most difficult thing during development?
Other than the time constraint of the competition the most difficult thing for me was all of the Artificial Intelligence work. I have A* built into my engine which is great but this game required more. Specifically, we needed Field of View. On top of that we had a lot of weird bugs with the AI. We literally would go hours with it working properly and than boom it would all be wrong....very wrong again and we hadn't changed that logic.
For Susan I would say her computer issue's were the most difficult thing for her. Not only was she learning how to create computer graphics, she at one point completely locked up Inkskape and lost our whole tile set, and later on (in the last day) another lock up while trying to save our Tutorial pop ups made her loose most of them as well.

What went poorly during development?
My emotions haha, it was a completely roller coaster ride. I would be riding high, happy with what we had and than boom the AI was shattered, as were my dreams. This went on for days until I basically put a hack in so that we could at least have something playable.

What are some of the regrets you have about the version of the game that is your official competition submission?
Missing transitions. This is usually such a small, simple task that really gives the game a finished appeal. Unfortunately, how we manage the game state in Army of the Undead is a completely new design than I am used to and it worked fabulously until I went to throw the transitions in at the very end - which broke everything so we took them out.
Field of View. This was something completely new for me to develop and something we fought with for days, the end game has a hack in place to prevent wall tunneling but it unfortunately also destroyed field of view. There are plenty of areas where the mob can clearly see you, but does not attack.
Visual studio screwed up and built a release version without taking the #IF DEBUG directives into account, so the version in the competition actually has some things available to the end user that it shouldn't; such as level restarting (so much for permadeath as intended). Button mash, you'll find them. Furthermore, poorly on my part, I had a list of things to test before submitting and those things were specifically on my list, but due to the panic in the last few hours I completely forgot to test for debug code, we just tested raw functionality.

Final thoughts on the game?
I have mixed feelings about the game. In one hand, it is easily one of the nicest looking games I've ever built thanks to Susan. In the other hand, I am disappointed because I got stuck for 4 days on the path finding logic - which still doesn't work properly. In my mind, the game is no where close to what it was going to be, had we only gotten stuck for half that time even, it would be completely different. But hey, that's what happens in competitions.

That being said, writing this game reminded me of how much I love creating games. There will always be things that come up but you have to roll with the punches and deal with them.

The project was extremely ambitious and we knew this going in. We had 2 ideas, the first one was too boring and the story didn't make sense in my mind. The second idea was what we created but we knew it was full of things that I had no idea how to create, but we took it on.

Things that didn't make the cut
In case you are interested, here are some things that didn't make the cut into the final game.
Skill visual effects (variation of skill effects)
Map screen
Map progression
Option screen
Progression profiles
Minigame ghost collection at the end
Enemy directed FOV
High score
Player stances
2 wall passes, one for bottom and right sides being on a higher layer, left and top sides being on a lower layer...gives a true illusion of passing through the wall
AI Bounding box checks between player and ghost work....but in open spaces they do not as the boxes are axis aligned and not rotatable. Need pixel collision.
Full sprites (only death sprites made it in)
Hover text on mobs indicating stats and skills such as the corpse explosion
Unit squadron's

**EDIT** Preview mode keeps removing my underlines.




WOA III - Day 7 -Utter CHAOS

Day 7
Where to begin. I am only counting day 7 from when I woke up - not the 4 hours after midnight of day 6 before bed. We entered the day with a massive list of things to do....and some major bullets on the list such as these ( means completed);
[indent=1] All skills
[indent=1] Buttons
[indent=1] Drawn
[indent=1] Mapped
[indent=1] Balanced
Death animations
[indent=1] Menu background
[indent=1] Tutorial screen
[indent=1] Buttons
Finished game screen & State

This is a sub-list from the original list that we had identified for the most part in day 1.

This was the first time I was not screwed over by an artist (7 different ones). By screwed over I mean they were all gun ho about making games, we talked about some ideas, some we even went as far as a game design document and I started to code, but in the end they never produced a single piece of art.

The result - amazing. It has re-fueled a previously burning passion in me to make games. As for the game itself, we hadn't even had levels 2-4 drawn, let alone mapped as of late in the afternoon and we hadn't even taken a crack at balancing. At the end of the day though, we have 4 great levels, the game play is nice and difficult - albeit very buggy.

Personally, I have mixed emotions about the game but I am happy @MusicboxDancer convinced me to participate. We made a hard game which is exactly what we were going for.

Stay tuned for a postmortem.




WOA II - Day....who know's now.

The day's are blurring together....
I have been drowning in AI pathing problems that have crippled the game. Every night I feel like I have them solved and the game appears to work and then all of sudden everything that could go wrong with the pathing is. At the start of day 6, I thought we were going to be okay and get something playable - and then it all broke again.

It's not all bad news...
About 2 hours ago I think we FINALLY (I'm afraid to say it at this point) have it working properly. Since this time I have been slaying a massive amount of simple bugs which is making the whole game feel a lot better. We are still far behind schedule, and full of programmer art but we are actually making progress now.

First playable prototype is attached here, please report any bugs you find.

Some things to note;
-Controls are explained in the tutorial
-Skils are all over the place currently (mix of cool downs, damagae etc), no balancing has been taken
-At the end of the 2nd level, the game will crash as level 3 isn't there.
-The levels are test levels from the prototyping and are not meant to be filled or hard yet.
-The build is a debug build so you may see things that you will not in the end product

** EDIT** Removed the download as it doesn't work if you do not have XNA installed. I will be opting to use a ClickOnce installer for the actual release. Thanks for reporting the issue though




WOA III - Day 3&4

**Reposted from the thread**

[color=rgb(40,40,40)][font=helvetica] [background=rgb(250,251,252)]Day 3 was great, Day 4 was atrociously bad. I spent hours yesterday [/background] [/font][/color]trying[color=rgb(40,40,40)][font=helvetica][background=rgb(250,251,252)] to fix bugs in my AI around path finding, I am using a combination of field of view, free space tracking and A*. I say trying because I thought I finally had it all working well, several hours later while working on another feature I realized it was still completely broken.[/background] [/font][/color]

[color=rgb(40,40,40)][font=helvetica][background=rgb(250,251,252)]I did however implement a true combat system and not the hacked system I had before. Both the player and the mobs can take damage etc. I have a strange bug where the mobs can only attack once though, then their code to find targets in range fails to find anything....even though it is the same code used throughout and works in other places.[/background] [/font][/color]

[color=rgb(40,40,40)][font=helvetica][background=rgb(250,251,252)]I must say though, between the major bugs in the AI and now finding out someone else has basically created the same game...I am feeling discouraged. We are extremely extremely late on our schedule now and it's going to be a long weekend. As it stands right now, with the AI bugs, the game is unplayable so without solving them there is no point in developing other features.[/background] [/font][/color]

[color=rgb(40,40,40)][font=helvetica][background=rgb(250,251,252)]One piece of good news is that the artist has a first pass at the tile set and they look great![/background] [/font][/color]

[color=rgb(40,40,40)][font=helvetica][background=rgb(250,251,252)]Trying to stay positive and to some degree, move on.....rewind.[/background] [/font][/color]




WOA III - Day 2-3

Oh where to begin...the last 2 days have been complete madness but a huge amount of progress on the programming front has been completed.

Day 2
It was an interesting day but I am satisfied with the result, I was able to prototype the "fear" emotion and how to influence this. I need to further prototype this to see how fun it actually is going to be, if it isn't, I already have a backup plan that will be fun.

MusicboxDancer (artist) is picking up Inkscape at an incredible rate, she knows how to use that tool better than I do and she's only been making digital art for about 4 hours haha. That is great news for me though, I can focus on what I love and am good at; making fun games.

At the end of day 2, we are still behind I am afraid but the major mechanics are built so it is time to build onto them.
Here is a crappy screen shot that shows the progress at the end of Day 2 - brace your eyes!;

Day 3
Today was incredibly productive for me, the artist was out painting a real world painting in a class, I completed the following features;
-5 skills including invisibility
-Implemented an observer pattern so now there is simple communication between my mobs and the players units.
-Implemented visual cue's to the units you have selected (green ring under them).
-Fixed the major lerping bug so now movement is constrained properly.
-Implemented a map loader which generates walls with collision detection, as well as AI information.
-Implemented the ability for mobs to take damage from skills and when they die something useful happens.
-Implemented the ability for mobs to track you when you are not invisible, they will run to your last known location.
-Roughed out a quick level to explore some of the path finding issues
-Squadron selection is implemented but they cannot do anything except move around together currently. This needs more work though to induce unit spacing so they do not stack.

After today I feel like we are still behind based on my original schedule but I think we are over a lot of the difficult portions now. The next few days should be interesting and a real grind.

No screen shot today as most of the work was back end today. In the next journal I hope to have a video.




WOA III - Day 1

After a full day in the office trying to focus on my enterprise work when all I wanted to do was work on the game concept, I finally was able to leave for the day to start working on a game. Throughout the day I was jotting down ideas and mechanics in a design document as they came to me between build cycles at work. As soon as I got home I went to start prototyping....but found I had no tools installed. After a few hours I had all of the tools installed but ran into a problem where my XNA project couldn't load my XNA Content projects assets. Eventually this was figured out....a few hours later.

Prototype Early!
To my fellow game developers or even developers in general - Prototyping is extremely important to do up front. There is no point making levels, characters etc if your concept is boring and not fun to play. Thus, prototype the core gameplay rapidly so you are aware if you need to change upfront and you haven't lost a lot of time.

I wanted to fully prototype the 4 major gameplay aspects last night. Unfortunately, I got caught up trying to fix a bug in the first prototype for a few hours before realizing "Hey, this is a competition, this bug is minor, so what if the character lerps its distance, it still moves to the correct location!". After this realization, I moved on to prototype 2 of the remaining 3 major gameplay aspects which made me feel as if I accomplished something.

Unfortunately, I didn't get to the 4th and most critical gameplay aspect last night which will literally make or break the game and I do not even have a clue how to implement it currently.

Rough schedule and current status
Day 1
[s]-Get a core screen rendering with nothing on it[/s]
[s]-Prototype field of view[/s]
[s]-Prototype tracking[/s]
[s]-Prototype last know location with tracking[/s]
-Prototype emotion and influencing

Day 2
-Start building a level to feel out the mechanics
-Prototype selection and squadron building

Day 3-5
-Content; multiple levels, enemies etc
-Sound effect production
-Music production

Day 6
-Polish the turd
-Menu screens
-Cinematic screens

All in all, I am very excited about the competition, the goal is extremely ambitious and contains many things I have never done before so it is going to be difficult as well.




WOA - My Return!

My Return!

I'm not dead!
It's been a long time since I have written any games or even written here. I continue to lurk but I've been primarily focused with enterprise software development for the past few years. Also, I was burnt by an artist for the last time and lost the desire to continue on with game development after being screwed over by 7 artists over the years. I still have a burning passion for game development and I guess this may be the start of something new.

I had read about the Week of Awesome a month or so ago but completely forgot about it, about this morning while at working firing up the engine (brain) by surfing my usual sites; gamedev being one of them. I looked at the journals as I always do and was quickly reminded of the Week of Awesome competition and that I had thought about participating. After reading the journals I knew what the theme had been (quickly confirmed in the competition thread) and the idea's began to flow.

My inner voice kicked in....why? Why should I do this? I'll be happy with the gameplay but miserable about the graphics and audio. After announcing to some friends via BBM that there is a competition happening this week and I am excited but not sure about participating, one of my artistic friends stood up and she said "I can try to learn electronic art and help you". Those were the words of encouragement I had needed to hear.

All Systems Go!
Now with my brain exploding with ideas, concepts and mechanics I have to reel myself in to make it through a full productive day...of which I was just dropped a bomb of creating a design for something for a meeting in 2 hours....woot woot! Ah the corporate life.

As mentioned earlier, I will be working with an artist friend, she is creating an account name "MusicboxDancer". It will be the two of us and our team will work under "Great White North Productions".

I wish all the teams the best of luck, may the odds be ever in your favour.




Play Snake Rawr Rawr Free

Hello everyone, some of you may have noticed that I quietly released my game Snake Rawr Rawr back in November due to it being unfinished but contract work had come in that required me to put the game on the back burner. I decided to release the game the way it was as it was already a lot of fun albeit missing some critical features that I wanted in the game.

I am proud to announce that the game is officially complete and can be downloaded for free from my portfolio and more specifically the project page found here.

What is Snake Rawr Rawr?
Snake Rawr Rawr is the classic snake game that used to ship with Windows that I enjoyed playing growing up, with some of my own spins.

What's with the name?
Yes I am well aware snakes do not roar; so what? Well the title had to include snake in it as that is what the game is in it's bare essence but I knew I would be throwing some of my own twists on the gameplay, so I gave it a bit of my crazy flavour throwing Rawr Rawr in the name.

Short Gameplay Video:

Additional Information:
Along with the installer which can be found on my portfolio the source is also available which is written in XNA 4.0 with C# and utilizes my engine that I have built while writing games.

I hope you enjoy the game as much as I have and others that have played it and sent me their feed back.




Generic object translator

This is the long overdue followup article to this journal entry about my generic object translator. This new object translator is extremely simple to use and add to if necessary. It replaces the hacked together object translator of said previous journal entry.

New object translator;

/// Translates a specific value to the specified data type
/// type to translate to
/// string version of the data
/// Object translated to
public static object translate(Type translationType, string value) {
object translatedObjects = null;
if (translationType == typeof(string)) {
// strings need to be converted to char arrays for some reason
translatedObjects = value;
} else {
// This works for most types, it will look through its constructors etc to find the best suited to create the object
List parms = new List();
ConstructorInfo[] constructorInfos = translationType.GetConstructors();
bool foundMethod;
string[] componenets = value.Split(',');
if (constructorInfos != null && constructorInfos.Length > 1) {
MethodInfo[] constructionMethods = null;
ParameterInfo[] constructorParamInfos = null;
object[] constructorsParamTypeValues = null;
foreach (ConstructorInfo constructorInfo in constructorInfos) {
if (constructorInfo != null) {
constructorParamInfos = constructorInfo.GetParameters();
if (constructorParamInfos != null && constructorInfo.GetParameters().Length == componenets.Length) {// does this constructor match the amount of data we have
constructorsParamTypeValues = new object[componenets.Length];
for (int j = 0; j constructionMethods = constructorParamInfos[j].ParameterType.GetMethods();
foundMethod = false;
foreach (MethodInfo method in constructionMethods) {
if (method.Name == "Parse") {
foreach (ParameterInfo paramInfo in method.GetParameters()) {
if (paramInfo.ParameterType == typeof(string)) {
constructorsParamTypeValues[j] =
method.Invoke(paramInfo.ParameterType, new object[] { ScriptUtils.scrubStringParameter(componenets[j], translationType) });
foundMethod = true;
if (foundMethod) {
translatedObjects = constructorInfo.Invoke(constructorsParamTypeValues);
} else {
// no constructors present for this type so try to directly parse it
MethodInfo[] typesMethods = translationType.GetMethods();
foundMethod = false;
foreach (MethodInfo method in typesMethods) {
if (method.Name == "Parse") {
foreach (ParameterInfo paramInfo in method.GetParameters()) {
if (paramInfo.ParameterType == typeof(string)) {
translatedObjects =
method.Invoke(paramInfo.ParameterType, new object[] { ScriptUtils.scrubStringParameter(componenets[0], translationType) });
foundMethod = true;
if (foundMethod) {
return translatedObjects;

The way this object translator works is very simple. It looks up the constructors for the type you pass in and invokes them in turn to create the type. If the type does not have a constructor it will try to directly invoke the objects "Parse" method if one exists. If no object is created the method will return null in which case you are responsible for handling the null (I throw a custom exception on the caller which bubbles up to the users command prompt to inform them of the error).

Say you are placing objects in your game and you are trying to get them to fit perfectly. Well in the past you had to shut down the game, change the floar by 1, re-compile, replay and see that it is still not in the right spot. With this scripting integration (and generic object translator) you can change things on the fly and shut down once you got the values figured out and change them at that time. Personally when designing levels I have seen a drastic improvement in efficiency. Note that this scripting engine is not just for placement, I use it for figuring out sprite animation rates and all kinds of other details such as scales, rotations etc etc.

How to invoke this translator;
If we have 2 objects on our screen ship1 and ship2 (registered names in the scripting engine) and we wanted to move ship1 you would want to invoke the ships position property this;

// Scripting engine is case insensitive
ship1.Position = Vector2(10,400)

The ship would move from here;
***NOTE** I cannot upload images to my journal still so you have to visit the links sorry;

To here;

How does this command work?
The command tells the scripting engine to find an object named "ship1" in its registered objects list and find and invoke its Position property. The property invocation within the scripting engine in turn realizes we have an assignment operator in the command so we want the setter accessor of the property and not the getter. The setter property will look at its parameter types and pass Vector2 and "Vector2(10,400)" to the object translator. The object translator will look up the Vector2''s constructors and find one that matches and invoke it.

I hope this object translator helps you with your XNA development or even raw C# development. Again, I appologize for the long delay in this posting and I am still trying to figure out why I cannot post files in my journal to put a direct link up in my previous post.

As always, thank you for reading my journal.




Move on....rewind

[heading]Move on....rewind[/heading]
Lovely story of my development experience and getting completely stone walled.

After several years of professional development, I am finding there are certain things that are guaranteed in programming. Things such as motivational spikes, finding needles in haystacks, and just about every time; nothing works the first time you complete it(in reference to large modules not simple tasks).

That being said time and time again it is important to stay positive, and if it permits, move on. A prime example of this I ran into the last couple weeks. I just jumped to XNA from raw Direct X and I had the need to write a simple game to test out all my ported framework code. So I decided to write a TicTacToe game since I love it and it will use all of the aspects of my framework such as sprites, particles, etc etc and find any defects in said framework. And for the hell of it...and quite frankly I didn't think it was possible I thought I would implement the MiniMax algorithm. I mean, I thought I knew how to always win TicTacToe so I had to see for myself that this algorithm made it impossible for me to win.

So off I went into my usual style...white boarding, listing milestones and than hammering away at them. In roughly 8 hours I got a full game running with menu screens, a state machine, a persistent back ground, the board, easy and moderate difficulties, and all game logic implemented. Now the only thing left was the MiniMax algorithm and polish. I felt pretty good at this point, most of my framework code was solid and I found a couple nasty bugs or lack of functionality in my existing classes that had now been upgraded and all I really had left was simple polish and the algorithm. Off I went reading everything I could about this algorithm, simple MiniMax....complex implementations....alpha beta pruning etc etc, and watched a couple lectures on game trees.

Than came time to write it. Surprisingly I got the algorithm running based on all of the descriptions I have seen in a few hours. However, it didn't work properly. After 2 weeks (literally) of reading material, debugging my code and trying to rewrite the implementation I just couldn't figure out what the problem was. Than last night as my wife was going to the gym she asked why I was so grumpy and I said "I cannot figure this fucking algorithm out, everything I have read and watched matches what I am doing" and as her supportive self, she said "You will figure it out, you always do". Sure enough in my pessimistic state at this time I exclaimed "No I wont, there is nothing wrong with my implementation...I am not going to figure it out I am going to paste my code somewhere in a minute and get someone to tell me what is wrong and I wont learn shit all". So off she went to the gym and off I went spinning my wheels. Well after a few hours of this on yet another night I said you know what, I am going to go knock out some of the simple polish tasks and I will come back to this.

Here is the kicker. Over the years of my development career I know and recognize that it is important to get up and walk away sometimes. What I never really thought about was; move on, and come back. You know in your day to day work this really isn't an option, but as a personal project it is. So I said screw the algorithm, closed its classes and went to my mile stones of phase 2 and looked at what polishing tasks to tackle. After tackling a couple polishing tasks quite fast and making the game look a lot better I went back to the algorithm and thought I would give it a couple more rounds of debugging. Still pessimistic that I might not even have it implemented properly I bit the bullet and went through with it. To my surprise and shock I found a couple problems. One I have never run into before was using the == comparison operation on an Enum opposed to a Constant.equals(enum) comparison. Sure enough I saw in my debugging that even though I was saying turn == COMPUTERS_TURN this was only sometimes equating to true even when the turn was indeed the computers turn. So I thought wtf?!?!? I flipped it to a .equals and sure enough now the states were being determined correctly. But there was still a problem......I could still beat the algorithm. Just as a whim I thought you know what....I bet the test data I have setup (4 squares already populated) is the problem, I bet the algorithm from the start would NEVER let this scenario arise. So I removed the test data and sure enough the algorithm was running 100%....kicking my ass granted.

The important thing here is that if you are able to and are completely stuck on a task.....move on to something else to take your mind off of it and than come back. For me I usually just go for a quick walk or something and that usually does the trick but even for this, that was not working, but apparently moving on to something much simpler and mundane was enough to reset my brain just enough to want to and figure out the problem.

**EDIT** Forgot to mention when my wife got home I did say "You were right babe, I did figure it out" and got the told you response.
Thank you for reading my entry and I hope you enjoyed it and find it useful if you ever find yourself in a similar predicament.




XNA 4.0 Scripting

[size="3"][font="Calibri"][size="3"][font="Calibri"][heading]XNA 4.0 Scripting[/heading][/font]
[subheading]Objectives of this journal:[/subheading][/font][font="Calibri"][size="3"]
[/font][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][font="Calibri"][size="3"][/font][/font][/font][/font]-Give you a starting point for command based scripting for your XNA game.
[/font][font="Calibri"][size="3"]-Receive feedback on the whole thing and especially alternatives to my ObjectTranslator, because it is extremely sloppy and I do not like it. It feels like a complete hack.[/font][/font][/font][font="Calibri"][size="3"]

[/font][font="Calibri"][size="3"][font="Calibri"][size="3"][/font]-I am in no way claiming this is the best way to do any of this, matter of fact I am positive the way my ObjectTranslator works is garbage, I encourage you to download the example solution and provide your feedback. I am simply stating it is possible and providing a rough example.
[/font][font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]This is a quick and dirty starting point written in a couple hours; its purpose is to give you a starting point that you can either take and write your own or build on to.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]This is a very BASIC implementation, meaning it is very limited such as it does not handle chained together method calls etc. I needed something with the ability to move elements around at runtime for design purposes and that is what this achieves. [/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]You can download a sample solution at the end of the article to see it in action.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]The sample you have to manually close the scripting window because I did not look into tying the rest of the tear down method to timeout the Console.ReadLine().[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]There is also a video included to show it in action[/font]
[font="Calibri"][size="3"][/font] [subheading]Back history:[/subheading][/font]
[font="Calibri"][size="3"][font="Calibri"][size="3"][/font]A couple months ago I was just starting to fall into the rabbit hole in which they call scripting. Then I made the change to the XNA framework, and to my great disappointment after hours upon hours of searching, there was no scripting solution available for XNA. Even more so to my disappointment everyone was stating it was not possible, nor feasible sense you have to redeploy to the Xbox anytime you make a change anyway. This is true. Let me reiterate this thought, you CANNOT use this on your Xbox, however no one (that I could find) was talking about using scripting and more specifically command based scripting to make designing your game easier and faster. By this I mean the ability to access and alter objects on the fly so that you can quickly position them etc without having to stop, change, compile, and run all over again.[/font]

[subheading]Quick, what is command based scripting:[/subheading][/font]
[font="Calibri"][size="3"][font="Calibri"][size="3"][/font]Command based scripting is essentially what it sounds like. You type in a command and it is parsed and executed. Basically it runs beside your main application (or inside it if you write it to be so) and it has access to methods and data within the program and is able to manipulates it. [/font]
[/font][font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Have a system of receiving input running either externally or internally, in its own thread.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Take the commands input to said system and send them to a parser.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]The parser determines if we are running a high level command such as getValue or help or a command against a registered object.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]If the command is high level, it simply executes[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]If the command is against a registered object, we first have to find our registered object via the reference name specified on creation.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Once we find the object, we pass the registered object the input and it is parsed again to determine if it is a method or property.[/font][size="3"] [font="Calibri"][size="3"][font="Arial"]-[/font]Then it is further parsed to determine if parameters were specified such as: test.Position = Vector2(10,10)[/font][font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Once a command and its parameters (if any) are found, the command is executed.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Now you need to design error handling so that if you put in an invalid command it will not crash your game (defeats the purpose of on the fly changes) and it will provide useful feedback as to WHY the command was invalid.[/font]
[font="Calibri"][size="3"]-[/font][font="Calibri"][size="3"]Now that you have your scripting system in place, just wrap everything about scripting in like the below example to ensure it only runs on WINDOWS and in DEBUG mode;[/font][font="Calibri"][size="3"]
protected override void LoadContent() {

// Create a new SpriteBatch, which can be used to draw textures.

spriteBatch = new SpriteBatch(GraphicsDevice);

this.spriteFont = Content.Load("SpriteFont1");

this.text = new Test("Foo bar", new Vector2(100f,100f));



// register objects

ScriptManager.getInstance().registerObject(this.text, "text");

Thread consoleInputThread =

new Thread(new ThreadStart(listenForInput));


this.running = true;






private void listenForInput() {

string input;

do {


input = Console.ReadLine();


} while (running);




[size="3"][font="Calibri"][subheading]Programmers speak:[/subheading][/font]
[font="Calibri"][size="3"][font="Calibri"][size="3"][/font]The way I achieved all of the above technique is with some basic string manipulation and via the magic of Reflection (System.Reflection).[/font]
[font="Calibri"][size="3"] [subheading]Video:[/subheading][/font]

[subheading]Example program download (Written in Visual Studio Express 2010 with Game Studio 4):[/subheading][/font]
Due to permission problems I am unable to attach a rar/zip file to the blog entry so unfortunately I have to use RapdiShare\MediaFire to host the solution for now until I can get in touch with admins to get this resolved.

Thank you for reading my blog entry on XNA 4.0 Scripting and I hope you found it interesting, helpful and most importantly; understandable.
Thanks, XXChester

**EDIT** Fixed the link and changed to mediafire because not only did my link become broken, rapdishare actually deleted my file as well. I am still working with admins to figure out why I cannot just attach the source here to avoid the third party software. Also please note that I deleted the old .rar I had saved off my desktop so this one is a bit different because it has some enhancements (such as automatic closing of the window on destruction) and the start of some rework(should all be commented out). This example should however still work. I also embedded the YouTube video.

Thanks again.





Step by Step server and Source control setup

So on the weekend my servers HD failed and I had to go through the joys of resetting up a SVN server and what not. As I was going through this again I was thinking; "You know I really need to write a doc this time on how to do it so it is really easy if I ever have to set one up again". Everytime I have set a server up the same couple of things get me everytime and it takes awhile to figure them out.

Setting up a subversion server;


[font=Calibri]-[/font] I have only done this on Windows XP 32 and 64 bit, but it should be similar for Vista/Windows7.

[font=Calibri]-[/font] If you are having trouble connecting to the server from either RDP or via your CVS Client, make sure the default Windows Firewall is turned off or the port is forwarded.

[font=Calibri]-[/font] To shut down your server via RDP open the Task Manager->Shut Down->Turn Off. This way you should never have to have a monitor hooked up to your server unless there is a major problem and you cannot connect to it.

1. Navigate to (http://subversion.ap...es.html#windows)

2. Download and Install Win32Svn

3. Right click My Computer->Properties->Advanced->Environment Variables->Add system variable


b. VALUE: C:\Windows\Notepad.exe

4. Click Start->Run

5. Type "cmd" and hit enter

6. Type the following command to create the repository "svnadmin create d:\Repository" (You can change the d:\Repository" to wherever you want yours to be

7. Create a .bat file on your desktop called "Server Start". Edit this batch file and put the following command in it; "svnserve -d -r d:\Repository"

8. Now it is time to set up users. Navigate to your repository (d:\Repository\conf)

9. Edit svnserve.conf

10. Scroll to [General] and remove the pound and space from # anon-access read and # auth-access = write

11. Add the following line under the auth-access;

a. password-db = passwd

12. If the "passwd" file does not exist in the conf directory, create it.

13. Edit this file

14. Enter the following to this file;

a. [users]

b. Hit enter

c. Now enter in users you want to have write access to this repository. Here is an example "Brandon=monkey"

15. Open the "authz" folder in the configuration directory. Scroll to the bottom of the file and add the following data;

a. Type(with the brackets): [repository]

b. Hit enter

c. Type: $authenticated = rw

16. Click Start->Settings->Control Panel->Scheduled Tasks->Add New Task

17. Point the new task to run that "Server Start.bat" file we created earlier and under "Perform this task;" set it to "When I log on" this way when your server starts and you log in, it will automatically start the repository

18. Right click My Computer->Properties->Remote

19. Check the "Allow users to connect remotely to this computer"

a. You MUST have a password on your user account for this to work

b. Click "Select Remote Users" and select the user accounts you want to be able to RDP to the server

20. Restart your computer to make sure everything takes effect

Configuring your client computers to use the server;

To setup remote connecting to the server

1) Using your RDP(Remote Desktop Protocol) client of choice (RoyalTS or Windows built in Remote Desktop Client) open it up

2) Set the address/host to your servers name or IP address

3) Hit connect and enter your username/password of the servers account

4) If everything was setup properly you will connect to your server

5) Close down the RDP window as you now know you can connect to it remotely

6) Download and install Tortoise SVN or your CVS client of choice

7) Right click in a directory and click "Repository Browser"

8) Enter the below into the URL replacing my servers name (xxcheste-23eada) with either your servers IP address or computer name

a. svn://xxcheste-23eada

That should be it, you should be able to check out and commit work now. Enjoy the flexibility of versioning now.

This article was written by Brandon McCulligh based off the information compiled off the Internet and makes strong reference to the article below;


Use the above link for troubleshooting information

I hope this helps some people out.
Thank you for reading and best of luck in your future endeavours.




Great Couple of days

So I have had a great couple of days lately. Last week I finished my latest game using the Irrlicht graphics engine which just proved that I am at the point now where I am able to fairly easily jump to different graphics engines to make games. On the weekend I took my first stab at writing an A* Implementation based on the details of how it should work outlined in this article (http://www.policyalmanac.org/games/aStarTutorial.htm). After a couple of hours I had a rough implementation done and took the next couple to write a generated C# Form that had a bunch of panels on it (essentially a maze creator) to test the ability to find paths. This little front end application identified a couple minor bugs with my implementation and after a couple hours of going back through that article, refusing to look up any code because I wanted the challenge, and debugging like a mad man; I had a fully functional 4 directional movement A* implementation and a slightly buggy 8 direction movement implementation(Going to fix this tonight). Needless to say as minor as this is I was extremely happy and proud but of course it wasn't enough. I wanted to take it to the next step and I came to a very important realization here. I could take hours (30 or whatever) to write a PAC-man clone which essentially 90% of the time would be just doing what I already know how to do (drawing) or I could take a couple to write a very simple on the fly AI demo which would be building upon my newly found knowledge of path finding. Needless to say I took the second option. In 2.5hours (which 2 of that was drawing sprites to the screen and movement controlled by the keyboard) I had a fully working on the fly demo that you start in the middle of the screen and 4 enemies in the 4 corners chase you around. Not necessarily as fun as a full game, but a simple demo that just about only used new skills (A* library I wrote). I was shocked at how easy the A* library I wrote was able to be used to dynamically generate paths on the fly and sub second performance(granted my scene was simple). So that was my Saturday and wee AM's of Sunday essentially, and it made for a great weekend.

Now today (Monday, yes I know there is a day in there somewhere but it was my Son's birthday so I had no time to program), my promotion was announced publicly which needs no explanation as to why that is great. Also to put the icing on the cake, Microsoft announced a public SDK is in the works for the Kinnect. A short back history is needed here. I have been just waiting to make the jump to a console or mobile platform and I said when I bought my Kinnect that "this is the future, and if Microsoft releases a public SDK than this will be my jump of choice". Yes I know that the day after the Kinnect was released, it was hacked and usable by third party; but the reality is that anything you create with a hacked driver could never be released publicly (yes I am aware the SDK's initial releases are for non-commercial use). Needless to say it is time to start learning XNA which should be relatively easy coming from raw DirectX.

That is the conclusion to my great couple of days thus far, I hope you enjoyed reading my ramblings and thank you.
Tell me, what are your thoughts about the X-Box Kinnect?




My Development Experiences Thus Far

This is just an entry of some things every beginning developer should know and things that I have run into and learned from my development, beginner to beginner.

Greatest Programming Experiences;
-Learning to start small. My first project(finished) was a Tic-Tac-Toe game....small right? It should have been, but by the end it had single player, 2 player and a full networked multiplayer version. The problem with this is, I did not know anything when I brought the original 2 player version over form a console (DOS not X-Box, etc) version. So this project took over 6months to complete (not working on it everyday but it took a long time).
-Don't jump right into 3D. For me, my latest math class was Grade 11 Functions, so when I tried to write my first game; a FPS (see point one as well) it took me weeks of working on it all day to just get a few models on the screen correctly and than trying to program camera controls, without the math...eeek. Needless to say I was very discouraged and stopped all game related development for months. After a long time I came back and realized the downfalls. 1)I started too big. 2)I did not know anything other than how to PLAY a FPS and 3)I really needed to learn a lot before I could do this. As much as (I thought) I didn't like 2D, I jumped to it. Now I can write a fairly simple 2D game in a couple of weeks and it feels great to finish projects and see things come together.
-People always say do not write engines, write games. To an extent I fully agree, but personally for me jumping right onto an Engine, I didn't feel like I was learning anything. I than started to write my own engine (if you could call it that). Let me clarify though, my engine was not really for other people to use or even me if I was going commercial, it was to learn the different building blocks of an engine, how they work, what even defines an engine. Doing this, I learnt a huge amount about game development and now feel like I could use someone's engine and actually have a rough idea of what is going on.
-Have a plan. I used to just jump right into games but the problem was that I could (kindof?)get a game done but there was a lot of frustration about where I was going with things, and it was very easy to loose motivation because I had no proof of what was done. Now every project has a GameNote.txt file. In that note it has my milestones and intentions of the project. An example can be seen below.

Game Note Example:
[]White boarding - this step is where I brainstorm all of objects required (of course I never get ALL of them but most) and roughly their member variables and support methods they will have (all in psuedo code, not actually writing implementations for methods).
[]Modeling the objects - This is where I actually create files and the basic model's outlines (variables they will need, support methods).
[]Render main menu -I always like to get the main menu up and running right away, so you initially have something done and working
[]Implement the game states -This is handling the transition from menus and what not
[]Render the main play area -Whether this is a Tic-Tac-Toe board or chess it doesn't matter its all the same.
[]Write game play -this is usually broken into several steps depending on the size of the game (such as catch keyboard input, keyboard input, placement algorithms, etc)
[]Render the HUD

A note about this simple template is that you can add in as many steps as you want and break down all the tasks however you want, but the purpose is to have a road map but also if you start to feel unmotivated, you can look at this and say "Wow, I already have this, this, and this done". For me this model for writing games is working very well. Keep in mind I only write little games at this time as I am still a beginner.

I am like just about every other developer, we do not like to plan, we like to just jump right in. But the truth is, that if you take the time to push through as much planning as you can up front, your overall development will be a lot faster and you will have a cleaner implementation.



Sign in to follow this  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!