@Superku: yes significant time, I'm sure there are further possibilities, and I need time for new features too. after a short question, a long answer is coming laugh , currently it does:

4 clearance map updates (spread over several frames), one for each capability. it is used by 1x1 tile sized units (infantry), larger units create an own small map (shortly: a light unit can access different tiles than heavy units or ships. these 4 maps show for each tile the max size of a unit can access them of the given capability). it could be eliminated sometimes, but in case of high number of 1x1 units it is currently faster.

20 long group A* pathfinding among areas taking into account area properties (map is about 500x500 tiles, an area is normally 8x8 tiles). its update frequency is high, thus very dynamic, but should be decreased a bit, but it has very small effect on performance. it can now handle a few building floors too, and senses bottlenecks which results in different group and unit behaviour. it will be different for AI and player. a basic path smoothing is also applied that is coming from the mutual effect of group and unit level targets.

the most power eating is the 600 unit movement target calculations and pathfindings, but only a few runs per frame (simple but fast depth first) using a common map or an own map, checking only a small area. group leaders has the longest search loop, the 1st line of units also has a bit longer search limit, the others are followers making very short searches, only a few tiles. units are keeping the formation taking into account actual group facing direction, and they "know" if they are far from where they should be. the formation calculations are not flexible nor fast at all at the moment, it should be rewritten totally.

units use c_move (I found physx slower but will test later again), which enables collision detection on path errors, which can be high in case of several crossing groups. they try to avoid each other in 2 ways, to avoid continuous colliding. far units can cheat. shadows are switched off for non-close units, aimation is also disabled for very far units.

what I found a bit too high, is the negative effect of shadows on performance. so probably I'll test shade-c 0.91 shadowmapping next as it produces double fps for my test level compared to default pssm. currently only the static lightmap for static, stencil shadows for dynamic objects configuration is fast enough for adding further functionalities, like combat behaviour.


Free world editor for 3D Gamestudio: MapBuilder Editor