Libraries

 

This is a very powerful tool and one that will optimize your scenery frame rates without any doubts. Especially if you use the same object frequently like trees or gates.

A library is a collection of macros and each of the included macros is called using a key from another macro. The great advantage of using a library is that it reduces the file size and increases performance of your scenery.

Let's assume you have 20 trees to place in a scenery. That means you will have to use a macro tree 20 times which means 20 times the same code. Macros can be small but they can also be very huge and complicated. Obviously the bigger your macro is the more efficient your Library will be.

Now if you place the same macro tree into a library you will use a new macro to call it. But this new macro has almost no code at all, it's very small. If your macro is 3 kb in size this table will give you an idea of the estimated savings.

Using a library Using macros only
Macro size   3 kb 3 kb
Macro Library call .10 kb not applicable
20 macros for example 3 + 20x0.10 = 5Kb  20x3 = 60 Kb
Note: All are estimated numbers

Library macros work the same way as normal ones, they are scalable.

There is only one exception - you can not use any passing argument to it. Some scenery designers use macros having arguments such as a choice of colors, etc. This type of argument can not be processed in a macro library. If you want to use it you will need to add the same macro into the library as many times and in as many colors as you want to have it...is it really worth it for you?

How to make a library

IMPORTANT NOTES: