Users browsing this thread: 1 Guest(s)
Beetle Bug .stg File
#1
The gist is simple, I'm planing to rip sprites from a game called Beetle Bug/Junior/Ju and all of the games assets are contained in a stg file. Looking in the file with Notepad Plus and Notepad show the names of some assets and random text. If you have any idea how to extract them i'd like to know.


Attached Files Thumbnail(s)
   
Reply
Thanked by:
#2
If you upload the file then I can take a look. Judging from your screenshot though, the file format doesn't look to complex.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: OS-PRIME
#3
(04-04-2015, 10:13 PM)puggsoy Wrote: If you upload the file then I can take a look. Judging from your screenshot though, the file format doesn't look to complex.
Looks complex to me since i have like, no knowledge in computers and stuff   Tongue
Anyway, here's the link to the file since its too big to be attached.
https://www.dropbox.com/s/am1yoqdbpft4xy2/BeetleJu.stg
Reply
Thanked by:
#4
Well it's not simple per-se, but I mean compared to a lot of other formats I've seen Tongue

Anyway, turns out it was. Here's a QuickBMS script:

Code:
# Beetle Bug .stg
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

idstring "stg2"
getdstring DUMMY 0x0e
get INFSTART long
get FILES long
goto INFSTART

for i = 0 < FILES
    get NMSZ short #not necessary but whatever
    get DUMMY long
    get ZERO byte
    get SIZE long
    get OFFSET long
    getdstring NAME 0x1D
    
    log NAME OFFSET SIZE
next i

The things you want should be ready to use in .png, .jpg, and .ogg format. Things like .lvl, .fnt, .spr, .dmo, and .sav probably aren't useful unless you want to try modding the game. There's also strings.bin which appears to hold all the text, again it isn't really useful if you're just extracting resources.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: OS-PRIME
#5
(04-05-2015, 12:15 AM)puggsoy Wrote: Well it's not simple per-se, but I mean compared to a lot of other formats I've seen Tongue

Anyway, turns out it was. Here's a QuickBMS script:


Code:
# Beetle Bug .stg
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

idstring "stg2"
getdstring DUMMY 0x0e
get INFSTART long
get FILES long
goto INFSTART

for i = 0 < FILES
   get NMSZ short #not necessary but whatever
   get DUMMY long
   get ZERO byte
   get SIZE long
   get OFFSET long
   getdstring NAME 0x1D
   
   log NAME OFFSET SIZE
next i

The things you want should be ready to use in .png, .jpg, and .ogg format. Things like .lvl, .fnt, .spr, .dmo, and .sav probably aren't useful unless you want to try modding the game. There's also strings.bin which appears to hold all the text, again it isn't really useful if you're just extracting resources.
Actually that is simple!
Anyway, i can't thank you enough for this. Is it okay if i add you as a submitter when i submit the sprites to the Spriters Resource?
Reply
Thanked by: puggsoy
#6
You can if you want to, but it's really not necessary. I'm just glad I was able to help Smile
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: OS-PRIME
#7
(04-05-2015, 01:00 AM)puggsoy Wrote: You can if you want to, but it's really not necessary. I'm just glad I was able to help Smile

Alright!
I'll upload the files tomorrow since i'm getting tired.
Also the BMS script works with the other beetle bug games except for 2 oddly enough.
Reply
Thanked by: puggsoy
#8
If you upload the one that doesn't work I can maybe make something for it. With luck it shouldn't be drastically different.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by:
#9
(04-05-2015, 05:31 AM)puggsoy Wrote: If you upload the one that doesn't work I can maybe make something for it. With luck it shouldn't be drastically different.
Alrighty, though there's 2 .stg files in this but one if them is too small to include anything but i included it just in case.
https://www.dropbox.com/s/44s8vbxsj39ihx...%20BB2.zip
Reply
Thanked by:
#10
OK, managed to update the script so it works for those as well:

Code:
# Beetle Bug .stg
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

idstring "stg2"
getdstring DUMMY 0x0e
get TBLEND long
get FILES long
get DUMMY short

for i = 0 < FILES
    get INFOFF long
    get CHNKNM long
    
    if CHNKNM != 0
        savepos TMP
        goto INFOFF
        
        for j = 0 < CHNKNM
            get NMSZ short #not necessary but whatever
            get DUMMY long
            get ZERO byte
            get SIZE long
            get OFFSET long
            getdstring NAME NMSZ
            
            log NAME OFFSET SIZE
            
            for TEST = 0 == 0
                get TEST byte
            next
            
            savepos POS
            math POS -= 1
            goto POS
            math i += 1
        next j
        
        goto TMP
    endif
next

I did two things here. First of all, I used an offset table at the front of the table to get at the information chunks. The first time round I wasn't aware how it worked but I got it this time. To be perfectly honest it doesn't really help at all and actually makes the script longer than necessary, but it doesn't slow it down and I guess it's more correct (and probably makes it more compatible for reimporting).

The other thing was that I didn't hard-code the name length. This is what screwed it up. I assumed that all names were 0x1D long but the Beetle Bug 2 files have different lengths. Unfortunately there's no way to detect the name length so I had to make a hackish loop that kind of goes through the padding until it reaches something else. It's not as clean as I would like but it's the only way I could think of. At least it doesn't seem to slow it down.

Should work for all archives now. Oh and by the way, Distr.stg does contain 2 tiny files but they're just config stuff that probably isn't really useful.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by:
#11
I think the .spr files hafe interesting sprites if there extracted.
http://www.fallout-files.de/index.php?c=details&f_id=51
oror here
http://freelancer.ag.ru/fallout/download..._eng.shtml
some interesting tools for spr files.
Reply
Thanked by:
#12
(04-06-2015, 01:03 PM)sutinoer Wrote: I think the .spr files hafe interesting sprites if there extracted.
http://www.fallout-files.de/index.php?c=details&f_id=51
oror here
http://freelancer.ag.ru/fallout/download..._eng.shtml
some interesting tools for spr files.

I'd guess that .spr files would be used for loading and animating the sprites. Besides, all of the monster sprites were in the extracted folder as a .PNG
Reply
Thanked by:
#13
Yeah, a lot of files use the .spr extension but aren't necessarily the same. For these they just look like animation files or something, like OS-PRIME said.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by:


Forum Jump: