Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

ApplicationStorageDirectory - Best Practice for Games Question

New Here ,
Jan 13, 2011 Jan 13, 2011

So I've been working on a game which uses AIR. My problem is that I have been storing my game assets in the application directory. That would be fine except that the game has a built-in editor which requires the ability to write files. Adobe has since locked the ApplicationDirectory to write access, so now I'm not sure of where I'm expected to store all of my user editable game files - which is potentially ALL game assets.

The seemingly obvious choice is to use ApplicationStorageDirectory. While not ideal, in that it seems I would need to duplicate all assets from inside the application to the storage directory on startup, it would provide a standard and easy to find place to store editable game assets.

However, this article (on this site) clearly tells me that I should not do that. It makes a good point. Backing up all of the games assets is messy proposition. And while I can see users who take advantage of the editting capabilities as appreciating the backup, for the average player, that would be a pretty big annoyance.

So what am I expected to do in this scenario? I need a writable location where the user and the application can easily access all game assets ( XML, Image, MP3 ). I don't want to pick an arbitrary location, and I'm turned off by the application needing to redundantly house the data just to copy to the destination directory since there's no way for me to delete it once it's copied since I can't write to the application folder.

Thanks for the thoughts.

TOPICS
Performance issues
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jan 13, 2011 Jan 13, 2011

Hi,

A couple things come to mind. It's actually not Adobe that locks the application directory on Windows, that's a MS permissions thing with folders under Program Files.  But either way, it's still a problem. 

As you mentioned, you could copy files on first launch but depending on the size, this could be annoying after a user just sat through the install.  It's also not very friendly when you want to uninstall.  You might want to consider sub launching the AIR installer from a separate installer

...
Translate
Adobe Employee ,
Jan 13, 2011 Jan 13, 2011

Hi,

A couple things come to mind. It's actually not Adobe that locks the application directory on Windows, that's a MS permissions thing with folders under Program Files.  But either way, it's still a problem. 

As you mentioned, you could copy files on first launch but depending on the size, this could be annoying after a user just sat through the install.  It's also not very friendly when you want to uninstall.  You might want to consider sub launching the AIR installer from a separate installer which also takes care of installing the game resources to another writable location.  Maybe this is user selectable, but at least it's monitored by the installer which should allow you to uninstall properly.

Would it be possible to keep the resources with your app, but architect the editor such that only user created content would go in a user writable directory (such as a subdirectory off of their documents folder?)

Chris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 14, 2011 Jan 14, 2011

Hi Chris,

Thanks for the helpful suggestions. Managing the user data seperately might be a tenable solution.

Could you speak to / point to information about using the secondary installation/uninstallation?

-Clayton

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 17, 2011 Jan 17, 2011

Hi Clayton,

For information about launching AIR as a sub installer from a native installer, I'd like to recommend signing up for our distribution agreement.  This is free and automated program that among other things, will let you run AIR installers silently.  Once you sign up, you'll get a link to detailed documentation that explains the different command line parameters available to you.  Many customers will bundle their AIR installer within another native installer, allowing them to install additional applications and content with a single, convenient, installer.

Chris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 17, 2011 Jan 17, 2011
LATEST

I was unaware of that. Thank you for the link! Answers accepted. Very helpful.

-Clayton

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines