Let’s say I have steering behaviors script, a big one that has methods for different behaviors such as seek, pursuit and so on. Do I gain anything by separating those behaviors, seek, pursuit, etc. in separate scripts or not?
Imagine for example you have 100 units and they just need seek behavior, but instead you attach to them this big script that contains methods and data for all other behaviors too. Or maybe it does not matter, maybe it only matters what happens in the update function for each?
I would generally say no, but that assumes the scripts have been written efficiently to start with.
I had my engine controller script that rotated all the individual wheels on my tanks. The script was taking quite a chunk of performance percentage wise for the wheel rotations, so I created a script dedicated to rotating the wheels.
The engine script run with a lower percentage, but that gain was lost in the new wheel rotation script, so in the end the total was about the same.
Not sure I explained my question well the first time, that is why I reexplain jlcnz your answer did not answer my question … my bad, did not explain well
Typically, a class’s methods are not duplicated in memory so the number of member variables and the number of instances have a greater influence on RAM utilization. These if they are entirely or near entirely method based might be better as static methods.
As for the files, maintainable code has great value making code you can understand and extend is always a good idea.