Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Native protected file-system for assets - coming soon!

Author
Message
nz0
AGK Developer
19
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Jun 2014 22:43
Thought I'd share an update on the project I've worked on this weekend, as it's quite exciting and finally we can easily protect our game assets!

I've been somewhat annoyed since day one about having to distribute unprotected assets with games so far, and although there are some paid wrappers you can use, what would be better than native?

Anyway, with this system, all of your game assets will be combined into a single file, much like the old WAD format.
More specifically, it is a virtual file system where each file (or file set for atlases) is compressed individually into a single archive which is accessed at runtime.

Of course, this process won't deter proper hackers, it's more to prevent casual pilfering of your stuff.

So far, I have got images (including atlases!) and music incorporated. Next will be wav files, objects, shaders and general data files.

There's a slight issue with music (mp3 etc.) as the actual file has to be persisted for playback, but it can be optionally cleared when finished with or will just be cleared up on exit.

While coding this, I even made a compressor/decompressor in tier 1 (!) which wasn't particularly brilliant (600K -> 500K) on an image, but was fun trying.

I've just updated the system to allow for multiple WAD files, which will work better if you want to make one for sound effects, one for images etc. or perhaps even better - to pack level data into single WAD files for efficiency - it will be up to you.

The main thing is that it works and there's only a small initialisation overhead. I can see a couple of areas where it can be sped up, but optimisation comes after functionality.

I could code it using V2 functionality, making it more efficient but for now, it's still V1 compatible.

The WAD generator tool wasn't written in AppGameKit, but in Delphi. You would simply point it at a directory and specify a file which will be a virtual representation of that directory and all subfolders within.
I'll add command line parameters, so you can just batch create your WAD files.

Functions replace existing methods:

LoadImage(file) becomes LoadWadImage(wadID,file)
LoadMusic(file) becomes LoadWadMusic(wadID,file)

etc..

simple as that. The filesystem looks up assets as if they were on the disk as normal, so you don't have to keep updating the WAD during development, just use your media folder as normal, then use the alternative loading method on your release version.

Paronamixxe
AGK Bronze Backer
14
Years of Service
User Offline
Joined: 10th Feb 2012
Location: Sweden
Posted: 8th Jun 2014 22:47
This sounds great! About time this was done Keep us posted!

cheers

JimHawkins
17
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 9th Jun 2014 00:14
I've been using my version of this for a long time. Has the ability to load stream segments etc from file. Obviously, also Delphi!

-- Jim - When is there going to be a release?
bjadams
AGK Backer
18
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Jun 2014 00:28
is it windows only or also works on ios?
nz0
AGK Developer
19
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Jun 2014 00:51
Will work on all platforms.
@Jim: Obviously delphi indeed! Shame on you for not sharing then, as people have been crying out for this for ages, unless your implementation isn't able to be utilised in tier 1.

My feelings are that this was always a major issue for AGK.

JimHawkins
17
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 9th Jun 2014 06:46
@nz0 - it's part of my company's language lab software. I'd have to ask the board to release it.

It would be tricky in T1 - I don't think the T1 file system is up to it. It's based on AIF - with FORMS and CHUNKS, and uses 64-bit internal addressing (Int64) for offsets and lengths.

It's been working without a single error for 12 years, so I reckon it's debugged!

-- Jim - When is there going to be a release?
nz0
AGK Developer
19
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Jun 2014 11:05
@Jim: Ah, I see - not already an AppGameKit implementation.
Yes, it's tricky with T1; could do with a couple of extra filestream type functions.. seek() for one.

JimHawkins
17
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 9th Jun 2014 13:16
@nz0 - I need to adapt it for Android. In the PC system teachers can load unlimited gigabytes of movies etc into one file. That's not likely to be necessary for Android!!!

I don't think that T1's primitive file system access is up to this, to be honest. Personally, I'm quite happy to support AppGameKit Pascal and leave others to sort out T1 and C++. Any file system access without a Seek() is not worth considering.

However - I will try to release a Pascal version next week.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2026-07-26 08:25:20
Your offset time is: 2026-07-26 08:25:20