Results 1 to 17 of 17

Thread: Isometric tanks

  1. #1
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187

    Isometric tanks

    Hello people,

    I started this project to learn Blender Game programming. I have been a programmer since 1991 and Blender user since 2012.
    It is my hobby, since now I am a high school teacher and father of two. However, I find great fun in building stuff with Blender.

    Following will be posts with the incremental version source code so that you can study and run the game, and also a brief explanation
    of how stuff is done. Source code is provided under the GPL license.

    Greetings and respect to all the Blender community, I really owe you guys, it is a remarkable place to be here.
    Last edited by dtrip; 02-Jun-17 at 02:58. Reason: Changed the game title



  2. #2
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187

    tank.01.blend

    This is the first version of the game. What you can do here is

    1. Drive the tank model with the keyboard WASD
    2. Move the turret with UP, DOWN, LEFT, RIGHT
    3. There is also a camCube object that follows the tank around. An orthographic camera will be "child-ed" to the camCube, so that the game takes on an orthographic view.

    tanks.01.png

    tank.01.blend



  3. #3
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187

    tank.07.blend

    ...with textures.

    In this version our tank is textured, the tank cannon has limitations and the camera is the child of the (now red) camCube.
    See the code of camCube to see how it follows the tank. It has the same location with the tank, minus some units along the x and y axes,
    and plus some units along the z axis to go higher. Also, it turns left and down. I experimented a lot with these to put the tank in the center.

    There are invisible static walls that do not allow you to fall off the level (very useful !!!).

    There are also walls and other obstacles. Those are "static", while the hero tank is "Character".
    A nice touch of "Character" is that it follows the terrain even if there are mountains. In future versions the ground will not be level, it will have slight "mountains", etc.

    There are also a couple of enemies, a moving enemy (tank) and a stationary enemy (turret).
    There is also a red-yellow small bullet somewhere.

    But the enemy tank, the turret and the bullet do not do anything. They just sit there.


    tank.07.zip

    tanx.jpg


    Next, I am working on enemy AI, that is I need the tank to move towards our tank and shoot at him in intervals.
    The turret will run the same AI, although his movement will be zero.



  4. #4
    Member rubeki's Avatar
    Join Date
    Jan 2016
    Location
    Toronto Ontario
    Posts
    51
    Looks cool!

    Any plan for multiplayer?
    ---
    Check out Hover Tank Battle League! https://rubeki.itch.io/hover-tank-battle-league
    Twitter: @_rubeki
    Youtube: https://www.youtube.com/channel/UCbF...yn_4XuRENwjsIg



  5. #5
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187
    Thanks,
    unfortunately I have no idea how to make it multiplayer. But it would be cool indeed



  6. #6
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187

    tank.08.blend

    Features added:

    [1] Shadows
    [2] Enemies created = The trigger plane now creates one enemy tank and two enemy turrets.
    [3] Independed enemy tank/turret movement: The enemy tank body runs a different script than its turret. This will be later very useful because we will be able to combine different tank chassis with different turrets, thus creating a variety of enemies.
    [4] All three turrets are now programmed to always aim at the player and Shoot every few seconds if
    the distance is closer than 7 units. Shoot itself has not been implemented yet, it is only printed in the console.

    What you can learn:

    1. Go to layer 2 and click any of the two towers to see how they track the player (Edit Object actuator ---> in Track To mode)
    (you need to have a Logic Editor window open to see the Logic blocks)
    2. Read any of their scripts (TurretSingle1 or TankTurretSingle1), to see how to measure distance from the player tank =
    = (subtract the world Positions).length
    3. Read script TankTurretSingle1, to see how it always gets positioned on the tank (you just copy the worldPosition of the tank, to
    the worldPosition of the turret).
    4. Go to layer 1 and click the Trigger1 plane and read its script (Trigger1). There you can see how to create the enemies and
    how, when it creates the tank and its turret, it creates custom variables on each one to link with each other. The link is
    required when one is shot and killed, to desrroy also the other. This has not been implemented yet, but it will.


    New .blend file is here:
    tank.08.blend

    (textures are the same as previous file tank.07.zip . Place tank.08.blend file in the same directory as tank.07.blend file)

    tank.08.jpg

    Next, I am implementing shooting bullets and collision detection. I still have to decide wether the player will have HP or dies instantly (I prefer the latter mua ha ha ha ! - no seriously, I believe it results in more adrenaline rush gameplay)
    Last edited by dtrip; 27-Feb-17 at 14:50.



  7. #7
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187

    Standalone playable blend file. Please test the gameplay

    Hello, this is an early demonstration of gameplay.

    Unzip the game. It is standalone (does not require anything from previous posts)

    Open the file, press p to start the game. Make sure folder "tex" is in the same folder with tank.13.blend (it should be, automatically)

    Move tank with WASD
    Move turret with UP, DOWN, LEFT, RIGHT arrow keys.
    Shoot with SPACE

    Kill the two turrets and the tank. Your shots are ballistic, while theirs are linear (whats the antonym for ballistic in English ?)
    If you kill them or you get killed instead, nothing else will happen. So press ESC and P again to try again.

    Please tell me what you think of the gameplay. Is it too hard ? Personally I love it, but I guess it does not matter much what I think.
    At the beginning its kind of hard, but after a while you grow to it and it becomes rewarding to hit them successfully.


    tank.13.jpg


    IF YOU WANT TO STUDY THE CODE, START FROM THESE OBJECTS/SCRIPTS:

    1. Player tank body moves with WASD (logic blocks)
    2. Player turret moves wth LEFT and RIGHT (logic blocks)
    3. Player cannon moves with UP and DOWN (logic blocks)
    4. Player cannon shoots with SPACE (logic block calls script)

    How enemies are created =

    5. Enemies are created when player tank steps on the plane named TRIGGER1.
    What that planes does when it collides with "DesertCamo" (this is the material of the player,
    it is unique so he can be easily detected by the game), is call a script which spawns enemies.

    How enemies are destroyed =

    6. Explosion and smoke empties are created by "EnemiDie" script. This script is called by
    the enemy tank and turret, when they collide with the player's bullet material.

    So there it is in an nutshell. Any questions feel free to ask.

    I hope you like it , greetings, Dimitris
    Attached Files Attached Files
    Last edited by dtrip; 09-Mar-17 at 16:18.



  8. #8
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187
    Finished the first two levels, they are downloadable and playable below (as blend files for now)

    The blends will save hiscore.txt file in the same directory you place them.

    Level 01 is an instructions tutorial with targets only. Level 02 has enemy cannons that can kill you and a boss
    cannon in the end. Now working on Level 03 with moving tanks that can patrol and follow player and use a nav map.

    Warning about the code comments = sometimes they refer to other files (because of copy paste). This will be fixed soon.

    Screenshot from 2017-04-21 09-07-53.jpg

    That's it for now, I hope you like it!
    Please tell me if you like the game and if you think it is too hard or too easy.
    Good bye!
    Attached Files Attached Files
    Last edited by dtrip; 21-Apr-17 at 01:30.



  9. #9
    Why don't you use google drive to make a standalone version of your videogame.Then share the link with us.Because blender artists.org has limit of the megabytes that can be uploaded.
    It is what i did.



  10. #10
    Looks really great so far.
    Keep up the good work.



  11. #11
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187
    Originally Posted by Lostscience View Post
    Why don't you use google drive to make a standalone version of your videogame.Then share the link with us.Because blender artists.org has limit of the megabytes that can be uploaded.
    It is what i did.
    Yes, I have thought of that,

    I am currently at Level 03. The game has 10 levels hopefully. There will be one more upload before the game is finished.
    When it is finished I will upload it at some file service and remove all files from blenderartists.org.



  12. #12
    I am waiting for the finished game or a blendfile with all the current levels on them.



  13. #13
    Member Nemescraft's Avatar
    Join Date
    Mar 2016
    Location
    Somewhere on Earth
    Posts
    192
    The turret (player) could aim at the mouse, and the gun could aim ballistically. https://blenderartists.org/forum/sho...jectory-Aiming



  14. #14
    Member Fred/K.S's Avatar
    Join Date
    Dec 2013
    Location
    The Blender universe.za
    Posts
    713
    I like your progress. Thats amazing i wish id progress like that bro !!!!!

    Fred/K.S
    Current project's: (BGE & UPBGE are the best ive ever used) Latest:http://Speed Racer A Whole New World 2 (2017) (WIP)



  15. #15
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187
    Finished at last.

    Tips, credits, locking levels and main menu, took me more than I expected. But in the end I believe
    it is an interesting game! Took me about 4 months to make, all by myself, starting from almost complete scratch.
    Average working hours must have been about 20 hous a week. So total it must have taken 200-300 hours.

    Full source code and assets available. I grant you permission to use anything, anyway you like.

    I put a lot of effort to make it presentable and playable, so play and have fun !!

    Any comments are welcome.




    Isometrictanks source code - also includes a brief explanation of the code.


    https://www.dropbox.com/s/yoy1ctpe4o...eCode.zip?dl=0




    Isometric Tanks for Ubuntu - standalone executable:


    https://www.dropbox.com/s/dqbuwpwp8w...buntu.zip?dl=0




    Isometric Tanks for Windows-64 - standalone executable:


    https://www.dropbox.com/s/uodv0uego4...ws-64.zip?dl=0



    Note about the source code :
    Everything is developed by me and I grant you the permission to fully use it however you want,
    without owing me anything. The only thing that is not mine, is the ground texture and some brick
    textures which I got from free textures Google search, so I believe they are free, but I can not be sure.


    I could use some help with the following =

    1. Make a runtime version for Mac OSX

    2. Make a runtime version for other Linux distributions (or verify that the Ubuntu one works for other Linux)

    3. Make a runtime version for Windows XP



    Special thanks go to this forum of course, without which it could not be possible.
    Also to BornCG YouTube channel, which helped me make a quick start with Blender game engine.

    That is all, I hope my game contributes inspiration and assistance to others. Cheers and stay creative!
    Last edited by dtrip; 04-Jun-17 at 09:32.



  16. #16
    Member John_tgh's Avatar
    Join Date
    Dec 2008
    Location
    New Atlantis
    Posts
    633
    Made it to level 3! : D

    This is an excellent resource and a fun game to play. Thank you for sharing this with the community, I'm certain it will be useful to a lot of people; beginners and veterans alike.

    By the way, I didn't see this in the Finished Games sub-forum, you should totally post it there! : D

    EDIT: Forgot some words. Small edits for clarity.



  17. #17
    Member
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    187
    Originally Posted by John_tgh View Post
    Made it to level 3! : D

    This is an excellent resource and a fun game to play. Thank you for sharing this with the community, I'm certain it will be useful to a lot of people; beginners and veterans alike.

    By the way, I didn't see this in the Finished Games sub-forum, you should totally post it there! : D

    EDIT: Forgot some words. Small edits for clarity.

    Thank you for your kind words and for playing the game!

    The community has done a lot for me and it was about time I gave something back

    You are right, I should post it in the finish section. I will see to it asap.

    Thanks again, take care
    Dimitris



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •