Jump to content

  • Log In with Google      Sign In   
  • Create Account

Aurioch's Time Machine

Back to the (my) past.

Posted by , 29 June 2013 - - - - - - · 1,069 views

I've been working a little on my old laptop. After digging through My Documents in search for some old documents, I've noticed VS2010 folder in it. With my curiosity suddenly awakened, I suddenly found myself staring at the content of the Projects folder.

Reason: some of my old projects were there. Most of them were games. A collection of 1s and 0s, silently waiting for their creator to come back for them. And he came.

After copying all the projects to the PC I work on, I loaded each solution and, after performing some maintenance like retargeting compiler to compile using .NET 3.0, ran debugger for each of them.
And felt like I was back there, looking at younger me sitting in front of PC I had at that time and trying to cope up with a solution to the problem.

So, here there are, the "games" I made before. Please join me in the travel to the past.
Note: I'll post code of each project. Because it's going to be huge, I'll put it in spoilers so that you can skip it if you're not interested.

Year 2006: Duck Shooting

Posted Image

First game I ever made, using Visual Basic (.NET Framework 2.0) with XNA 3.1. I have no idea how long it took me to make it. Gameplay is simple: shoot ducks and dog using the mouse to score points. Blue ducks are the slowest and give least amount of points; green are in the middle and brown are fastest. Dog jumps at random times and gives the most points.

Maybe you, dear reader, recognize the ducks and dog. Yeah, they're from Duck Hunt. And yeah, I hated that dog so much I created a way to get my revenge on him for mocking me each time I missed those damned duck(s). However, game is satisfying to play for maximum 60 seconds.

As for the code... when I look it now, it is atrocious. However, when I calmed myself I realized that... I didn't know better at that time. That was my best. For those who love statistics and code analysis, here's the data Code Metrics gave:
  • Maintanability Index: 59
  • Cyclomatic Complexity: 52
  • Depth of Inheritance: 2
  • Class Coupling: 32
  • Lines of Code: 243
Code for itself is rather easy to follow. However, I violated so many principles that it might be a bit painful to read.

XNAGame class:

DuckGame module:

DefineTextures module:

AnimatedTexture module:

HitDetection module:

Year 2009 (I think): Battle Tanks v0

Posted Image

Wrote with C# (.NET 3.5) and XNA 3.1. This was my first try of making "player" move the objects using keyboard.
This was also the project I learned why many of the modern games (League of Legends, for example) avoid using slick rotations of models unless needed.

Project isn't particulary impressive. Just a box with a barrel moving around and rotating. With one interesting bug I didn't fix: pressing Space during rotation makes bullet stuck at that angle.

Code is actually quite simple:

I could say that the project is abandoned, but I won't; I used this project as a base for the one later.

Year 2010: Nine Men's Morris

Posted Image

Back to the mouse based games. This one is once again written with C# (.NET 3.5) with XNA 3.1. I believe you can recognize the game, but in case you don't know, I'll explain:

Two players, each has 9 pieces. Game is split into 2 phases.
In phase 1, players alternately place their tokens on the board, trying to fill a row or column - make a "mill". After all 18 tokens are placed, each player can take away one of the opponents tokens from the board for each mill that player made. Tokens from mills cannot be taken out.
In phase 2, each turn players can move one token to the adjacent cell. Goal is to take out all opponent tokens by making mills. Once player remains with only 3 tokens, he isn't restricted to the adjacent cells of each token and can "jump" over the whole board.

Sadly, I never wrote a game beyond Phase 1. I might finish it one day... *looks at code* Screw it, if I ever decide to finish it I'll rather remake it from scratch:

I wasn't that young anymore. I just finished high school and entered faculty (college, if you like). I learned QBasic, (Turbo) Pascal, Visual Basic and C# until that point and I was comfortable with Trigger Editor in WarCraft 3 World Editor. So, I have full right to ask this: "WHAT THE HELL WAS I THINKING!!!"

Year 2011: Arkanoid (more like "Half Pong")

Posted Image

This one is also uncomplete. Written with C# (.NET 4.0) and XNA 4.0, I managed to get the basics (paddle moving and ball bouncing) before giving up for some reason. I think the reason was making the collision detection work the way I imagined it. While many people finished it (most recent example being superman3275), I decided to skip it... for now.

Code is actually quite clean, however I think I made it more complicated than I should:

Year 2012: Battle Tanks

BattleCity Alpha2

This one should actually be familiar if you remember anything from my older journal entries. I won't ramble too much about it; based on "Box with barrel", it's actually the 2nd sensible thing I made after a huge gap and a huge step up. I slowly started to do actual object-oriented programming. I've wrote more about it in my earlier entries.

For anyone interested in code:

Game1 class:

Player class:

Tank class:

Year 2013: Battle City

Posted Image

Upgrade of Battle Tanks. I'm still working on it - on both code and art. I won't ramble much about it here, and just add: powerups are added.

Now, take the picture above and compare it with this:
Posted Image

However, the biggest step is not the art - it's the code. Up to the Battle Tanks, I used strictly arrays and simple structures/classes and used only main class (the one automatically created with project), with a lot of copy/pasting, bad code etc. Now, with Battle City, I finally stepped - at least with one leg - into "true" object oriented programming. Skills I learned here helped me to deal with other tasks faster and easier. For example, laboratory tasks (like writing Finite State Machine) took no longer than 20 minutes of writing and debugging.

Battle City is nowhere near completition, but here are code metrics for current state:
  • Maintanability Index: 78
  • Cyclomatic Complexity: 873
  • Depth of Inheritance: 3
  • Class Coupling: 85
  • Lines of Code: 2025
If you wish to try it, head to my last entry and grab the attachement. That version doesn't have powerups but is still playable; I'd appreciate a feedback. I hope I'll be able to provide better version soon enough.

I hope this little trip to the past was at least a little interesting. If nothing, I'll have this journal preserving my memories and as a reminder how I was before as a programmer.

Thanks for reading and, I hope, see you in next entry.

Battle City - Battlefield is opened

Posted by , in Battle City development 27 June 2013 - - - - - - · 1,039 views


I took a break from exams in order to work on the game. For now, I managed to pass Databases exam and Intro to Computer Science exam so I'm a little tired from studying.

Battle City revamped graphics

This time, there are no any big updates on the progress, except for graphical revamp (which is still in progress). Instead, I'd like to share a current version of the game. I'd like to hear your feedback of any kind about the game. Part of this is for selfish reasons - I'm starting to get bored of it due to (somewhat) long production (burnout?); however I don't want to start a new project because I'll never finish this one. Another problem is that I don't know what I'll do with it once I finish it, other than add it to my portfolio. Apart from these concerns, I still enjoy making it.
Any suggestions, comments etc. are appreciated.

Grab the game:
Attached File  Battle City.zip (1.61MB)
downloads: 51
and just extract and run.
Game requires .NET Framework 4.0 installed on the machine to run!

Controls: Up, Down, Left, Right, Enter (Shoot).

For now, I disabled 2 player mode and Options screen. Options screen is incomplete and 2 player mode has too many bugs I need to fix. For example, AI once took control over my tank and suicided it!!! I couldn't believe my eyes.

To change settings, open config.txt file. Parameters are easily recognizable; however, I didn't code in any protective mechanisms so if game suddenly starts crashing, check config file.

Currently known bugs:
  • 2 enemy tanks get stuck in small passages.
  • Sometimes enemy tanks go between two closest tiles.
  • Sometimes enemy tanks can fire a stream of bullets.
  • Brick wall destructions is sometimes too big or too small.
  • On widescreen resolution, mouse cursor and level editor cursor are displaced.
Other than that, alpha is perfectly playable.
One little note - in current state, game has 1897 lines of code (calculated with Visual Studio's code analysis), which also officialy makes it the biggest program I ever wrote.

Thanks for reading.

Learning to draw, pixel by pixel

Posted by , in Battle City development 13 June 2013 - - - - - - · 937 views


Some time has passed from last update. Semester end is coming close and with it summer vacation, valuable time for learning anything programming-related and... Exams. Lots of exams. Oh how I don't want to study from faculty materials, I'd rather invest time on working on projects or study from real life examples where I can learn much faster and more efficient. Sadly, math and physics aren't courses which I can learn that way. At least I had good math professor and managed to pick up most from him; physics was bad so I need to learn by myself.

As far as development goes, AI is in satisfying condition so I left it for now in current state. Most problems have been fixed, there are some issues here and there, but it's playable. With that out of the way, I've turned to the next tasks:
  • Options screen - mostly complete; pure text, serves purpose
  • Powerup system
  • Graphical update
I finally came to the powerups. This is where I can become creative and make major distinction between my clone and the original game. Apart from some powerups which are standard and thus picked up from the original, I can create some of my own as long as I know how to implement it. In preparation for implementation, I have to modify existing code in order to provide better interaction between objects. Hopefully, experience will be satisfying.
There will be two major differences in powerup system between original and clone. One, powerups will be delivered "from the air" instead of appearing after destruction of certain enemy. Two, powerups won't disappear after lying for some time without collecting - after some time from appearance of an powerup, enemy tanks will be able to pick it up as well. Because of that, some powerups will have to have different effects depending on who picks it up. I can't wait to see how will this end up.

Here's a list of the 12 powerups I plan to implement for start.
Powerup list

Now, back to the title. In order to get better assets, I've started to practice artistic skills. Because of its (relative) simplicity, I started with pixel art. Result can be seen on the picture above (I hope - resizing small sprite often brings catastrophe), with powerup icons, new brick wall and new tank. Any feedback would be appreciated.
By using pixel art and vivid colors, I plan to give the game a retro feel suited to the NES and Sega Genesis/Megadrive games.

Special shoutout and thanks to riuthamus for spending his own valuable time in order to help me with art - new tank is mostly his work, I just finished shading it. Without him, I would still be stuck with art skill on absolute zero; thanks to his help, I can produce something at least decent and continue learning from that. It's much harder than coding... time to make pencil, paper and eraser my best friends, huh?

Thanks for reading

June 2013 »


Recent Entries

Recent Comments