Blender Battletech 2 (DEMO).

UPDATE: October 18th 2015

At last! A demo you can play.
You can try out the game here:

Controls are in the video but just to reiterate:
WASD for movement, use the mouse for view/turret movement.
Left mouse to fire, right mouse to change weapon group.
Middle mouse to switch between group fire and chain fire.

Num pad +/- or mouse wheel can zoom your view.
“r” for radar, “q” for target under reticule, “e” for toggle near targets and f for free targeting.

“m” to cycle through HUD color variations. “c” for external camera, which you can move around using the arrow keys.

“p” for pause, and space bar to switch the camera to another vehicle.

Thanks for everyone who played it so far and thanks again if you want to give it another try! I found a couple of game breaking bugs while preparing this for download, maybe you can find some more. :slight_smile:


Original Post, 13th July 2015

Devblog number 1 in my attempt to relaunch an old project.


Awesome work!!
It’s nice to see this being revisited, and I look forward to updates!
Minor critique: the turret on the first tank appears just a bit too large for the main body; maybe that’s just me though…

Yes, looking again at the miniature, it does look a bit big. Thanks. :slight_smile:

A few points:

  • You don’t have to use inheritance to provide differentiation of the vehicle behaviours. A Generic vehicle with composition techniques (like the component pattern) can be used to specialise behaviour. It’s a choice, though.
  • Avoid emulating player inputs from the AI. The AI / Player inputs should use a generic control interface. The player controller maps key presses to intentions, whilst the AI controller determines and outputs intentions.
  • The helicopter can either use a controller to convert intentions into flight mechanics, or for more advanced game-play directly use the vehicle control interface. The “intention-controls-interface” is basically an intermediary layer between the intention (player / AI) and the flight controls, like a simplified flight computer. If you don’t want the player to have to deal with the complicated controls of a real helicopter, the player should control this interface. The AI should probably deduce intentions, rather than individual controls, as that would quickly become cumbersome.

My intention is for the AI to behave like a Bot; a computer controlled character in a multiplayer game. So although the AI controller won’t be emulating exact key presses they still have the same movement restrictions as the player (turning speed, acceleration etc…).

I want to be able to have individual AI agents use good or bad strategies depending on requirements of plot. So green militia pilots might rush you while elite mercenaries may try to outflank you. So it makes sense to separate movement control and decision-making.

I’ve made an interface for player control which checks keyboard and mouse input against a customizable dictionary and turns that in to commands such as “fire”, “turn_left” etc… and feeds those to the vehicle class. The AI will generate similar commands to control their own vehicles by comparing angles and distances. This might not be the most efficient way of doing AI but it apeals to me as a way of creating more “human” like behaviour in AI characters.

Also, to clarify what I said about helicopters in the video; normally helicopter or airplane simulation in a game recreates full 6 degrees of movement. You can roll over, loop the loop, fly straight up etc… but here I’m just using 2d movement, with pitch, roll and yaw faked simply for aesthetics.

This is partly because the game is designed to emulate the board game with only 2d movement, and partly because I just dont know how I’d get the AI to fly the aircraft well using a full six degrees of movement simulation which includes gravity and thus a requirement not to fly upside down or into the ground.

Anyway, Ive finished designing movement, next comes the AI controller. This will be split between tactical and strategic decisions. First the AI will evaluate the vehicle for strengths and weaknesses (fast or slow, short or long ranged weapons) to decide on a strategic role such as fire support, brawler or hit and run. Then it will look up tactical actions specific to that role, like plot a course to take it around to the rear of the closest enemy while avoiding collisions with other units.

Very beautiful models but tanks and helis aren’t remotely as fascinating as huge stomping robots are :slight_smile:

I’m very impressed by https://www.youtube.com/watch?v=YYFEOpOmSXI - did you ever release a playable .blend or .exe of this game?

A limited version was finished, you can play it here:
http://gamejolt.com/dashboard/games/76068
Tanks and vehicles didn’t make it in to that version and the UI was very simple compared to the demo in that vid.

Mechs are coming soon, don’t worry :slight_smile:
I’m using all the old assets with new gameplay, but it takes time to build it all up. Vehicles are easiest to work on first, so they are serving as a kind of test bed for now.

Looking great so far,

why dont you use the grass geometry shader in resources? with the waving etc?

