Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Tanks !  (Read 9530 times)

0 Members and 1 Guest are viewing this topic.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Tanks !
« on: April 05, 2014, 10:40:07 pm »
Intro
Let me introduce you to this game i made for masturbation purpose only as it took me  a ridiculous amount of very long time to do as a hobbyist game developer.
You play a green USofA tank. You must survive endless waves of red chinese communist tanks.

Rules
Each enemy destroyed will add 1 point to your score.
Each bullet you take from an enemy will drop your health by 1 point.
When you run out of health the game is over.

Tech
From a tech aspect, and because i did this for educational purpose, the game features :

- not fully mastered deWitter's game loop
- cheap xml / spritesheet based animation system using pugixml.
- as limited (feature wise) as sexy useless template based resource manager.
- quite decent 2D Opengl drawing , sound and system events handling based on S.F.M.L.
- pitifully bugged entity system. seems stable now.
- super simple particle system designed in a way that it completely wastes lambda expression usefulness.
- lousy memory management. should be ok now.
- some known and probably unknown bugs.
- some other stuff that doesn't deserve to be mentioned.

Website
http://dwarfman78.github.io/tanks/

Medias




binaries for windows (4 mb) : https://github.com/dwarfman78/tanks/releases/tag/v1.0.0

Sources available from my github repository : https://github.com/dwarfman78?tab=repositories

You'll need pugixml, Box2D and SFML 2.1 to build the engine and the game.

Controls

Move : Keyboard arrows or joystick, you can assign joystick buttons by editing config.xml
Shoot : Spacebar or designated button in config.xml
M : Mute music
Escape : show/hide menu

Have fun.
« Last Edit: May 29, 2014, 10:51:17 am by dwarfman78 »
@dwarfman78
github.com/dwarfman78

Doodlemeat

  • Guest
Re: Tanks !
« Reply #1 on: April 06, 2014, 01:53:30 am »
Quote
this game i made for masturbation purpose only
I hope that is either irony or a spelling mistake.

Seriously though, I think it looks pretty good. But you should consider giving the player smooth movement aswell. From what I can see now, the enemy tanks can attack you from 0-360 angle, while you only can attack them in a 0-45-90.. angle. Whenever you are pressing the W or KEYUP, make the tank go towards the mouse.
« Last Edit: April 06, 2014, 01:59:56 am by Doodlemeat »

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #2 on: April 06, 2014, 09:14:56 am »
it is indeed an ironical statement, however the making of this little game was like intellectual s&m porn to me, very stimulating and yet fun to learn c++, trigonometry etc.

I am afraid that introducing the mouse as input controller will compromise the game simplicity and straightforwardness ... unless i move the fire button from spacebar to mouse click button, this is a quite interesting idea thank You.

EDIT : my friends advised me to implement joystick with full 360° rotation and progressive throttle.
« Last Edit: April 08, 2014, 11:08:25 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #3 on: April 08, 2014, 09:32:22 pm »
To satisfy you bearded geeky paranoid folks, i've posted a new package with bug fixes and embedded src which should compile on both windows and linux provided you declare the needed precompiler instructions.

dependencies are SFML  2.1 (audio, graphics, window, system) and pugixml.

You need to build the engine first then the game itself. I recommend dynamic linking on linux.
« Last Edit: April 08, 2014, 10:24:18 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #4 on: April 08, 2014, 10:48:32 pm »
By the way you can modify the game's configuration so that red tanks become blue and green tank becomes red (if you're a communist you'd prefer playing a red tank yeah i get that) or run faster.

Make sure you keep aside a backup config before making the game unplayable.

Here's the animation.xml for red vs blue like the old days c&c red alert.

