Runtime Generation Performance

  • April 30, 2018 at 06:18 #23177
    Exsavio
    Participant

    Hi Apex Team,

    I was hoping I could lean on your expertise for advice or approaches to runtime grid generation.

    I am working on a procedural terrain put together with mesh tiles. The tiles are roughly 300×300 each, which I evenly split into grids (though I’ve been experimenting with various configurations to fill the space); aiming for around 2.5m cell size (120×120). Heightmap is set to raycast as the heightmap data over the procedural terrain took significant and unworkable amounts of memory.

    Using the players position; I calculate based on a threshold distance all the grids i need to generate which results in a roughly radial pattern. I then initialize sequentially by order of proximity (checked each time the next grid to init is calculated). I do so sequentially as attempting to load balance across the set took far too long. I give the initialize method 20ms of CPU time per frame.

    This works well enough whilst the player is relatively stationary; however – if a player runs in a direction long enough; it starts to outpace the initialization of the grids.

    I’ve attempted to skew the proximity calculation to bias a distance head of the character but the result is still eventually the same.

    The only lever I think I have left to manipulate is the size of the cells; however I think that if I make them too large; the pathfinding will be too “blocky” and will potentially leave a lot of deadzones or permit a character to stand in the middle of a inaccessible cell (thanks to a well placed tree) and be out of reach of the AI’s using the grid.

    Any thoughts?

You must be logged in to reply to this topic.