Hexfields instead of square grids (inc. demo src)

A 3D game in the spirit of Transport Tycoon. Click here for the web site.
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post by Villem » 10 Jun 2004 12:37

Heh...Hexxagon squares. :lol:

User avatar
jfs
Director
Director
Posts: 565
Joined: 08 Jan 2003 23:09
Location: Denmark

Post by jfs » 30 Jun 2004 19:44

I'm not sure, but wouldn't a triangle-based map be just as flexible, if not more, than a hexagon-based map, while possibly being simpler to use? An example of a game using triangles would be Settlers 2, where it works pretty well.

As for rail-building tools, something where you just click start and endpoint (like in simu) could work well in most cases, but still allow for manual construction, maybe a bit like XFig (eg. no holding-and-dragging.) I don't have an idea how landscaping would be done the easiest, though... but maybe RCT does have a good idea there :)

User avatar
charlieg
Transport Coordinator
Transport Coordinator
Posts: 323
Joined: 08 Oct 2003 14:07
Contact:

Post by charlieg » 01 Jul 2004 03:13

G4S wrote:I'm not sure, but wouldn't a triangle-based map be just as flexible, if not more, than a hexagon-based map, while possibly being simpler to use? An example of a game using triangles would be Settlers 2, where it works pretty well.
Having been thinking about this and trying to come up with the best approach, I always end up working with triangles and would have to agree that a triangle based map would be the way forward.

Although to maintain the extra directional advantage we got with hexfields you'll need an additional trick or two, but I'm still working on a proposal.
Open source tycoon games
--
Free Gamer - open source and Free Software games
FreeGameDev forums - open source game development community

User avatar
jfs
Director
Director
Posts: 565
Joined: 08 Jan 2003 23:09
Location: Denmark

Post by jfs » 03 Jul 2004 22:01

If you use a triangle grid you need to allow one end of a track-piece to be on a corner of the triangle, but not both ends on a corner (that would be too messy, I think.) Also, you have to be careful on restricting how close together tracks can be laid, as well as how sharp turns trains can take. Maybe introduce proper curved tracks, as in RCT.

Finally, I'm completely sure landscaping where you manipulate single corners of land will always work for triangle-based maps. Refer to how a triangle can only have one normal calculated from its points/vectors.

BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP » 19 Jul 2004 14:26

charlieg wrote:Although to maintain the extra directional advantage we got with hexfields you'll need an additional trick or two
You could, of course, just build track in a straight line from any side of any triangle to a side of another triangle... would allow very flexible track building, but I'm not sure how it would be stored... :|
<!-- End Of Post !-->
Image

User avatar
charlieg
Transport Coordinator
Transport Coordinator
Posts: 323
Joined: 08 Oct 2003 14:07
Contact:

Post by charlieg » 20 Jul 2004 23:36

BobXP wrote:You could, of course, just build track in a straight line from any side of any triangle to a side of another triangle... would allow very flexible track building, but I'm not sure how it would be stored... :|
Or from any triangle to any other triangle (similar effect).
Open source tycoon games
--
Free Gamer - open source and Free Software games
FreeGameDev forums - open source game development community

BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP » 21 Jul 2004 13:35

yes, but then the line would go from center to center, which is not what we want.
<!-- End Of Post !-->
Image

Amit
Engineer
Engineer
Posts: 1
Joined: 07 Aug 2004 19:48
Contact:

Triangles vs. Hexagons

Post by Amit » 07 Aug 2004 21:52

A triangle map is merely the "dual" of a hexagon map. Draw a hexagon map. Connect the centers. You get a triangle map. The triangle vertices correspond to hexagon centers, and hexagon vertices correspond to triangle centers. You can use either as the primary -- think of Go vs. Chess, or Chinese Checkers vs. Checkers. (I wonder if Eastern cultures use the vertices and Western cultures use the centers?)

What I tried to do with my game was to use a hexagon map for the objects (roads, trees, etc.) but use a triangle map for the terrain (mainly because 3D cards like triangle strips, and it rendered much faster, but also because you avoid some of the issues with hexagons being "bent" in the middle).

Hexagons are slightly simpler to use for the map objects because: (a) they are "round" so you can put a good sized object in a single tile, (b) hexagons are all oriented the same way (whereas every other triangle is upside down), (c) more neighbors gives you more directions for movement. But triangles are easier and faster to render. If you try using both, you will end up with hexagons that have three different slopes. To deal with that you'll want to put your objects on stilts or have graphics that allow the objects to be built in the hillside (I have no experience with this, so I don't know if this works out in practice).

Unfortunately, a few years ago I found TTD (in the bargain bin at Best Buy). I've been spending time playing that instead of working on my game...

Post Reply

Return to “Zugspiel”

Who is online

Users browsing this forum: No registered users and 1 guest