Optimization Question towards the Mcreator Devs

Started by masterkostas on

Topic category: Help with MCreator software

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Optimization Question towards the Mcreator Devs
Sun, 11/17/2024 - 12:27 (edited)

So in general calling an element -procedure in case of mcreator- has an impact on the performance of the program- mod in this case.

So let's say i would like to check if a projectile has the tag <AoE> in it by checking a string variable. 
If the appropriate tag is found, a big block of If conditions like IsElementX has to be checked. 
After finding the appropriate element of the projectile i would like to check for the appropriate visual and potion effect to apply to all entities within my AoE.

 

The question:

Is it better to hard-code the effect and visuals i want to play into the same procedure 

OR 

Should i make a new procedure for each element's visuals and effects and then call the one i want.


Additional Question:

In case i want to call multiple procedures how will that affect performance compared to coding everything- coding = both custom code and the visual coding of mcreator?


Let's assume the procedures are as optimized as they can be. Same goes for the IF Conditions. 



So far i have used a mix of both but i think it would be better for cleanliness shake to make each proc seperately.
Thank you for your time, expect an absurd mod to drop this year

Edited by masterkostas on Sun, 11/17/2024 - 12:27
Is it better to hard-code…
Sun, 11/17/2024 - 15:45

Is it better to hard-code the effect and visuals i want to play into the same procedure 

OR 

Should i make a new procedure for each element's visuals and effects and then call the one i want.

Do what makes your project more understandable and maintainable to you. Procedure calls have a minimal performance impact.

In case i want to call multiple procedures how will that affect performance compared to coding everything- coding = both custom code and the visual coding of mcreator?

Custom code will be somewhat more performant than procedures, but this depends on the per-case scenario.

Procedures hide quite a lot of programming challenges from the user and this comes at some performance penatly.