Is keep adding new variebles and casting slowly making project unstable, how many is too many?

I’m curious to ask that is keeping adding new variebles and castings gonna make your project less stable if there are too many, even when you have all the correct logics? As I’m making my project more complex recently, I started to notice some small issues that never happened before, I checked and the logic seem to be all correct.
I was wondering if it has something to do with casting? like if multiple castings are toward the same actor at exactly the same time, will that cause any issues?
Generally speaking, how to keep project stable in the long run? Is there any tutorials or articles I can check up on?
Many thanks!!!

Optimisation is a huge topic:

But, even if executed perfectly, it will not save you from inherently bad scripting / coding practises.

[…] adding new variebles […] multiple castings are toward the same actor at exactly the same time, will that cause any issues?

Should not be a problem. On the other hand, consider avoiding:

  • casting on Tick
  • unnecessary Tick logic
  • long blueprint loops
  • widget function binding
  • getting (all) actors of class
  • manual garbage collection
  • spawning and keeping a huge number of actors / widgets alive
  • spamming delays

Try to employ:

  • an event driven approach whenever possible
  • soft references
  • object pooling

The above is super-generic; no clue what you’re up to.

I started to notice some small issues that never happened before

Like what? It’s pretty impossible to advise without concrete details.

Thanks for the lists of the importance.
The small issues I mentioned were like flipbook doesn’t switch right, post processing volume should be invisible but stay visible, also switching from slow-mo to normal speed sometimes fails etc.
All these small things I haven not modified the BPs, they used to work perfectly and it seems not related to the logic, because set visibility of a post processing volume is pretty simple, and the casting to actor is always valid and it seems impossible to fail by the logic itself.

You may need to debug it step-by-step. Start placing breakpoints where things should work but fail and step through the script.

Have a read, try it with a simple setup to get the gist of how it works and then apply it in your project.

Thanks, that’s a good advise. I’ll do some testing with it.