Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello, thanks for your work :) your mrpas is really helping me out on my project. I wanted to ask if you had any idea about how to optimize multiple mrpas in a single scene ?

Basically I'm working on a tilebased tactical (think fire emblem) but where every unit has a field of view, and units are themselves obstacles. It means that currently, when a unit move, every other units get the notification that a unit moved, set the transparency of the unit's old and new position, and recompute their field of view. As you imagine, it causes a bit of lag.

(3 edits)

If its turn based, you could have it so they only recompute their fov on either their turn, or on the turn before theirs, evening out the computational need and reducing spikes

Alternatively, you could look into making use of a compute shader, which will offload the task to the GPU, allowing it to run in parallel.

You could make a central ‘map’ with the positions of all obstacles, and update that, then you can choose to only notify units within the view radius of that point

This is a year old, so probably not needed anymore, but I figured if you had the question so might other people