Home    LittleBigPlanet 1 - PSP - Tearaway -Run Sackboy Run    LittleBigPlanet 1    [LBP1] Help! [Archive]
#1

Memory preservation 101

Archive: 26 posts


Since Ive got years of experience with the unreal editor, and when it comes to preservation of memory (optimalisation) I should know quite some tricks.
Unreal 2004 levels could go up to the 100's of MB's, and with some good care and work you could lower that filezise with at least 20 to 40 MB.

Offcourse LBP works a little different,
I think that the entire level is loaded at once, and even everything that isnt in your view is "working" (moving objects etc).
That is the reason you cant move your camera 360 degrees around your work, it would be to hard for the engine to show everything at once.
Anyways, im 99.9% sure on most stuffI if one of MM people tells me different I will change it.

Anyways, we all want to build bigger levels, or in other cases we want to get a little better framerate when playing online with a few other sackpeople.
Ill try to explain some stuff to gain that little extra memory that might give you some extra room to build some stuff, or let levels work a little better when playing online multiplayer.

lets start with the 101's.

__

Moving objects.

Now, I dont mean objects that are attached to a piston or anything like that.
Objects that arent attached to dark matter or glued to the floor/wall/ceiling are in fact also movable objects.
Also stiffened rods make an object un-movable (if the rod is attached to dark matter/floor/ceiling/walls)
Movable objects need more memory than solid ones.

Now Ive read before that it would be wise to add a small piece of "dark matter material" inside you work so it floats and stays where it is.
There is actually a better way.
Place a small cube of dark matter material near your object, preferable out of view.
Now (preferable in pauze modus) attach the dark material to your object with a "Rod".
Make the rod stiff, and your object wont go anywhere.
(unless another moving object interferes with it.. this might end up in horrifying things.. like all of a sudden your entire level falling appart, but that would also happen when you attach the dark matter directly into your object)

Why is this better than putting the dark matter directly into your object?
I have noticed that every new shape you add into an object adds to the complexity of the object and therefore makes it more filesize-heavy if you know what I mean.
Attaching your objects with a rod to the dark matter doesnt increase the complexity of the object, and you can use one square of dark matter material to attach it to loads of objects with stiffened rods.

So.. If your level gets rather large.. try using the rod with dark matter material to get the most out of the filezise, this will also lower the chance of sudden "cracking and breakings" in your level.

If you made a floor, and added a loose wall on top of it, either glue the object to the floor, or attach it with a rod, offcourse this also goes for the ceiling.
If you made i.e. windows/beams etc into your walls etc, make sure you glue this to the entire piece of wall.
If its still moveable there might be friction between the wall and window/beam and that can result in sudden crack sounds.. that often tell you something broke.. and I dont think you''d like to hear that sound when you are almost finished with your level.
And like I mentioned.. moving objects are bigger in size..

Now you might think its a great idea to glue your entire level together..
but that would be one of the biggest mistakes you could make.
and I Will tell you why.
Glued objects will be seen as one object, and therefore the complexity will increase (sometimes significantly) and you will eventually get a message you cant add anything more to that shape.
If you get this message, consider redoing your shape, sometimes redoing an object makes it more efficient because you have seen the result of your complex one, now try to get the same result/feeling without making it to complex. (great for learning)

To get the most out of the filesize you should try to find a balance in using dark matter, rods, glueing and attaching objects to the floor/ceiling/walls.
My first legendary sack level was 1/2 the size of the 2nd level, because my objects all had massive complexity (and you couldnt even tell)..
But I think Ive found a nice way to get some balance in the whole rod/dark matter/glue, attach stuff.

I tend not to create massive long roads, but piece by piece,
Lets say that when you use the biggest grid settings my roads often arent longer than 10 big grid-spaces.
If needed I attach the background wall and ceiling on it, and glue them together.
Now I need one dark matter and one stiffened rod to make the whole room unmovable.
Offcourse, I fill the floor/walls/ceilings up with more than one material, and I make sure that they are glued to their surroundings.
!!Warning!! watch out with careless glueing, all of a sudden you could glue half of your level together, or worse.. your cars will be glued to the floor, your birds to the background.. and fixing that.. It hurts man.. it hurts!

