Sign in to follow this  
Nicholas Kong

Is there a downside to statically adding gameobjects in a game?

Recommended Posts

Is there a downside to statically adding gameobjects in a game?

 

I am not sure if they are just used for adding gameobjects when a certain flag is turned on. But that is what I am using it for. So they are not loaded ahead of the time when the game starts.

 

 

If I choose the non-static approach of adding gameobjects, it meant I needed to load everything ahead of time. While the non-static way was good it for loading objects ahead of time, it might be deemed inefficient when you are loading A LOT of game objects ahead of time.

Share this post


Link to post
Share on other sites
This kind of highly depends on the type of game you're making, if it was a very simple pong game or something and it wouldn't hurt to load everything when the program started, yeah, you could theoretically do it.

There's just not much of a point to when it's much simpler and generally more intuitive to create the game objects when you're setting the other data related to the game and setting up the game loop and such.

It's not really so much performance as control and readability, though of course performance would become a major issue after certain complexity is reached, you can't really "unload" a static object.

Share this post


Link to post
Share on other sites

This kind of highly depends on the type of game you're making,

 

i'm making a "guess a word" game. The game displays an image. The number of underscores that appears along with the image gives you a hint on what the word can possiby be. The image of the letter that appears when the user types a key triggers of that letter to appear. That particular letter which is represented by an image is not loaded and draw until the user presses that specific key to trigger the letter.

Edited by warnexus

Share this post


Link to post
Share on other sites

What do you think static and non-static mean? What you're saying doesn't make any sense according to my understand of the word "static".

 

It looks like you might make sense if the topic was lazy vs. non-lazy loading. Is that what you mean?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this