Arduventure - 12th TEAM a.r.g. game


(Josh Goebel) #101

HAHAH, was that somehow getting completely optimized away? Doesn’t code reference it anywhere?


#102

Not completely but I did notice from some disassemblies that the new compiler is trying harder to leave stuff out.


(Matt) #103

It produces a larger binary for my game than 1.8.5 does :expressionless: wish I could get in on that optimization.


#104

Well on Arduventure it saves 900 bytes*


*Size will be different with Standard Leonardo and arduboy libraries. I’m compiling using my master version of my HomeMade Package but with the standard Arduino core leaving just the Arduboy2 library and ATMlib optimisations (I also wasted a few bytes again by adding a battery a meter test)


#105

It’s referenced in both a C++ function and assembler. The C++ code will be optimised away if not used (I haven’t investigated if this is actually the case) and the asm code does reference the symbol but doesn’t list it among its input or output operand list so the compiler probably feels entitled to consider it unused.

TheCompiler works in mysterious ways.


(Nunya ) #106

Very impressive. You put a lot into the Arduboy! I am motivated to start a game now but want to use your optimizations so I can add as much as I need. I this a bad place to ask for tips? Is there a wiki or something you guys can share with newbies to learn from all your work (I am new to c++ and don’t fully understand the coding layout!)


(Holmes) #107

I’d suggest making your own thread, but certainly, you can ask for tips! However, it may be better to try makingthe game, first, then try to optimize things to fit in more, especially for beginners.


(Pharap) #108

Tip number 1:
get comfortable with the language and start writing a game before worrying about optimisation.

Optimisation is no good if you don’t have anything to optimise,
or you don’t understand the aspects of the language that allow it to work.


@crait’s right though, best start another thread if you want to ask for tips.


(Nunya ) #109

10-4. Will do. Going to make a text based game first… So optimization shouldn’t be an issue now. Maybe next game will need some graphics!