Offcourse you can attach moving objects to your non movable room without any problems, but be carefull!
If you attached lets say a square roller to your background wall, and the corner of that roller hits a corner of something non movable... its either the Roller that breaks.. or your entire background wall. If that wall is the reason the ceiling is staying where it is..
the ceiling might also come down.. if the ceiling comes down.. it might destroy everything in its path..
offcourse you can rewind, try to find the problem and fix it..
But its better to make sure this wont happen..
Ive had it a few times.. and again.. it hurts man!! it hurts!!

Also, if you have moving objects like elevators, let them go for a few practice rounds, and listen carefully to them..
Sometimes you can hear a small tick.. clash.. this means that the moving object still has some force behind it, and "hurts" the other object.
Now more than often this goes allright.
But sometimes after a few hours the object might give in.
I dont know why this happens.. but it does.

_______________

Delete all that is not seen!!

Its kinda useless to have a ceiling if you wont see the ceiling ingame.. this also goes for the top of tree's, parts of buildings, caves etc.
Every added curve, bend, corner that isnt be seen should be smoother.

Some kinda example.
Most caves have a natural form, jagged edges, cracks etc.
like: _/_/__|__
Picture your sackboy walking behind that.
If you can see those edges and spikes when playing.. you should let them stay (dont make them to complex), but if they are outside the players view, select your square and cut of all the edges and make (prefereable) one smooth line of them.
Like: _______________
every added corner, edge, curve adds to the complexity,
So when they are not seen, you should try to cut of any edges/weird shapes.

This also goes for using more than one material in an object, the more materials.. the complexer it gets.
So dont make something too complex when it will be seen for less than a second, or worse.. wont be seen at all.

__________

Monsters with brains seem to increase the filesize quite a lot.
I dont know why, but I noticed that when I get a notice that I maxed out my filesize, It often dissapeared by deleting one monster.. giving me the breating space to add some final adjustments to the parts that need it.
(hence I havent used that many monsters yet .. I often delete them to help me fix other stuff.. but then again...)
But then again?.. ow! obviously the more complex the monster, the bigger the filesize.

___________

Emitters.

Lovely little things..
Some explenation.. because these little ones can hog up memory like a fat guy hogging up all the candy.
(opens notition book)

I wont go into the object selection.. just use a self created object, or something pre-made.. select it, place it on the row you want, increase/decrease size and location it spawns.

Frequency.. how often an object appears.
lifetime.. how long an object lives.
max emitted.. how many.. from infinite to 1.
max emitted at once.. this is the one part that can hog up memory like a girlfriend hogging up your quality LBP game-time.

Ill explain, how many objects can there be emitted at once..
lets say.. freq: 5 sec.
lifetime 4 sec.
Now stating, the object comes once every 5 seconds, and only stays for 4 seconds.
This means: you will only emit one object every 5 seconds.
So the max emitted at once can be set to 1.
For every 1 you increase this number, it takes up a little bit of your filesize.

Now, if the emitter states:
Freq: 3 sec.
Lifetime 6 seconds.
Means that every 3 seconds an object appears..
and with some deep math you can tell that there will be a max of 2 objects at one time.
so set the max emitted at once to 2.

get my drift.

especially when you are using loads of emitters.. this can end up quite important towards your filesize.

_____

As far as I know, lights, sounds, pickups,switches, mouths etc dont cost that much of memory, but when the wire-ing gets more complex, it can cost you a little.

_____

Repeatency of objects.. (how often the same object is used)
Ive found out that using only unique shapes costs more memory than re-using same shapes.. therefore 10 simmilair objects seem to costs a lot less than 5 different ones.
IVe tried this in my darkness level, and didnt see an increase in filesize when I added 10 simmilar switchboards I created (made an object out of the whole).
But when I deleted 9 of them, and added another unique switchboard.. the filesize increased.

