Saturday, April 19, 2014

 

She's Leaving Home

Some more steps further.
I restyled the mountains, now they look like mountains and not like vomit.
I also decided for the appearance of units when going on top of mountains. I've spent a week or so testing the various options to solve a nasty problem: when a unit climbs a mountain the slope will cut through the unit's 3d shape, and the effect is not so fine. The options were to rotate the unit by an amount equal to the slope, which would have required a complex calculation of pitch and roll on the basis of relative heights of intersection points between the mountain and the unit itself.
This had the downside of actually rotating the unit, which would have created immense difficulties when calculating the contact between enemy units.
Another option was to recreate the profile of the slope by capturing a sample of the heightfield equal to the area of the unit, then use this cropped heightfield to re-shape the unit, in practice it would have followed the altitude of the mountain, only it would have been slightly moved upwards. This posed technical difficulties related not much to obtaining that cropped heightfield but rather to applying that same calculation to all the units visible in a game.
The third option has always been to just scale the unit so that it simply topped the highest point it was upon in a given moment. However I didn't like the appearance of a tower on top of a mountain, so I decided to move the unit on the highest of point, and then to create a semi-transparent column beneath it, so that it was clear which area it was currently covering but at the same time it was not horrible as the simple scaling of the unit.
A picture is worth a thousand posts, so here you go.



Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?