• Content count

  • Joined

  • Last visited

Community Reputation

3 Neutral

1 Follower

About Outliner

  • Rank

Personal Information

  • Interests
  1. Lately I've been working on building up a game's terrain from grid-aligned pieces. We might call these pieces metatiles because each piece is made of a collection of grid tiles that work together to create a unified feature in the game world. The beauty of this approach is that it fits neatly within the grid of a height mapped terrain. The difficulty is determining how to maximize the flexibility of the system using very few metatiles. Not only does a metatile require time and effort to design and model, but having a vast library of metatiles to choose from would complicate the world editing process. In my experience, most complicated metatiles boil down to arrangements of a few fundamental types of pieces. My idea is to simplify the whole process by restricting the game to features built up out of these six metatiles, plus flips and rotations: The red lines represent the feature that is drawn through the grid cells, and the gray lines represent how the cell is triangulated around the feature. For example, the red line might represent a vertical cliff or the boundary between one area and another, like the edge of a road or the shore of some body of water. These pieces, plus the flexibility of a height map, should be enough to create a wide variety of game terrains. The question is how does one build build an easy-to-use editor around assembling such small metatiles? For example, you can build up a curve out of these pieces by starting at a point and dragging the mouse in the desired direction. The editor would automatically choose the piece that most closely matches the direction from the current point to the mouse cursor. We can preview the next piece and perhaps wait for a mouse click to accept it, then continue with yet another piece until the curve catches up with the mouse. If the next piece would overlap with an existing piece, we display the preview in an error color and refuse to place the piece. Has anyone ever seen a system like that? While the above seems technically sufficient, there are a few details that would make editing awkward without additional automation. For example, a road would usually tend to have two parallel edges, and manually creating two parallel edges along a curved road in a system like this would be tedious and tricky. There is also a question of UV-mapping and how the user would specify the UV-coordinates of things like cliff walls and road surfaces. Ideally UV-coordinates would be handled entirely automatically.
  2. Octagon-Square tiling for world map

    Good point. I'm not seriously concerned about the landscape having a realistic shape at the moment, but if we do end up using height maps then it might be nice to have erosion algorithms and so on to carve believable mountains. Right now I'd be happy to have vertical cliffs and blatantly unrealistic mountains, but my standards may rise in the future. I've been doing some work with graph paper to see how my metatiles may go, and my cliffs effectively end up being facade objects, except I'm planning to delete the terrain faces beneath the facade. I'm using a 7x7 subtile grid because the diagonal across 5 tiles is very close to exactly 7 which makes it easy to model roads and rivers the same width whether they are diagonal or axis aligned. The plan is to manually construct a text file that contains a list cliff metatile descriptions. Each description would contain the 7x7 collision array for each tile, and a list of 2D points and triangles relative to the subtile grid. The listed points will define the curve of the cliff through the subtile grid. Integer points will be translated to the corresponding subtile vertices, and fractional points will be bilinearly interpolated. The listed triangles will specify how to re-triangulate the terrain mesh around the specified curve, with triangles on the left side of the curve being listed separately from triangles on the right side of the curve, since one side or the other will need to be raised to the top of the cliff. We can cut a hole in the terrain mesh based on the collision arrays and then construct a mesh from the text file to neatly fill in the hole with a cliff. Other types of metatiles would be handled similarly, and the various metatiles would share many curves. For example, a curve used to define a cliff can also be used to define one side of a road metatile. This saves modelling effort and also allows a road to perfectly hug the edge of a cliff. I don't expect to be able to use a terrain object supplied by Unity. Considering how seriously I intend to carve up the terrain, it's surely easier to start from scratch. I don't have much of a plan for dealing with LOD, but we can at least use simplified meshes for the empty tiles in the distance, rather than rendering the entire 7x7 grid on every tile. It's not clear how we might simplify tiles that are in use by metatiles except by eliminating the metatiles. Unfortunately roads, rivers, and cliffs are exactly the sorts of details that we'd want to preserve when viewed from a distance. I would love to avoid doing terrain modelling in Blender. Imagine what would happen if I wanted to adjust the height map. I'd need to bring the modified height map into Blender again and start from scratch with push/pulling the vertices and creating the caves and so on. Making a large scale terrain by moving individual vertices in Blender feels like washing a car with a toothbrush. I have heard of this technique in several places. I have always dismissed it as impractical because you would need a special editor to manipulate such 3-way displacements. This approach doesn't seem to make modelling easier; it is just an alternative way to store the mesh you're trying to create without helping you to create it.
  3. Octagon-Square tiling for world map

    It is a RPG in the style of classic Final Fantasy where the player wanders around the world having menu-based encounters. To that end, there needs to be a world to explore, but there also needs to be barriers to block the player from going straight from A to B. Rivers and forests can play this role, but from the very first version of the design document I've been imagining cliffs. When I say cliffs I mean sharp changes in elevation that create vertical walls. This requires the terrain at the top of the cliff to have a much higher elevation than terrain at the bottom. Cliffs also serve as a location for cave entrances which would send the player to a dungeon/maze. Aside from facilitating cliffs, elevation serves no direct purpose in the game. Even so, there is a more nebulous goal that elevation might contribute to. It's important that the player be able to recognize the various locations in the game by sight. If everywhere looks the same then exploration would feel tedious and the game would fail to be fun. Variations in elevation may be an excellent tool to add distinctiveness to locations. I don't particularly want to displace ground to make rivers. That is just a technical trick to allow me to render rivers. Alternative approaches are welcome. Player-controlled terrain modification is not one of the goals for this game. It would be excellent to have the terrain change in pre-programmed ways as the game's story progresses, though that seems very ambitious when we're still struggling to render any terrain at all. This is exactly the case. Tiles seem like a regrettable compromise made only for the sake of level building, so I'm constantly looking for ways to make the tiles less visible to the player. The idea of building a level by fitting together pre-constructed pieces is very appealing for its efficiency and I'd gladly sacrifice life-like graphics for the sake of efficient level editing, but I don't actually want the tile-based look, especially if the tile-based look ends up making the various parts of the game world look the same. That is a very impressive tool. The most interesting parts for my purposes are the tools that generate roads and rivers from splines, because roads and rivers are important elements in my game design. There is no use for randomly generated terrain in this story-oriented RPG. A major challenge in any big project is deciding when to abandon your goals for the sake of the project. From the beginning I've wanted vertical cliffs to act as barriers and hold cave entrances. I also want roads that look like actual roads by having textures aligned with the direction of the road. These are things that a simple height map cannot do, but modelling the game terrain as a simple height map would be so easy and relieve all the struggle. Do I abandon sharp cliffs and directional roads for the sake of the simplicity and flexibility of height map terrain? If I instead go with a grid-based tile approach I can easily get directional roads and sharp cliffs, but the result is sacrificing all the subtlety and flexibility of height map terrain. Metatiles are a powerful compromise between the two, at the cost of being technically more complicated. The options are overwhelming. My current target is Unity. That also has prefabs, but as far as I can tell there's no way to make a prefab to do what metatiles must do. A prefab can contain some geometry, but it won't automatically manipulate a height map to create a river or flatten the ground beneath a road segment. The fact that two metatiles can share a single tile forces them to have a lot of subtlety that ordinary tiles don't have. Of course if we were just using ordinary tiles then prefabs would be ideal.
  4. Octagon-Square tiling for world map

    What about the way that the object modifies the underlying height map? A river has a bit of geometry for the water surface, but mostly it is a depression in the ground height map. In fact, it seems that everything would be manipulating the height map. Roads, beaches, cliffs, and whatever else are all intimately tied to the height map, and the height map is a grid just like your proposed subtile grid. If two objects were trying to modify the same height map vertex, that would cause problems. For example, if a road were along the edge of a river and they were close enough that the road was trying to flatten the same vertex that the river was trying to depress, nothing good would come of it. This might happen even if their geometries have no collision, unless we expand the collision geometry to either side to avoid this issue, but that would mean the objects block more space around them than necessary. It seems that the fact that we need to use height maps for rivers is almost forcing us to use subtile grid collision detection. On the other hand, I have some concerns over what tools I would use to create these metatile objects. Was this latest advice designed to help simplify the construction of metatiles? Since these objects are more than just geometries, it seems that Blender and kin are not options. I know of no way to make Blender aware of the game's height map grid, nor any way to export the relevant depression data. I should probably ask about that on a Blender forum. The more I think about how I'd construct metatiles, the more appealing it seems to design them with pencil and paper and import them into the map editor by hand.
  5. Octagon-Square tiling for world map

    I was hoping for a one-size-fits-all solution, but any solution is good enough. As I understand this solution, it means dividing the simple ground tile into a height map grid an depressing the vertices beneath the river. This might be done using the collision subtile grid and depressing the subtiles that are marked as being part of the river. Alternatively, river metatiles might have a special float array that stores how far the height map should be depressed at each vertex to allow for fine control and allow us to vary the resolution of the height map independently of the resolution of the subtiles. In contrast, roads would be handled entirely differently. We would force the height map to be exactly flat beneath the road, then have the road hover above the ground by a small distance to be sure that none of the ground pokes through. Other things that we'd want would also need to be handled in their own particular ways. For example, beaches are neither quite like roads nor quite like rivers. They slope down toward a body of water, so they're not flat enough to handle like a road, but they're also not depressed like a river. How could we be sure that the ground wouldn't interfere with a beach? I think I've figured out how to do cliffs. Naturally the metatile would includes a mesh for a vertical wall along the cliff and the metatile would raise the height map on one side to match the top of the wall. Then the metatile just needs to cover the gap between the top of the wall and the ground by including hand-crafted polygons that precisely connect the top of the wall to the height map vertices. The map editor for this game is going to be more complicated than the game, but it's going to be worth it.
  6. Octagon-Square tiling for world map

    This is a more sophisticated technique than I am used to. Ordinarily when I think of 3D rendering I imagine a scene being built out of pieces as if they exist in a real 3D space. My concern about drawing the simple ground and then the road isn't that it would be inefficient due to unnecessary drawing; my concern is that the simple ground would conflict with the road. The road might be raised above the ground slightly to avoid conflicts, but that would never work for a river which must be below the ground level by its nature, so layering both the ground and the river would hide the river completely. It occurs to me that there might be a way to render this with multiple passes. For example, we might render the ground first, then throw away the depth buffer, then render the road/river/whatever. That way something like a river could sink below the ground without being covered by the ground. Unfortunately that approach wouldn't work quite so simply because the ground is sometimes supposed to cover the river, such as when looking at the river from ground level so that the water is hidden by the river bank. I'm having a hard time picturing how this is supposed to be done.
  7. Octagon-Square tiling for world map

    I have created some illustrations to show what I mean. Imagine that the blue square above is one of the game's tiles. In green we have the wireframe of two roads that each come from a metatile. Since they are multi-tile objects, they pay no attention to the tile they are crossing over, and if the tile were left in this state the space between the roads would be an open void. This is the key point. How do we do this? Let's use another illustration to see what the tile might look like once we've put some ground in between the two roads. In red we see a mesh that neatly covers the void. Imagine that it is textured as bare ground. To be clear about the question, let's look at the ground mesh alone. This is the shape that is needed to fill the space between the two roads. It doesn't need to be exactly this mesh, but it needs to cover the same space and the vertices along its edges need to precisely match up with the vertices on the edges of the roads. Is this an asset that should be prepared in advance? Should it be somehow generated as needed? If it is prepared in advance, how would we lookup the necessary mesh for each tile? If we generate it as needed, what data structures and algorithms would you recommend to do the generation? Now that the challenge is hopefully clear, the proposed solution that I mentioned earlier can also be clear. I'm thinking of doing a grid-based mesh that fills in all the unoccupied subtiles. This requires that each metatile takes care of filling in every subtile that it touches, but that's no problem since metatiles never have to share a subtile with any other object.
  8. Octagon-Square tiling for world map

    I see what you mean. The road metatiles would naturally be designed so that the end of one road segment perfectly fits with the start of the next one. The difficult connection isn't at the point where one road segment continues another because that can be predicted and standardized. An example of a difficult connection is between a road and the rock sitting beside the road within the same tile. The rock could be anywhere, so there's no way to standardize that connection. Or consider two roads passing near each other and touching the same tile. Each road supplies its own mesh, but what do we do for the remainder of that tile to make it fit with the two roads?
  9. Octagon-Square tiling for world map

    To keep things consistent I would make everything a metatile even if it occupies only a single tile. That's probably wise. Even if it seems unlikely that more than two things would fit onto a single tile, there's no reason to create such an artificial restriction. It's a pretty big difference. It's easy to combine images with alpha channels. It's not at all easy to combine separate meshes together. The subtile concept is a great way to keep the meshes from colliding, but connecting the two meshes across the gap between them is not obvious. One approach might be to ensure that there is no gap between meshes by requiring that every subtile be completely filled. So if a metatile touches a subtile, then the metatile is responsible for covering the entire subtile, and an algorithm could be devised to efficiently fill the uncovered subtiles in each tile.
  10. Octagon-Square tiling for world map

    I like this idea, but making it memory efficient like this seems unnecessary because we wouldn't have a subtile array for each tile in the world. We would only need a subtile array for each tile of each meta-tile, excluding those meta-tiles that can share the same subtile array. Since it's not memory per world tile, it can't impact on how much world we can hold in memory at once. Each world tile only needs slots for up to two meta-tiles in no particular order. We can use that to indirectly look up the collision data to check if adding the second meta-tile to this tile is legal based on the collision data of the existing meta-tile. It is also useful at runtime for doing collision detection with game characters. One issue with this approach is that it means that up to two meta-tiles share the responsibility for rendering the same world tile. When the tiles are just images we can just use an alpha channel to determine which meta-tile is responsible for which part of each tile, and use a background image for the parts that no meta-tile claims. It's not so easy if we want to render each tile as a 3D mesh to allow the player to get a closer look at the world. Each meta-tile would contribute a mesh to the world without difficulty, but it's not obvious how we would fill in the ground between the two meta-tiles when two meta-tiles share the same world tile.
  11. Octagon-Square tiling for world map

    What do you do when more than one element share a tile? For example, in an 8x8 wide curve it leaves an area inside the curve where track can be laid. If the entire 8x8 area is considered part of the element, then any other elements within that area would have to share tiles with the wide curve. Even if we strictly specify that only tiles directly touching the track are part of the element, there would still be situations where a tile can touch more than one element. Each time a diagonal track crosses a corner it absorbs a tile to either side of the corner, so two parallel diagonal tracks can easily share tiles. It would be fascinating to learn how Locomotion handles its diagonals. Perhaps it allows its square tiles to be split into two triangular tiles so an element can own half a tile. That way diagonal tracks don't own more tile than they need.
  12. Octagon-Square tiling for world map

    That's a really interesting option that I hadn't considered. Does anyone know of any resources for how to implement such a system? There is some question about what sort of data structure should be used to represent a grid that can have multi-tile elements, but even more difficult would be creating an editor for such grids that would be easy to use.
  13. Octagon-Square tiling for world map

    I see what you mean. It's probably best to do the tiles in layers. For example, the road could be on the top layer and the ground the road runs across can be the bottom layer. That way we can rotate the road without rotating the ground, so the ground only needs to tile seamlessly in one orientation. There would be a seam between the ground and the road, but that is a natural place for a seam so it would probably be acceptable. There are only a few possibilities for what the squares need to be, assuming we only allow roads to begin, end, or turn in the octagons. We need a square with no road, a square with road going from bottom-left to top-right, a square with road going from top-left to bottom-right, and an intersection where the road comes in from all four directions. That is all the possibilities for road squares done in four assets, and one of them is just a rotation of another. Double the assets when compared to what? Do you have a preferred alternative in mind?
  14. Octagon-Square tiling for world map

    The big savings from a square and an octagon comes from features that run diagonally. For example roads are usually restricted to horizontal and vertical when they are being rendered with tiles because a diagonal road will awkwardly cut across multiple tiles. When a road crosses a corner between four tiles it means a piece of the road ends up on all four, thereby complicating all four tiles. With square and octagon tiling, a diagonal road can be rendered just as simply as a horizontal or vertical road because it never needs to cross a corner. A diagonal road is as simple as rotating the tile of a horizontal road by 45 degrees. That depends on the point of view. From a game design perspective I neither need nor want grids. There are no grids in the design document. All I need is world to explore for an RPG. It's not a turn-based game where the grid defines where you can stand and how far you can move. I'm doing my best to make the grid as unobtrusive as possible so the player won't notice it, and ideally there would be no grid at all. The reason I'm using a grid is purely technical. I don't want to hand-model the whole game world, so I'm looking for shortcuts, and building the world out of tiles should make this considerably easier. The grid is needed only because it's the best option I've currently been able to find. It is an RPG in the style of classic Final Fantasy where the player wanders around a map and has text-based encounters. Therefore I'm looking for a simple way to render large amounts of terrain. As far as I can tell seamless tiling of textures for octagons and squares is just as easy as tiling an ordinary square grid. Think of it as cutting off the corners of the squares and then filling in the gaps with a smaller square. You can use the texture from the cut off corners in the small square and then you've automatically got seamless tiling for octagons and squares.
  15. I'm looking for a way to render a game world that allows for both flexibility and easy editing. Directly modelling the world by hand is too labor-intensive. Using a pure height map is great for rolling hills, but terrible for anything else. Building a mesh from a vector representation of the map would seem to be ideal, but the geometric algorithms involved are quite difficult. Using a regular square grid is appealing in its simplicity, but only being able to use 90-degree angles everywhere would be painfully obvious to the player. Hexagon grids suffer from being unable to use 90-degree angles anywhere. My latest idea is an octagon-square grid, which consists of a regular tiling of octagons with squares to fill in the gaps between diagonal octagons. This has numerous benefits. Tiles can be rotated 8 ways, so one tile can do the work of 8, while squares usually only get 4 and hexagons only get 6. Broad winding features like roads, rivers, and beaches are free to wind in 8 directions without the complication of passing over a corner. 45-degree angles are almost small enough to prevent players from noticing that the game is rendered on a grid, especially when viewed from a first-person angle. It is far less obtrusive than other options. This seems like a good plan, but it's not easy to find resources on the internet to make it easier. For example, where are the pre-made octagon-square tile sets? I couldn't find anything about octagon-square tiling on gamedev.net. Am I failing to see some issue that makes this approach unpopular? Is there some easier way to get the same effect, or is there some hidden pitfall that will cause me problems?