Tool to show dependencies?

Tutorials and discussions about Mapping - Introduce your own ones!
User avatar
f7r
Experienced
Posts: 131
Joined: Mon Oct 19, 2020 6:53 pm

Re: Tool to show dependencies?

Post by f7r »

v0.5a tested on Windows and Linux, Python minimal version 3.7

Code: Select all

usage: utdep.py [-h] [-L] [-q] [-n] [-i] [-d] [-e] [-a] [-l] [-o #] [-r #]
                [-t] [-c] [-f] [-p <path>] [-C [file]] [-R] [-x] [-X <file>]
                [-s] [-v] [--debug DEBUG]
                file [file ...]

UT99 File Dependency Checker v0.5a f7r AI-gen based on perl script utdep.pl
v0.3.0 by Christiaan ter Veen

positional arguments:
  file                  UT99 file to analyze

optional arguments:
  -h, --help            show this help message and exit
  -L, --lists           Treat main file(s) as list(s)
  -q, --headers         Print headers
  -n, --names           Print name table
  -i, --imports         Print import table
  -d, --dependencies    Print dependencies list (default)
  -e, --exports         Print export table
  -a, --advanced        Print advanced info
  -l, --levelinfo       Print level info
  -o #, --object #      Dump object properties by export ID
  -r #, --rawobject #   Dump raw object properties by export ID
  -t, --tree            Print dependency tree recursively
  -c, --condensed       With -t print dependency tree condensed w/o afore
                        found
  -f, --filesonly       With -t print dependency files only w/o info
  -p <path>, --path <path>
                        With -t use <path> for search dependencies
  -C [file], --cache [file]
                        Use cache file [file], default ./cache.dat
  -R, --nostorecache    With -C use cache file readonly mode
  -x, --excludevanila   Exclude vanilla UT99 files from dependencies
  -X <file>, --excludelist <file>
                        Exclude files from dependencies from list <file>
  -s, --silence         Supress extra output
  -v, --version         Print version
  --debug DEBUG         Set debug level (0, 1, 2, ...)            
advanced info:

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr -a                                          
Processing file: Maps/CTF-[R3P]-W007-II-[AMC].unr                                                             
Advanced information:                                                                                         
  Mapname: CTF-[R3P]-W007-II-[AMC]                                                                            
  Title: R3P'S W007 (MKII)                                                                                    
  Author: Kris [R3plicant] Andrews 2018                                                                       
  IdealPlayerCount: 12-14                                                                                     
  LevelEnterText: wildimagination2003@yahoo.com Paypal donations welcome. Thank you.

Weapons:
  Enforcer: no, ammo: 4
  Bio Rifle: 2, ammo: 8
  Shock Rifle: 2, ammo: 8
  Pulse Gun: 2, ammo: 6
  Ripper: 2, ammo: 8
  Minigun: 2, ammo: 4
  Flak Cannon: 2, ammo: 10
  Rocket Launcher: 2, ammo: 8
  Sniper Rifle: 2, ammo: 8
  Redeemer: 2

Powerups:
  Medbox: 4
  HealthVial: 56
  HealthPack: no
  ThighPads: 2
  Armor2: 2
  UT_ShieldBelt: 2
  UDamage: 2
  UT_JumpBoots: 2

Playerstarts: 16

Botpathing:
  Path Nodes: yes
  AlternatePath: no
  Ambush Points: yes
  Defense Points: no
'???' is because it is not always possible to accurately determine (at least i don't know) the package extension from its import:

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr                                             
Processing file: Maps/CTF-[R3P]-W007-II-[AMC].unr                                                             
Dependencies:                                                                                                 
  Engine.u                                                                                                    
  PK_Tech_Set.utx                                                                                             
  R3pW007Tex.utx                                                                                              
  Botpack.u                                                                                                   
  CSMCXExtras.u                                                                                               
  SkyR3p.utx                                                                                                  
  ArenaTex.utx                                                                                                
  UnrealShare.u                                                                                               
  swjumppad.u                                                                                                 
  R3pTex.utx                                                                                                  
  R3pGlass2.utx                                                                                               
  Core.u                                                                                                      
  AmbModern.uax                                                                                               
  Mine.utx                                                                                                    
  SpaceFX.utx                                                                                                 
  AmbOutside.uax                                                                                              
  UTMenu.utx                                                                                                  
  XC_Siege_r4.u                                                                                               
  XbpFX.utx                                                                                                   
  Liquids.utx                                                                                                 
  UnrealI.u                                                                                                   
  W007ExtraHealthy1.???                                                                                       
  Activates.uax                                                                                               
  AmbAncient.uax                                                                                              
  GenFX.utx                                                                                                   
  NaliCast.utx                                                                                                
  R3pW007Health2.utx                                                                                          
  R3pBolt3.???                                                                                                
  VRikers.uax                                                                                                 
  SlowVacuumZone.u                                                                                            
  Scripted.utx                                                                                                
  R3pSignW007_part.u                                                                                          
  ISVFX.utx                                                                                                   
  genfluid.utx                                                                                                
  R3pUserFonts7.???                                                                                           
  chaossounds2.uax                                                                                            
  Razor-ub.umx                 
without conventional dependencies:

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr -x  
Processing file: Maps/CTF-[R3P]-W007-II-[AMC].unr
Dependencies:
  PK_Tech_Set.utx
  R3pW007Tex.utx
  CSMCXExtras.u
  SkyR3p.utx
  swjumppad.u
  R3pTex.utx
  R3pGlass2.utx
  XC_Siege_r4.u
  W007ExtraHealthy1.???
  R3pW007Health2.utx
  R3pBolt3.???
  SlowVacuumZone.u
  R3pSignW007_part.u
  R3pUserFonts7.???
  chaossounds2.uax
condensed silenced tree:

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr -tcs                                        
Maps/CTF-[R3P]-W007-II-[AMC].unr                                                                              
  - Engine.u: System/Engine.u                                                                                 
      - Core.u: System/Core.u                                                                                 
  - PK_Tech_Set.utx: Textures/PK_Tech_Set.utx                                                                 
  - R3pW007Tex.utx: Textures/R3pW007Tex.utx                                                                   
      - Fire.u: System/Fire.u                                                                                 
  - Botpack.u: System/Botpack.u                                                                               
      - UnrealShare.u: System/UnrealShare.u                                                                   
      - UnrealI.u: System/UnrealI.u                                                                           
      - Female2Voice.uax: Sounds/Female2Voice.uax                                                             
      - Male2Voice.uax: Sounds/Male2Voice.uax                                                                 
      - Female1Voice.uax: Sounds/Female1Voice.uax                                                             
      - BossVoice.uax: Sounds/BossVoice.uax                                                                   
      - Male1Voice.uax: Sounds/Male1Voice.uax                                                                 
      - UMenu.u: System/UMenu.u                                                                               
          - UWindow.u: System/UWindow.u                                                                       
          - UBrowser.u: System/UBrowser.u                                                                     
              - IpDrv.u: System/IpDrv.u                                                                       
      - Announcer.uax: Sounds/Announcer.uax                                                                   
  - CSMCXExtras.u: System/CSMCXExtras.u                                                                       
  - SkyR3p.utx: Textures/SkyR3p.utx                                                                           
  - ArenaTex.utx: Textures/ArenaTex.utx                                                                       
  - swjumppad.u: System/swJumpPad.u                                                                           
  - R3pTex.utx: Textures/R3pTex.utx                                                                           
  - R3pGlass2.utx: Textures/R3pGlass2.utx                                                                     
  - AmbModern.uax: Sounds/AmbModern.uax                                                                       
  - Mine.utx: Textures/Mine.utx                                                                               
      - Detail.utx: Textures/Detail.utx                                                                       
  - SpaceFX.utx: Textures/SpaceFX.utx                                                                         
      - GenFX.utx: Textures/GenFX.utx                                                                         
  - AmbOutside.uax: Sounds/AmbOutside.uax                                                                     
  - UTMenu.utx: System/UTMenu.u                                                                               
      - LadderSounds.uax: Sounds/LadderSounds.uax                                                             
      - UWeb.u: System/UWeb.u                                                                                 
      - UTServerAdmin.u: System/UTServerAdmin.u                                                               
          - IpServer.u: System/IpServer.u                                                                     
      - LadrArrow.utx: Textures/LadrArrow.utx                                                                 
  - XC_Siege_r4.u: System/XC_Siege_r4.u                                                                       
  - XbpFX.utx: Textures/XbpFX.utx                                                                             
      - GenFluid.utx: Textures/GenFluid.utx                                                                   
      - XFX.utx: Textures/XFX.utx                                                                             
          - DecayedS.utx: Textures/DecayedS.utx                                                               
          - Palettes.utx: Textures/Palettes.utx                                                               
  - Liquids.utx: Textures/Liquids.utx                                                                         
  - W007ExtraHealthy1.???: System/W007ExtraHealthy1.u                                                         
      - R3pW007Health.utx: Textures/R3pW007Health.utx                                                         
  - Activates.uax: Sounds/Activates.uax                                                                       
  - AmbAncient.uax: Sounds/AmbAncient.uax                                                                     
  - NaliCast.utx: Textures/NaliCast.utx                                                                       
  - R3pW007Health2.utx: Textures/R3pW007Health2.utx                                                           
  - R3pBolt3.???: System/R3pBolt3.u
  - VRikers.uax: Sounds/VRikers.uax
  - SlowVacuumZone.u: System/SlowVacuumZone.u
  - Scripted.utx: Textures/Scripted.utx
  - R3pSignW007_part.u: System/R3pSignW007_part.u
  - ISVFX.utx: Textures/ISVFX.utx
  - R3pUserFonts7.???: Textures/R3pUserFonts7.utx
  - chaossounds2.uax: Sounds/chaossounds2.uax
  - Razor-ub.umx: Music/Razor-ub.umx         
condensed tree without conventional dependencies:

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr -tcx                                        
Processing file: Maps/CTF-[R3P]-W007-II-[AMC].unr                                                             
Dependency Tree for Maps/CTF-[R3P]-W007-II-[AMC].unr:                                                         
Maps/CTF-[R3P]-W007-II-[AMC].unr (23398676 bytes, MD5: ca7a0df8a3e05ca5ff943391cbfbeac0)                      
  - PK_Tech_Set.utx: Textures/PK_Tech_Set.utx (8514401 bytes, MD5: 43cb36d01b988070f280bcea9df64387)          
  - R3pW007Tex.utx: Textures/R3pW007Tex.utx (12332322 bytes, MD5: d8b7664c79c4972f287bb0ab9f1ae584)           
  - CSMCXExtras.u: System/CSMCXExtras.u (2340402 bytes, MD5: f5e499b01404b71af3db673a9b89a624)                
  - SkyR3p.utx: Textures/SkyR3p.utx (26141949 bytes, MD5: 52d3dce59adc4c66f298188684d3ffa3)                   
  - swjumppad.u: System/swJumpPad.u (23548 bytes, MD5: 5ab21b44a32472fa1182c0d0ff0fb02c)                      
  - R3pTex.utx: Textures/R3pTex.utx (3029300 bytes, MD5: 423a4cd2e19cda845d0a42d34535e67b)                    
  - R3pGlass2.utx: Textures/R3pGlass2.utx (438808 bytes, MD5: 29f61a431ec2214e505081b54c8c1ba3)               
  - XC_Siege_r4.u: System/XC_Siege_r4.u (202805 bytes, MD5: 0ec32233343cd509ea6527606194e561)                 
  - W007ExtraHealthy1.???: System/W007ExtraHealthy1.u (7564 bytes, MD5: ac813d9de8709744410492714ce32b42)     
      - R3pW007Health.utx: Textures/R3pW007Health.utx (357539 bytes, MD5: 0ab31e1528aac5cb9f1b94c4b54a4512)   
  - R3pW007Health2.utx: Textures/R3pW007Health2.utx (179369 bytes, MD5: f4622ef97aef6808f2b9024f3f0c4c7c)     
  - R3pBolt3.???: System/R3pBolt3.u (1769 bytes, MD5: 1cc7ad0f47a2328d7a9548b198e31b5c)                       
  - SlowVacuumZone.u: System/SlowVacuumZone.u (7771 bytes, MD5: 3788710c50284dc54a5a1924e7dff76e)             
  - R3pSignW007_part.u: System/R3pSignW007_part.u (201544 bytes, MD5: f4414f8f37402ee4918a702b80bedc3a)       
  - R3pUserFonts7.???: Textures/R3pUserFonts7.utx (1001454 bytes, MD5: 72f27d51c043d15b6e0e4c57486256b2)      
  - chaossounds2.uax: Sounds/chaossounds2.uax (3183219 bytes, MD5: e5ac598f955c3de7baa7be66f00cdb31) 
only files needed to distribute with heading line (-s will be without):

Code: Select all

~/Games/Unreal> ./utdep.py Maps/CTF-[R3P]-W007-II-[AMC].unr -tfcx                                       
Processing file: Maps/CTF-[R3P]-W007-II-[AMC].unr                                                             
Textures/PK_Tech_Set.utx                                                                                      
Textures/R3pW007Tex.utx                                                                                       
System/CSMCXExtras.u                                                                                          
Textures/SkyR3p.utx                                                                                           
System/swJumpPad.u                                                                                            
Textures/R3pTex.utx                                                                                           
Textures/R3pGlass2.utx                                                                                        
System/XC_Siege_r4.u                                                                                          
System/W007ExtraHealthy1.u                                                                                    
Textures/R3pW007Health.utx                                                                                    
Textures/R3pW007Health2.utx                                                                                   
System/R3pBolt3.u                                                                                             
System/SlowVacuumZone.u                                                                                       
System/R3pSignW007_part.u                                                                                     
Textures/R3pUserFonts7.utx                                                                                    
Sounds/chaossounds2.uax 
Can work with multiple packages or lists at once. You can specify a list of dependencies exceptions.
Detailed description and intricacies may be later... maybe portable exe version... :ripper:   
Auto merged new post submitted 2 minutes later
PS: The map was chosen at random.
You do not have the required permissions to view the files attached to this post.
User avatar
sektor2111
Godlike
Posts: 6489
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Tool to show dependencies?

Post by sektor2111 »

I added "EnhancedShockRifle" aka "SuperShockRifle" - and those useless ammo (if used) and the rest of whatever ammo subclasses.
Perhaps I'll drop there other checks for "PowerUp" types from Unreal - including check for that dummy garbage called QuadShot and more such.
Thanks a lot, dude !
Why do I like this thing ? It's a very fast way to have a clue about content before to even see the map-file.
I would like to know more about Python stuff...