So its best to reuse objects when possible, and if it needs to be really unique.. make sure it is unique in more way than one.. it should stand out.(visually) unless its for something like a switchboard that wont be seen by the public.

___
UPDATED PART!!

Ok,
there are a lot of people that have the problem that their level is overheating and they cant either finish their self created level, or need to free up some memory to fix problems not found earlier.

Others just want to get the most out of the memory to create even bigger levels.. (like me!!)

so here it is:

Every new texture/material you use takes up at least 1/3th of a memory block in your thermometer.
this means, for every texture/material you get rid off in your level you will regain 1/3th of memory!

because of my ut times i tend to stick to 4 to 8 textures.
so if you are in need of a new texture.. make sure its worth it, and try to re-texture/materialize your allready created objects! im sure you can reuse materials in other places without losing any real detail, just keep trying.

it is worth the trouble when you can gain up to 4 bars of memory!

I just did in one of my levels and gained 6!! memory bars back!

So, when im finished with my new level..
Im gonna clean up the memory of my prev. levels and hopefully be able to get enough memory available to fix all the bugs left.

End of updated part
___

Ow, and If you want to be real picky, and even save 0,1 kb,
Only work on grid.
To get nerdy, lets say the grid goes 0 - 4 - 8 - 12 - 16
And you place an object, chances are it will go to one of the gridlines and set its coordinates on i.e. 2-4 (length/height)
(smallest grid goes 1 - 2 - 3 - 4..)
Working offgrid will make on object appear on 1,3451345-2,562456.
Now it wont be that bad for filesize, especially in the unreal/UT99 age this was very important.
Nowdays the pc/ps3 etc can handle it with ease, but to get picky..
You can probably get a micro amounth of filesize free only working on grid.
but that would be boring

(though, I do suggest working on grid for most things, since it helps you create clean shapes without making them complex)

__

Also, if you i.e. select the cylinder, and drag it around for a floor,
this will be much more complex than just making the front and end of the floor out of a cylinder, and them connect them with a square/pentagon thingy..
more on that when I understand it more.

Ok, thats it for now,
If there are any typo's blaim my speech-recognition software
2008-12-28 01:38:00

Author:
Luos_83
Posts: 2136


Some really useful information here, I've made this a sticky as it will help a lot of new creators. Thanks for the post, very helpful.

Cheers QuozL
2008-12-28 01:47:00

Author:
QuozL
Posts: 921


Thank you so much man, i'm struggling with create mode, and your input helped


Thanks Bro....!
2008-12-28 02:25:00

Author:
Thee-Flash
Posts: 3154


my head hurts2008-12-28 04:58:00

Author:
UltraNative
Posts: 59


Updated with info on material usage!2008-12-29 13:55:00

Author:
Luos_83
Posts: 2136


*Mag keys use alot of memory

Something I noticed recently while optimizing a timing wheel, that involves a mag switch rotating inside a circle of mag keys. Originally I had a wheel inside a wheel, attached to a circle of dark matter. I managed to eliminate all but one circle surface, and make the rest squares, reducing the number of faces by around 80%.

However, in testing it turned out the optimized wheels used almost the same footprint, the issue was the number of mag keys per wheel (20) - they represented 90%+ of the memory footprint of the object.


So use those switches with caution, because they will quickly wipe out any gains you get form optimizing elsewhere.
2009-01-01 19:36:00

Author:
mmmiles
Posts: 16


*Mag keys use alot of memory

Something I noticed recently while optimizing a timing wheel, that involves a mag switch rotating inside a circle of mag keys. Originally I had a wheel inside a wheel, attached to a circle of dark matter. I managed to eliminate all but one circle surface, and make the rest squares, reducing the number of faces by around 80%.

However, in testing it turned out the optimized wheels used almost the same footprint, the issue was the number of mag keys per wheel (20) - they represented 90%+ of the memory footprint of the object.


