Monday, March 27, 2006

MPD fixed

This might sound completely unbelievably dumb but MPD was getting all screwd up because of one wrong SIGN!! I just put one '+' instead of a '-' somewhere and it went crazy. Anyhow that is fixed. MPD gives decent looking read smooth terrain (but with square grid peaks which is a bit pissing off and spoils the whole effect) Another problem with MPD is the size (cant get past 257 x 257), and much to my chagrin I've found out that its not a memory allocation thing. Theres a problem somewhere in the MPD method: it just doesn't like large size terrain!

Besides all this, the apparent smoothness of the terrain is making the bot enjoy itself like never before. Have to give it some food for thought. duh, have to give it the ability for thought first.

First thing would be to give it path memory so that it stops hovering in loops. Am still thinking about floating point movement (more realistic discrete movement).

I also keep getting windows equivalents of segmentation faults on changing parameters like MaxHt, SlopeFactor, Roughness constant etc which should ideally have absolutely nothing to do with this most despised of all program crashes

Hell, I got too long a way to go and too little time (44 DAYS TO GO!!!)

Wednesday, March 22, 2006

Update

As always, I've managed to the take the easy way out yet again (aka patli gali if you will). I was getting insane results with my implemtation of the MPD algorithm, so frustrated I used Particle Deposition for terrain. Now taking a break (a long one hopefully) from generation on concentrating on the actual project! Moving the darn bot!!!

The problem is, I scale the heightmap to 8-bit values, which at different XY-plane scales, are either just too high or just too low for the bot too traverse (ie either it moves around in circles caught in a loop (if XY scale is low), or it goes to its target in a straight line (if XY scale is too high) and a very pathetic path it follows too (since it can only move in the eight cardinal directions. But mostly, the bot is stuck at the 45 degree slope

Immediate plans
***************
Finish the file I/O for sim parameters
Make the bot travel more realistic paths (probably using floating pt co-ordinates for the bot. Calculating filler heights for these paths will be a problem
Make terrain more realistic (must figure out some method to view terrain in 3D) probably by using MPD, or improved particle deposition.

Sunday, March 19, 2006

Now coding..

Finished first code for MPD. Gives extremely trashy results. Limit was kept from -x to +x. Some values I get are just insane! Something like 40 times x!! Have to work on MPD: pretty clueless what to do actually, theres nothing wrong with the code I've written. Will try and experiment with parameters and hope for better results.

Btw used 3Dem for the first time successfully on an ASCII matrix, and on an USGS DEM file. The latter was beautiful, the former hideous (it was generated from my program).

First link on Google for Perlin Noise. It is a pretty decent article. Seems to cover all the basics. Related to this is this article on Image interpolation.

Unfortunately, perlin noise gives very very...almost to the point of being unrealistic, rough terrain. Have to make MPD work. In desperation might try particle deposition too, although its very costly, and the quality of terrain would probably be questionable too.

A few links related to interpolation in 2D
******************************************

Short article summarizing a few interpolation algorithms
Bicubic interpolation@Wikipedia
Article on interpolation in USGS DEMs