This blog has moved. Visit Groundswell Games for the latest. Remember to update your bookmarks and RSS feeds.
Showing posts with label terrain. Show all posts
Showing posts with label terrain. Show all posts

Tuesday, July 29, 2008

Unity 2.1!

Ok, this news is pretty stale at this point, but it's worth posting anyway. Unity Technologies released Unity 2.1 on Friday. This update was a long time coming (about nine months I think), but it's a doosy. The message around this update is that it finally makes Unity MMO-enabled. How? Well...

  • Endless streaming terrains. Yes, that's right, Unity now supports as large a world as you want to create. You can build multiple terrain tiles and stream them in to create truly massive worlds. Anyone following TGNM the last month or so knows I've been working toward a home-grown version of the same thing. I had a feeling the Unity folks would throw something like this, but I couldn't be happier. Ok, I could be happier: I haven't figured out how to make these nifty new features work yet. The documentation is noticeably lacking so far.
  • More realistic terrain lighting. Terrains in Unity 2.0 would only work with directional lights and lightmaps, which severely limited things. You couldn't, for example, light a road with torches in any realistic way. Terrains also now work with projectors, which means better shadow effects (for poor indie owners like me--terrains support real-time shadows for pro licenses) and the possibility for projected spell effects or selectors.
  • Procedural control over characters and animation. Unity always had a really flexible animation scripting system, but now it's possible to create even more advanced effects like on-the-fly creation of skinned meshes. This stuff is pretty advanced, but it seems to open the door for really flexible MMO-style character creation. You can also sync scripted events with animations, making it easy to spawn things like footprints, footfall sounds, impact effects, etc.
  • Streaming assets. This feature, alas, is reserved for pro licenses, but you can now pack up any group of assets in Unity into a bundle and stream it in as the player approaches.
All in all it's a pretty amazing release. There are still plenty of things huge things that would be required to build an MMO with Unity, like all the back-end databases and server configurations, but this is a major step.

Sure, I suppose I could feel annoyed that I spent so much time doing things the hard way with terrain, but who am I kidding? I always do things the hard way.

Wednesday, July 23, 2008

Seamless tiling terrain, in pieces

I've still been working away on several things since my last post, but most of the sweat has gone into correcting a few issues with the looping terrain I linked a couple weeks ago. I'm happy to report that I've finally fixed the two things that were driving me crazy:

  • Published versions of the file were strangely not rendering the main instance of the terrain from certain angles. Something about it was not working nicely with the camera. I never figured out why the problem was happening, but I did manage to work around it.
  • It was painfully obvious where the seams were between tiles. The cause for this was pretty obvious as well: While the vertices lined up perfectly on the edges of the terrain tile, the normals did not, which made light react differently to two vertices located in the same place along the edges. Unfortunately it took way too long to fix the problem. In the end, very little code was involved (which is not to say that I didn't write a lot of unnecessary code along the way), but I used quite a bit of scratch paper trying to figure out how to access normals on the mesh's borders.
Anyway, check out the new, improved version.

But wait, there's more! I also developed a system to generate floor tiles around you as you walk. This means you could walk forever in any direction, and there will always be something to walk on. By itself this isn't terribly interesting, as you can see. Still, the possibilities are pretty cool. If I could generate random terrains a little more quickly, I could generate a truly endless, randomly generated terrain.

Or, even better, I could create any number of seamless terrain meshes and load them in as necessary around the player a la World of Warcraft. I would just need to store a master grid of terrain tiles and keep track of the player's location. I'm still a few steps away from there, but it's starting to look doable. Pretty cool, huh?

Wednesday, July 2, 2008

Notes from the abyss

Absentee bloggers are no fun. They entice you with a stream of regular posts and then disappear for weeks at a time, offering not a peep. When they do return it's just to supply excuses about a busy schedule or an obsession with the latest big game or to post frivolous items like creatures of the week.

Well, I'll not become an absentee (denial is an ugly thing). I have no excuses. But, for those few loyal readers who still stop by from time to time, here's a little update on my activities.

In short, I've been scattered, lacking focus. When I started writing this blog, I was working steadily on a single, massive, impractical project. Then I decided to turn my attention to SPUDZOOKA, and still I was focused. After releasing SPUDZOOKA, though, I haven't been able to settle on anything. I still work on things, a little here, a little there. But three things have primarily held my attention the last few months:

  • A new game. No specifics yet, but I've been working on a concept for a new game quite a bit different than SPUDZOOKA, one that will focus more on story and character and, I hope, have a wider appeal (not that potato cannons aren't universally entertaining). The difficulty so far is that story and character are tricky to develop and, while I think the concept and setting are good, I haven't been able to find the game in it. People might explore for a while, but what would compel them through the story?
  • A web site concept. I had an idea for a web site recently that I've been exploring, which means reading a lot about databases, php, and xml, and then tinkering with them to see if I've got the programming chops to make this idea happen.
  • Procedural terrain generation. Huh? I don't know where this stuff comes from, but I got it in my head that I would try to see if I could generate an application in Unity that would dynamically generate and display an endless terrain. The usefulness of something like that is maybe a little suspect, but it could spin off into some interesting applications. Unity's terrain system is a little limited right now, for example, so something like this could help people generate more realistic terrains and link them together to create truly massive worlds. Even just linking sections of terrain terrain together is something that could be useful right off the bat, particularly in, I don't know, an RPG. I hit a few tricky parts, but I did manage to create a randomly generated terrain that loops forever. Check it out (it may take a few seconds to compute).
