Monday, January 25, 2010

Initial lander terrain triangulation

I'm back in the saddle again (barely) on my lunar-lander-on-a-disc program. (The latest released version is here, but does not include today's changes.) I am working on triangulating the terrain so I can draw it as a solid mass rather than an outline.

My first pass does the job and fits into the recursive framework for how I'm creating the BSP and outline, but it isn't ultimately what I'd like because it wastes a ton of triangles in the interior:

I could just triangulate the outline, and I may end up just doing that. It will result in long sliver-like triangles, which aren't necessarily a problem. If I decide I'd like to render the terrain in several discrete chunks that can be culled independently, though, I'd want something different. I don't yet have a solid vision for how the terrain ought to look, so I'm experimenting.

I think I'd like something that is similar to this but replaces clusters of solid triangles with larger ones, so I'm working out how to do that.

I also want to filter out those inaccessible pockets inside the terrain (and maybe the floating islands), so I'm trying to figure out the best way to do that. I have several representations of the terrain and it's a trick to figure out how to process them all. The outlines would be an easy thing to cull: just remove all the ones that wind in the interior direction. Fixing up the BSP to remove the pockets would be more of a challenge, though. I sort of want to flood-fill BSP leaf nodes. BSPs don't have readily accessible connectivity information between adjacent cells, though.

Sunday, January 10, 2010

"Raytracing on a Grid" updated

Commenter SyntaxError has spotted and corrected several bugs in the code I presented in my article Raytracing on a Grid; I mention this in case anybody used the first or second pieces of example code as a basis for their own work. The code in the article has been updated and retested.

The core of the problem was that I was failing to account for the fact that zero multiplied by infinity yields an undefined result. This happened when both endpoints had identical horizontal or vertical coordinates, which you'd think I would have caught earlier.

Monday, January 4, 2010


I actually managed to play some games over the holidays, something I haven't done much of in a long time. My opinions:

Torchlight: Pretty but extremely repetitive Diablo clone. Still good for a few hours of fun.

Might and Magic: Clash of Heroes: Fantastic gameplay burdened with a generic fantasy license (saying this as a one-time Might and Magic fan). Inventing a puzzle-based battle system has been a goal of mine for a long time and I'm very impressed with the one Capybara has concocted here. I saw Critter Crunch on PSN last month and there are definite similarities. I loved the fiction surrounding Critter Crunch. Here it's the usual overwrought elves-n-paladins stuff, but you should try your best to overlook that because the gameplay's great.

Zelda: Spirit Tracks: Partway into this one. Moderately interesting. The train seems like it has potential to be a real drag.

Halo: ODST: Meh. Fight a bunch of dudes through a series of tunnels that are supposed to be a city. Some day there will be a game set in a city where you can actually go into any building and the layouts are not intentionally mazelike to compensate for hardware handicaps. This is not that day. This is essentially the Halo 3 Remix, at least in the single-player.

Assassin's Creed: (the first one) Surprisingly less polished than I would have expected given the size of the development teams in Montreal. I'm only partway into this one; I like the environments. The animation is atrocious though, with pops and hitches continually violating characters' appearance of weight.

Mass Effect: Also only partway into this one. I love their character rendering system during cutscenes. Very cinematic lighting. Of course the lip-sync brings everything crashing down. Animation is the Achilles' heel of all current CG, even $350 million epics like Avatar.

Saira: Tried the demo, decided it was a bit too frustrating for me. I loved Nifflas' previous games though. If you haven't, check them out.