Possible uses for packages.
by Brian Allen Vanderburg II
The packages mechanism provides a way to isolate one set of game data
from another, and allows one set of game data to depend on resource data
(images, sound, music) from other packages. I originally had in mind
that this could be used by other level developers to develop levels that
are outside of the scope of the game use packages so that the data
doesn't pollute the main game data. I'm thinking that it may also be
usable for the main game to use packages, possible both for game play
data (levels, worlds, and campaigns) as well as resource data.
By using packages for game play data, it is possible to break the game
up into separate scenarios, each with their own worlds, levels, and
campaigns. This could be similar to how some DOS-based games had
different scenarios that you could play independently of one another.
The idea of using packages even for the resource data is for upgrades
and compatibility. It may occur that some graphics could be modified
during the development of the game. A change could cause level-breaking
or other issues if the graphics change sizes, collision rectangles,
etc. If the resource data is also in packages, then upgrading the
graphics if it causes such problems can be done as follows:
* Create a new resource package "tsc-core-v2" that depends on the
previous/original resource package "tsc-core-v1".
* Place any modified graphics in this new package, leaving the data in
the original package alone.
Here, a game play data "tsc-scenario1-v1" would depend on the resource
package "tsc-core-v1". By placing the changed level-breaking graphics
in the package "tsc-core-v2", the game play data from "tsc-scenario1-v1"
would not be affected as it would still use the original v1 graphics.
Also, any custom-developed packages would not be affected by changes
done like this. An upgraded package can then be created that depends on
"tsc-core-v2", lets call it "tsc-scenario1-v2". Since "tsc-core-v2"
depends on "tsc-core-v1", any graphics not changed will still be used
from "tsc-core-v1". A later scenario "tsc-scenario2-v1" may be created
that depends directly on "tsc-core-v2". As the older packages are
updated, the unmodified data from "tsc-core-v1" can be copied into
"tsc-core-v2", the dependency on "tsc-core-v1" removed, and eventually
"tsc-core-v1" removed from the game data entirely. (it may be archived
somewhere for use by others if they still have old custom-developed
packages that depend on it)
I have attached an example graph to explain a bit more.