Announcement

Collapse
No announcement yet.

Civ on a sphere step one: geodesic tiling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Civ on a sphere step one: geodesic tiling

    This:

    (edit: That image isn't showing up for some reason. See this: http://postimg.org/image/kjcba8drl/)
    That is a sphere, built by a function that takes an arbitrary integer, and puts that many hexagons between some pentagons. Holy freaking vector math, did that take a long time to program. This particular sphere has 25 hexes between pentagons. Click here for hi-res version: [shot]http://postimg.org/image/szkuyg9p9/[/shot]


    15: [shot]http://postimg.org/image/qtqk3y68t/[/shot]
    10: [shot]http://postimg.org/image/8bm7jpogt/[/shot]
    5: [shot]http://postimg.org/image/sk9l5fnrx/[/shot]
    1: [shot]http://postimg.org/image/lr9895wyl/[/shot]

    #2
    That's pretty awesome. I can't help but feel the pentagons will break the game mechanics a bit - are you going to make them non-passable / usable?

    Out of curiosity, why did you not just mathematically define the grid, and overlay it in the materials instead of making each tile an actor? (Also, what are you going to do with it - my mind is reeling from the implications! )

    Comment


      #3
      Thanks Ambershee. To tell you the truth, I can't actually merge this into any current version of Civilization, but I might be able to make my own game. An actual globe-shaped map surely would break much of Civ, but if I designed a game around the idea, I think I could make it work.

      I've never tried overlaying a grid before. Maybe I should try it. Spawning a new actor just seemed like it made sense, but it does seem to slow down my system when I make a very large sphere. I was thinking that if every cell (hexagon or pentagon) were its own actor, I could give it a terrain type, unique mesh, movement cost, resources, and everything else one would want in a strategy game. The next thing I think I'll do is fine-tune the formula to spread the cells a little more evenly away from the edges, then I'll see about making a world-builder program that can save and load maps and change the terrain type on the cells.

      The only thing I'm really dreading right now is pawn pathfinding along a sphere, and figuring out which cells are connected to other cells, and which cells are within movement range. But that's pretty far down the road...

      Comment


        #4
        The things with terrains can be done, with an array of arrays of arrays, which holds data for each position.

        Comment


          #5
          Originally posted by Nathaniel3W View Post
          Thanks Ambershee. To tell you the truth, I can't actually merge this into any current version of Civilization....

          ...An actual globe-shaped map surely would break much of Civ
          Given that Civ isn't very moddable, I'm already aware that this is the case

          I don't think the globe shape would make much difference though. The game mechanics operate entirely in two dimensions and have no concern for height or anything else; placing it on a sphere only really serves to make it wrap around differently.

          Originally posted by Nathaniel3W View Post
          but I might be able to make my own game...

          ...but if I designed a game around the idea, I think I could make it work.
          This is what intrigues me. I'm fond of Civ style games and other turn based games that use grids, but I'd never really considered operating fully in three dimensions before.

          Originally posted by Nathaniel3W View Post
          I've never tried overlaying a grid before. Maybe I should try it.
          I recommend it - I've done it before in two dimensions and it's actually quite easy and flexible to set up. My algebra isn't great, so I never ported my work to UDK (though if I had unlimited time and patience, I certainly would!). I would not personally be able to do it in three dimensions however. If you want to chat on something like Skype, I can talk you through the process of recreating my own technique in two dimensions, and you could work from there to get everything else in that you might want. It should sort out all your performance and pathfinding issues; if you think you can handle the math that is!

          Comment

          Working...
          X