Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
packaging resources tool
#1
Hi Boys!
do you have/use a tool for packaging a game/app with its used resources  into a folder for distribution/condivision among staff/collaboration members?
Or do you have made one? 
I talk about a tool that scans source code and collects the file loaded (Images, sound, music, font) then it creates a folder tree with this resources (or similar tool) .

ie 
     MainFolder|--->Assets|---->Images|--->SplashScreens
                    |                |                 |--->SpritesSheets
                    |                |                 |--->GraphicImageFonts
                    |                |                 |--->GUI images
                    |                |                 |--> ICO
                    |                |
                    |                |-----> Sounds|-->Sound & Noise       
                    |                |                    |--> Music
                    |                |                    |--> Voices
                    |                | 
                    |                |----> OS compatible Fontfiles
                    |
                    |---> Source Code
Reply
#2
That is certainly something someone could build, but you'd have to deal with all the nuances for calling images, paths, etc. For instance, if I use: _LOADIMAGE("c:\qb64\space-invaders\mypic.jpg", 32) I could easily find the path to create the directory if it didn't already exist, but if I use: _LOADIMAGE(dir1$ +"mypic.jpg", 32) then my routine would have to examine the software and figure out what path dir1$ was used for... and it gets worse; what if I use dir1$ for more than one path and I don't use a progressive top to bottom flow in my program? Now I essentially have to make my routine read and determine the entire code flow, to see what dir1$ assignment was used for this image to unpack it into the correct folder.

So no, I haven't made one of these nor do I use one.

What I did make 20+ years ago was a pseudo-zip file. It put all my routines together as one big exe file. The files were joined in such a way that when they were copied back with BINARY read/write, a header was read at the beginning of the file to determine the number of bytes of each file and the path and name, so each path could be made and each file could be copied to the correct folder in its exact size, and the remaining would look to the next set of header entries to begin unpacking the next file, and so on.

Pete
Reply
#3
The easiest way to do this is set up your folders as so:


QB64 --->  MY PROJECT FOLDER   --> SUBFOLDERS

Now keep the source code and compiled EXE in MY PROJECT FOLDER (one folder for each project use as "SPACE INVADERS" or "ASTEROIDS" or "TENTACLE PORN DOWNLOADER".... Or whatever your needs might be.

Now, if you ever need to share that project, just 7zip or winrar or tar or whatever file compression routine you use, use it on MY PROJECT FOLDER and include subfolders with that compression.

PRESTO!!  One simple file ready to extract with all resources intact and file structure maintained.  It really doesn't get any simpler than this.

Sure, somebody could write a program to do this.  I used to have one back in the day -- SAC (Steve's Anexoric Code), which "ate" files and then later "barfed" them back up later from the single file they made, but it was amature grade workmanship.  It *worked*, but I certainly can't compare to the compression amount or speed or efficiency of 7ZIP or any of those other softwares dedicated to the process.  It ended up being just a lot easier to use the proper tool for the job, than to try to make and maintain my own.
Reply
#4
I haven't made the exact same thing, but similar:
This is for loading resources (images only for now) by parsing an external file.
I use this for my Minecraft clone:  QB-Blocks/AssetsParser.bas at master · AadityaParashar0901/QB-Blocks · GitHub
Reply
#5
Do it as Steve suggested. That's how I've always done it. In the example: Dino is the main folder containing all subfolders and other files. You zip it, and after unzipping, you can move the main Dino folder to wherever you want it; all the paths are correct.

That still works today, but it was intended for 800 x 600 resolution; something like that.

[Image: Ordnerstruktur-Tree2025-09-16.png]

I made this page just for fun.

[Image: Dino-Ursprung-Mittel.jpg]
Reply
#6
The only thing different that I do from what Steve said is that I keep all my work and others in a QB Files folder separate from the current QB Folder that contains QB64pe.exe and all its stuff. That way when QB64pe gets updated I dont have to move all my QB64 files to a new place. It also makes it easier to backup all those files onto flash drive (you don't need to backup QB64pe files just get another download).

I also tell my QB64pe shortcut to start in my QB Files Folder after each new QB64pe update.

My QB Files folder is also divided into Major sub category Folders along with all the project Name folders like: Graphics, DeskTop apps, Test Code for working Subs and Functions, Games, Math, Interpreters, GUI...
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#7
Hi friends
yeah I thank all of you! These are all good advices... I must refine this idea
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question REDIM takes more resources than DIM? bplus 34 5,738 07-23-2024, 01:04 PM
Last Post: luke

Forum Jump:


Users browsing this thread: 1 Guest(s)