So use those switches with caution, because they will quickly wipe out any gains you get form optimizing elsewhere.

I do not agree totally with you.
I often use a high quantity of mag keys and mag switches, and i noticed no changes at all in the memory bar, maybe the shape of the optimized wheel was complex the same (i didn't see it so i can't tell for sure).

I noticed (before reading this useful and helpful tutorial on memory saving) that what really sucks your memory away are different materials and shapes...

Obviously IMHO an in my experience.
2009-01-03 11:38:00

Author:
Miglioshin
Posts: 336


agreed with miglioshin,
mmmmiles.. thats not true,
it must be your amounth of materials or other objects.

On a sidenote:
I was using gears in my (thnx 2 bug) not working level (in the objects list)
and one gear takes up between 1/3th to 1 whole bar on your thermometer.
So if you want to use pre made objects like those gears.. only use one and use different scales and let it rotate in different directions,
its up to you..
but My latest level was almost as big as all three legendary sack levels combined due to optimalisation.
2009-01-03 14:26:00

Author:
Luos_83
Posts: 2136


Definately good advice. On a level I was making improvements on I had about hit the limit. The first thing I did was go back and straighten the edges of my rocks throughout (I decided straight shapes instead of a lot of jaggies was a good tradeoff). In doing this, I gained an additional 25% of my resources back.

Then, I picked a number of materials I could do without and simplified the number of different materials I was going to use (for instance, I picked 2 pieces of wood I could use throughout and changed all other wood to be one of the 2). This knocked down the meter another 10%.

Suddenly I had a LOT of room to work with.

On the other hand, something that I MAY disagree with, but am going to need to perform some more testing on, is how much of a footprint emitters take. I have had a lot of success in efficiency with emitters.

On "Splat Invaders Saga" (not publushed yet), I am using over 100 emitters to emit plasma balls. They didn't raise the thermo much at all. I'm thinking it may not be the emitters that are hogs, but the objects within the emitters (it also may help that most of the emitters shared a common object).

Another note with emitters is that theoretically using them and only turning them on when you enter an area of the level could save quite a bit of CPU - since the objects being emitted don't need to react to the physics engine until they are emitted.
2009-01-14 18:54:00

Author:
CCubbage
Posts: 4430


Excellent advices. But i've read about memory test done by another user on another forum demonstrated that gluing is the next best thing to than attaching to dark matter or ground.

DO NOT shy away from gluing your things together if it's too complicated to link with darkmatter or the ground.
2009-01-14 20:41:00

Author:
RangerZero
Posts: 3901


*** I know this is a lot of text, but please read - useful information ***

Glueing things together:

I have found that to be true also, HOWEVER one gotcha to watch out for:

Glueing things together works well, however I would keep smaller areas of your level glued together and make sure bigger sections are separated (test by clicking on pieces of floor periodically and see how far out the glueing stretches).

Because of the nature of LBP physics, if you have large areas of your level glued together and the physics create stress, REALLY interesting things can happen to seemingly unreated areas of your level.

"Dante's Temple" was my first level. I unknowingly had a lot of my level glued from one side to the other. I made a small adjustment to the other side of the level, saved, and went into play mode.

On the entire other side of the game, a tree had fallen, water effects broke apart, and the planks on a dock actually MERGED INTO 1 PIECE OF WOOD.

So, use caution with glueing. Build your levels in sections and keep them physically separated from each other to give you maximum flexibility. That way if something breaks you can SEE it happen instead of breaking things that are somewhere else entirely.

*** A technical trick ***

Many times if you unglue things a big chunk of your level can collapse.

If this is happening, instead try ERASING the area instead of unglueing. This does not seem to have the same effect. I have been able to separate areas of my level by erasing the matter that connected them safely. If you have switches or cameras on the area you are going to erase, first move them to some floating dark matter to keep your logic safe.
2009-01-15 14:06:00

Author:
CCubbage
Posts: 4430