So, I've been working, just not on a single project. Once I settle, I'm sure regular posting will resume. For now, don't forget to check back for the next creature of the week.

Edit: I fixed the bug that people were seeing in the web player and put a new file at the same location.

Thursday, October 18, 2007

The world isn't flat, it's square, part 2

Well, I'm stumped. After what seems like days of pondering, I can't think of a way to create the illusion of a massive world using one square terrain. Sure, the terrain might look fantastic when you're near the middle of it; the problem arises when you approach the edge. What looks like a vast mountain range head-on just looks silly from the side.

I've considered several options, and none of them really satisfies me:

  • Use a truly huge terrain. This option is quite attractive, but I pause because, while there seems to be no upper limit to the size of terrains Unity will let you try to create, there is certainly a limit to how large a terrain most computers will handle without choking (I've hung Unity more than once by trying to create too large a terrain). It is therefore a requirement to divide things up into sections.
  • Hide the edges of the terrain. One obvious way to do this is with water. Indeed, islands are probably the ideal use of square terrains. But I'm not creating a group of islands Myst style, I'm creating continents. Another option is the inverse of islands: valleys. If each area of the world is surrounded by impassable cliffs, the player will never see the edges. That might work, but what if you discover some lofty perch that lets you see for miles? You would see the edge of the world, and beyond that, nothing. It would be very disconcerting.
  • Build a backdrop. Hiding the edges might work, but a world full of squarish islands and valleys isn't very appealing to me. Besides, how can you let the player travel between areas without letting them approach some sort of boundary? Another option, then, is to acknowledge the edge of the map and just use a flat image that looks like it carries on into a new area. The illusion might be convincing enough for the player to go with it. Final Fantasy XII uses a technique like this to divide many of its zones. Unfortunately, I'm not confident in my ability to paint a backdrop that gives the necessary sense of depth.
  • Something in between. Or I could use some mixture of the first two options. I could hide the edges by building a terrain that is considerably larger than what I need for an area but not so big that it would slow things down. Then I could focus the action of that area near the middle of the terrain, and the functional boundary between zones could exist some distance away from the terrain's actual edge. This could certainly work, but it seems like an inefficient use of the computer's memory and, frankly, like a waste of space.
That's a lot of words to say that I don't know what to do. If anyone has ideas, please let me know.

Part of the trouble, of course, is that I'm trying to force a tool to do something it wasn't really built to do. Probably I should take a step back and come up with a creative solution that will work within the boundaries I've got, instead of trying to explore the edges all the time.