I’m working on a tool that can edit GRP files, and I have a problem. I can add,delete and extract files to the GRP. The data from extracting files (even if I extract one file, delete it from the GRP and added it back in) seems to be exactly the same as KEXTRACT .EXE outputs.
CON files look 100% the same as the unpacked CON files already in the directory (of the shareware version of Duke3D) and the MIDI files play perfectly inside winamp or Windows Media player.However, it seems that if I extract a file (let’s say E1L1.MAP) delete it from the GRP and then add it again (thus changing its position within the GRP file) the GRP file becomes corrupt. If I would run Duke3D.exe it will crash as soon as it needs the file (in this case it can find E1L1.MAP).
I’ve tried some other freeware GRP editors (to check if maybe my data was wrong), and they all seem to have the same problem! I’m pretty positive my data is correct. Because when I extract the main theme (GARBAGE.MID) from the GRP into the duke3D directory and then delete it from the GRP. The game seems to find the file, and play it. However, if I try to added it back in, it doesn’t play.
Is there something I’m missing ? do those files need to be in a specific order or something ?
Awesoken at
Re: GRP file problem
It would be much easier if you posted a url to your corrupt GRP file so I can look at it. Making me guess at your problem, hoping for a hit, is just a waste of time.
0xC0DE at
I have problems with my server. So used some website services, hopefully it works : http://encodable.com/cgi-bin/filechucker.cgi?action=landing&path=/&file=DUKE3D.rar
In this GRP file, I extracted the E1L1.MAP, deleted the file and added back in. The file size is the same as the original GRP, KEXTRACT outputs exactly the same output as with the original GRP. But somehow duke3D.exe is not able to find E1L1.MAP.
Awesoken at
When I run "kextract duke3d.grp e1l1.map" on your GRP file, the first 4 bytes of the MAP file are: 0x00, 0x07, 0x00, 0x00. You have an extra 0 in the beginning. Build version 7 maps should always start with: 0x07, 0x00, 0x00, 0x00. You, sir, have a bug.
If the first 4 bytes of the map file do not match, BUILD.EXE reports 'Invalid map format.' and loads nothing. When loadmap() fails in DUKE3D.EXE, it calls gameexit() without giving a clue as to why. That's sloppy programming by Todd.