Hi, everyone! I'm creating a strategy game with a lot of processes, buildings, units, and their costs. I've noticed that some of the costs are defined as macros, while others are global variables. I was wondering if it makes sense for optimization to rewrite all the global cost variables and similar things as macros. Will this actually have an impact on performance? Or am I mistaken? Thanks in advance for any response. And thanks in general for your help with my newbie questions.
#What is better to use for prices in a strategy? #macro or global var?
1 messages · Page 1 of 1 (latest)
Oh, I would also add that the prices in the game are indeed constants. And will not be subject to any changes.
I wouldn't say this has any impact on performance
In fact, so very little that it's not really worth it for a rewrite.
But
There is a management cost on your end
Hi! Ok, got it! Thank you very much! That's what I wanted to know.
I'd say that if anything, it'd be good to use global variables in terms of easier management
If you take it one step further, a struct database stored in a global variable
So you could have
global -> buildings -> building -> info on building.
Or global.buildings[$ "name of building"].some_info_var
Anywho, no worries
Oh, as for management, right now I just have a list/script at the beginning of the game with all the prices. It is convenient for me to balance the game directly in the engine.
Thank you very much once again, you often answer my questions, and besides, I signed your github. I will definitely send you the key to the game when it comes out! I hope you like strategies.
I do actually like strategy games!
Played a variety of them. RTS, 4X, City-based building
I can't wait to see your game 🙂
Let me attach a few screenshots here. My game is called HYPERBOREA-12, but it's a working title and it's going to change to a cooler one soon!
Very nice graphics!! 😮
Whoa this is beautiful!!!!
brother.... hook me up with your artist... jesus
holy holy
Never would've thought this was GameMaker ngl
Thanks guys!
Looks like it's not as bad with my game as I thought, I should show my work more often lol🥹
If you are using any libraries, —> #games_made_with_libraries
Should def drop some images/videos 😉