Sunday, November 10, 2013

So You Want An Artist

2013.11.08:

I wanted an artist... But then I realized I needed an art pipeline:
------------------------------------------------------------------------

I am trying to make a folder called "assets" that my .swf takes from on runtime so that
my artist Matt can test out art in a build of the game without me rebuilding it.


The basic challenge:
I want to switch between a build with embedded art assets. 
(uses art assets embedded at compile time) and between a 
build that pulls from Matt's asset folder at runtime.


Implimentation Challenge #1:
/////////////////////////////////////////////////////////////////////////////////////
A lot of flixel classes use COMPILE-TIME embedded assets of type "class".
For example: When loading a sprite sheet, you load a class that represents that sprite sheet.
NOT a bitmap data instance. When loading bitmaps from a folder at RUNTIME the data is stored within
a bitmapData instance.


So, the problem is the data format:
1. Flixel uses Class type.
2. My assets are of type "Class" when embedded at compile time.
3. My assets are of type "BitmapData" when embedded at runtime.


SOLUTION:
In both modes of my game, I need the data abstracted to the common format of type "class".
Todo this I am using AS3Commons ByteCode to dynamically generate class definitions at runtime.
http://www.as3commons.org/as3-commons-bytecode/emit.html#Generating_classes


Implimentation Challenge #2:
///////////////////////////////////////////////////////////////////////////////////
I am refactoring the game to work with an instance of my own type called
"GenericAssetPack".
The "GenericAssetPack" will be able to load assets from:
1. COMPILE-TIME static registry. No conversion necessary as assets in registry are type "Class".
2. From a RUNTIME folder of PNG files. Will need to convert BitmapData object into type "Class".


After the GenericAssetPack is finished loading, all of the contents of the GenericAssetPack
get injected back into a static registry. This is a bit convoluted, but it is to avoid a huge
refactor that I don't think is necessary.


In future games, the game may work DIRECTLY with a GenericAssetPack instead of with
a registry. Especially since static classes cannot have interfaces and previously I have
had to create "interface hacks" to give my static registries an interface.


//TODO notes (You don't have to read these. I only wrote the below for me to understand)
1. Get GenericAssetPack loading AssetCoreMakeChoice.as assets.
2. Get GenericAssetPack dumping assets into AssetReg.as
3. Get game running again after huge refactor.
4. Work on runtime asset loading for Matt.

No comments:

Post a Comment