PGD Home

P0-B4: Part 1203: Ground Cover Exclusion System

by on Feb.26, 2023, under Astral Realms, Meridian, P-0, P0_B4, Software and Games, Spiritus Astrum

I replaced the build in terrain function with another solution, which projects a point onto a plane. I could use this to get all of the needed points onto the same plane, so that I could get the distance between them. I could then use this distance to determine which pixels should contain ground cover, and which shouldn’t.

This solution was much faster, and seemed to work, but when the player approached areas with a lot of ground cover exclusion objects (such as settlements, etc), it too became slightly too slow.

I am now looking into multithreading as a solution, but I will need to rewrite quite a lot of code to make it thread safe (transform.transformpoint, etc).

I cannot call setpixels from another thread, but the main bottleneck is in loading the array for setpixels, this is where I need to improve performance, so multithreading should be useful.

Facebooktwitterredditpinterestlinkedinmail

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!