Eufloria > Eufloria Classic Mods

The "I want to but I can't" modding requests thread

<< < (15/19) > >>

annikk.exe:
Mihhaelo, that is basically what the Starfield engine does at the moment.
It takes each star and compares it against each asteroid, until it has checked it against all the asteroids or it detects an overlap.
For overlap detection, first it checks for an X-coordinate overlap.  If there is no x-coord overlap, the star cannot possible be overlapping with the asteroid.  But if it finds one, it then checks for a Y-coordinate overlap, giving an effective bounding box check.  If the bounding box check indicates no overlap, the star cannot possibly be overlapping with the asteroid.  However, if there is a bounding box overlap, it does a full overlap check.  If overlap is then confirmed, the star is not rendered.  The one-dimensional checks are much cheaper than a real check, so we try to rule out the need for a real check in as many instances as possible... for efficiency reasons...

We HAVE implemented it ourselves, but doing it in Lua is not efficient enough.  Have you even seen the 3D Starfield engine? :>  I've spent hundreds of hours on this problem...



--- Quote ---If it's too CPU hungry, you could simply make your own coroutine or have it on a timer.
--- End quote ---

If you have any information that could lead to further optimization of the 3D Starfield Engine, I'd be very interested to hear about that!  Please elaborate.

Aino:
Yo annikk, where you been man?

annikk.exe:
Hiding under a rock :>

Aino:
Ok... Been very silent without you here it seems... Maybe someone talking once a while(except me, I talk alll the time xD)...

Mihhaelo:
Well as I stated, you could create your own coroutine. You could then use os.clock to enforce a limit to how much cpu time a specific part of your code is using. Since you're using a coroutine, next time you call it, it'll pick up from where you left off.

http://lua-users.org/wiki/CoroutinesTutorial

There's a tutorial.

Also (and i realise this is a less elegant solution)... But if you coloured your asteroids in team colours with an alpha setting of "1", you don't even need any checking code :P

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version