Przejdź do głównej zawartości

Szukaj

How do I keep complex logic from making my scene run slow?

  • Queen_Abaddon

    Honestly I'm stumped when it comes to the thermo. My level "Mushroom Kingdom" was fine when I first released it (with the exception of it saying my thermo was maxed at only ~50%) but I went back in to edit a small thing in text and all of the sudden I got the "Slow Alert" as well but when I went into play mode it didn't seem to make a difference? I have no idea.

  • Aecert

    Show us the logic

  • Supposer

    I think playtest mode itself slows things down anyway. It has to render a ton of UI on top of the game itself. So I'm not sure how reliable that slow-down indicator is for the game itself?

  • Almadiel

    Think about the longest chain of logic your vehicle might have to evaluate. If you have an output to say a mover, every frame it is going to need to figure out the signal value for that output wire. To do that, is has to figure out everything that is connected to that wire, for as many connections as you have, which then have to be evaluated in sequence. It is likely that disconnected sections of logic can be run in parallel on the CPU, but connected chains couldn't unless they branch off from each other and stay separate. So the length of the longest possible "path" through your logic wires is probably a good indicator of overall cost.

    And obviously not all component is equal in cost. A laser sensor is probably thousands of time more expensive than using an add calculator.

  • Almadiel

    One thing you can do is disable the power for components that are not needed at any given moment. Like instead of doing a bunch of complex logic and then multiplying the result by 0 at the end when you want to turn it off, maybe put that whole section in its own microchip, and then power the whole thing off.

  • ServantOfTruth

    Almadiel, I hadn't considered that Dreams logic would be locked into a component per frame speed. Thanks. I'll try shortening my circuits and reducing redundancy to improve functionality.

  • ServantOfTruth

    After some tests I've found my previous statement false. A signal does go from beginning to end in a single frame. Which means it's processing everything in-between each frame. I reread previous comments and realized that what they were saying all along.

Zaloguj się, aby dodać komentarz.