• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
MichaelDeCicco

Terrain management on iOS for iPads?

6 posts in this topic

I've been looking around the internet for the past week on and off and can't find anything about what sort of terrain management system would be the best for specifically the iPads.

I wanted to implement ROAM but I can't seem to understand certain aspects of it for some reason and it's taken a massive amount of effort to not only have time to program recently but also understand the concept of the ROAM algorithm. So before I put the effort into it, would it be a lost cause due to the possible performance issues? What would be the best kind of algorithm to use on the iPad? Should most of the work go to the CPU or the GPU?
0

Share this post


Link to post
Share on other sites
This is the technique I'm planning to use:on iOS [url="http://www.gamasutra.com/view/feature/1754/binary_triangle_trees_for_terrain_.php"]http://www.gamasutra.com/view/feature/1754/binary_triangle_trees_for_terrain_.php[/url]. I don't really know ROAM, but at a glance I think this BTT solution is a little simpler to get your head around.

In terms of performance on iOS, your main concern should probably be to minimise draw call count.
0

Share this post


Link to post
Share on other sites
The best for iOS devices is GeoMipmaps.
GeoClipmaps is the best overall, but requires vertex-shader texture reads.
GeoMipmaps is the next overall best and is fully compliant with the capabilities of iOS devices, as it requires no vertex-shader texture reads. Unity 3D proves that GeoMipmaps are viable and fast on iOS devices.


L. Spiro
0

Share this post


Link to post
Share on other sites
So I'm having a hugely difficult time visualizing some aspects of this in my head, which is a big part of the way I program things. There's that and some other things I can't seem to understand about terrain lod, specifically geomipmapping. I am starting to get a handle on it, but no matter how many threads or pages I read I just can't seem to get a clear view of what I'm programming.

So let me get this straight:
[list=1]
[*]With geomipmapping you start with a quadtree.
[*]That quadtree is subdivided enough times to give you the number of patches you want along the sides of the terrain.
[*]Each leaf node has an index buffer for each level of detail, each connected to a single vertex buffer (assuming the main vertex buffer is below 5MB)
[*]Magic stitching happens that I still don't have a clue about that fixes gaps between patches with differing lod values
[/list]

Is this even near the ballpark?
0

Share this post


Link to post
Share on other sites
GeoMipmapping does not use quad-trees (although it can). It typically uses grid-based tiles that are subdivided. You are describing progressive GeoMipmapping which is more advanced than you probably need.
GeoMipmapping can be very simple to implement in its most basic form. It is just a grid of terrain chunks that decrease in resolution by half the further away they are from the camera. You can decide which LOD to apply to any check using metrics as simple as this or optionally more complicated such that you account for view angle over the chunk etc.

You can also worry about the gaps later. Get the basic implementation down first and then you will start to understand the rest.


L. Spiro Edited by L. Spiro
0

Share this post


Link to post
Share on other sites
I only use the quadtree for culling purposes, the leaves of the quadtree hold the geomipmapping grid and the leave spaces are defined as the bounding box of the vertices used by that terrain patch. The branches are defined as a bounding box that contains all of its children. That way I can cull it all. That's not important though.

So here's what I have:
Terrain patches have MaxLOD number of index buffers which reference a vertex buffer for that patch, I realize that using vertex buffers for each patch isn't efficient enough, but it's just to get it working first.

At initialization the vertex buffers are created and then each lod level is created like this:
[source lang="cpp"]void GeoPatch::GenerateBuffers(const Vector2f &TopLeft,i32 Size,UHeightMap *HeightMap)
{
Vertices.Clear();
Vertices.SetRenderPrimitives(GL_TRIANGLES);
Vertices.ToggleVertexTexCoords();
Vertices.SetMaterial(UMaterial::GetBasicTextureMaterial());
Vertices.GetMaterial()->SetTexture(0,HeightMap->Map);

Vector2f TexScale = Vector2f(1.0f / HeightMap->Map->GetTexDimensions().x,1.0f / HeightMap->Map->GetTexDimensions().y);

for(u16 y = 0;y <= Size;y++)
{
for(u16 x = 0;x <= Size;x++)
{
u16 cx = TopLeft.x + x;
u16 cy = (HeightMap->Map->GetTexDimensions().y - TopLeft.y) + y;
Vector2f c(cx,cy);

Vertices += HeightMap->GetVertexAtPos(c);
Vertices.SetTexCoord(c * TexScale);
}
}

#define Idx(x,y) (((y) * (Size + 1)) + (x))
u16 Sy = TopLeft.y + Size >= HeightMap->Map->GetTexDimensions().y ? Size - 1 : Size;
u16 Sx = TopLeft.x + Size >= HeightMap->Map->GetTexDimensions().x ? Size - 1 : Size;

Indices[0].Clear();
Indices[0].Vertices = &Vertices;
for(u16 y = 0;y < Sy;y++)
{
for(u16 x = 0;x < Sx;x++)
{
Indices[0] += Idx(x + 0,y + 0);
Indices[0] += Idx(x + 0,y + 1);
Indices[0] += Idx(x + 1,y + 1);

Indices[0] += Idx(x + 0,y + 0);
Indices[0] += Idx(x + 1,y + 1);
Indices[0] += Idx(x + 1,y + 0);
}
}

for(u8 Lod = 1;Lod < Parent->MaxLOD;Lod++)
{
Indices[Lod].Clear();
Indices[Lod].Vertices = &Vertices;
u8 Skip = Lod * Lod;

for(u16 y = 0;y < Sy;y += Skip)
{
for(u16 x = 0;x < Sx;x += Skip)
{
Indices[Lod] += Idx(x + 0 ,y + 0 );
Indices[Lod] += Idx(x + 0 ,y + Skip);
Indices[Lod] += Idx(x + Skip,y + Skip);

Indices[Lod] += Idx(x + 0 ,y + 0 );
Indices[Lod] += Idx(x + Skip,y + Skip);
Indices[Lod] += Idx(x + Skip,y + 0 );
}
}
}
#undef Index
}[/source]

The code is pretty straightforward, Size = size of terrain patch, TopLeft = top left of terrain patch, Heightmap = the heightmap..

That's not important either. Just know that it sort of works even though it presents some graphical errors probably from not using power of two + 1 size heightmaps or whatever has to happen there. I'm sort of fuzzy on that and haven't found anything around the internet that clearly defines it.

I haven't implemented anything to choose LOD yet
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0