donderdag 11 april 2013

Recycle for a better game environment!


Hi!
Today some news about a new game! Just like Eugene im working on a new project as well!
And I am going to tell you a technique to reduce the memory usage by recycling objects.

In this game we are re-using a lot of objects during the game. Like in every other game but this time we are re-using it at the time we are not using it any more. So when we are following a path, we pass numerous objects. Once we pass them we will recycle it and not destroying it. We set it to the next possible spot. This way we won't need to delete it and create it again.
Just a quick reset of its variables and visuals and then set it again for another use! A very nice way of recycling!
Level unmodified

Well this sounds very promising but we need to cooperate with the artist for this. Normally u want to place all these objects in Max and export it the normal way. But since we are recycling all of those objects we don't want a normal export. The export we want, to save some memory and size, has to be modified.




Their are some things we need to know of that model, name, position, scale and rotation. So its name and transform. This can be done in several ways without actually exporting the models. Write all of its data to a text file or replace the model with a dummy and give it the same properties. There are several other ways but we are going to use the dummies. To do this we are using a max script that will search through the scene and replace all the models with dummies.
Models replaced by dummies

We can then search for the specific dummies and add their transform to a array.
So let's say we want to create different sets of objects we now know the type, position, rotation and scale of that specific object. The next part to make it all work, we need a pool of those object types. For each object type we need an original model so we can clone that and put it in a object pool.
So when we need to create a set of objects we can get it from the pool, get its transform we listed before.

This can sound a bit weird but it's very useful.
This can actually increase your game's performance if you use the same objects over and over again. Instead of destroying them on the end and allocating new ones later we are now recycling them. So stop wasting the garbage collector with the same stuff over and over again!

In game
Greetings,

Michael

17 opmerkingen:

  1. Oh my goodness! Incredible article dude! Thank you, However I am experiencing troubles with your RSS.

    I don't know why I cannot join it. Is there anybody else having the same RSS issues? Anyone that knows the answer will you kindly respond? Thanks!!

    Also visit my website :: elektronisk cigaret

    BeantwoordenVerwijderen
  2. I useԁ to be able to finԁ good advice
    from your blog pοsts.

    Μy web blog ... diamondlinks review

    BeantwoordenVerwijderen
  3. Some bodies have a high burn rate of calories, which prevents
    them from accumulating fat. Going from skinny to muscle depends on
    how you approach and execute your workouts as well as how you manage your nutrition and
    rest. Figuring out how much protein you should be eating can be tricky.


    Also visit my web site; Power Pump XL Review

    BeantwoordenVerwijderen
  4. Just want to say your article is as astounding.
    The clarity in your submit is simply excellent and i can suppose you
    are an expert in this subject. Well with your permission allow me to grasp your RSS feed to stay updated with coming near near post.
    Thank you a million and please continue the gratifying work.


    Stop by my web blog raspberry ketones

    BeantwoordenVerwijderen
  5. My relatives always say that I am killing my time here at web, but I know I
    am getting experience every day by reading thes nice articles or
    reviews.

    My page - No2 maximus facts

    BeantwoordenVerwijderen
  6. I like reading a post that can make people think. Also, many thanks for permitting me to comment!


    My blog: earn money on internet

    BeantwoordenVerwijderen
  7. I am genuinely pleased to read this weblog posts
    which includes plenty of helpful data, thanks for providing
    these information.

    My blog post :: Natural Cleanse Review

    BeantwoordenVerwijderen
  8. You're so awesome! I do not think I've truly read anything like this before.
    So good to discover another person with original thoughts on this issue.

    Seriously.. many thanks for starting this up. This site is one thing that's needed on the internet, someone with a bit of originality!

    Have a look at my blog post :: Buy lift and glow pro

    BeantwoordenVerwijderen
  9. Good day! This is kind of off topic but I
    need some guidance from an established blog. Is it tough to set up your own blog?
    I'm not very techincal but I can figure things out pretty fast. I'm thinking about making my own but I'm not sure where to begin. Do you have any tips or suggestions? Thank you

    Also visit my website Order Acai Energize

    BeantwoordenVerwijderen
  10. This is a topic that's close to my heart... Many thanks! Exactly where are your contact details though?

    Also visit my page Green Coffee Cleanse

    BeantwoordenVerwijderen
  11. Hi to every one, it's actually a fastidious for me to visit this site, it includes important Information.

    build muscle now

    BeantwoordenVerwijderen
  12. This article presents clear idea in favor of the
    new visitors of blogging, that in fact how to do blogging and site-building.



    build muscle

    BeantwoordenVerwijderen
  13. My programmer is trying to convince me to move to .

    net from PHP. I have always disliked the idea because of the costs.

    But he's tryiong none the less. I've been using Movable-type on various websites
    for about a year and am concerned about switching to another platform.

    I have heard fantastic things about blogengine.
    net. Is there a way I can transfer all my wordpress content into it?
    Any kind of help would be really appreciated!

    Also visit my page ... garcinia cambogia reviews (http://advancedgarciniacambogiablog.net)

    BeantwoordenVerwijderen
  14. I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.
    cara menggugurkan kandungan

    BeantwoordenVerwijderen