Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Cruiser1

Pages: [1]
1
Programming / Mazes: Not just for Maze-related scenarios
« on: November 25, 2013, 08:29:40 AM »


Parts of the programming in the Hunger Games Roguelike use Mazes for things that aren't Maze related, which might be of interest. The Hunger Games Simulation is a part of the Maze program Daedalus, and so has access to many Maze creation and solving abilities, which can be used to help create landscape features. Consider the random arena map above, which is a flat wooded grassland with rivers, lakes, mountains placed upon it:

Rivers: We want to have random river-like lines crossing the arena. To do this, we create a Maze (a "perfect" Maze with no loops) the same size as the arena, then solve it leaving a single squiggly line. Each additional entrance on the edge of the bitmap results in an additional line or fork in the river. (The river in the map above is from a Maze with four entrances/exits, one on each edge of the bitmap.) The solved path is expanded slightly so that fanfold passages will merge into each other, resulting in a slightly wider section there, so the river realistically has different widths in different areas. The Maze is generated with the Growing Tree algorithm, which has the right amount of curviness (curvier than Prim's Algorithm, but not as curvy as Recursive Backtracking).

Lakes: To have lakes, mountains (and meadows which are open spaces in the trees) we want to create irregular boundary shapes. To do this, we start creating a Maze in a separate bitmap using Prim's Algorithm, which semi-roughly "flows" outward from a start point. Stop creating the Maze after a certain number of cells, then expand the paths slightly so the passages cover adjacent walls, and the shape of the visited cells forms a nice random blob, which can then be randomly placed over the arena. For example, lakes will occasionally have small islands in them.

2
Download page: http://www.astrolog.org/labyrnth/daedalus/hunger.htm
Wiki page: http://roguebasin.roguelikedevelopment.org/index.php?title=Hunger_Games

I've created a Hunger Games theme roguelike, inspired by "The Hunger Games" book trilogy and movie. As expected, you're one of 24 tributes forced to fight to the death until only one remains standing. Personally, I really enjoyed the novels, and wanted a video game simulating you playing in the arena. As a long time fan of roguelikes, I felt that genre is an effective way to represent arena exploration and combat with fellow tributes (potentially large group combats like in the opening "Bloodbath"). The Hunger Games is free software for Windows, with full source code available. In addition to the Hunger Games theme, it also features 3D first person perspective graphics (similar to Dragonslayer, my other roguelike).


This screenshot is a 3rd person overview of the randomly generated arena, showing the 24 tributes in a semicircle, the central "Cornucopia" containing a concentration of the best gear, and the surrounding woods.


This screenshot shows the early game Bloodbath battle. The "Career tribute" alliance of Districts 1, 2, and 4 is guarding the mouth of the Cornucopia against the girls from Districts 6, 7, and 3.


This screenshot shows an example of winning, in which you nicely avoided killing your District alliance partner until you were the final two remaining.

Pages: [1]