New functions to influence entity sorting

Posted By: Superku

New functions to influence entity sorting - 03/12/15 23:01

For various purposes, especially the creation of special effects, I would like to put entities at the end of the (C_LINK?) list so they get rendered last (without re-creating them every frame). Earlier today I needed to have an entity to be rendered first which I then had to workaround by doing a different view NOENT+genius/parent approach.

I assume corresponding functions would not get used by a lot of people but I think they should not be too hard to implement - maybe I can even do it myself by manipulating the C_LINK stuff or would that conflict with other intern stuff?

Thanks.
Posted By: EpsiloN

Re: New functions to influence entity sorting - 03/24/15 23:00

Dunno if you're talking about the same thing, but I've always been thinking there should be some property to influence the order of functions executing. I hate using proc_late for many functions, because in the end, I don't know which one is the last to be executed laugh

I guess it could be done with a 'layer' type of property, like in a panel, or something...
Posted By: MasterQ32

Re: New functions to influence entity sorting - 03/25/15 07:55

Yeah i support both of your ideas!
Also superku, have you tried layer_sort for giving the entities the correct order? May work if the function itself is agnostic to what input it gets...
Posted By: sivan

Re: New functions to influence entity sorting - 03/25/15 08:12

@EpsiloN, yeah it would be great in many cases, but because of the performance cost of "wait(1);"-s, I use no independent loops in high quantity, instead I call them from a main game loop in every frame, resulting in significantly improved performance, beside perfectly managed running order.
Posted By: EpsiloN

Re: New functions to influence entity sorting - 03/30/15 19:55

Originally Posted By: sivan
instead I call them from a main game loop in every frame, resulting in significantly improved performance, beside perfectly managed running order.

I started doing exactly the same thing recently, without even noticing I'm doing it laugh too bad it took me 15 years to learn it. (By the way, I think it was partly influenced by a Java android game programming tutorial I read recently...)

Anyway, having an option for execution order is still a good thing. You cant put EVERY function in one while loop grin
© 2024 lite-C Forums