i love it when people get on the XNA forums and ask, “how do i make a game?” that is one of the rare occassions where the bastardly answer, “if you don’t know, i can’t tell you” might actually be appropriate. games are designed to be fun to play, and it’s easy to look at a beautiful let-down like far cry 2 and think you coud do better. but my god, video games are not trivial things to make. it’s not like golf…pretty simple to create a game like golf, but as they say, it takes a lifetime to master playing. i would say video games are quite the opposite.
so what brought this mini-rant on? i spent my weekend optimizing. i try to follow the rule of optimization, “don’t do it”, but when you’re running at 20 fps, you don’t have much choice. my newest xbox-crippling feature was about 1200 trees. they’re all the same, so hardware instancing was the obvious solution. now, i could have cut+pasted the xna instancing sample, but where’s the fun in that? actually, getting quick results can be extremely fun, but i’m doing this project partly to learn something so i dissected every LOC in the sample and recreated the whole damn thing. i can’t say it was the funnest thing i’ve done, but the technology is cool, i learned a lot, and it works (what more can a programmer ask for?)!
results? could be better, but on the xbox i’m bottoming out at 45 fps. still needs work (better culling), but if you think about it, if every tree is 100 polys…
100polys * 1200 trees = 120,000
120,000 * 2 (reflection in water) =240,000 polys
plus the terrain…not too shabby.
and what was the point of this post? i’m not sure myself. for one, the game now has trees! second, for those who want to know how to make games, multiply this kinda stuff by…oh i don’t know…the xbox’s fillrate or some other really big number.