I’m going to be doing a lot of work on the terrain later, but it’s going to cover quite a large area. Most work is going towards managing the assets to use little resources. For example a group LOD setup where the distance to the group of trees is measured once and then all objects in the group have their mesh switched.

I like this helicopter. Is it made to play it in first person, can you change to third person? I like the camera movement when the helicopter is in 3rd prson.

Right now the third person view is just for fun. I’m not sure how to make it playable in 3rd person. It would be a bit hard to aim…
It’s nice to be able to look outside your mech/vehicle but it’s not that useful for gameplay.

I’m going through some options right now for improved textures. The change from simgle tex mode to full glsl opens up some interesting options for choosing camo colors. I’m going to do some experiments…

A new devlog today, in which I explore the options for providing color for mechs and vehicles.

All cool like always!

Some ideas for how to handle mechs (though you probably already know all this).

At some stage, you want there to be complete abstraction. So you have an instance of a vehicle, and simply say “vehicle.shoot” or “vehicle.move(direction)”. This way you can separate our your AI and keyboard control logic and keep things nice and simple.
This is fine for Tanks, as movement is simple.
But with mechs, walking animations make things hard.

One thing I’ve seen is to use some rather complex weighting. So you set up the legs using inverse kinematics and constrains, and then … work magic. Some of this magic is things like:

  • I need to move a foot from behind to in front when moving
  • The foot should align to the ground
  • Only one foot can move at a time.
  • A foot must be roughly infront/behind the torso at all times

If this is implemented correctly, you can get it so that you move the body of the mech, and the legs simply follow suit, walking it along. The position of the mech body is set by the movement. The position of the feet is set by some target empties that move into the right sort of place.

So some example math/pseudocode:
probability_of_moving_foot = all_feet_on_ground * dist_from_center * hip_rotation
foot_position = previous_foot_position or direction_of_mech_movement * rotation_of_mech

So now you have a leg that warps to a correct looking place. How do you get it to draw a nice path from it’s old place to it’s new place? I’m afraid I’m out of ideas for that.

Have I done this myself? Nope
Have I seen it done? Yup, I saw a demo for a six legged vehicle done in a different game engine.
There are a couple videos like these:


These are multipeds, but the same strategy can be applied to bipeds.

Actually, Bipedal walking is not a solved problem (as can be seen by the recent darpa fails). I’m actually interested in procedural bipedal walking to implement in the real world, but I keep hitting mental walls. Thankfully many of these (such as inertia of legs, center of mass) can be ignored in the game world.

Your night vision looks much better than mine - how do you achieve it?

Thanks sdfgeoff, I’ve got some things I want to try in that direction, I’m going to do some testing and see how it goes. As they say, throw somethings at the problem and see what sticks. :slight_smile:

@ adriansnetlis
I mixed the result with SolarLune’s pixelate shader and a noise shader to give a ‘dirty’ result. I’ll post the shader tonight.

Yes, I see the noise, but how do you achieve it light up scene so much and the color to be so accurate? Is it the same method as I use or different? Also, could you find a 2.75 fix for my shader? :smiley:

Nines, are you trying to make expanded version of Katan?

@nines when it comes to board games people love to see faithfull conversions. Even if you completely change the genre people like to see rules from the game getting converted in a way that keeps the original flavor.
Early on in this project there was quite a lot of vocal opposition when I wanted to “improve” the look of some mechs, or when I wanted to change the gameplay to be more fast paced. Actually I think they were right, and the slower paced, more clunky gameplay helped to distinguish the game from the other mechwarrior outings.

This time I’m trying to keep as close as possible to the board game rules but some things have to be changed for playability, for example no one shot kills to the player. That’s just not fun.

Today I got quite a lot done including a new method of torso/turret twisting which should make things much more interesting. In the TT rules torso twisting can take a whole turn, ten seconds for 180 degrees. I need a way of slowing down twisting without making the player uncomfortable as they try to drag the mouse back and forth. So now cursor position on the screen is not fixed to the center, and the torso will twist to bring the targeted point in to the middle of the view. You have to think more carefully about position and angles of attack, and fast mechs or vehicles will be able to get in to a blind spot and really cause some trouble.

I’ve also started work on the AI structure. So I’ve got the AI moving and aiming quite well.