Layers and memory usage

I am attempting to use layers to represent the modifications available for each card in several decks of cards. Each modification has a separate location on the card. Unfortunately I can’t use a common layer prototype to represent the modifications so I’ve been adding a layer trait for each modification per card. As I’ve done this I noticed a large increase in memory usage, receiving out of memory errors, based on the amount of layer traits that have been added. I’ve bumped the heap size up to 1500 which has allowed the module to load.

Currently there are 892 modifications available, which will require a layer trait for each one, and each layer contains 19 levels. So a couple of questions. 1) Is there a better way to do this? 2) Do layer traits act as their own object, rather than acting as reference, even though they are using the same image for each layer level?

Thank you.

After reviewing the Vassal Designer Guide 3.1 multiple times and trying different methods I believe it is not possible to achieve my goal. My initial attempt was to use layers to represent 19 modifications for 892 modification slots throughout multiple decks. As I applied a layer trait for each slot, only changing the offset, I discovered the module was consuming more ram. Thankfully I examined the current state and identified the problem at only one quarter of the way implemented.

To summarize the attempt is to create multiple layers, ideally with a prototype, as it greatly reduces memory consumption but change only the offset on each game piece. At this point I believe I may have to create a custom Java class to provide what I think will fix the problem. I’m going to move this discussion over to the Developers section as it no longer is a Module Design issue. However if anyone has other suggestions, please feel free to reply.

Thank you.