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.

Newcomers AppGameKit Corner / How to include media files in the executable?

Author
Message
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 8th Jul 2017 06:42
I noticed the executable does not work without the media files.

So, my question is- how, when creating the executable, do you include the media files in it?
.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 8th Jul 2017 07:24 Edited at: 8th Jul 2017 07:24
There are several virtualization solutions out there but I am not sure how / if they would work with AppGameKit BASIC.

Now for C/C++ a person can create their own.

I've been meaning to post and ask if there is a way to create sounds from in memory data banks the same as images can be created from them. Because I have this same interest and if I could at least make it so I only have one data file in the media folder that contains all audio and graphics files that would be a nice compromise.

Anyway search online for virtualization solutions executable data packers etc.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
blink0k
Moderator
11
Years of Service
Recently Online
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Jul 2017 10:34 Edited at: 8th Jul 2017 10:40
If i understand the question;
1. For android/ios AppGameKit will create a package
2. For windows you could use an install package creation utility
3. Or just copy the media folder as well as the .exe
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 8th Jul 2017 14:09
There used to be one available on the TGC website, I believe it took an application of lose files and packed them into a single executable and when executed it would unpack them to a temporary folder and run the app from there, I think you can do the same using winrar with a self executable set to silent install, but obviously it would not be very secure.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 8th Jul 2017 20:39 Edited at: 8th Jul 2017 20:41
It seems like for Tier 1 BASIC with it being interpreted it should be quite easy for them to implement a virtual file system just tacking on all media and other data to the end of the bytecode file. Because this all runs in an interpreted environment anyway it could be implemented seamlessly and as a standard.

Although some people might not like that idea I suppose. So maybe just make it an option.

Anyway... going the virtualization route there is no need to unpack the data to the hard drive or anywhere else. The data (media, etc) would simply be loaded directly into memory from the relevant section of the bytecode file. This is how portable all-in-one executable files work.

Once that is done the next step would be for them to make it so there is no separate bytecode file and instead the bytecode data is tacked onto the end of the AppGameKit interpreter executable. Then we end up with a single file.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 8th Jul 2017 21:48
Quote: "Once that is done the next step would be for them to make it so there is no separate bytecode file and instead the bytecode data is tacked onto the end of the AppGameKit interpreter executable. Then we end up with a single file."


I used to do that with PureBasic tacking a users lua script into a custom engine I built but some antivirus systems flag the exe as being tampered so I had a constant annoyance of users complaining "it's a virus bla bla bla", it would be good though if the media files were added to the bytecode file as some graphic vendors insist that you take steps (make a reasonable effort) to secure the media, me being a bit backwards on the art front I buy a lot of media and its part of the license in some cases so its a very welcome idea for me.

Quote: "I've been meaning to post and ask if there is a way to create sounds from in memory data banks the same as images can be created from them. "


CreateMemblockFromSound() then CreateFileFromMemblock() // CreateMemblockFromFile() then CreateSoundFromMemblock() should work, I'v not tried it but it looks like TGC have provided what we need to semi secure our media, just need to make a small app to dump the data files .... seems like a nice small project for this evening lol

GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 8th Jul 2017 22:01 Edited at: 8th Jul 2017 22:05
@PartTimeCoder Really?! So they do have support for that! Awesome.

Ha ha! I was just telling @janbo how I generally don't spend much time nor have desire to spend much time digging through api documentation. This is a great example of that. lol

I mean I'd have eventually got around to finding it in the docs but I am just not the way I used to be. There was a time when I would dig through api docs constantly and had reference manuals on the internals of the C64, Amiga, Win32 API, etc that I would study. After doing it so much I just burnt out on it and "wing it" for the most part anymore. Sometimes I look something up but am just as, if not more, likely to reinvent the wheel and write it myself because to me the effort involved feels about the same or even less to just do it myself.

Well with that in mind then heck yeah I think I will make a PackFile system for my projects. Because having a single .dat file or even a .dat file per level in the media folder would be a great thing IMO.

Not right now I mean. Maybe next week. I probably won't do any dev today at all. Maybe not tomorrow either. But sooner or later I will get the urge to do something again. And who knows maybe you will already have it done by that point. lol
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 8th Jul 2017 22:38
lol, I swear by API docs, programming for Win32 without visiting MSDN 100 times a day is nigh on impossible, remembering all those structure members and constant definitions is not something my brain can handle, don't get me wrong though I don't ever spend a fortnight reading a doc then get stuck in, I just look up the info relevant to the task at hand and within a month or 2 you read the whole doc.

AGK has zip file commands but no password access, it would be handy to pack data files into a passworded zip then we could extract, load and delete in the blink of an eye, that way the data is on disk for minimal time only a few MS or a couple of seconds tops, someone could recreate the data from a dat file, a savvy user or wannerbe hacker would do it just for kicks, a bunch of dat files packed into a unsecured zip would still putoff 95% of people though so its worth considering, for instance if you paid for lots of custom media or spent 100's of hours creating it and the game has the potential to be a hit ... its a no briner.

or even just for file management, like you said a master dat file for each level could be a zip full of data files for that level, something to consider when building your packer app
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Jul 2017 02:52
I really must finish my controlled media library..

Login to post a reply

Server time is: 2024-04-25 00:52:40
Your offset time is: 2024-04-25 00:52:40