Impostering

RPG games will often have numerous towns in the game and it is often desirable that towns be visible from long distances. For example when standing on a mountain top it might be desirable to be able to see all the towns in the game. But many towns displayed at one time can greatly reduce the frame rate . A solution is impostering where a 3D object is replaced by another 3D object when a player moves a certain distance from the original object. An example may be a player leaves a town that is surrounded by walls. When the player is a certain distance from the town the town is replaced by just the models of the walls and the town buildings are no longer rendered. This increases framerate but at the same time the player can still see the town in the distance.

Impostering is achieved in the parent maps staticpositions element. The position elements of the staticpositions has the attribute 'impostername' which is the name of the object to replace the original object with.

For example:

<POSITION name="sanom" x="300" y="200" impostername="sanomwalls" imposterdistance="17"/>

means the town 'sanom' will be impostered with the object 'sanomwalls' when the player moves 17 mud units away from the town centre.

'imposterdistancex' and 'imposterdistancey' can be used if you'd like the impostering to occur at different distances in the x and y plane. For example:

<POSITION name="sanom" x="300" y="200" impostername="sanomwalls" imposterdistancex="17" imposterdistancey="25"/>

means that if the player is 17 units east or west of the sanom or 25 units north or south of the sanom then the imposter is used.

By default the imposter centre is the x,y position of the position but you can set it to something else using the attributes 'centerx' and 'centery'. For example :

<POSITION name="sanom" x="300" y="200" impostername="sanomwalls" imposterdistance="17" centerx="310" centery="220"/>

means that if the player is 17 mud units from x=310 y=220 then the imposter 'sanomwalls' is used.