*** I know this is a lot of text, but please read - useful information ***

Glueing things together:

I have found that to be true also, HOWEVER one gotcha to watch out for:

Glueing things together works well, however I would keep smaller areas of your level glued together and make sure bigger sections are separated (test by clicking on pieces of floor periodically and see how far out the glueing stretches).

Because of the nature of LBP physics, if you have large areas of your level glued together and the physics create stress, REALLY interesting things can happen to seemingly unreated areas of your level.

"Dante's Temple" was my first level. I unknowingly had a lot of my level glued from one side to the other. I made a small adjustment to the other side of the level, saved, and went into play mode.

On the entire other side of the game, a tree had fallen, water effects broke apart, and the planks on a dock actually MERGED INTO 1 PIECE OF WOOD.

So, use caution with glueing. Build your levels in sections and keep them physically separated from each other to give you maximum flexibility. That way if something breaks you can SEE it happen instead of breaking things that are somewhere else entirely.

*** A technical trick ***

Many times if you unglue things a big chunk of your level can collapse.

If this is happening, instead try ERASING the area instead of unglueing. This does not seem to have the same effect. I have been able to separate areas of my level by erasing the matter that connected them safely. If you have switches or cameras on the area you are going to erase, first move them to some floating dark matter to keep your logic safe.

What exactly do you mean by erase? How would I go about that? My problem is with a tank i built. I want to glue something on top of it but when I do, it makes the whole thing seize up and not roll anymore. How can one glue something to something that is already able to roll and not have the whole object glue itself together?
.
.
.
.
.
2009-01-22 07:36:00

Author:
mrjoeyman
Posts: 217


First of all, the erase question: Let's say you have a piece of material glued to other material. But, when you unglue the one piece a whole bunch of other things become unglued. The answer: instead of unglueing it, simply use the triangle to erase it off of the other object.

Second question (trying to glue something onto another object without causing a bunch of other things to become glued together):

If you want to ONLY glue an object to other objects behind it, hold down the left back button when glueing. You can also do a directional glue by holding the left stick towards what you are trying to glue while you glue.

** But here's the best tip if you are building a complex object such as a tank **

Build it as smaller objects (which you can KEEP as separate objects), then assemble them. I've found this particularly useful because if I am building a complex object and I mess up, I still have the original unassembled objects to work with.

If you get a chance and you get to play "Splat Invaders Saga", check out the reactor core near the end. It is 6 layers of shields with each layer spinning in an opposite direction. This was a fairly complex object to build, so I built 4 different separate objects which I assembled into the final object. So, if I messed up glueing, or needed to work from the back of the object, I could do changes and quickly re-assemble the object.
2009-01-22 14:46:00

Author:
CCubbage
Posts: 4430


Thanks, I will try that asap! And the object pieces if a fantastic idea.2009-01-23 01:31:00

Author:
mrjoeyman
Posts: 217


I know this probably doesnt contribute much, but i got little bit of info you can use about materials its the "fake material" sticker idea:
(I dont know if this has any ownership yet, if not ill take it =P).

-Take a blank level template and make a gaint block of the material of your choice.
- Change to play mode and take a picture of the material, the larger the picture the more detail remains when resizing the picture.
-Now instead of using that material in your level, you can use a material you've already used and then place that material sticker over it and...Viola it looks like one material but its a different one.
-This also a useful tool for hiding dissolve material.

This can keep your types of materials down to just the "basic" ones.
2009-01-25 01:54:00

Author:
King_Tubb
Posts: 435


I know this probably doesnt contribute much, but i got little bit of info you can use about materials its the "fake material" sticker idea:
(I dont know if this has any ownership yet, if not ill take it =P).

-Take a blank level template and make a gaint block of the material of your choice.
- Change to play mode and take a picture of the material, the larger the picture the more detail remains when resizing the picture.
-Now instead of using that material in your level, you can use a material you've already used and then place that material sticker over it and...Viola it looks like one material but its a different one.
-This also a useful tool for hiding dissolve material.

