Code optimization

I thaught myself how to code so i can imagine that my code isn’t aswell optimized as it should be. Is there any documention on the subject i could use to improve my code optimization?

hard to say without seeing any code… I often have the same feeling (also autodidact) I try learning as much as i can from C# tutorials outside of unity. Look for tutorials on inheritance, polymorphism, interfaces, delegates, events, generics, abstract classes, virtual methods,… and allround design patterns especially Object Oriented Programming ones. Nice things like State Machines or Factory methods.

That’s pretty much everything there is to know about programming lol.

2 Likes

Profiler is king. Build your game. Get it finished and running. Then profile it to find bottle necks. Fix those bottle necks. You are done.

I do not know if this is something that will help a lot, but I know object pooling is a nice feature…

What if you don’t have the profiler :stuck_out_tongue_winking_eye:

Then run bench marks on the code you are concerned about. And make guesses. There are also some obvious guidelines that can be found by looking around the forums.

If you are planning to make less then 100, 000 off of selling your game then performance is probably not that important anyway.