• 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
Jossos

A tile system... for a sphere?

12 posts in this topic

So I'm trying to work out how I would go about doing a tile system wrapped around the shape of a 3d sphere (like a planet). I can do this in the shape of a Torus quite easily, but it's a sphere I'm after. I'm not even sure where to begin to be honest.Computer generated spheres (like in maya or 3ds max) seem to use triangles for the poles and the squares squash and stretch to fill the shape, which is just no good for a tiling system for a game.

 

Any help is appreciated.

Edited by Jossos
0

Share this post


Link to post
Share on other sites

Actually, I have always seen the subdivided cube approach as probably being easier for this particular item.  You start with 6 faces (2 triangles each of course), when you subdivide you push the new verts out to the sphere boundary repeat.  The advantage is ending up with rectangular areas after each subdivision which keeps the texture mapping simple.

2

Share this post


Link to post
Share on other sites

Do you really need to tile the whole sphere at the same time? Maybe you can get away with a tangent plane; whenever the "camera" moves you switch to a nearby tangent plane, pretending that the sphere is flat. 

0

Share this post


Link to post
Share on other sites

Beside using some ico sphere, there is another way to do it. It might work or not depending on the kind of game you are implementing.

 

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

 

Then the trick is to use a spherical vertex shader to make the 2D plane looks like a sphere. The idea is to rotate each point in function of their distance from the center of the screen. There is not much about it on the web but it's not difficult to implement if you know a bit of GLSL.

 

The nice thing is that all the logic is very simple because it's still 2D however it gives to the player the illusion that he is playing on a sphere. Here is a proof of concept (a project that I sadly abandoned) :

http://www.zappedcow.com/sphere/

1

Share this post


Link to post
Share on other sites

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

 

This more of a torus really. But I like this idea a lot, and might just do that.

0

Share this post


Link to post
Share on other sites

And what you think about hexagon sphere? Its possible to be done as easy as triangles (becuase its made of them), and also hexagons are nice fields for strategy game (a lot of games use those already).

Edited by Zennoya
0

Share this post


Link to post
Share on other sites

 

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

 

This more of a torus really. But I like this idea a lot, and might just do that.

 

In case you're curious, the perspective would end up looking something similar to this:

http://www.youtube.com/watch?v=B0yKuLopp8c

 

Actually those special stages pull off that very same trick (OK, not exactly given the hardware that was on, but I mean it was just a 2D plane with a fake sphere look). I don't think anybody ever bothered to wonder how those special stages would map to an actual sphere.

0

Share this post


Link to post
Share on other sites

And what you think about hexagon sphere? Its possible to be done as easy as triangles (becuase its made of them), and also hexagons are nice fields for strategy game (a lot of games use those already).

 

It's not possible to make a sphere out of hexagons, without a few pentagons

0

Share this post


Link to post
Share on other sites

The one you see most often from modelling tools is made by starting with an icosahedron and subdividing each triangle. As I think you're getting at, triangles aren't very good cells for a strategy game.

 

But, if you take your subdivided icosahedron and truncate it (http://en.wikipedia.org/wiki/Truncated_icosahedron), then you get an awesome shape sometimes known as a buckyball, which is made up of lots and lots (number depends on how subdivided the icosahedron was) of hexagons (which are great for strategy games) and 12 pentagons (which are rather inconvenient). However, if you can live with those pesky pentagons somehow, then this is a great option.

 

If you want square cells (or just a simple life), then as AllEightUp says, take a cube, subdivide it, then warp it into shape. When you warp your cube into a sphere, the squares become misshaped and inconsistently sized. This approach http://mathproofs.blogspot.co.uk/2005/07/mapping-cube-to-sphere.html is slighty better than the obvious approach of just normalising each vertex.

 

I second the buckyball idea. Actually, you could use triangle tiles to draw it (just squishing the tiles that make up a pentagon a tiny bit), but for game logic purposes use the center of the pentagons/hexagons as tiles. Or alternatively, if you want all your faces to be the same size and shape (but irregular triangles) draw a pentakis dodecahedron and use the vertices as game positions. Either way, each of the 32 "game tiles" still has 5 or 6 neighbors.

0

Share this post


Link to post
Share on other sites

Look at the sphere on the extreme right in this: http://sol.gfxile.net/sphere/

 

Take two triangles, they form a distorted square (where triangle join at the diagonal of the square).

 

Perhaps you can distort your square tiles in the same way and use them to tile the sphere?

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