# Re: (TFT) Online Melee

```--- Steve Reinhardt <stever08@fastmail.fm> wrote:

> So far I have not had to resort to trigonometry for anything.
> Hexes are
> identified by a pair of coordinates and distances are measured by
> counting hexes rather than along a straight line.  Line of fire is
> also
> handled by looking at intervening hexes based on these coordinates.
>  I
> haven't planned on building the map.  I was just going to overlay
> figures over an image of the map, tilted so the hex-grain runs
> horizontally.

If you haven't already, check out these page of game programming
information:
http://www-cs-students.stanford.edu/~amitp/gameprog.html#Hex

Isometric 'n' Hexagonal Maps
http://www.gamedev.net/reference/articles/article747.asp

Coordinates in Hexagon based tile maps
http://www.gamedev.net/reference/articles/article1800.asp

If you want to put artificial intelligence into the movement (I used
this in my Java Ogre game described below), one of the most popular
pathfinding algorithm is the A* (A-Star) algorithm.
http://en.wikipedia.org/wiki/A-star_search_algorithm

Also, Google just released its source-code search engine. The
following link will find you all JavaScript files that have the word
hexagon in them:

I've written a prototype for Melee in Java (could be run as an
Applet) that handles movement on a hexgrid, facing, etc. The nice
thing about Java (not javascript) is the rich programming API - when
you want to rotate a GIF 30 degrees or whatever, you can do it
relatively easily. Data structures are a piece of cake (Collection
API), etc. The "look" is nice using Swing GUI. However, the source
code quickly became ugly and I have lost interest a bit.
Theoretically, C# (Microsoft's Java) and its API would do just as
well, although I've never tried.

Over Christmas break a few years back, based on the prototype for
Melee, I finished a player-vs-computer version of Steve Jackson's
Ogre. But as it contains the full rule-set of the Ogre game, scans of
the counters, etc. I won't distribute it because of copyright. I did
pay for the game myself (more than once, first in the 80s and again
but he pointed out that he is in the business of selling paper-based
games and obviously didn't like the idea of a free Java-based version
floating around on the internet.

Java code is kinda like the ROMs you run on a console game, and the
Java Virtual Machine (aka JRE that you download and install) is like
an emulator of a console, and since the JRE exists for MacOS,
Windows, Linux, etc., Java code can be easily copied/run on any
platform. I proposed to SJ the idea of a game server, where people
would have to log in (and pay to play), but I don't think there's any
money in that these days (given the real-time 3D games like World of
Warcraft, Halflife, whatever). I recall that Starfleet Battles had
some kind of online, server-based system, but I have no idea how
profitable it is... Anyway, I digress...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
=====
Post to the entire list by writing to tft@brainiac.com.
Unsubscribe by mailing to majordomo@brainiac.com with the message body
"unsubscribe tft"

```