New Battle City update

Published January 27, 2013
Advertisement
Hello again!

Here's another project status update; unlike last time, this time I made more "visible" stuff rather than tuning the code that operates it. Well... when I think about it... there is plenty of both. This update is rather big (for me) and I cannot express how determined and happy I am because of it.

Short summary:


  • Added level selection screen
  • Level progression, scoring and life counting
  • Game over and Victory mechanics
  • New types of tiles (20 of them)
  • Improved collision detection and destruction
  • Complete level editor
  • Manual (by editing config file) resolution selection
  • Framerate counter

New Collision Detection with destructables



Remember the solution I used in last journal entry for destroying brick walls? If you don't, let me help you: you don't need to. It's gone. Simpler, better and faster solution was implemented instead which gives me greater control over tiles while doing the exactly same thing as pixel-perfect collision detection (PPCD in short) - tile is splitted into multiple segments which are checked if CD detects there is collision with that tile.
There were also performance issues with PPCD on levels where were many bricks which caused framerate drops from 60 FPS to 38 due to multiple checking, transforming etc. due to nature of the code. Maybe I didn't write it perfectly optimized but still, calling 40 000 times same operation is not healthy.

New CD also helped me to create new types of tiles easily, which brings us to...

Level Editor



2j35xqd.jpg

Oh yeah, complete level editor with toolbox (took inspiration from Sapphire Yours) and little menu with all necessary operations. Level editor is operated by mouse (currently only place where mouse is enabled). In the toolbox you can also see all tiles which currently exist in the game; numerous variations of brick and metal tile were easy to implement thanks to new collision detection. Save and Load Level bring out dialog box where you write which level you want to load or save. Those two will be improved later, together with warning there are unsaved changes when you try to exit the editor, additional level management features and few more safety measures like prevention of saving empty level.

Since level editor exists, there is also level selection screen:
34yxiza.jpg
It's ugly. I know. But it's "similar" to the original (NES) version and will suffice for now. Also, game automatically transitions between levels when you kill all enemy tanks through this screen; when it does that, player is prevented from choosing other level.

Configuration file

For easier manipulation over destructibles (read as: I don't wanna mess with non-integers if I don't need to) resolution the game is based is increased from 800*600 to 960*720. Naturally, it caused few minor issues I didn't fix yet (respawn control going berserk, font a little smaller). Game doesn't look much different, except for fresh stuff on the right side:

bdjnt2.jpg

What happens when you change resolution? For 4:3 resolutions (like 1280*1024) everything's same except bigger. For non-4:3 resolutions, this happens:

1zwj6lx.jpg

Screenshot is taken on HDReady resolution (1366*768). On this picture you can notice 3 things.
First one is a little gray part on the left side which "came out of nowhere". I didn't like horizontal stretching during expansion on 16:9 format so I rather kept the main part in 4:3 format and added more background part to the left, keeping nice square tiles.
For now, resolution is selected by manually editing configuration file. Aside from height and width, there are also Fullscreen and Show Framerate options. I have 32' TV as my monitor screen and game in current format looks really nice on 1920*1080 fullscreen.

Game over, Victory and game exiting



What is on of main components which makes the game "game"? Challenge. Or rather, ability to lose. Now, on the previous picture, look at the bottom right of the game screen. "Game Over" for 2nd player. Yup, it's finally properly supported. I don't need to explain rules, right? smile.png

I took advantage of Game State Machine to make this little thing that You probably spotted first on that screenshot. I think I don't need to talk about it.

What is next?



Obviously, to raise up the challenge, I need to improve AI of opponents. For now, it utilizes randomizer to create its behaviour which gives little challenge, but I swear that Random Number Generator has its own mind. Luck my ***, there is no other explanation on AIs ability to dodge perfectly fired shots in last second; if I didn't write it myself I would swear that AI tries to sabotage me.
I already have designed the behaviour of new AI, now I "just" need to implement it properly. CPU overload, here I come!

I really don't know what will I do with art and sound. I tried to draw new tank for Player 1 to replace the current one but the result was catastrophic due to overusage of Bevel&Emboss to create a 3D feeling:
[spoiler]
nbwzdt.png
It's ugly. Especially when you shrink it on 48*48.
[/spoiler]

I'll try to get new assets as soon as I can but until then I'll work on other things like improving code and performance and adding support for playing in 2 players over LAN.

Well, this is it for now, thanks for reading, I hope I wasn't too boring.
2 likes 5 comments

Comments

3Ddreamer

Work hard you do. Far you will go.

January 28, 2013 03:48 AM
riuthamus

This is some impressive work. With some art you might have something there! :P

January 28, 2013 04:28 PM
Josip Mati?

Thanks, both of you :)

riuthamus, I know... sadly, I'm VERY bad when it comes to art and I don't have money to pay artist to make it for me. However, as game is getting complete mechanicwise, getting new assets becomes more and more urgent...

January 28, 2013 04:50 PM
riuthamus

Is it 2d work only? how many assets?

January 28, 2013 06:15 PM
Josip Mati?

Since it's my first full game and I'm quite inexperienced I'll stick to 2D only, maybe with a little 3D illusion. For next project I'll try something 3D, but about that when I finish this :)

How many assets... for core I use 11-12 assets (Player tank, Enemy tank, brick wall, water - may stay the same, tall grass/trees, metal wall, castle/bunker/base, background for playable area - optional, main menu screen, popup box, options menu screen, game background), later I'll add more (powerups, more types of tanks, new types of tiles like ice and sand). I'll most probably either ask my lil sister to make them for me (she's great at drawing) or I'll take time to learn using Photoshop and/or Illustrator and draw them myself. I cannot ask other people to do it for me without some kind of compensation (money being the most practical one).

January 28, 2013 06:37 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement