Battletech virtual board

A project I’ve thought about for a while…

A virtual board to play Battletech over the Internet, able to support large battles and take care of the dice rolling bookkeeping.

EDIT: Webplayer available at www.electricrune.com.

Alpha at his stage, the game only works up to the end of the Move Phase.

Youtube link:

I’m really loving the way it’s turning out so far, five different terrains so far (Clear, Rough, Light Woods, Dense Woods, Cement), three depths of water, and up to 15 levels above ‘sea level’.

Images are of a 40x40 map, but this is by no means the limit.

Next in development, Pew, Pew, Bang! Weapons!

yay, isometrics!

Um, no…

Not Isometric, it’s fully 3D, rotatable and zoomable…

New video, showing weapons!

Best in high res…

Web player available now, but it is only a game up until the end of the Move Phase.

www.electricrune.com

Still, you can get your hands on the virtual table, and see how it works and feels.

This is really cool.
Can I ask how you accomplished the hex game board? I’ve been toying around with a turn-based hex-board game and I’d love to see how you got yours to work.

Awesome Tasarran, go man go! I loved these games as a kid, this was one of the first things I tried making later on, my inspiration came from a game called MechForce (http://www.scharmers.info/2010/08/forgotten-amiga-classics-1-mechforce.html or for a quick youtube of gameplay, some dude with Amiga and floppy ftw here : http://www.youtube.com/watch?v=vz3e2hpbo50 ). Ralph Reed was THE MAN for my $ as a kid, between MechForce, Ultima, BardsTale and Wastelands - there went a lot of youth ;).

A buddy and I helped out a bit (nothing significant just the menu at the time iirc), on the Titans of Steel project which was essentially a remake of MechForce, good job but I’ve always thought it could have went a lot further in usability.

Something that would be really cool is making this a F2P style game with online store - would be pretty balanced as you’d just sell credits then hook up a centralized AH for buying/selling gear from arena matches, have auto-ransoming, etc…

Very exciting stuff, will love watching this one come to fruition!

I kicked it around a bit…not much to do, as you noted.

There is alot of potential for coolness though.

Looking forward to more upDates!

I would also be interested to hear how you made the board.

Nice job!

Like Welby said, the idea has a lot of potencial.

Keep the good work up!

How I made the board…

I made a model of one tile, it consists of a hexagonal cylinder, with extra faces on the top.

Then I made four different copies of this in Unity, and modified them for Rough, Woods, Forest, and Clear.
I added rocks and trees to each tile, then added a script that only runs once that randomly displaces the trees and rocks, and for some of the tiles (like Clear), I randomly destroy most of them, leaving a few randomly placed and chosen features on the tile. There is a custom version of this script on each Prefab.

I have a couple of arrays that store two points about the map. The first stores the type of each hex, and the other stores the height.
The script reads these two arrays, and Instantiates the tiles, one by one, assigning variables for X, Y, Z coordinates to a script called HTMod that is also on each tile. (These are the grid coordinates, not the actual coordinates in Unity, so the first tile would have 0,height,0)
On Update, HTMod moves the tile to which it is attached to the proper actual coordinates.
It also assigns variables that point to each of the hex’s six neighbors, and the height difference between the two.

As I Instantiate each tile, I add it to a Unity Array, and also assign the number in the array to a value in HtMod called Index. This way, I can refer to tiles by the number in the array, or by actually referring to the GameObject.

Then the magic happens. HTMod looks at each tile, and if the neighbors are not zero height difference, it modifies the vertices to make a smooth slope.
Actually, it only moves the verts halfway, the other tile goes the rest of the way, so the slope is spread over the two tiles.

The water planes are at a set height, any terrain that dips low enough will end up below the water.

That’s impressive. The terrain generation you have seems very solid. Another question: Is your movement based on a per-tile basis? For example, does the mech move from the center of one tile to the center of an adjacent tile? Along these lines, are the directions locked as well to the 6 angles of the hex? (i.e. Mech can only move in a straight line along these angles.)

Thanks for sharing. This is very interesting stuff. Good work.

Yes, the placement and movement are from tile center to tile center. The handle of the tile is at the center of the top.
Each move is broken up into three segments, the middle one distorted up or down based on elevation change.

Even the facing isn’t set to 60 degree intervals, but rather, the mechs face the center of the adjacent tile (minus the Y component)

So you broke each tile into 6 triangles to calculate the grid, right? I remember being told by a CMU computer science professor that hexagonal grids are impossible to code on a computer, turns out it takes a lot of certificates to prove you’re a moron.

I guess that’s the benefit of being self-educated…

I didn’t have anyone to tell me something was impossible.

:smile:

Each tile is distinct, and has an array of six integers, that contain the index numbers of the tiles that connect to it.
As to how I calculate the grid, I cheated…

Let me see if I can draw this out a bit…

HEX 0           HEX 1             HEX 2
 0, 0            2, 0              4, 0
        HEX 3            HEX 4            HEX 5
         1, 1             3, 1             5, 1
HEX 6           HEX 7             HEX 8
 0, 2            2, 2             4, 2

This way, X represents lines of longitude, and Y is latitude.
If I was making an array this way, it would be 50% empty and wasted, but I’m not, so no worries.
I can check to see if any set of coordinates is valid by making sure the sum of the two coordinates is even.

So when I find the tile, for example, NE of Hex 4, its at X+1, Y-1. I have an equation to find the index from the X,Y coordinates, and vice versa.

It is essentially a node list, but there’s no need for an array of structs to define it, there’s just the tiles themselves, and variables set on scripts attached to the tiles.

(By the way, don’t be confused by my X and Y above, those are just the Hex Coords. X axis is the same, but the Y Hex Axis is actually inverse of Z in the unity editor)

I discovered long ago that an education doesn’t make you smart. Obviously the creators of Bookworm didn’t listen to this guy either.

Thats even simpler than I had imagined, nice work.

It seems there are cliffs, not only slopes. How do you decide if there is a cliff or slope?

Neat. :slight_smile:
Have you thought how to do rivers? They can start on a height far above the water plane.

How to program hex grid stuff: