PK3 checker script


(SiliconSlick) #1

As mentioned elsewhere, I wrote a little shell script
(hack) to do some quick checks on PK3 files.

The script can be found here:

http://www.nd80usa.net/slicks/analyse_pk3s.sh.txt

A sample of the output can be found here:

http://www.nd80usa.net/slicks/map_conflict_report.txt

This is NOT an extensive validator. It will generate
warning about things that aren’t used (e.g. shaders).
It is up to map author’s to determine if the warnings
generated are truly a concern (though, ideally, you
would get none if you did a good job of bundling
your map [and trim out all the unused garbage]).

See the output for the types of things it checks for.

If you have suggestions, please post them here.
I’ve tried to incorporate most the ideas already
mentioned (short of writing a parser to do a
detailed examination of used shaders/textures),
but I may have missed some.

SiliconSlick

p.s. btw, Iffy, byzantine.pk3 is no longer perfect. :slight_smile:


(Ifurita) #2

:frowning:


(SiliconSlick) #3

Given the volume of texture conflict warning, I guess
the next thing to do is check to see if it is from one
of the editor PK3s (astro-skies.pk3, common.pk3,
lights.pk3 and mapmedia.pk3) and either be silent
if it is identical or give a FATAL ERROR if it uses
the same name but has been modified (which
will wreak havoc with other maps using the
same texture).

SiliconSlick


(Ifurita) #4

Nothing serious in Byz, however, it shows very nicely who else’s map you will fuck up if you create a custom model/texture and give it a default name and path


(seven_dc) #5

Nice job SiliconSlick. I see you have quite 31337 bash skillz! Using linux? Maybe mapping with linux? That has been my dream since ages. But radiant won’t run on my machine.


Potpourri vaporizer


(SiliconSlick) #6

Hmmm… that doesn’t seem to be a complete list.

Can someone tell me where to get the SD .pk3
for things like:

models/mapobjects/shell_sd/big_shell.tga
models/mapobjects/plants_sd/grass_low.md3
models/mapobjects/rocks_sd/rock_big4.md3
models/mapobjects/trees_sd/brokentree_b.md3

TIA,

SiliconSlick


(chavo_one) #7

If I remember correctly, those things don’t live in a pk3. They are simply installed onto the hard drive, uncompressed, when you install the SDK. That’s why mappers have to include them in their own pk3s if they use any of it.


(G0-Gerbil) #8

Worth catching though - yellow and black sqaures aren’t in fashion this year :slight_smile:


(SiliconSlick) #9

OK… I updated it to ignore things that came with SD/GtkRadiant
if they haven’t been altered.

However, I still don’t seem to have all the “common” files.

For example, where did these come from?

models/mapobjects/tombstones/tombstone0?.jpg
models/mapobjects/lamps/desklamp*.jpg
models/mapobjects/military_trim/dragon_teeth.md3
models/mapobjects/light/ametal_m03dm.tga
etc.

See the latest report for the “Conflict warnings”. There
are still a lot so there is obviously some other base files
I need to be verifying against.

I expect those warning between maps by the same
author and collaborations, but the number I’m seeing
indicates there is another source.

SiliconSlick


(chavo_one) #10

models/mapobjects/tombstones/tombstone0?.jpg [???, sounds custom to me.]
models/mapobjects/lamps/desklamp*.jpg [RTCW ASSET]
models/mapobjects/military_trim/dragon_teeth.md3 [ET SDK? I’ve got it in my mapping installation.]
models/mapobjects/light/ametal_m03dm.tga [RTCW ASSET]


(SiliconSlick) #11

Here’s a sample interpretation from another thread while I think
about how to add “IP warnings/errors” for RTCW/Q3/CTF assets.

SiliconSlick


(SiliconSlick) #12

Indeed… thanks for providing such an excellent example
for finding such things. And for finding entitities referenced
in the map script that aren’t in the .bsp. :wink:

mml_helmsdeep_53.pk3 - **** MAJOR WARNING: Unable to locate maps/mml_helmsdeep_53.script’s entity allied_bottom_hall_spawn in maps/mml_helmsdeep_53.bsp ****
mml_helmsdeep_53.pk3 - **** MAJOR WARNING: Unable to locate maps/mml_helmsdeep_53.script’s entity bank_door1 in maps/mml_helmsdeep_53.bsp ****

mml_helmsdeep_53.pk3 - *** Model Warning: Could not locate model models/mapobjects/plants_sd/mil1 referenced in maps/mml_helmsdeep_53.bsp ***

My script missed the pretty orange and black striped
plants the first time. I’ve since modified it to “grep”
the .bsp for “models” and “textures” and added
those that can’t be found to the report.

See the links above for the latest.

I need some feedback from map authors and the SD crew
as to whether the warning/errors generated are really a problem.

RivrStyx mentioned something about “misc_models” only
needing textures in the .pk3 while “misc_gamemodels”
not defined in pak0.pk3 need the .md3 file as well.
I’m not sure how to deal with such things when grepping
strings from a .bsp, so for now they are just “Model warnings”.

SiliconSlick


(jah) #13

can you please make this work in windows? :frowning:


(G0-Gerbil) #14

A misc_model ‘should’ not need any special processing, and shouldn’t show up as a seperate entity - these are baked into the BSP at compile-time.
misc_gamemodels, however, are stored as the entity reference, so will need special processing - in this case you’ll need to find the model reference (it’s an entity key / value of model) then parse the format to find what shaders it refers to and off you go.
‘Simple’ :wink:


(SiliconSlick) #15

http://www.cygwin.com/

SiliconSlick


(SiliconSlick) #16

http://www.cygwin.com/[/quote]

I’ll also be happy to run it for anyone willing to post
a link to their map.

SiliconSlick


(SiliconSlick) #17

It is a Unix shell script so will require a Unix environment.

Copy script to your home directory. e.g.


cd 
# if you don't have curl, you can probably use wget instead
curl -O http://www.nd80usa.net/slicks/analyse_pk3s.sh

Create a temporary directory and copy the pk3s to analyze
to it:


mkdir /tmp/mytmp
cp pk3tocheck-1.pk3 /tmp/mytmp
cp pk3tocheck-2.pk3 /tmp/mytmp
...

Change to the temp directory, run the script and redirect
output to a file and then view the file:


cd /tmp/mytmp
~/analyze_pk3s.sh >& out
more out

SiliconSlick