<animations>
        <animation name="joueur_stop" duration="1">
                <frame left="0" top="32" width="32" height="32"/>
        </animation>
        <animation name="joueur_run" duration="1000000">
                <frame left="0" top="32" width="32" height="32"/>
                <frame left="32" top="32" width="32" height="32"/>
                <frame left="64" top="32" width="32" height="32"/>
                <frame left="96" top="32" width="32" height="32"/>
                <frame left="128" top="32" width="32" height="32"/>
                <frame left="160" top="32" width="32" height="32"/>
                <frame left="192" top="32" width="32" height="32"/>
                <frame left="224" top="32" width="32" height="32"/>
        </animation>
        <animation name="ennemi_stop" duration="1">
                <frame left="0" top="96" width="32" height="32"/>
        </animation>
        <animation name="ennemi_run" duration="1000000">
                <frame left="0" top="96" width="32" height="32"/>
                <frame left="32" top="96" width="32" height="32"/>
                <frame left="64" top="96" width="32" height="32"/>
                <frame left="96" top="96" width="32" height="32"/>
                <frame left="128" top="96" width="32" height="32"/>
                <frame left="160" top="96" width="32" height="32"/>
                <frame left="192" top="96" width="32" height="32"/>
                <frame left="224" top="96" width="32" height="32"/>
        </animation>
        <animation name="bullet_fire" duration="1">
                <frame left="180" top="117" width="16" height="17"/>
        </animation>
        <animation name="fire_smoke" duration="1000000">
                <frame left="0" top="560" width="130" height="90"/>
                <frame left="130" top="560" width="130" height="90"/>
                <frame left="260" top="560" width="130" height="90"/>
                <frame left="390" top="560" width="130" height="90"/>
                <frame left="520" top="560" width="130" height="90"/>
                <frame left="650" top="560" width="130" height="90"/>
        </animation>
        <animation name="explosion" duration="750000">
                <frame left="0" top="0" width="64" height="64"/>
                <frame left="64" top="0" width="64" height="64"/>
                <frame left="128" top="0" width="64" height="64"/>
                <frame left="192" top="0" width="64" height="64"/>
                <frame left="0" top="64" width="64" height="64"/>
                <frame left="64" top="64" width="64" height="64"/>
                <frame left="128" top="64" width="64" height="64"/>
                <frame left="192" top="64" width="64" height="64"/>
                <frame left="0" top="128" width="64" height="64"/>
                <frame left="64" top="128" width="64" height="64"/>
                <frame left="128" top="128" width="64" height="64"/>
                <frame left="192" top="128" width="64" height="64"/>
                <frame left="0" top="192" width="64" height="64"/>
                <frame left="64" top="192" width="64" height="64"/>
                <frame left="128" top="192" width="64" height="64"/>
                <frame left="192" top="192" width="64" height="64"/>
        </animation>
</animations>
 
« Last Edit: April 08, 2014, 11:03:59 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

BaneTrapper

  • Full Member
  • ***
  • Posts: 213
  • Do you even see this, i dont need it.
    • View Profile
    • Email
Re: Tanks !
« Reply #5 on: April 10, 2014, 06:47:18 pm »
My antivirus has prevented the app from running reported virus i am not known with what it is,
also the site is untrusted, antivirus blocks most of the page from loading i get really weird "page / view".
Is it safe? can anyone confirm?

EDIT::
It was resolved in post as !!!SAFE!!!
« Last Edit: April 11, 2014, 09:30:43 pm by BaneTrapper »
BaneTrapperDev@hotmail.com Programing, Coding
Projects: Not in development(unfinished/playable):
http://en.sfml-dev.org/forums/index.php?topic=11073.msg76266#msg76266
UP and in Development: The Wanderer - Lost in time
http://en.sfml-dev.org/forums/index.php?topic=14563.0

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Tanks !
« Reply #6 on: April 10, 2014, 06:51:26 pm »
Your browser complains about the site because it uses HTTPS without a valid certificate, and the executable is fine also.

You can easily check it using any online scanner like this.
« Last Edit: April 10, 2014, 06:54:50 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #7 on: April 10, 2014, 07:21:07 pm »
There's no danger, you have this message because it is a self signed certificate i could make a valid certificate but i don't want to provide the personal information the authority is asking for.

The binary is safe too, you can build the game yourself if you want as i'am providing the source code within the zip archive.

The game works fine on wine as far as i know.

I've discovered at least a memory leak in the game so, i think i'm going for raii in the next version because i'm starting to be fed up with those memory management problems.
« Last Edit: April 10, 2014, 07:27:35 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #8 on: April 13, 2014, 11:09:25 am »
New version available

Changelog:

Changed memory management (shared_ptr instead of raw pointers)
Grassy background.
Muzzle flashes, impacts and trails particles added.
Centered window at start.

