Asset management across platforms


I have a question regarding asset management across platforms.

Let’s say i want an app to be cross-platform both across desktop computers and android, and i want to use high-res textures and models on the desktop, but use low-res on the mobile.

On way i’ve thought of it using resource bundles in some way, and modify the build xml’s to use asset paths (probably the simplest way).

I guess what i’m really asking is if there’s already a way to do this, and keep track of the different “asset distributions” in the current platform?



Yeah, you would basically have different asset.jar files with the same files but different content or with some added name like MyTexture_hires.jpg MyTexture_lowres.jpg and leave away the files not intended for that platform. I intend to make separations like these (per-platform, per-“distribution”) easier in the SDK project configuration, if you have any good ideas hit me.

I was basically thinking about two ways: One would be having different assets folders that are displayed in the main project view “as one” but are separated on distribution. The other would be a settings panel that lists all assets and lets you select to which jar file they go and/or in which distribution they are supposed to be.

1 Like

Cool! I’ll think about it for a bit.

I kind of like how resource bundles work, and how android handles drawables; that you have a “base” asset pack, that is used by default. If you have any assets you want to use for a specific platform, you place them in a separate asset folder, with the same name and folder structure. The app will use them when found, and fall back to the “base” asset pack for any assets that aren’t found in the platform specific folder.

Yeah, so the first solution… Would also allow having one folder with stuff you really only need during development (e.g. blender models etc)

As a follow up to this;

It seems JME’s asset management is pretty flexible as it is (or maybe somethings been done since this topic was created).

I think i’ve partly solved this issue by doing the following;

  1. Create a sub folder in the assets folder called “Android”.
  2. Put your down sized textures (or whatever) there, in the same tree structure.
  3. Add another “Classpath locator” to your Asset Config, with “Android/” as root path.

    There is a follow up problem to this though;

    AndroidAssetManager has a hard coded config. Is there a good reason for that?

    Any attempts to modify it seems to be completely ignored when i clean/build jme. Could anyone tell me why this is?