This can keep your types of materials down to just the "basic" ones.

Yup, very useful. I do this too!
2009-01-25 02:14:00

Author:
aer0blue
Posts: 1603


If there are any typo's blaim my speech-recognition software


You got speech recognition software?! that's awesome! what do you use, i want to look in to that, as it could be very useful for any work that i have to do.

Cheers!
2009-01-25 06:42:00

Author:
RAINFIRE
Posts: 1101


I know this probably doesnt contribute much, but i got little bit of info you can use about materials its the "fake material" sticker idea:
(I dont know if this has any ownership yet, if not ill take it =P).

-Take a blank level template and make a gaint block of the material of your choice.
- Change to play mode and take a picture of the material, the larger the picture the more detail remains when resizing the picture.
-Now instead of using that material in your level, you can use a material you've already used and then place that material sticker over it and...Viola it looks like one material but its a different one.
-This also a useful tool for hiding dissolve material.

This can keep your types of materials down to just the "basic" ones.


I'll take it back!

This is a great way to reduce complexity. Not only for masking materials as others, but also for reducing the amount for objects in you level and creates much more beautiful levels.
Any non-interactive details you wish to have, simply create them from materials in another level and take a photo, then use the sticker to add the details to your level as a 2d image. I always try to use custom textures that are 'painted' using materials, coloured with stickers, and finally truned into a custom sticker for use on simple objects.
You can see the early results in my beta level here: http://www.lbpcentral.com/forums/video.php?do=viewdetails&videoid=25
Notice the save shrines and other stonework especially, and also the custom costume
2009-01-25 14:02:00

Author:
accordion
Posts: 76


really, really, really helpful stuff thank you.2009-02-17 20:34:00

Author:
olit123
Posts: 1341


Cool stuff. All I read thoroughly was the bit about the piston attatched to dark matter. Wouldn't gluing the dark matter to the object do the same thing? Anyway thats what I do, 0 chance of it breaking that way. Also that bit about the stickers to make the material look like a different material. It is helpful but be weary it changes the color ever so slightly so you detail fiends should watch out.2009-02-26 02:19:00

Author:
Hexagohn
Posts: 335


what King_Tubb was pretty help too. 2009-02-27 19:10:00

Author:
graygoose
Posts: 371


If you want to ONLY glue an object to other objects behind it, hold down the left back button when glueing. You can also do a directional glue by holding the left stick towards what you are trying to glue while you glue.

O_o never noticed this,
for me personally very usefull,
thank you!
2009-03-31 13:01:00

Author:
Luos_83
Posts: 2136


im making a massive level, but it went to 100% when i was 15% finished it....
(then i took out this very complex thing... and it went down to 75%...!!!!!!!)

but now im 30% done with 90%...and nothing able to decrease, so im planning on making it a 2part series
2009-04-22 04:46:00

Author:
johnrulz77
Posts: 835


You got speech recognition software?! that's awesome! what do you use, i want to look in to that, as it could be very useful for any work that i have to do.

Cheers!


I use dragon naturally speaking.
http://netherlands.nuance.com/naturallyspeaking/products/preferred.asp
it isnt really natural speaking, its more.. a bit robotlike.
Especially when the software is just starting to learn your way of speaking.
but nowadays its getting faster and faster.

problem is, I'm dutch and even though my english is quite good,
I sometimes "correct" mistakes made by dragon with mistakes.
And it kinda remembers that.

The pro. version lets you imput macro's.
Example: If I say: "Computer, **** you!" the computer shuts down
_
sorry for the offtopic.
_
2009-04-23 18:39:00

Author:
Luos_83
Posts: 2136


make your own items, if you use another persons it vastly increases them, an example of this is the collector boss takes up half of the thermometer also you will need to update this when the water thingie comes out2009-08-19 15:26:00

Author:
Kern
Posts: 5078


I will not update this anymore.2009-08-20 10:28:00

Author:
Luos_83
Posts: 2136


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.