mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 23:01:56 -04:00
scripts: update and remove unneeded ones
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
|
||||
// optional: a predetermined object file name map from a file.
|
||||
// this will make decompilation naming consistent even if you only run on some objects.
|
||||
"obj_file_name_map_file": "goal_src/jakx/build/all_objs.json",
|
||||
// "obj_file_name_map_file": "goal_src/jakx/build/all_objs.json",
|
||||
|
||||
////////////////////////////
|
||||
// LEVEL EXTRACTION
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
jak2_files = None
|
||||
|
||||
import json
|
||||
import hashlib
|
||||
|
||||
def get_md5_from_file(filename):
|
||||
file_bytes = open(filename, "rb").read()
|
||||
# Remove the last 16bytes of the data as it's 16-byte aligned
|
||||
# if this is the only difference in the entire file, it is very likely identical
|
||||
# but this data is potentially garbage
|
||||
length_bytes = bytes([file_bytes[12], file_bytes[13], file_bytes[14], file_bytes[15]])
|
||||
offset_to_truncate = int.from_bytes(length_bytes, "little")
|
||||
bytes_chopped = len(file_bytes) - offset_to_truncate
|
||||
file_bytes = file_bytes[:offset_to_truncate]
|
||||
|
||||
return [hashlib.md5(file_bytes).hexdigest(), bytes_chopped]
|
||||
|
||||
# print(get_md5_from_file("../../decompiler_out/jak2/raw_obj/air-train-ag-CAP.go"))
|
||||
|
||||
with open("../../goal_src/jak2/build/all_objs.json", "r") as f:
|
||||
jak2_files = json.load(f)
|
||||
|
||||
dgos = set()
|
||||
|
||||
for file in jak2_files:
|
||||
for dgo in file[3]:
|
||||
dgos.add(dgo.lower())
|
||||
|
||||
import glob
|
||||
from pathlib import Path
|
||||
|
||||
obj_files = glob.glob("../../decompiler_out/jak2/raw_obj/*")
|
||||
|
||||
print(len(obj_files))
|
||||
|
||||
# Find all the files that have the same name, but a different prefix
|
||||
potentially_identical_files = {}
|
||||
|
||||
print("WARNING: Be aware of the NOTE below, double check the output that the assumption has not changed")
|
||||
|
||||
for file in obj_files:
|
||||
name = Path(file).stem
|
||||
base_name = None
|
||||
duplicate = False
|
||||
for dgo in dgos:
|
||||
if name.lower().endswith("-{}".format(dgo)):
|
||||
# some files have multiple dgos in the name
|
||||
base_name_parts = []
|
||||
for token in name.split("-"):
|
||||
# NOTE - this is still a little fragile
|
||||
# some files begin with a dgo name, for example `oracle-door-ag-ORACLE`
|
||||
# so the easy hack is to skip tokens only if they are DGOs _and_ uppercase
|
||||
if token.isupper() and token.lower() in dgos:
|
||||
continue
|
||||
base_name_parts.append(token)
|
||||
base_name = "-".join(base_name_parts)
|
||||
duplicate = True
|
||||
if duplicate:
|
||||
# Calculate the hash of the file
|
||||
hash = get_md5_from_file(file)
|
||||
if base_name not in potentially_identical_files:
|
||||
potentially_identical_files[base_name] = [{"path": file, "hash": hash[0], "bytes_dropped": hash[1]}]
|
||||
else:
|
||||
potentially_identical_files[base_name].append({"path": file, "hash": hash[0], "bytes_dropped": hash[1]})
|
||||
|
||||
# Log any that actually differ
|
||||
for base_file in potentially_identical_files:
|
||||
common_hash = potentially_identical_files[base_file][0]["hash"]
|
||||
for file in potentially_identical_files[base_file]:
|
||||
if common_hash != file["hash"]:
|
||||
print("{} is different!".format(base_name))
|
||||
break
|
||||
|
||||
with open('./potentially-identical-files.json', 'w') as json_file:
|
||||
json.dump(potentially_identical_files, json_file)
|
||||
@@ -1,583 +0,0 @@
|
||||
# Reduces work and tries to maintain consistency by placing objects in the same folder
|
||||
# as they were in the previous game.
|
||||
jak1_files = None
|
||||
jak2_files = None
|
||||
|
||||
import json
|
||||
|
||||
with open('../../goal_src/jak1/build/all_objs.json', 'r') as f:
|
||||
jak1_files = json.load(f)
|
||||
with open('../../goal_src/jak2/build/all_objs.json', 'r') as f:
|
||||
jak2_files = json.load(f)
|
||||
|
||||
num_replicated = 0
|
||||
num_left = 0
|
||||
|
||||
engine_files = {
|
||||
"profile": "util",
|
||||
"texture-anim": "gfx/texture",
|
||||
"capture": "util",
|
||||
"text-id": "ui",
|
||||
"camera-defs": "camera",
|
||||
"minimap": "ui",
|
||||
"bigmap": "ui",
|
||||
"blit-displays": "gfx",
|
||||
"region": "level",
|
||||
"traffic": "ai",
|
||||
"gui": "ui",
|
||||
"ambient": "ambient",
|
||||
"speech": "sound",
|
||||
"lightning": "gfx",
|
||||
"penetrate": "game",
|
||||
"script": "util",
|
||||
"scene": "scene",
|
||||
"process-focusable": "process-drawable",
|
||||
"focus": "process-drawable",
|
||||
"collide-hash": "spatial-hash",
|
||||
"chain-physics": "physics",
|
||||
"projectile": "game",
|
||||
"find-nearest": "collide",
|
||||
"simple-sprite": "gfx/sprite",
|
||||
"nav-mesh": "nav",
|
||||
"nav-control": "nav",
|
||||
"spatial-hash": "spatial-hash",
|
||||
"actor-hash": "spatial-hash",
|
||||
"joint-mod": "anim",
|
||||
"wind-work": "gfx",
|
||||
"sprite-glow": "gfx/sprite",
|
||||
"history": "debug",
|
||||
"emerc-vu1": "gfx/merc",
|
||||
"emerc": "gfx/merc",
|
||||
"warp": "gfx",
|
||||
"texture-anim-funcs": "gfx/texture",
|
||||
"texture-anim-tables": "gfx/texture",
|
||||
"font-data": "data",
|
||||
"etie-vu1": "gfx/tie",
|
||||
"etie-near-vu1": "gfx/tie",
|
||||
"game-task": "game/task",
|
||||
"mood-tables": "gfx/mood",
|
||||
"mood-tables2": "gfx/mood",
|
||||
"mood-funcs": "gfx/mood",
|
||||
"mood-funcs2": "gfx/mood",
|
||||
"mood": "gfx/mood",
|
||||
"sky-data": "gfx/sky",
|
||||
"load-state": "load",
|
||||
"fma-sphere": "anim",
|
||||
"carry": "game",
|
||||
"pilot": "game",
|
||||
"board": "target/board",
|
||||
"darkjak": "target",
|
||||
"collide-reaction-target": "target",
|
||||
"gun-part": "target/gun",
|
||||
"debug-part": "debug",
|
||||
"task-arrow": "game/task",
|
||||
"target-anim": "target",
|
||||
"target-swim": "target",
|
||||
"target-carry": "target",
|
||||
"target-darkjak": "target",
|
||||
"target-gun": "target",
|
||||
"gun-util": "target/gun",
|
||||
"gun-blue-shot": "target/gun",
|
||||
"gun-yellow-shot": "target/gun",
|
||||
"gun-red-shot": "target/gun",
|
||||
"gun-dark-shot": "target/gun",
|
||||
"gun-states": "target/gun",
|
||||
"board-util": "target/board",
|
||||
"target-board": "target/board",
|
||||
"board-part": "target/board",
|
||||
"board-states": "target/board",
|
||||
"mech": "game",
|
||||
"simple-nav-sphere": "process-drawable",
|
||||
"process-taskable": "process-drawable",
|
||||
"gun": "target/gun",
|
||||
"collide-debug": "collide",
|
||||
"bigmap-data": "ui",
|
||||
"editable": "debug",
|
||||
"editable-player": "debug",
|
||||
"mysql-nav-graph": "debug/nav",
|
||||
"nav-graph-editor": "debug/nav",
|
||||
"sampler": "debug",
|
||||
"weather-part": "gfx/mood",
|
||||
"time-of-day": "gfx/mood",
|
||||
"path": "geometry",
|
||||
"progress": "ui/progress",
|
||||
"sparticle": "gfx/sprite/particles",
|
||||
"sparticle-launcher": "gfx/sprite/particles",
|
||||
"video": "gfx/hw",
|
||||
"target-tube": "target",
|
||||
"texture-upload": "gfx/texture",
|
||||
"texture-finish": "gfx/texture",
|
||||
"vu1-user-h": "gfx",
|
||||
"math-camera": "gfx",
|
||||
"decomp": "load",
|
||||
"texture": "gfx/texture",
|
||||
"shadow-cpu": "gfx/foreground",
|
||||
"shadow-vu1": "gfx/foreground",
|
||||
"bones": "gfx/foreground",
|
||||
"eye": "gfx/foreground",
|
||||
"foreground": "gfx/foreground",
|
||||
"debug-foreground": "gfx/foreground",
|
||||
"ripple": "gfx/foreground",
|
||||
"res": "entity",
|
||||
"pat": "collide",
|
||||
"wind": "gfx/background",
|
||||
"wind-work": "gfx/background",
|
||||
"prototype": "gfx/background",
|
||||
"process-drawable": "process-drawable",
|
||||
"simple-focus": "process-drawable",
|
||||
"bsp": "level",
|
||||
"idle-control": "game",
|
||||
"joint-exploder": "anim",
|
||||
"background": "gfx/background",
|
||||
"subdivide": "gfx/background",
|
||||
"water": "common_objs",
|
||||
"enemy": "ai",
|
||||
"water-flow": "common_objs",
|
||||
"generic-obs": "common_objs",
|
||||
"voicebox": "common_objs",
|
||||
"projectile": "common_objs",
|
||||
"water-anim": "common_objs",
|
||||
"blocking-plane": "common_objs",
|
||||
"dark-eco-pool": "common_objs",
|
||||
"collectables-part": "common_objs",
|
||||
"crates": "common_objs",
|
||||
"collectables": "common_objs",
|
||||
"powerups": "common_objs",
|
||||
"los-control": "collide",
|
||||
"carry": "target/mech_suit",
|
||||
"mech": "target/mech_suit",
|
||||
"nav-enemy": "nav",
|
||||
"base-plat": "common_objs",
|
||||
"plat": "common_objs",
|
||||
"basebutton": "common_objs",
|
||||
"bouncer": "common_objs",
|
||||
"conveyor": "common_objs",
|
||||
"elevator": "common_objs",
|
||||
"rigid-body-plat": "common_objs",
|
||||
"rigid-body": "physics",
|
||||
"rigid-body-queue": "physics",
|
||||
}
|
||||
|
||||
path_overrides = {
|
||||
"hopper-ag": "levels/common/enemy",
|
||||
"oracle": "levels/city/oracle",
|
||||
"hopper": "levels/common/enemy",
|
||||
"bouncer": "levels/common/enemy",
|
||||
"yakow": "levels/city/farm",
|
||||
"yakow-ag": "levels/city/farm",
|
||||
"trail": "levels/city/common",
|
||||
"village1-vis": "levels/jak1/village1"
|
||||
}
|
||||
|
||||
# i can be smarter than this...i swear....refactor eventually!
|
||||
def level_name(file_meta):
|
||||
dgos = file_meta[3]
|
||||
# Handle files unique to one level
|
||||
if dgos == ["HIDEOUT"] or dgos == ["LHIPOUT"] or dgos == ["LTHRNOUT"] or dgos == ["LTRNTESS"] or dgos == ["LTRNKRKD"]:
|
||||
return "levels/hideout"
|
||||
elif dgos == ["ORACLE"]:
|
||||
return "levels/city/oracle"
|
||||
elif dgos == ["DEMO"] or dgos == ["DEMO", "TITLE"]:
|
||||
return "levels/demo"
|
||||
elif dgos == ["ONINTENT"] or dgos == ["LTENTOB"] or dgos == ["LTENTOUT"]:
|
||||
return "levels/city/onin_tent"
|
||||
elif dgos == ["VI1"]:
|
||||
return "levels/jak1/village1"
|
||||
elif dgos == ["INTROCST"] or dgos == ["LINTCSTB"]:
|
||||
return "levels/intro"
|
||||
elif dgos == ["OUTROCST"] or dgos == ["LOUTCSTB"] or dgos == ["LGARCSTA"]:
|
||||
return "levels/outro"
|
||||
elif dgos == ["ART", "GAME"] or dgos == ["ART"] or dgos == ["GAME"]:
|
||||
return "levels/common"
|
||||
elif dgos == ["MTX"] or dgos == ["MTN"] or dgos == ["MTX", "MCN"]:
|
||||
return "levels/temple"
|
||||
elif dgos == ["FOR"] or dgos == ["LWIDEB", "FOR"]:
|
||||
return "levels/forest"
|
||||
elif dgos == ["FOB"] or dgos == ["LPROTECT"]:
|
||||
return "levels/forest/lifeseed"
|
||||
elif dgos == ["HIPHOG"] or dgos == ["LHIPOUT"] or dgos == ["LWHACK"]:
|
||||
return "levels/hiphog"
|
||||
elif dgos == ["GGA"]:
|
||||
return "levels/gungame"
|
||||
elif dgos == ["DMI"]:
|
||||
return "levels/drill_platform"
|
||||
elif dgos == ["DRI"] or dgos == ["DRI", "DRILLMTN"]:
|
||||
return "levels/drill_platform"
|
||||
elif dgos == ["PAC"]:
|
||||
return "levels/palace/cable"
|
||||
elif dgos == ["PAE", "PAC"]:
|
||||
return "levels/palace"
|
||||
elif dgos == ["PALBOSS"]:
|
||||
return "levels/palace/boss"
|
||||
elif dgos == ["THR"] or dgos == ["LASHTHRN"]:
|
||||
return "levels/palace/throne_room"
|
||||
elif dgos == ["PAS"]:
|
||||
return "levels/palace/shaft"
|
||||
elif dgos == ["PAR"]:
|
||||
return "levels/palace/roof"
|
||||
elif dgos == ["PALOUT"]:
|
||||
return "levels/palace/outside"
|
||||
elif dgos == ["PAE"]:
|
||||
return "levels/palace/explore"
|
||||
elif dgos == ["STR"]:
|
||||
return "levels/strip"
|
||||
elif dgos == ["DG1", "D3A"]:
|
||||
return "levels/dig"
|
||||
elif dgos == ["D3A"] or dgos == ["D3B"]:
|
||||
return "levels/dig/lurker_village"
|
||||
elif dgos == ["DG1"]:
|
||||
return "levels/dig/drill_equipment"
|
||||
elif dgos == ["DRILLMTN"]:
|
||||
return "levels/drill_platform/bg_mountain"
|
||||
elif dgos == ["DRB"]:
|
||||
return "levels/drill_platform/tower"
|
||||
elif dgos == ["FEA"] or dgos == ["FEB"]:
|
||||
return "levels/fortress/exit"
|
||||
elif dgos == ["FRA"] or dgos == ["FRB"]:
|
||||
return "levels/fortress/rescue"
|
||||
elif dgos == ["PRI"] or dgos == ["LPRSNCST"]:
|
||||
return "levels/fortress/prison"
|
||||
elif dgos == ["CAS"]:
|
||||
return "levels/landing_pad"
|
||||
elif dgos == ["CAP"] or dgos == ["CASEXT"]:
|
||||
return "levels/castle/pad"
|
||||
elif dgos == ["CAB"]:
|
||||
return "levels/castle/boss"
|
||||
elif dgos == ["FDB"] or dgos == ["FORDUMPC"] or dgos == ["FDA"] or dgos == ["FORDUMPD"] or dgos == ["FORDUMPC", "FDA"]:
|
||||
return "levels/fortress/ammo_dump"
|
||||
elif dgos == ["FDA", "FRB"] or dgos == ["FEB", "FDB"]:
|
||||
return "levels/fortress"
|
||||
elif dgos == ["TOA"] or dgos == ["TOC", "TOA"] or dgos == ["TOC", "TOE", "TOB"]:
|
||||
return "levels/mars_tomb"
|
||||
elif dgos == ["TOB"]:
|
||||
return "levels/mars_tomb/left"
|
||||
elif dgos == ["TOC"]:
|
||||
return "levels/mars_tomb/right"
|
||||
elif dgos == ["TOD"]:
|
||||
return "levels/mars_tomb/entrance"
|
||||
elif dgos == ["TOE"]:
|
||||
return "levels/mars_tomb/left/chase"
|
||||
elif dgos == ["VIN"]:
|
||||
return "levels/power_station"
|
||||
elif dgos == ["LPOWER"]:
|
||||
return "levels/power_station/power_switches"
|
||||
elif dgos == ["ATO"] or dgos == ["ATE"]:
|
||||
return "levels/atoll"
|
||||
elif dgos == ["ATE", "CTYASHA"]:
|
||||
return "levels/atoll/ashelin"
|
||||
elif dgos == ["TBO"] or dgos == ["TOMBEXT"]:
|
||||
return "levels/mars_tomb/baron"
|
||||
elif dgos == ["CTYKORA"]:
|
||||
return "levels/city/slums/kor"
|
||||
elif dgos == ["LKIDDOGE"]:
|
||||
return "levels/city/kid_escort"
|
||||
elif dgos == ["CTYASHA"]:
|
||||
return "levels/city/market/east/ashelin"
|
||||
elif dgos == ["CMA", "CMB"]:
|
||||
return "levels/city/market"
|
||||
elif dgos == ["CMB"]:
|
||||
return "levels/city/market/east"
|
||||
elif dgos == ["CMA"]:
|
||||
return "levels/city/market/west"
|
||||
elif dgos == ["KIOSK"] or dgos == ["LMEETBRT"]:
|
||||
return "levels/city/market/west/brutter_kiosk"
|
||||
elif dgos == ["LPORTRUN"]:
|
||||
return "levels/city/port/mines"
|
||||
elif dgos == ["TITLE"]:
|
||||
return "levels/title"
|
||||
elif dgos == ["LSACK"]:
|
||||
return "level/haven/misc/collection_task"
|
||||
elif dgos == ["LPACKAGE"]:
|
||||
return "level/haven/misc/delivery"
|
||||
elif dgos == ["GARAGE"]:
|
||||
return "levels/city/stadium/garage"
|
||||
elif dgos == ["LRACELIT"]:
|
||||
return "levels/stadium/races"
|
||||
elif dgos == ["STADBLMP"]:
|
||||
return "levels/city/stadium/defend"
|
||||
elif dgos == ["SKA"]:
|
||||
return "levels/stadium/jetboard"
|
||||
elif dgos == ["LWIDESTA"] or dgos == ["STA"] or dgos == ["STD", "STC", "STB"] or dgos == ["STD", "STC"]:
|
||||
return "levels/stadium"
|
||||
elif dgos == ["STB"] or dgos == ["LRACEBF"]:
|
||||
return "levels/stadium/races/class3"
|
||||
elif dgos == ["STC"] or dgos == ["LRACECF"]:
|
||||
return "levels/stadium/races/class2"
|
||||
elif dgos == ["STD"] or dgos == ["LRACEDF"]:
|
||||
return "levels/stadium/races/class1"
|
||||
elif dgos == ["MCN"]:
|
||||
return "levels/temple/canyon"
|
||||
elif dgos == ["COA"] or dgos == ["COB"]:
|
||||
return "levels/consite"
|
||||
elif dgos == ["RUI"]:
|
||||
return "levels/ruins"
|
||||
elif dgos == ["SAG"]:
|
||||
return "levels/ruins/hut"
|
||||
elif dgos == ["SEW"] or dgos == ["SEB", "SWB"] or dgos == ["SEB"] or dgos == ["SWE", "SEW"] :
|
||||
return "levels/sewer"
|
||||
elif dgos == ["NES"] or dgos == ["NESTT", "NES"] or dgos == ["NESTT"]:
|
||||
return "levels/nest"
|
||||
elif dgos == ["NEB"]:
|
||||
return "levels/nest/boss"
|
||||
elif dgos == ["SWE"] or dgos == ["SWB"] or dgos == ["SEB", "SWB", "UNB"]: # interesting this is in underport too... who is 'ruf' and 'hal'?
|
||||
return "levels/sewer/escort"
|
||||
elif dgos == ["HALFPIPE"]:
|
||||
return "levels/test/halfpipe"
|
||||
elif dgos == ["CWI"] or dgos == ["PAC", "CWI"] or dgos == ["LWIDEA"] or dgos == ["LWIDEB"] or dgos == ["LWIDEB", "LWIDEA"] or dgos == ["LWIDEC"] or dgos == ["LWIDEC", "LWIDEA"] or dgos == ["LWIDEB", "LWIDEC", "LWIDEA"]:
|
||||
return "levels/city/common"
|
||||
elif dgos == ["LBBUSH"]:
|
||||
return "levels/city/side_missions"
|
||||
elif dgos == ["CTA"] or dgos == ["CTB"] or dgos == ["CTC"]:
|
||||
return "levels/city/slums"
|
||||
elif dgos == ["CPA"]:
|
||||
return "levels/city/palace"
|
||||
elif dgos == ["CIA"] or dgos == ["CIB"]:
|
||||
return "levels/city/industrial"
|
||||
elif dgos == ["CPO"] or dgos == ["PORTWALL"]:
|
||||
return "levels/city/port"
|
||||
elif dgos == ["LPRTRACE"]:
|
||||
return "levels/city/port/race/side_mission"
|
||||
elif dgos == ["LERLCHAL"]:
|
||||
return "levels/city/port/race/errol"
|
||||
elif dgos == ["LERLCHAL", "LPRTRACE"]:
|
||||
return "levels/city/port/race"
|
||||
elif dgos == ["CFB"] or dgos == ["CFA"] or dgos == ["CFB", "CFA"]:
|
||||
return "levels/city/farm"
|
||||
elif dgos == ["LBOMBBOT"]:
|
||||
return "levels/common/enemy/bombots"
|
||||
elif dgos == ["LTESS"] or dgos == ["LERLTESS", "LTESS"]:
|
||||
return "characters/tess"
|
||||
elif dgos == ["ATE", "UNB"]:
|
||||
return "characters/sig"
|
||||
elif dgos == ["LGUARD"] or dgos == ["LWIDEB", "DG1", "FRA", "FOB", "LWIDEC", "CAS", "PAE", "FEA", "FDB", "LWIDEA"] or dgos == ["LCGUARD"]:
|
||||
return "characters/guards"
|
||||
elif dgos == ["FRA", "FOB", "DRILLMTN"]:
|
||||
return "characters/hover_guards"
|
||||
elif dgos == ["FOR", "DMI", "FRA", "STR", "NEB", "D3A", "UNB"]:
|
||||
return "levels/common/enemy/hover"
|
||||
elif dgos == ["FOR", "DG1", "FRA", "CAS", "PAE", "FEA", "FDB"]:
|
||||
return "levels/common/enemy/guards"
|
||||
elif dgos == ["FOR", "ATE"]:
|
||||
return "levels/common/enemy"
|
||||
elif dgos == ["STD", "STC", "LERLCHAL", "STB", "LPRTRACE"] or dgos == ["LRACEDF"] or dgos == ["LRACECF"] or dgos == ["LRACECB"] or dgos == ["LRACEBB"] or dgos == ["LRACEDB"] or dgos == ["LRACEBF"]:
|
||||
return "levels/common/races"
|
||||
elif dgos == ["LTHRNOUT", "NEB"] or dgos == ["PAS", "TOD"] or dgos == ["FRB", "TOA"] or dgos == ["FRB", "FDB"] or dgos == ["LWIDEC", "CAS"] or dgos == ["TBO", "FRB"] or dgos == ["NESTT", "NES", "LPROTECT"] or dgos == ["SEB", "SWB", "PAE", "PAC"] or dgos == ["ATO", "NESTT", "NES", "LPROTECT"] or dgos == ["ATE", "CTYKORA"] or dgos == ["PAC", "LCITYLOW", "CASCITY"] or dgos == ["FRA", "FRB"] or dgos == ["DRI", "DRB"] or dgos == ["D3B", "RUI"] or dgos == ["PAC", "HALFPIPE"] or dgos == ["CASEXT", "LWIDEC", "LWIDEA"] or dgos == ["LOUTCSTB", "LHIPOUT"] or dgos == ["CTC", "MTN", "CAS", "COA", "CFA", "CPA"] or dgos == ["LOUTCSTB", "VI1"] or dgos == ["CIB", "CAP"] or dgos == ["LKEIRIFT", "LINTCSTB"] or dgos == ["FDA", "FEA", "TOB"] or dgos == ["CTB", "SEB", "SWB", "CFA", "PAS", "CPA"]:
|
||||
return "levels/common/entities"
|
||||
elif dgos == ["LKEIRIFT"]:
|
||||
return "characters/keira_riftrider"
|
||||
elif dgos == ["LERLTESS"]:
|
||||
return "characters/errol_tess"
|
||||
elif dgos == ["LERROL"]:
|
||||
return "characters/errol"
|
||||
elif dgos == ["LWIDESTA", "ATE", "VIN"]:
|
||||
return "levels/common/particls"
|
||||
elif dgos == ["LSHUTTLE"]:
|
||||
return "characters/underground_fighters"
|
||||
elif dgos == ["ATO", "SEB", "SWB", "RUI"]:
|
||||
return "levels/common/enemy/fodder"
|
||||
elif dgos == ["LHELLDOG"]:
|
||||
return "levels/common/enemy/hellcat"
|
||||
elif dgos == ["LJAKDAX"]:
|
||||
return "characters/jak_daxter"
|
||||
elif dgos == ["ATE", "SEB", "SWB", "RUI"] or dgos == ["ATE", "SEW", "RUI"]:
|
||||
return "levels/common/enemy/amphibian"
|
||||
elif dgos == ["LWIDEB", "STR", "DRILLMTN", "STADBLMP", "HALFPIPE", "SEW", "UNB", "RUI", "CTYASHA"]:
|
||||
return "levels/common/enemy/metalhead_grunt"
|
||||
elif dgos == ["LWIDEB", "STR", "NEB", "D3A", "STADBLMP", "RUI"]:
|
||||
return "levels/common/enemy/metalhead_scout"
|
||||
elif dgos == ["NEB", "DRILLMTN"]:
|
||||
return "levels/common/enemy/metalhead_wasp"
|
||||
elif dgos == ["DMI", "MTN"] or dgos == ["DRI", "MTX"]:
|
||||
return "levels/common/enemy/metalhead_bearer"
|
||||
elif dgos == ["DG1", "D3A", "UNB", "RUI"] or dgos == ["D3A", "RUI"]:
|
||||
return "levels/common/enemy/metalhead_slinger"
|
||||
elif dgos == ["DG1", "MTN", "ATE", "D3A"] or dgos == ["ATE", "MTX", "D3A"]:
|
||||
return "levels/common/enemy/metalhead_brown"
|
||||
elif dgos == ["LSAMERGD"]:
|
||||
return "characters/samos_errol_guard"
|
||||
elif dgos == ["DG1", "D3A", "TOA"]:
|
||||
return "levels/common/enemy/baby_spider"
|
||||
elif dgos == ["LERBRNGD"]:
|
||||
return "characters/errol_baron_guard"
|
||||
elif dgos == ["LSMYSBRT"]:
|
||||
return "characters/samos_youngsamos_brutter"
|
||||
elif dgos == ["LBRNERMK"]:
|
||||
return "characters/baron_errol_metalkor"
|
||||
elif dgos == ["LDJAKBRN"]:
|
||||
return "characters/jak/intro_clothes"
|
||||
elif dgos == ["NEB", "CTYKORA"]:
|
||||
return "characters/kid"
|
||||
elif dgos == ["LYSKDCD"]:
|
||||
return "characters/youngsamos_kid_dog"
|
||||
elif dgos == ["LYSAMSAM"]:
|
||||
return "characters/youngsamos_and_samos"
|
||||
elif dgos == ["LTRNYSAM"]:
|
||||
return "characters/torn_youngsamos"
|
||||
elif dgos == ["LJKDXASH"]:
|
||||
return "characters/jak_daxter_ashelin"
|
||||
elif dgos == ["LWIDESTA", "LERLTESS", "LBRNERMK", "INTROCST", "LERROL", "LSAMERGD"]:
|
||||
return "characters/high-res/errol"
|
||||
elif dgos == ["NEB", "COB"]:
|
||||
return "characters/high-res/metalkor"
|
||||
elif dgos == ["ATE", "LHIPOUT", "LTESS", "UND", "LGUARD"]:
|
||||
return "characters/high-res/sig"
|
||||
elif dgos == ["LTHRNOUT", "LTRNYSAM", "LTRNTESS", "SAG", "LTRNKRKD"]:
|
||||
return "characters/high-res/torn"
|
||||
elif dgos == ["ORACLE", "NEB", "VI1"]:
|
||||
return "characters/high-res/darkjak"
|
||||
elif dgos == ["LERLTESS", "LGARCSTA", "CAB", "LTESS", "LGUARD"]:
|
||||
return "characters/high-res/krew"
|
||||
elif dgos == ["LERLTESS", "LGARCSTA", "LPRSNCST", "LTRNTESS", "OUTROCST", "LWHACK", "LTESS"]:
|
||||
return "characters/high-res/tess"
|
||||
elif dgos == ["KIOSK", "LOUTCSTB", "STADBLMP", "LSMYSBRT"]:
|
||||
return "characters/high-res/brutter"
|
||||
elif dgos == ["OUTROCST", "ONINTENT"]:
|
||||
return "characters/high-res/onin"
|
||||
elif dgos == ["LERBRNGD", "LSAMERGD"]:
|
||||
return "characters/low-res/guard"
|
||||
elif dgos == ["LGARCSTA", "LPRSNCST", "OUTROCST", "LERBRNGD", "STADBLMP", "LSAMERGD", "LINTCSTB", "LSMYSBRT", "LYSAMSAM"]:
|
||||
return "characters/high-res/samos"
|
||||
elif dgos == ["LTRNYSAM", "LOUTCSTB", "LPRSNCST", "FOB", "STADBLMP", "LYSKDCD", "TOD", "LTENTOUT", "LSMYSBRT", "LYSAMSAM"]:
|
||||
return "characters/high-res/youngsamos"
|
||||
elif dgos == ["LOUTCSTB", "NEB", "LTRNKRKD", "LYSKDCD", "TOD", "VIN", "CTYKORA"]:
|
||||
return "characters/high-res/kid"
|
||||
elif dgos == ["LHIPOUT", "LYSKDCD", "TOD", "VIN"]:
|
||||
return "characters/high-res/crocadog"
|
||||
elif dgos == ["LHIPOUT", "ONINTENT"]:
|
||||
return "characters/high-res/pecker"
|
||||
elif dgos == ["LTENTOB", "LTRNKRKD", "TOD", "VIN", "CTYKORA"]:
|
||||
return "characters/high-res/kor"
|
||||
elif dgos == ["OUTROCST", "LKEIRIFT", "LINTCSTB", "GARAGE"]:
|
||||
return "characters/high-res/keira"
|
||||
elif dgos == ["LWIDESTA", "LBRNERMK", "LERBRNGD", "COA", "TOMBEXT", "PALBOSS", "LDJAKBRN"]:
|
||||
return "characters/high-res/baron"
|
||||
elif dgos == ["LWIDESTA", "LERBRNGD", "COA", "LCGUARD", "FORDUMPD", "LSAMERGD", "LASHGRD", "LGUARD", "CTYKORA", "CTYASHA"]:
|
||||
return "characters/high-res/guard"
|
||||
elif dgos == ["CASEXT", "HIDEOUT", "KIOSK", "ORACLE", "INTROCST", "ATE", "FOB", "LJAKDAX", "FORDUMPC", "LTRNTESS", "THR", "PRI", "SAG", "NEB", "DEMO", "MTX", "LJKDXASH", "COA", "TOMBEXT", "PALBOSS", "TITLE", "ONINTENT", "STA", "TOA", "UND", "LYSKDCD", "D3B", "SWE", "GGA", "TOD", "MCN", "SEW", "VIN", "CAP", "CTYKORA", "CTYASHA", "HIPHOG", "VI1"]:
|
||||
return "characters/high-res/daxter"
|
||||
elif dgos == ["CASEXT", "HIDEOUT", "KIOSK", "ATE", "LPRSNCST", "FOB", "LJAKDAX", "FORDUMPC", "LTRNTESS", "THR", "SAG", "MTX", "LJKDXASH", "COA", "PALBOSS", "ONINTENT", "STA", "TOA", "UND", "LYSKDCD", "D3B", "SWE", "GGA", "TOD", "MCN", "SEW", "VIN", "CAP", "CTYKORA", "CTYASHA", "HIPHOG"]:
|
||||
return "characters/high-res/jak"
|
||||
elif dgos == ["CASEXT", "LTHRNOUT", "LGARCSTA", "ATE", "LASHTHRN", "LJKDXASH", "LASHGRD", "CTYASHA"]:
|
||||
return "characters/high-res/ashelin"
|
||||
elif dgos == ["UND"] or dgos == ["UNB"]:
|
||||
return "levels/underport"
|
||||
elif dgos == ["CGB"] or dgos == ["CGA"] or dgos == ["CGC"]:
|
||||
return "levels/city/generic"
|
||||
elif dgos == ["LCITYLOW"] or dgos == ["CASCITY"]:
|
||||
return "levels/city/low-quality"
|
||||
elif dgos == ["GAME", "COMMON"]:
|
||||
return "levels/common"
|
||||
elif dgos == ["ATE", "SEB", "SWB", "LKIDDOGE", "UNB", "CTYKORA", "CTYASHA"]:
|
||||
return "levels/common/ai"
|
||||
elif dgos == ["LASHGRD"]:
|
||||
return "characters/ashelin_guard"
|
||||
elif dgos == ["SEB", "SWB", "LKIDDOGE", "UNB", "CTYKORA"]: # TODO - wtf is 'hal'
|
||||
return "levels/undefined"
|
||||
elif dgos == ["DRILLMTN", "UNB", "RUI"] or dgos == ["UNB", "RUI"] or dgos == ["DMI", "RUI"]:
|
||||
return "levels/target/mech_suit"
|
||||
|
||||
remaining_dgos = {}
|
||||
|
||||
folders = {}
|
||||
|
||||
for jak2_file in jak2_files:
|
||||
if jak2_file[3] == ["NO-XGO"]:
|
||||
num_replicated = num_replicated + 1
|
||||
continue
|
||||
# manual overrides
|
||||
if jak2_file[0] in path_overrides or jak2_file[0].removesuffix("-h") in path_overrides:
|
||||
num_replicated = num_replicated + 1
|
||||
if jak2_file[0] in path_overrides:
|
||||
jak2_file[4] = path_overrides[jak2_file[0]]
|
||||
else:
|
||||
jak2_file[4] = path_overrides[jak2_file[0].removesuffix("-h")]
|
||||
if jak2_file[4] not in folders:
|
||||
folders[jak2_file[4]] = 1
|
||||
else:
|
||||
folders[jak2_file[4]] = folders[jak2_file[4]] + 1
|
||||
continue
|
||||
# port over manually specified engine files
|
||||
if jak2_file[0] in engine_files or jak2_file[0].removesuffix("-h") in engine_files:
|
||||
num_replicated = num_replicated + 1
|
||||
if jak2_file[0] in engine_files:
|
||||
jak2_file[4] = str.format("engine/{}", engine_files[jak2_file[0]])
|
||||
else:
|
||||
jak2_file[4] = str.format("engine/{}", engine_files[jak2_file[0].removesuffix("-h")])
|
||||
if jak2_file[4] not in folders:
|
||||
folders[jak2_file[4]] = 1
|
||||
else:
|
||||
folders[jak2_file[4]] = folders[jak2_file[4]] + 1
|
||||
continue
|
||||
# attempt to find the object with the same name in jak1
|
||||
jak1_path = None
|
||||
if not jak2_file[0].startswith("tpage"):
|
||||
for jak1_file in jak1_files:
|
||||
if jak1_file[0] == jak2_file[0]:
|
||||
jak1_path = jak1_file[4]
|
||||
if (jak1_path.startswith("levels")):
|
||||
print("{} - {}".format(jak1_path, jak2_file[0]))
|
||||
break
|
||||
if jak1_path is not None:
|
||||
jak2_file[4] = jak1_path
|
||||
num_replicated = num_replicated + 1
|
||||
elif level_name(jak2_file):
|
||||
jak2_file[4] = level_name(jak2_file)
|
||||
num_replicated = num_replicated + 1
|
||||
else:
|
||||
num_left = num_left + 1
|
||||
if ",".join(jak2_file[3]) in remaining_dgos:
|
||||
remaining_dgos[",".join(jak2_file[3])] = remaining_dgos[",".join(jak2_file[3])] + 1
|
||||
else:
|
||||
remaining_dgos[",".join(jak2_file[3])] = 1
|
||||
if jak2_file[4] not in folders:
|
||||
folders[jak2_file[4]] = 1
|
||||
else:
|
||||
folders[jak2_file[4]] = folders[jak2_file[4]] + 1
|
||||
|
||||
with open('../../goal_src/jak2/build/all_objs.json', 'w') as json_file:
|
||||
# Calculate these to make the file as compact as possible
|
||||
longest_name = 0
|
||||
longest_name_in_dgo = 0
|
||||
for jak2_file in jak2_files:
|
||||
if len(jak2_file[0]) > longest_name:
|
||||
longest_name = len(jak2_file[0])
|
||||
if len(jak2_file[1]) > longest_name_in_dgo:
|
||||
longest_name_in_dgo = len(jak2_file[1])
|
||||
# Actually write things out
|
||||
json_file.write("[\n")
|
||||
i = 0
|
||||
for jak2_file in jak2_files:
|
||||
name = '{: <{}}'.format("\"{}\",".format(jak2_file[0]), longest_name + 2)
|
||||
name_in_dgo = '{: <{}}'.format("\"{}\",".format(jak2_file[1]), longest_name_in_dgo + 2)
|
||||
dgo_set = "["
|
||||
for dgo in jak2_file[3]:
|
||||
dgo_set += "\"{}\", ".format(dgo)
|
||||
dgo_set = dgo_set.removesuffix(", ")
|
||||
dgo_set += "]"
|
||||
if i == (len(jak2_files) - 1):
|
||||
json_file.write("[{}{}{}, {}, \"{}\"]\n".format(name, name_in_dgo, jak2_file[2], dgo_set, jak2_file[4]))
|
||||
else:
|
||||
json_file.write("[{}{}{}, {}, \"{}\"],\n".format(name, name_in_dgo, jak2_file[2], dgo_set, jak2_file[4]))
|
||||
i = i + 1
|
||||
json_file.write("]\n")
|
||||
|
||||
print("Mapped: {} and Left: {}".format(num_replicated, num_left))
|
||||
|
||||
limit = 0
|
||||
for dgo_set in dict(sorted(remaining_dgos.items(), reverse=True, key=lambda item: item[1])):
|
||||
dgo_set_nice = ""
|
||||
for dgo in dgo_set.split(","):
|
||||
dgo_set_nice += "\"{}\", ".format(dgo)
|
||||
dgo_set_nice = dgo_set_nice.removesuffix(", ")
|
||||
print("or dgos == [{}]: {}".format(dgo_set_nice, remaining_dgos[dgo_set]))
|
||||
if limit > 100:
|
||||
break
|
||||
limit = limit + 1
|
||||
print(len(remaining_dgos))
|
||||
|
||||
print("Folder | Number of Files")
|
||||
for folder in dict(sorted(folders.items(), reverse=True, key=lambda item: item[1])):
|
||||
print("{}: {}".format(folder, folders[folder]))
|
||||
if limit > 100:
|
||||
break
|
||||
limit = limit + 1
|
||||
@@ -1,693 +0,0 @@
|
||||
# Reduces work and tries to maintain consistency by placing objects in the same folder
|
||||
# as they were in the previous game.
|
||||
jak2_files = None
|
||||
jak3_files = None
|
||||
|
||||
import json
|
||||
|
||||
with open('../../../goal_src/jak2/build/all_objs.json', 'r') as f:
|
||||
jak2_files = json.load(f)
|
||||
with open('../../../goal_src/jak3/build/all_objs.json', 'r') as f:
|
||||
jak3_files = json.load(f)
|
||||
|
||||
num_replicated = 0
|
||||
num_left = 0
|
||||
|
||||
engine_files = {
|
||||
"profile": "util",
|
||||
"texture-anim": "gfx/texture",
|
||||
"capture": "util",
|
||||
"text-id": "ui",
|
||||
"camera-defs": "camera",
|
||||
"minimap": "ui",
|
||||
"bigmap": "ui",
|
||||
"blit-displays": "gfx",
|
||||
"region": "level",
|
||||
"traffic": "ai",
|
||||
"gui": "ui",
|
||||
"ambient": "ambient",
|
||||
"speech": "sound",
|
||||
"lightning": "gfx/generic/lightning",
|
||||
"penetrate": "game",
|
||||
"script": "util",
|
||||
"scene": "scene",
|
||||
"process-focusable": "process-drawable",
|
||||
"focus": "process-drawable",
|
||||
"collide-hash": "spatial-hash",
|
||||
"chain-physics": "physics",
|
||||
"projectile": "game",
|
||||
"find-nearest": "collide",
|
||||
"simple-sprite": "gfx/sprite",
|
||||
"nav-mesh": "nav",
|
||||
"nav-control": "nav",
|
||||
"spatial-hash": "spatial-hash",
|
||||
"actor-hash": "spatial-hash",
|
||||
"joint-mod": "anim",
|
||||
"wind-work": "gfx",
|
||||
"sprite-glow": "gfx/sprite",
|
||||
"history": "debug",
|
||||
"emerc-vu1": "gfx/foreground/merc",
|
||||
"emerc": "gfx/foreground/merc",
|
||||
"warp": "gfx",
|
||||
"texture-anim-funcs": "gfx/texture",
|
||||
"texture-anim-tables": "gfx/texture",
|
||||
"font-data": "data",
|
||||
"etie-vu1": "gfx/tie",
|
||||
"etie-near-vu1": "gfx/tie",
|
||||
"game-task": "game/task",
|
||||
"mood-tables": "gfx/mood",
|
||||
"mood-tables2": "gfx/mood",
|
||||
"mood-funcs": "gfx/mood",
|
||||
"mood-funcs2": "gfx/mood",
|
||||
"mood": "gfx/mood",
|
||||
"sky-data": "gfx/sky",
|
||||
"load-state": "load",
|
||||
"fma-sphere": "anim",
|
||||
"carry": "game",
|
||||
"pilot": "game",
|
||||
"board": "target/board",
|
||||
"darkjak": "target",
|
||||
"collide-reaction-target": "target",
|
||||
"gun-part": "target/gun",
|
||||
"debug-part": "debug",
|
||||
"task-arrow": "game/task",
|
||||
"target-anim": "target",
|
||||
"target-swim": "target",
|
||||
"target-carry": "target",
|
||||
"target-darkjak": "target",
|
||||
"target-gun": "target",
|
||||
"target-pilot": "target",
|
||||
"pilot-states": "target",
|
||||
"gun-util": "target/gun",
|
||||
"gun-blue-shot": "target/gun",
|
||||
"gun-yellow-shot": "target/gun",
|
||||
"gun-red-shot": "target/gun",
|
||||
"gun-dark-shot": "target/gun",
|
||||
"gun-states": "target/gun",
|
||||
"board-util": "target/board",
|
||||
"target-board": "target/board",
|
||||
"board-part": "target/board",
|
||||
"board-states": "target/board",
|
||||
"mech": "game",
|
||||
"simple-nav-sphere": "process-drawable",
|
||||
"process-taskable": "process-drawable",
|
||||
"gun": "target/gun",
|
||||
"collide-debug": "collide",
|
||||
"bigmap-data": "ui",
|
||||
"editable": "debug",
|
||||
"editable-player": "debug",
|
||||
"mysql-nav-graph": "debug/nav",
|
||||
"nav-graph-editor": "debug/nav",
|
||||
"sampler": "debug",
|
||||
"weather-part": "gfx/mood",
|
||||
"time-of-day": "gfx/mood",
|
||||
"path": "geometry",
|
||||
"progress": "ui/progress",
|
||||
"sparticle": "gfx/sprite/particles",
|
||||
"sparticle-launcher": "gfx/sprite/particles",
|
||||
"video": "gfx/hw",
|
||||
"target-tube": "target",
|
||||
"texture-upload": "gfx/texture",
|
||||
"texture-finish": "gfx/texture",
|
||||
"vu1-user-h": "gfx",
|
||||
"math-camera": "gfx",
|
||||
"decomp": "load",
|
||||
"texture": "gfx/texture",
|
||||
"shadow-cpu": "gfx/foreground",
|
||||
"shadow-vu1": "gfx/foreground",
|
||||
"bones": "gfx/foreground",
|
||||
"eye": "gfx/foreground",
|
||||
"foreground": "gfx/foreground",
|
||||
"debug-foreground": "gfx/foreground",
|
||||
"ripple": "gfx/foreground",
|
||||
"res": "entity",
|
||||
"pat": "collide",
|
||||
"wind": "gfx/background",
|
||||
"wind-work": "gfx/background",
|
||||
"prototype": "gfx/background",
|
||||
"process-drawable": "process-drawable",
|
||||
"simple-focus": "process-drawable",
|
||||
"bsp": "level",
|
||||
"idle-control": "game",
|
||||
"joint-exploder": "anim",
|
||||
"background": "gfx/background",
|
||||
"subdivide": "gfx/background",
|
||||
"water": "common-obs",
|
||||
"enemy": "ai",
|
||||
"water-flow": "common-obs",
|
||||
"generic-obs": "common-obs",
|
||||
"voicebox": "common-obs",
|
||||
"projectile": "common-obs",
|
||||
"water-anim": "common-obs",
|
||||
"blocking-plane": "common-obs",
|
||||
"dark-eco-pool": "common-obs",
|
||||
"collectables-part": "common-obs",
|
||||
"crates": "common-obs",
|
||||
"collectables": "common-obs",
|
||||
"powerups": "common-obs",
|
||||
"los-control": "collide",
|
||||
"carry": "target/mech",
|
||||
"mech": "target/mech",
|
||||
"nav-enemy": "nav",
|
||||
"base-plat": "common-obs",
|
||||
"plat": "common-obs",
|
||||
"basebutton": "common-obs",
|
||||
"bouncer": "common-obs",
|
||||
"conveyor": "common-obs",
|
||||
"elevator": "common-obs",
|
||||
"rigid-body-plat": "common-obs",
|
||||
"rigid-body": "physics",
|
||||
"rigid-body-queue": "physics",
|
||||
|
||||
"lightjak": "target",
|
||||
"lightjak-wings": "target",
|
||||
"target-lightjak": "target",
|
||||
"target-ladder": "target",
|
||||
"target-launch": "target",
|
||||
"target-invisible": "target",
|
||||
"target-flut": "target/flut",
|
||||
"indax-h": "target/indax",
|
||||
"target-indax": "target/indax",
|
||||
"target-indax-hang": "target/indax",
|
||||
"ragdoll": "physics",
|
||||
"cloth": "physics",
|
||||
"nav-engine": "nav",
|
||||
"light-trails": "gfx/sprite/particles",
|
||||
"lightning-new": "gfx/generic/lightning",
|
||||
|
||||
"hfrag": "gfx/background/hfrag",
|
||||
"hfrag-h": "gfx/background/hfrag",
|
||||
"hfrag-vu1": "gfx/background/hfrag",
|
||||
"hfrag-vu1-h": "gfx/background/hfrag",
|
||||
"hfrag-common": "gfx/background/hfrag",
|
||||
"hfrag-work": "gfx/background/hfrag",
|
||||
"hfrag-texture-anim": "gfx/background/hfrag",
|
||||
|
||||
"bug-report": "debug",
|
||||
"visvol-edit": "debug",
|
||||
"collision-editor": "debug",
|
||||
"nav-mesh-editor-h": "debug",
|
||||
"nav-mesh-editor": "debug",
|
||||
|
||||
"matrix-compose": "common-obs",
|
||||
"cloth-art-h": "common-obs",
|
||||
"prim-h": "common-obs",
|
||||
"water-info-h": "common-obs",
|
||||
"prim": "common-obs",
|
||||
"curves": "common-obs",
|
||||
"prim-beam-h": "common-obs",
|
||||
"particle-curves": "common-obs",
|
||||
"water-part": "common-obs",
|
||||
"gem-pool": "common-obs",
|
||||
"vent": "common-obs",
|
||||
"secrets-menu": "common-obs",
|
||||
"speech-manager": "common-obs",
|
||||
"dir-tpages": "common-obs",
|
||||
"airlock": "common-obs",
|
||||
"proc-focusable-spawner": "common-obs",
|
||||
"enemy-states": "common-obs",
|
||||
"scene-actor": "common-obs",
|
||||
"warp-gate": "common-obs",
|
||||
"guard-projectile": "common-obs",
|
||||
"metalhead-projectile": "common-obs",
|
||||
"enemy-part": "common-obs",
|
||||
"ragdoll-test": "common-obs",
|
||||
"debris": "common-obs",
|
||||
"shield-sphere": "common-obs"
|
||||
}
|
||||
|
||||
path_overrides = {
|
||||
"trail": "levels/city/common",
|
||||
"tomb-baby-spider": "levels/temple",
|
||||
"tomb-baby-spider-ag": "levels/temple",
|
||||
"mhcity-obs": "levels/mhcity",
|
||||
"mhcity-obs2": "levels/mhcity",
|
||||
"mhcity-part": "levels/mhcity",
|
||||
"race-control": "levels/common/race",
|
||||
"rhino-ag": "levels/desert/wvehicle",
|
||||
"mantis": "levels/common/enemy",
|
||||
"mantis-ag": "levels/common/enemy",
|
||||
"roboguard": "levels/common/enemy",
|
||||
"roboguard-ag": "levels/common/enemy",
|
||||
"ladder": "levels/common-obs",
|
||||
"ladder-ag": "levels/common-obs",
|
||||
"desert-dust-storm": "levels/desert",
|
||||
"des-bush": "levels/desert",
|
||||
"des-bush-part": "levels/desert",
|
||||
"des-burning-bush": "levels/desert",
|
||||
"jump-pad": "levels/sewer",
|
||||
"robo-hover": "levels/common/enemy/hover",
|
||||
"kg-grunt": "levels/common/enemy",
|
||||
"spydroid-orig": "levels/common/enemy",
|
||||
"cty-borrow-manager-h": "levels/city/common",
|
||||
"cty-faction-h": "levels/city/common",
|
||||
"tentacle": "levels/desert",
|
||||
"tentacle-ag": "levels/desert",
|
||||
"external-player-control": "levels/common",
|
||||
"forestb-vis": "levels/forest",
|
||||
"transport-ag": "levels/forest",
|
||||
"cty-homing-missile-ag": "levels/city/hijack",
|
||||
"predator": "levels/city/destroy-grid",
|
||||
"predator-ag": "levels/city/destroy-grid",
|
||||
"neo-wasp": "levels/common/enemy/darkprec",
|
||||
"neo-wasp-part": "levels/common/enemy/darkprec",
|
||||
"neo-wasp-ag": "levels/common/enemy/darkprec",
|
||||
"neo-wasp-b-ag": "levels/common/enemy/darkprec",
|
||||
"pecker-ingame": "levels/comb/pecker",
|
||||
"pecker-ingame-ag": "levels/comb/pecker",
|
||||
"battle-amulet-ag": "levels/wascity",
|
||||
"prebot-eco-creature": "levels/common/enemy",
|
||||
"bombbot-bomb-ag": "levels/city/bombbot",
|
||||
"jakc-highres-ag": "levels/borrow/jak",
|
||||
"king-highres-ag": "levels/borrow/damas",
|
||||
"daxter-highres-ag": "levels/borrow/daxter",
|
||||
"vin-effect-ag": "levels/borrow/jak-daxter-vin",
|
||||
"spotlight-ag": "levels/comb",
|
||||
"sew-fan-ag": "levels/sewer",
|
||||
"sew-jump-pad-ag": "levels/sewer",
|
||||
"sew-floor-switch-ag": "levels/sewer",
|
||||
"monk-ag": "levels/wascity/leaper",
|
||||
"errol-lowres-ag": "levels/factory",
|
||||
"eco-crystal-light-ag": "levels/common",
|
||||
"lfac-hanger-door-ag": "levels/factory",
|
||||
"errol-effect-ag": "levels/desert/hover",
|
||||
"jak-pilot-wcar+0-ag": "engine/target",
|
||||
"monster-frog": "levels/mine",
|
||||
"monster-frog-ag": "levels/mine",
|
||||
"stadiumb-vis": "levels/stadium",
|
||||
"conveyor": "levels/factory",
|
||||
"flut": "engine/target/flut",
|
||||
"flut-part": "engine/target/flut",
|
||||
"flut-racer": "engine/target/flut",
|
||||
"jak-flut+0-ag": "engine/target/flut",
|
||||
"jak-tube+0-ag": "engine/target",
|
||||
"jak-pole+0-ag": "engine/target",
|
||||
"jak-turret+0-ag": "engine/target",
|
||||
"warp-gate-ag": "levels/temple",
|
||||
"ctymark-obs": "levels/wascity",
|
||||
"brutter-highres-ag": "levels/museum",
|
||||
"crocadog-highres-ag": "levels/museum",
|
||||
"baron-highres-ag": "levels/museum",
|
||||
"errol-highres-ag": "levels/museum",
|
||||
"kid-highres-ag": "levels/museum",
|
||||
"kor-highres-ag": "levels/museum",
|
||||
"youngsamos-highres-ag": "levels/museum",
|
||||
"pecker-highres-ag": "levels/museum",
|
||||
"tess-highres-ag": "levels/museum",
|
||||
"torn-highres-ag": "levels/museum",
|
||||
"ashelin-highres-ag": "levels/museum",
|
||||
"jak-highres-ag": "levels/museum",
|
||||
"keira-highres-ag": "levels/museum",
|
||||
"onin-highres-ag": "levels/museum",
|
||||
"sig-highres-ag": "levels/museum",
|
||||
"kid-ag": "levels/stadium",
|
||||
"crimson-guard-ag": "levels/city",
|
||||
"samos-highres-ag": "levels/museum",
|
||||
"crimson-guard-highres-ag": "levels/intro",
|
||||
"lerrol": "levels/borrow/errol",
|
||||
"darkjak-highres-ag": "levels/mhcity",
|
||||
"wascity-burning-bush-ag": "levels/wascity",
|
||||
"fort-entry-gate-ag": "levels/gungame",
|
||||
"palmpilot-b-ag": "levels/city",
|
||||
"0credits-tx": "levels/title",
|
||||
"1credits-tx": "levels/title",
|
||||
"2credits-tx": "levels/title",
|
||||
"3credits-tx": "levels/title",
|
||||
"4credits-tx": "levels/title",
|
||||
"5credits-tx": "levels/title",
|
||||
"6credits-tx": "levels/title",
|
||||
"7credits-tx": "levels/title",
|
||||
"8credits-tx": "levels/title",
|
||||
"9credits-tx": "levels/title",
|
||||
"10credits-tx": "levels/title",
|
||||
"credits-h": "levels/title",
|
||||
"rub-rhino-door-ag": "levels/stadium",
|
||||
"rub-tower-ag": "levels/stadium",
|
||||
"ottsel-dummy-ag": "levels/museum",
|
||||
"babak-ag": "levels/museum",
|
||||
"precur-warp-effect-ag": "levels/precursor",
|
||||
"pre-artifact-a-ag": "levels/desert/artifact-race",
|
||||
"gauntlets-ag": "levels/desert/artifact-race",
|
||||
"jak-ladder+0-ag": "engine/target",
|
||||
"ctycrate-ag": "levels/city/common",
|
||||
"neo-satellite-break-ag": "levels/wascity",
|
||||
"jinx-highres-ag": "levels/city/hiphog",
|
||||
"blue-gun-mod-three-ag": "levels/city/destroy-grid",
|
||||
"jakc-scarf-ag": "levels/desert",
|
||||
"krimson-wall-ag": "levels/city/industrial",
|
||||
"precursor-ship-ag": "levels/outro",
|
||||
"kg-grunt-ag": "levels/common/enemy",
|
||||
"krimson-wall-break-ag": "levels/city/port/attack",
|
||||
"des-burning-bush-ag": "levels/desert/bbush",
|
||||
"precur-door-a-ag": "levels/precursor",
|
||||
"precur-swingpole-pop-ag": "levels/precursor",
|
||||
"jakc-wings-ag": "levels/temple",
|
||||
"dark-maker-idol-ag": "levels/temple",
|
||||
"urn-a-ag": "levels/temple",
|
||||
"urn-b-ag": "levels/temple",
|
||||
"urn-c-ag": "levels/temple",
|
||||
"flamer-lava-ag": "levels/volcano",
|
||||
"light-eco-vent-ag": "levels/common",
|
||||
"grunt-ag": "levels/common/enemy",
|
||||
"gekko-ag": "levels/mine",
|
||||
"manta-ag": "levels/mine",
|
||||
"kg-debris-ag": "levels/city",
|
||||
"eco-crystal-dark-ag": "levels/desert/rescue",
|
||||
"wlander-male-ag": "levels/desert/rescue",
|
||||
"robo-hover-ag": "levels/sewer",
|
||||
"cty-door-ag": "levels/city/slums",
|
||||
"egg-spider-ag": "levels/nest",
|
||||
"tpl-elevator-ag": "levels/temple",
|
||||
"spydroid-orig-ag": "levels/factory",
|
||||
"kg-flying-turret-ag": "levels/city/blow-tower",
|
||||
"jak-pilot-gun+0-ag": "engine/target",
|
||||
"jak-indax+0-ag": "engine/target/indax",
|
||||
"kg-hopper-ag": "levels/sewer",
|
||||
"mhcity-de-tower-egg-ag": "levels/mhcity",
|
||||
"kleever-highres-ag": "levels/borrow/kleiver",
|
||||
"veger-highres-ag": "levels/borrow/veger",
|
||||
"cav-eco-lg-ag": "levels/mine",
|
||||
"errol-ag": "levels/borrow/errol",
|
||||
"kg-pickup-ag": "levels/city/hijack",
|
||||
"snake-wheel-fma-ag": "levels/borrow/snake_wheels",
|
||||
"comb-rail-rider-ag": "levels/comb",
|
||||
"rhino-wheel-fma-ag": "levels/stadium",
|
||||
"seem-highres-ag": "levels/borrow/seem",
|
||||
"city-flitter-ag": "levels/common/enemy",
|
||||
"terraformer-head-ag": "levels/desert/boss",
|
||||
"jak-pilot-hcar+0-ag": "engine/target",
|
||||
"rapid-gunner": "levels/stadium",
|
||||
"spydroid": "levels/common/enemy",
|
||||
"credits": "levels/title",
|
||||
"ragdoll-edit": "engine/physics",
|
||||
"manipulator": "engine/debug"
|
||||
}
|
||||
|
||||
# i can be smarter than this...i swear....refactor eventually!
|
||||
def level_name(file_meta):
|
||||
dgos = file_meta[3]
|
||||
# Handle files unique to one level
|
||||
if dgos == ["DESA"] or dgos == ["DESB"] or dgos == ["DESC"] or dgos == ["DESD"] or dgos == ["DESE"] or dgos == ["DESF"] or dgos == ["DESG"] or dgos == ["DESH"] or dgos == ["DST"] or dgos == ["DESD", "WIN"] or dgos == ["LWASBBV"] or dgos == ["HGA", "WIN", "DST"] or dgos == ["LDESGCST"] or dgos == ["LWLANDM"] or dgos == ["WARPCAST"]:
|
||||
return "levels/desert"
|
||||
elif dgos == ["DESRACE2", "DESJUMP", "DESOASIS", "DESRESCG", "DESRACE1", "DESRALLY", "DESTRACK", "DESINTER", "DESCHASE"] or dgos == ["DESRACE2", "DESOASIS", "DESRESCG", "DESRACE1", "DESRALLY", "DESTRACK", "DESINTER", "DESCHASE"] or dgos == ["DESINTER"]:
|
||||
return "levels/desert"
|
||||
elif dgos == ["LBBRING1"] or dgos == ["LBBRING2"] or dgos == ["LBBRING3"] or dgos == ["LBBRING4"] or dgos == ["LBBRING5"] or dgos == ["LBBRING6"] or dgos == ["LBBSPID"] or dgos == ["LBBSPIRT"] or dgos == ["LBBSPRT2"] or dgos == ["LBBSPRT3"]:
|
||||
return "levels/desert/bbush"
|
||||
elif dgos == ["DESRALLY"] or dgos == ["DESTRACK"] or dgos == ["DESRALLY", "DESTRACK"]:
|
||||
return "levels/desert/race"
|
||||
elif dgos == ["DESLIZ"]:
|
||||
return "levels/desert/lizard"
|
||||
elif dgos == ["DESBOSS1"] or dgos == ["DESBOSS2"] or dgos == ["DESW"] or dgos == ["DESERROL"] or dgos == ["DESBCST"] or dgos == ["DESW", "DESBOSS1", "DESBOSS2"] or dgos == ["DESBOSS1", "PRECD"] or dgos == ["DESW", "DESBOSS1"]:
|
||||
return "levels/desert/boss"
|
||||
elif dgos == ["DESHOVER"] or dgos == ["DESBATTL"] or dgos == ["DESBATTL", "DESHOVER"] or dgos == ["DESHUNT"]:
|
||||
return "levels/desert/hover"
|
||||
elif dgos == ["DESRACE1"] or dgos == ["DESRACE2"] or dgos == ["DESRACE2", "DESRACE1"]:
|
||||
return "levels/desert/artifact-race"
|
||||
elif dgos == ["DESRESC"] or dgos == ["DESRESCG"] or dgos == ["DESRESCC"] or dgos == ["DESRESC", "RUBA"]:
|
||||
return "levels/desert/rescue"
|
||||
elif dgos == ["DESJUMP"] or dgos == ["DESCHASE"] or dgos == ["DESJUMP", "DESCHASE"] or dgos == ["DESOASIS", "WASSTADC", "DESCHASE"]:
|
||||
return "levels/desert/chase"
|
||||
elif dgos == ["DESOASIS"] or dgos == ["OASISCST"] or dgos == ["OASISCST", "WSD"] or dgos == ["OASISCST", "TEMA", "RBCT", "COMBA"]:
|
||||
return "levels/desert/oasis"
|
||||
elif dgos == ["LPATK", "LFACCAR", "WASALL"]:
|
||||
return "levels/desert/wvehicle"
|
||||
elif dgos == ["NSA"] or dgos == ["NSB"] or dgos == ["LNSTOA"] or dgos == ["LNSTOBB"] or dgos == ["LNSTCST"] or dgos == ["NSA", "LFORP", "LBBSPID"] or dgos == ["LNSTOBC"]:
|
||||
return "levels/nest"
|
||||
elif dgos == ["LBBTCHA1"] or dgos == ["LBBTCHA2"] or dgos == ["LBBTCHA3"] or dgos == ["LBBTCHA3", "LBBTCHA2", "LBBTCHA1"] or dgos == ["LBBSDRP1"] or dgos == ["LBBSDRP2"] or dgos == ["LBBSDRP3"]:
|
||||
return "levels/wascity/bbush"
|
||||
elif dgos == ["WASALL"] or dgos == ["WWD"] or dgos == ["WCA"] or dgos == ["WCASEEM"] or dgos == ["WCB"] or dgos == ["DESRESC", "WWD", "CWI"] or dgos == ["WCB", "WCA", "WASCHASE"] or dgos == ["WSD", "WCA"] or dgos == ["WSD", "DESB"] or dgos == ["WCB", "WCA"] or dgos == ["WASSEEM"] or dgos == ["WASCAST"]:
|
||||
return "levels/wascity"
|
||||
elif dgos == ["WASPALA"]:
|
||||
return "levels/wascity/palace"
|
||||
elif dgos == ["WIN"]:
|
||||
return "levels/wascity/intro"
|
||||
elif dgos == ["WASSTADA"] or dgos == ["WASSTADB"] or dgos == ["WASSTADC"] or dgos == ["WASSTADC", "DESRACE1"] or dgos == ["LWASSIG"] or dgos == ["ARENACST"] or dgos == ["LWSTDPCK"] or dgos == ["WASSTADA", "WASSTADC", "WASSTADB"]:
|
||||
return "levels/wascity/wasstadium"
|
||||
elif dgos == ["WASLEAPR"] or dgos == ['WWD', 'DESLIZ', 'VOCA']:
|
||||
return "levels/wascity/leaper"
|
||||
elif dgos == ["WASCHASE"]:
|
||||
return "levels/wascity/chase"
|
||||
elif dgos == ["WSD"]:
|
||||
return "levels/wascity/doors"
|
||||
elif dgos == ["WASPGAME"] or dgos == ["WASDEFEN"]:
|
||||
return "levels/wascity/defend"
|
||||
elif dgos == ["TEMA"] or dgos == ["TEMB"] or dgos == ["TEMC"] or dgos == ["TEMD"] or dgos == ["TEMX"] or dgos == ["TEMA", "TEMB"] or dgos == ["TEMPLEE"]:
|
||||
return "levels/temple"
|
||||
elif dgos == ["TEMA", "DESW", "TEMD", "HALFPIPE", "LPTRL", "TEMB"]:
|
||||
return "levels/temple"
|
||||
elif dgos == ["HGA"] or dgos == ["HGB"] or dgos == ["HGA", "VOCX"]:
|
||||
return "levels/glider"
|
||||
elif dgos == ["VOCA"] or dgos == ["VOCX"] or dgos == ["VOCX", "TEMX"]:
|
||||
return "levels/volcano"
|
||||
elif dgos == ["FACTORYA"] or dgos == ["FACB"] or dgos == ["FACC"] or dgos == ["FACD"] or dgos == ["LFACCITY"] or dgos == ["LFACB"] or dgos == ["LFACTORY"] or dgos == ["LFACRM1"] or dgos == ["LFACRM2"] or dgos == ["LFACB", "LFACCITY"] or dgos == ["FACC", "FACTORYA"] or dgos == ["LFACO"]:
|
||||
return "levels/factory"
|
||||
elif dgos == ["HGA", "CWI", "LFACTORY"] or dgos == ["LFACCAR"]:
|
||||
return "levels/factory/car"
|
||||
elif dgos == ["PRECA"] or dgos == ["PRECB"] or dgos == ["PRECC"] or dgos == ["PRECD"] or dgos == ["PRECB", "PRECA"] or dgos == ["PRECA", "PRECD"] or dgos == ["LPRECC"] or dgos == ["PRECD", "FRSTA"] or dgos == ["LPRENME"] or dgos == ["LPRENME", "PRECD"] or dgos == ["LPRENME", "TOWB", "LFORM", "FACD", "LPATK", "TOWERA"]:
|
||||
return "levels/precursor"
|
||||
elif dgos == ["COMBA"] or dgos == ["COMBB"] or dgos == ["COMBC"] or dgos == ["COMBD"] or dgos == ["COMBE"] or dgos == ["COMBN"] or dgos == ["COMBX"]:
|
||||
return "levels/comb"
|
||||
elif dgos == ["RAILA"] or dgos == ["RAILB"] or dgos == ["RAILC"] or dgos == ["RAILD"] or dgos == ["RAILE"] or dgos == ["RAILF"] or dgos == ["RAILX"] or dgos == ["RAILA", "COMBA"] or dgos == ["RAILB2"] or dgos == ["RAILCST"]:
|
||||
return "levels/comb"
|
||||
elif dgos == ["SEA"] or dgos == ["SEB"] or dgos == ["SEC"] or dgos == ["SED"] or dgos == ["SEE"] or dgos == ["SEF"] or dgos == ["SEG"] or dgos == ["SEH"] or dgos == ["SEI"] or dgos == ["SEJ"] or dgos == ["SEK"] or dgos == ["SEL"] or dgos == ["SEM"] or dgos == ["SEN"] or dgos == ["SEO"] or dgos == ["SEO", "SEL"] or dgos == ["SEK", "SEF"] or dgos == ["SEH", "SEG"]:
|
||||
return "levels/sewer"
|
||||
elif dgos == ["MIA"] or dgos == ["MIB"] or dgos == ["MIC"] or dgos == ["MINED"] or dgos == ["MINEE"] or dgos == ["MIA", "COMBN"] or dgos == ["MIA", "MIB", "MINED"]:
|
||||
return "levels/mine"
|
||||
elif dgos == ["LMECH"]:
|
||||
return "engine/target/mech"
|
||||
elif dgos == ["CITYCAST"] or dgos == ["LCITYSML"]:
|
||||
return "levels/city"
|
||||
elif dgos == ["LCTYHIJK"]:
|
||||
return "levels/city/hijack"
|
||||
elif dgos == ["LCTYPROT"] or dgos == ["LCTYPALT"] or dgos == ["CTYPESA"] or dgos == ["CTYPESB"] or dgos == ["CTYPESC"] or dgos == ["CTYPEPA"] or dgos == ["CTYPEPB"]or dgos == ["CTYPEPC"]:
|
||||
return "levels/city/protect"
|
||||
elif dgos == ["LCTYBLOW"] or dgos == ["LBLOWCST"] or dgos == ["LBLOWTMH"] or dgos == ["LBLOWTKG"]:
|
||||
return "levels/city/blow-tower"
|
||||
elif dgos == ["LJINX"] or dgos == ["GRIDCST"]:
|
||||
return "levels/city/destroy-grid"
|
||||
elif dgos == ["FREEHQ"] or dgos == ["FREECAST"] or dgos == ["LFREEOUT"]:
|
||||
return "levels/city/freehq"
|
||||
elif dgos == ["LCTYSNPR"]:
|
||||
return "levels/city/sniper"
|
||||
elif dgos == ["VIN"] or dgos == ["POWERGD"] or dgos == ["LVINCST"] or dgos == ["LVINCST", "POWERGD"]:
|
||||
return "levels/city/vinroom"
|
||||
elif dgos == ["LCTYPATK"] or dgos == ["LPATKCS"]:
|
||||
return "levels/city/port/attack"
|
||||
elif dgos == ["LCTYASS"]:
|
||||
return "levels/city/assault"
|
||||
elif dgos == ["CWI"] or dgos == ["PAC", "CWI"] or dgos == ["LWIDEA"] or dgos == ["LWIDEB"] or dgos == ["LWIDEB", "LWIDEA"] or dgos == ["LWIDEC"] or dgos == ["LWIDEC", "LWIDEA"] or dgos == ["LWIDEB", "LWIDEC", "LWIDEA"]:
|
||||
return "levels/city/common"
|
||||
elif dgos == ["CTYCARA"] or dgos == ["CTYCARB"] or dgos == ["CTYCARC"] or dgos == ["CTYCARKG"]:
|
||||
return "levels/city/vehicle"
|
||||
elif dgos == ["CTA"] or dgos == ["CTB"] or dgos == ["CTC"] or dgos == ["SLUMBSET"]:
|
||||
return "levels/city/slums"
|
||||
elif dgos == ["CPA"]:
|
||||
return "levels/city/palace"
|
||||
elif dgos == ["CIA"] or dgos == ["CIB"]:
|
||||
return "levels/city/industrial"
|
||||
elif dgos == ["CPO"] or dgos == ["PORTWALL"]:
|
||||
return "levels/city/port"
|
||||
elif dgos == ["CFB"] or dgos == ["CFA"] or dgos == ["CFB", "CFA"]:
|
||||
return "levels/city/farm"
|
||||
elif dgos == ["CGB"] or dgos == ["CGA"] or dgos == ["CGC"]:
|
||||
return "levels/city/generic"
|
||||
elif dgos == ["LTOWCITY"]:
|
||||
return "levels/city/palace"
|
||||
elif dgos == ["HHG"] or dgos == ["LTNJXHIP"] or dgos == ["LTNFXHIP"]:
|
||||
return "levels/hiphog"
|
||||
elif dgos == ["ONINTENT"] or dgos == ["LTENTOB"] or dgos == ["LTENTOUT"]:
|
||||
return "levels/city/onintent"
|
||||
elif dgos == ["LBOMBBOT"]:
|
||||
return "levels/city/bombbot"
|
||||
elif dgos == ["MHCA"] or dgos == ["MHCB"] or dgos == ["MHCB", "MHCA"] or dgos == ["MHCB", "LCTYDEST", "MHCA"] or dgos == ["LCTYDEST"] or dgos == ["LMHCA"] or dgos == ["LMHCB"] or dgos == ["MHCTYCST"]:
|
||||
return "levels/mhcity"
|
||||
elif dgos == ["TOWERA"] or dgos == ["TOWB"] or dgos == ["TOWERC"] or dgos == ["LTOWA"] or dgos == ["LTOWB"] or dgos == ["TOWERCST"] or dgos == ["LTOWA", "TOWB"] or dgos == ["LTOWA", "TOWB", "TOWERCST"]:
|
||||
return "levels/tower"
|
||||
elif dgos == ["FRSTA"] or dgos == ["FRSTB"] or dgos == ["FRSTX"] or dgos == ["LFORM"] or dgos == ["LFORP"] or dgos == ["LFORRING"]:
|
||||
return "levels/forest"
|
||||
elif dgos == ["STA"] or dgos == ["STAA"] or dgos == ["STB"] or dgos == ["RUBA"] or dgos == ["RUBA2"] or dgos == ["RUBB"] or dgos == ["RUBC"] or dgos == ["RBCT"] or dgos == ["LPATK"] or dgos == ["LPTRL"] or dgos == ["RUBB", "RUBA2"]:
|
||||
return "levels/stadium"
|
||||
elif dgos == ["GGA"] or dgos == ["GUNGAME1"] or dgos == ["GUNGAME2"] or dgos == ["LGUNRNC"] or dgos == ["LGUNNORM"]:
|
||||
return "levels/gungame"
|
||||
elif dgos == ["TITLE"] or dgos == ["INTTITLE"]:
|
||||
return "levels/title"
|
||||
elif dgos == ["IPF"] or dgos == ["INTROCST"] or dgos == ["INTPALRF"]:
|
||||
return "levels/intro"
|
||||
elif dgos == ["OUTROCST"] or dgos == ["LOUTRO"] or dgos == ["LOUTRO2"] or dgos == ["LOUTRO3"] or dgos == ["OUTCAST3"] or dgos == ["LOUTRO3", "LONINSIM"] or dgos == ["TEMP"]:
|
||||
return "levels/outro"
|
||||
elif dgos == ["MUSEUM"] or dgos == ["MUSEUM2"] or dgos == ["MUSEUM2", "LOUTRO2"] or dgos == ["MUSEUM2", "LOUTRO", "RAILCST"] or dgos == ["MUSEUM3"] or dgos == ["MUSEUM3B"] or dgos == ["MUSEUM4"] or dgos == ["MUSEUM4B"]:
|
||||
return "levels/museum"
|
||||
elif dgos == ["HALFPIPE"]:
|
||||
return "levels/test/halfpipe"
|
||||
elif dgos == ["ART", "GAME"] or dgos == ["ART"] or dgos == ["GAME"]:
|
||||
return "levels/common"
|
||||
elif dgos == ["HGA", "LPATK", "RAILA", "LFACCAR", "CWI", "WASALL", "LFACTORY", "COMBA"]:
|
||||
return "levels/common/hvehicle"
|
||||
elif dgos == ["TEMA", "LFORM", "FACD", "LBIPED", "LPATK", "TOWERA", "PRECA"] or dgos == ["TEMA", "CTYPESA", "PRECB", "LFORM", "FACD", "LBIPED", "LPATK", "TOWERA", "PRECA"]:
|
||||
return "levels/common/enemy/darkprec"
|
||||
elif dgos == ["LBIPED"]:
|
||||
return "levels/common/enemy/darkprec"
|
||||
elif dgos == ["LONINSIM"]:
|
||||
return "levels/borrow/onin-simple"
|
||||
elif dgos == ["LKEIRA"]:
|
||||
return "levels/borrow/keira"
|
||||
elif dgos == ["LSAMOS"]:
|
||||
return "levels/borrow/samos"
|
||||
elif dgos == ["LTORN"]:
|
||||
return "levels/borrow/torn"
|
||||
elif dgos == ["LTORNSAM"]:
|
||||
return "levels/borrow/torn-samos"
|
||||
elif dgos == ["LSEEMWCA"]:
|
||||
return "levels/borrow/seem"
|
||||
elif dgos == ["LKLEEVER"]:
|
||||
return "levels/borrow/kleiver"
|
||||
elif dgos == ["LTORNJNX"]:
|
||||
return "levels/borrow/torn-jinx"
|
||||
elif dgos == ["LJAK"] or dgos == ["LJAKC"] or dgos == ["LJKFEET"]:
|
||||
return "levels/borrow/jak"
|
||||
elif dgos == ["LJAKNDAX"]:
|
||||
return "levels/borrow/jak-daxter"
|
||||
elif dgos == ["LJAKCKLV"] or dgos == ["LJAKKLEV"]:
|
||||
return "levels/borrow/jak-kleiver"
|
||||
elif dgos == ["LJKDMPK"]:
|
||||
return "levels/borrow/jak-damas-pecker"
|
||||
elif dgos == ["LJKCDMKL"]:
|
||||
return "levels/borrow/jak-damas-kleiver"
|
||||
elif dgos == ["LJKDXVIN"]:
|
||||
return "levels/borrow/jak-daxter-vin"
|
||||
elif dgos == ["LJNDKLEV"]:
|
||||
return "levels/borrow/jak-daxter-kleiver"
|
||||
elif dgos == ["LDAX"]:
|
||||
return "levels/borrow/daxter"
|
||||
elif dgos == ["LASHELIN"]:
|
||||
return "levels/borrow/ashelin"
|
||||
elif dgos == ["LDAMKLEV"]:
|
||||
return "levels/borrow/damas-kleiver"
|
||||
elif dgos == ["LDAMPECK"] or dgos == ["LDMPCKGN"]:
|
||||
return "levels/borrow/damas-pecker"
|
||||
elif dgos == ["LDAMPKSM"]:
|
||||
return "levels/borrow/damas-pecker-samos"
|
||||
elif dgos == ["LDAMSIG"]:
|
||||
return "levels/borrow/damas-sig"
|
||||
elif dgos == ["LSIG"]:
|
||||
return "levels/borrow/sig"
|
||||
elif dgos == ["LSIGKLV"]:
|
||||
return "levels/borrow/sig-kleiver"
|
||||
elif dgos == ["LJAKSIG"] or dgos == ["LSIGJAKC"]:
|
||||
return "levels/borrow/jak-sig"
|
||||
elif dgos == ["LJKDMPK"]:
|
||||
return "levels/borrow/jak-damas-pecker"
|
||||
elif dgos == ["LTRNJNX"]:
|
||||
return "levels/borrow/torn-jinx"
|
||||
elif dgos == ["LTRTWHLS"]:
|
||||
return "levels/borrow/turtle-wheels"
|
||||
elif dgos == ["LSNKWHLS"]:
|
||||
return "levels/borrow/snake-wheels"
|
||||
elif dgos == ["GAME", "COMMON"]:
|
||||
return "levels/common"
|
||||
|
||||
remaining_dgos = {}
|
||||
|
||||
folders = {}
|
||||
|
||||
for jak3_file in jak3_files:
|
||||
if jak3_file[3] == ["NO-XGO"]:
|
||||
num_replicated = num_replicated + 1
|
||||
continue
|
||||
# manual overrides
|
||||
if jak3_file[0] in path_overrides or jak3_file[0].removesuffix("-h") in path_overrides:
|
||||
num_replicated = num_replicated + 1
|
||||
if jak3_file[0] in path_overrides:
|
||||
jak3_file[4] = path_overrides[jak3_file[0]]
|
||||
else:
|
||||
jak3_file[4] = path_overrides[jak3_file[0].removesuffix("-h")]
|
||||
if jak3_file[4] not in folders:
|
||||
folders[jak3_file[4]] = 1
|
||||
else:
|
||||
folders[jak3_file[4]] = folders[jak3_file[4]] + 1
|
||||
continue
|
||||
# port over manually specified engine files
|
||||
if jak3_file[0] in engine_files or jak3_file[0].removesuffix("-h") in engine_files:
|
||||
num_replicated = num_replicated + 1
|
||||
if jak3_file[0] in engine_files:
|
||||
jak3_file[4] = str.format("engine/{}", engine_files[jak3_file[0]])
|
||||
else:
|
||||
jak3_file[4] = str.format("engine/{}", engine_files[jak3_file[0].removesuffix("-h")])
|
||||
if jak3_file[4] not in folders:
|
||||
folders[jak3_file[4]] = 1
|
||||
else:
|
||||
folders[jak3_file[4]] = folders[jak3_file[4]] + 1
|
||||
continue
|
||||
# attempt to find the object with the same name in jak 2
|
||||
jak2_path = None
|
||||
if not jak3_file[0].startswith("tpage"):
|
||||
for jak2_file in jak2_files:
|
||||
if jak2_file[0] == jak3_file[0]:
|
||||
jak2_path = jak2_file[4]
|
||||
if (jak2_path.startswith("levels")):
|
||||
print("{} - {}".format(jak2_path, jak3_file[0]))
|
||||
break
|
||||
if jak2_path is not None:
|
||||
jak3_file[4] = jak2_path
|
||||
num_replicated = num_replicated + 1
|
||||
elif level_name(jak3_file):
|
||||
jak3_file[4] = level_name(jak3_file)
|
||||
num_replicated = num_replicated + 1
|
||||
else:
|
||||
num_left = num_left + 1
|
||||
if ",".join(jak3_file[3]) in remaining_dgos:
|
||||
remaining_dgos[",".join(jak3_file[3])] = remaining_dgos[",".join(jak3_file[3])] + 1
|
||||
else:
|
||||
remaining_dgos[",".join(jak3_file[3])] = 1
|
||||
if jak3_file[4] not in folders:
|
||||
folders[jak3_file[4]] = 1
|
||||
else:
|
||||
folders[jak3_file[4]] = folders[jak3_file[4]] + 1
|
||||
|
||||
with open('../../../goal_src/jak3/build/all_objs_TMP.json', 'w') as json_file:
|
||||
# Calculate these to make the file as compact as possible
|
||||
longest_name = 0
|
||||
longest_name_in_dgo = 0
|
||||
for jak3_file in jak3_files:
|
||||
if len(jak3_file[0]) > longest_name:
|
||||
longest_name = len(jak3_file[0])
|
||||
if len(jak3_file[1]) > longest_name_in_dgo:
|
||||
longest_name_in_dgo = len(jak3_file[1])
|
||||
# Actually write things out
|
||||
json_file.write("[\n")
|
||||
i = 0
|
||||
for jak3_file in jak3_files:
|
||||
name = '{: <{}}'.format("\"{}\",".format(jak3_file[0]), longest_name + 2)
|
||||
name_in_dgo = '{: <{}}'.format("\"{}\",".format(jak3_file[1]), longest_name_in_dgo + 2)
|
||||
dgo_set = "["
|
||||
for dgo in jak3_file[3]:
|
||||
dgo_set += "\"{}\", ".format(dgo)
|
||||
dgo_set = dgo_set.removesuffix(", ")
|
||||
dgo_set += "]"
|
||||
if i == (len(jak3_files) - 1):
|
||||
json_file.write("[{}{}{}, {}, \"{}\"]\n".format(name, name_in_dgo, jak3_file[2], dgo_set, jak3_file[4]))
|
||||
else:
|
||||
json_file.write("[{}{}{}, {}, \"{}\"],\n".format(name, name_in_dgo, jak3_file[2], dgo_set, jak3_file[4]))
|
||||
i = i + 1
|
||||
json_file.write("]\n")
|
||||
|
||||
print("Mapped: {} and Left: {}".format(num_replicated, num_left))
|
||||
|
||||
limit = 0
|
||||
for dgo_set in dict(sorted(remaining_dgos.items(), reverse=True, key=lambda item: item[1])):
|
||||
dgo_set_nice = ""
|
||||
for dgo in dgo_set.split(","):
|
||||
dgo_set_nice += "\"{}\", ".format(dgo)
|
||||
dgo_set_nice = dgo_set_nice.removesuffix(", ")
|
||||
print("or dgos == [{}]: {}".format(dgo_set_nice, remaining_dgos[dgo_set]))
|
||||
if limit > 100:
|
||||
break
|
||||
limit = limit + 1
|
||||
print(len(remaining_dgos))
|
||||
|
||||
print("Folder | Number of Files")
|
||||
for folder in dict(sorted(folders.items(), reverse=True, key=lambda item: item[1])):
|
||||
print("{}: {}".format(folder, folders[folder]))
|
||||
if limit > 100:
|
||||
break
|
||||
limit = limit + 1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
file_list = None
|
||||
|
||||
with open('../../goal_src/jak2/build/all_objs.json', 'r') as f:
|
||||
file_list = json.load(f)
|
||||
|
||||
def dgo_names_string(names):
|
||||
result = ""
|
||||
for x in names:
|
||||
result += x + ", "
|
||||
result = result[:-2]
|
||||
return result
|
||||
|
||||
def make_file(root, path, name, name_in_dgo, dgos, version):
|
||||
if version == 3:
|
||||
filename = name + ".gc"
|
||||
text = """;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: {}
|
||||
;; name in dgo: {}
|
||||
;; dgos: {}
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
""".format(filename, name_in_dgo, dgo_names_string(dgos))
|
||||
Path(os.path.join(root, path)).mkdir(parents=True, exist_ok=True)
|
||||
with open(os.path.join(root, path, filename), "w") as f:
|
||||
f.write(text)
|
||||
|
||||
for x in file_list:
|
||||
make_file("../../goal_src/jak2", x[4], x[0], x[1], x[3], x[2])
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
file_list = None
|
||||
|
||||
with open('../../../goal_src/jak3/build/all_objs.json', 'r') as f:
|
||||
file_list = json.load(f)
|
||||
|
||||
def dgo_names_string(names):
|
||||
result = ""
|
||||
for x in names:
|
||||
result += x + ", "
|
||||
result = result[:-2]
|
||||
return result
|
||||
|
||||
def is_code_file(name, dgos):
|
||||
return not name.endswith("-ag") and not name.endswith("-vis") and not name.startswith("tpage-") and not name.endswith("COMMON") and not dgos[0].lower() == name and not name.endswith("-tx")
|
||||
|
||||
def make_file(root, path, name, name_in_dgo, dgos, version):
|
||||
if is_code_file(name, dgos):
|
||||
filename = name + ".gc"
|
||||
text = """;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: {}
|
||||
;; name in dgo: {}
|
||||
;; dgos: {}
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
""".format(filename, name_in_dgo, dgo_names_string(dgos))
|
||||
Path(os.path.join(root, path)).mkdir(parents=True, exist_ok=True)
|
||||
with open(os.path.join(root, path, filename), "w") as f:
|
||||
f.write(text)
|
||||
# print("make_file {}/{}/{} {} {}".format(root, path, filename, name_in_dgo, dgos))
|
||||
|
||||
for x in file_list:
|
||||
make_file("../../../goal_src/jak3", x[4], x[0], x[1], x[3], x[2])
|
||||
|
||||
@@ -1,29 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
file_list = None
|
||||
|
||||
with open('../../../goal_src/jak3/build/all_objs.json', 'r') as f:
|
||||
file_list = json.load(f)
|
||||
with open("../../../goal_src/jakx/build/all_objs.json", "r") as f:
|
||||
file_list = json.load(f)
|
||||
|
||||
|
||||
def dgo_names_string(names):
|
||||
result = ""
|
||||
for x in names:
|
||||
result += x + ", "
|
||||
result = result[:-2]
|
||||
return result
|
||||
result = ""
|
||||
for x in names:
|
||||
result += x + ", "
|
||||
result = result[:-2]
|
||||
return result
|
||||
|
||||
|
||||
def is_code_file(name, dgos):
|
||||
return not name.endswith("-ag") and not name.endswith("-vis") and not name.startswith("tpage-") and not name.endswith("COMMON") and not dgos[0].lower() == name and not name.endswith("-tx")
|
||||
return (
|
||||
not name.endswith("-ag")
|
||||
and not name.endswith("-vis")
|
||||
and not name.startswith("tpage-")
|
||||
and not name.endswith("COMMON")
|
||||
and not dgos[0].lower() == name
|
||||
and not name.endswith("-tx")
|
||||
)
|
||||
|
||||
|
||||
def make_file(root, path, name, name_in_dgo, dgos, version):
|
||||
if is_code_file(name, dgos):
|
||||
filename = name + ".gc"
|
||||
text = """;;-*-Lisp-*-
|
||||
if is_code_file(name, dgos):
|
||||
filename = name + ".gc"
|
||||
text = """;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: {}
|
||||
@@ -33,11 +43,11 @@ def make_file(root, path, name, name_in_dgo, dgos, version):
|
||||
;; DECOMP BEGINS
|
||||
|
||||
""".format(filename, name_in_dgo, dgo_names_string(dgos))
|
||||
Path(os.path.join(root, path)).mkdir(parents=True, exist_ok=True)
|
||||
with open(os.path.join(root, path, filename), "w") as f:
|
||||
f.write(text)
|
||||
# print("make_file {}/{}/{} {} {}".format(root, path, filename, name_in_dgo, dgos))
|
||||
Path(os.path.join(root, path)).mkdir(parents=True, exist_ok=True)
|
||||
with open(os.path.join(root, path, filename), "w") as f:
|
||||
f.write(text)
|
||||
# print("make_file {}/{}/{} {} {}".format(root, path, filename, name_in_dgo, dgos))
|
||||
|
||||
|
||||
for x in file_list:
|
||||
make_file("../../../goal_src/jak3", x[4], x[0], x[1], x[3], x[2])
|
||||
|
||||
make_file("../../../goal_src/jakx", x[4], x[0], x[1], x[3], x[2])
|
||||
|
||||
Reference in New Issue
Block a user