Have fun.
« Last Edit: May 29, 2014, 10:15:53 am by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #9 on: April 13, 2014, 11:13:02 am »
38 points is my best score so far (with default configuration)
@dwarfman78
github.com/dwarfman78

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Tanks !
« Reply #10 on: April 13, 2014, 11:37:05 am »
Funny little game :)

My impressions:
  • Sometimes the enemies spawn almost inside or directly behind the player, where you have no chance to evade. Don't you want to let them enter from the border of the screen?
  • There's a bug when you stand still: an enemy tank drives over you and is too close to hit you.
  • At the moment, you can keep firing all the time. There should be a motivation to limit the fire, for example ammo supply that needs time to reload (so you can fire 5 projectiles, but then have to wait some time), or health that regenerates while you're not firing.
  • I agree that 8 directions limit the gameplay, as you cannot really aim.
  • The smoke could be focused in front of the tank.
  • It would be nice to restart directly after game over.
By the way, you should rather use unique_ptr instead of shared_ptr, unless you have a good reason for the latter :P

(My highscore was 32)
« Last Edit: April 13, 2014, 01:12:16 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #11 on: April 13, 2014, 07:09:46 pm »
Funny little game :)

Thank you ! I'm glad you tried and enjoyed it, thank you for your feedback, here are my answers :

Quote
Sometimes the enemies spawn almost inside or directly behind the player, where you have no chance to evade. Don't you want to let them enter from the border of the screen?

Well i don't know, i see what you mean but i like the effect of surprise and this behavior adds some "luck" parameter to your final score, which is good in any game (skills+a touch of luck = success)

EDIT : spawning enemies outside the window add a little extra immersion i like it !

Quote
There's a bug when you stand still: an enemy tank drives over you and is too close to hit you.

Yes i think i have to stop the enemy before he reaches the player.

Quote
At the moment, you can keep firing all the time. There should be a motivation to limit the fire, for example ammo supply that needs time to reload (so you can fire 5 projectiles, but then have to wait some time), or health that regenerates while you're not firing.

Interesting, i've been thinking about dropping bonuses and ammo crates at a random pace, however it complicates the game's balance.

Quote
I agree that 8 directions limit the gameplay, as you cannot really aim.
I guess i will have to implement mouse+keyboard control and analogic joypad too.

Quote
The smoke could be focused in front of the tank.
I'll make some tests as it shouldn't take long.

Quote
It would be nice to restart directly after game over.
Yeah, i have to add a menu in any case, with a start button and replay button, it should be a nice addition to my little engine as i need to implement a sort of scenes stack (lifo) before i do the gui, there's some work to do in that area and i don't know if i'll be able to do it.

Quote
By the way, you should rather use unique_ptr instead of shared_ptr, unless you have a good reason for the latter :P

You are right, i was not aware of unique_ptr existence. After a short analysis, it needs to be used with temporary entities as i call them in my engine because the main rendering class is the only one to own those entities (from instantiation to destruction).

I must say that i am a bit disappointed about the documentation i found about smart pointers (and c++ in general) on the internet, i do not mean reference websites as i mostly don't care about methods listing and short examples, i'm talking about good, complete, clear and fresh litterature on those cutting edges subjects.

Quote
(My highscore was 32)
Congratulations, most of my friends do an average of 30 points.
« Last Edit: April 13, 2014, 07:35:10 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #12 on: April 28, 2014, 08:51:40 pm »
New version available:

Added scenes stack, rendering on texture and shaders to the engine.
Added menu to the game using those features.
New musics (using ogg format for better compression).
Foes now spawn out of the screen and stop near the player.
Joystick is enabled but it doesn't work well on windows (though you can tweak buttons assignation numbers from conf file).
« Last Edit: May 29, 2014, 10:16:09 am by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #13 on: April 29, 2014, 09:30:32 pm »
New release :

After a little session of profiling, i cleaned the code from the most costly operations.
« Last Edit: May 29, 2014, 10:16:19 am by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Tanks !
« Reply #14 on: May 27, 2014, 11:46:08 pm »
New release, i can't remember the changelog, the big add is Box2D bodies support to the engine, this is illustrated in the game with gun shells popping out of the tanks.

So how does it look ?
@dwarfman78
github.com/dwarfman78