fourfury 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fourfury-0.2.1/CHANGELOG.md +76 -0
- fourfury-0.2.1/MANIFEST.in +1 -0
- fourfury-0.2.1/PKG-INFO +84 -0
- fourfury-0.2.1/README.md +75 -0
- fourfury-0.2.1/fourfury/__init__.py +493 -0
- fourfury-0.2.1/fourfury/_utils.py +75 -0
- fourfury-0.2.1/fourfury/animation.py +788 -0
- fourfury-0.2.1/fourfury/crypto.py +183 -0
- fourfury-0.2.1/fourfury/fragment.py +236 -0
- fourfury-0.2.1/fourfury/gtxd.py +197 -0
- fourfury-0.2.1/fourfury/ide.py +396 -0
- fourfury-0.2.1/fourfury/img.py +445 -0
- fourfury-0.2.1/fourfury/ipl.py +112 -0
- fourfury-0.2.1/fourfury/materials.py +167 -0
- fourfury-0.2.1/fourfury/mlo/__init__.py +33 -0
- fourfury-0.2.1/fourfury/mlo/definition.py +960 -0
- fourfury-0.2.1/fourfury/model.py +484 -0
- fourfury-0.2.1/fourfury/nod.py +594 -0
- fourfury-0.2.1/fourfury/path.py +257 -0
- fourfury-0.2.1/fourfury/rpf.py +457 -0
- fourfury-0.2.1/fourfury/rsc.py +111 -0
- fourfury-0.2.1/fourfury/shaders.py +652 -0
- fourfury-0.2.1/fourfury/wad.py +1894 -0
- fourfury-0.2.1/fourfury/wad_audit.py +487 -0
- fourfury-0.2.1/fourfury/water.py +666 -0
- fourfury-0.2.1/fourfury/wbd.py +229 -0
- fourfury-0.2.1/fourfury/wbn.py +853 -0
- fourfury-0.2.1/fourfury/wdd.py +203 -0
- fourfury-0.2.1/fourfury/wdr/__init__.py +253 -0
- fourfury-0.2.1/fourfury/wdr/constants.py +119 -0
- fourfury-0.2.1/fourfury/wdr/geometry.py +661 -0
- fourfury-0.2.1/fourfury/wdr/material.py +227 -0
- fourfury-0.2.1/fourfury/wdr/math.py +135 -0
- fourfury-0.2.1/fourfury/wdr/reader.py +843 -0
- fourfury-0.2.1/fourfury/wdr/scene.py +315 -0
- fourfury-0.2.1/fourfury/wft.py +1262 -0
- fourfury-0.2.1/fourfury/wft_audit.py +215 -0
- fourfury-0.2.1/fourfury/wnv.py +911 -0
- fourfury-0.2.1/fourfury/wpl.py +635 -0
- fourfury-0.2.1/fourfury/wpl_lod.py +298 -0
- fourfury-0.2.1/fourfury/wtd.py +270 -0
- fourfury-0.2.1/fourfury.egg-info/PKG-INFO +84 -0
- fourfury-0.2.1/fourfury.egg-info/SOURCES.txt +74 -0
- fourfury-0.2.1/fourfury.egg-info/dependency_links.txt +1 -0
- fourfury-0.2.1/fourfury.egg-info/top_level.txt +1 -0
- fourfury-0.2.1/pyproject.toml +18 -0
- fourfury-0.2.1/setup.cfg +4 -0
- fourfury-0.2.1/setup.py +30 -0
- fourfury-0.2.1/src/binary.hpp +34 -0
- fourfury-0.2.1/src/crypto.cpp +257 -0
- fourfury-0.2.1/src/module.cpp +65 -0
- fourfury-0.2.1/src/native.hpp +18 -0
- fourfury-0.2.1/src/wbn.cpp +280 -0
- fourfury-0.2.1/src/wdr.cpp +253 -0
- fourfury-0.2.1/tests/test_animation.py +184 -0
- fourfury-0.2.1/tests/test_archives.py +217 -0
- fourfury-0.2.1/tests/test_crypto.py +39 -0
- fourfury-0.2.1/tests/test_gtxd.py +48 -0
- fourfury-0.2.1/tests/test_layered_terrain_shaders.py +36 -0
- fourfury-0.2.1/tests/test_map_formats.py +409 -0
- fourfury-0.2.1/tests/test_materials.py +24 -0
- fourfury-0.2.1/tests/test_model.py +190 -0
- fourfury-0.2.1/tests/test_native_wbn.py +71 -0
- fourfury-0.2.1/tests/test_native_wdr.py +118 -0
- fourfury-0.2.1/tests/test_nod.py +252 -0
- fourfury-0.2.1/tests/test_path.py +80 -0
- fourfury-0.2.1/tests/test_shaders.py +60 -0
- fourfury-0.2.1/tests/test_wad.py +629 -0
- fourfury-0.2.1/tests/test_water.py +191 -0
- fourfury-0.2.1/tests/test_wbd.py +104 -0
- fourfury-0.2.1/tests/test_wbn.py +245 -0
- fourfury-0.2.1/tests/test_wdd.py +81 -0
- fourfury-0.2.1/tests/test_wdr.py +489 -0
- fourfury-0.2.1/tests/test_wft.py +331 -0
- fourfury-0.2.1/tests/test_wnv.py +184 -0
- fourfury-0.2.1/tests/test_wtd.py +60 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `fourfury` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The changelog is release-oriented and uses a small fixed set of categories:
|
|
6
|
+
`Breaking Changes`, `Added`, `Changed`, `Fixed`, and `Performance`.
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.1] - 2026-07-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Lossless GTA IV `water.dat` support with typed triangle and quad surfaces, runtime flags, spatial queries, validation, editing, and format-neutral mesh export.
|
|
14
|
+
- Complete target-independent WFT fragment projection with common, undamaged, and damaged models, physical piece metadata, transforms, and primitive-data export.
|
|
15
|
+
- Explicit WFT group hierarchy navigation, neutral group projection, and structured structural validation.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- WFT fragment, group, and child flags now expose confidence metadata and preserve unnamed bits explicitly instead of presenting inferred meanings as verified GTA IV behavior.
|
|
19
|
+
- WFT group flag bits now use canonical `UNKNOWN_BIT_*` names because their previous inferred meanings are not verified for GTA IV; the former names remain compatibility aliases.
|
|
20
|
+
- WFT child flag bits now use canonical `UNKNOWN_BIT_*` names because neither CodeX nor the stock corpus establishes their semantics; the former speculative names remain compatibility aliases.
|
|
21
|
+
- WFT fragment bit 2 now uses the canonical `UNKNOWN_BIT_2` name instead of the unverified `UNUSED` label.
|
|
22
|
+
- WFT child drawables now inherit the common shader group when their serialized drawable omits one, while retaining the distinction in the public API.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Windows native-extension builds no longer collide with the Win32 `max` macro.
|
|
26
|
+
|
|
27
|
+
### Performance
|
|
28
|
+
- WFT child drawables are decoded lazily, avoiding geometry and bound parsing when callers only inspect fragment physics.
|
|
29
|
+
|
|
30
|
+
## [0.2.0] - 2026-07-24
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- WAD animation-dictionary reading with animation names, hash lookup, flags, and track metadata.
|
|
34
|
+
- Decoding for stock WAD channel encodings, with lossless inspection of unsupported encodings.
|
|
35
|
+
- Frame evaluation, time-based sampling, and format-neutral targets, values, sparse frames, and interpolation.
|
|
36
|
+
- Selected-track streaming and primitive-data export for format-independent animation consumers.
|
|
37
|
+
- Semantic WAD track classification, structured validation, aggregate audits, and explicit custom track IDs.
|
|
38
|
+
- Target-independent UV transforms, frames, clips, interpolation, and coordinate transformation.
|
|
39
|
+
- UV-animation material-slot bindings and neutral WDR default UV transforms shared with the animation API.
|
|
40
|
+
- Typed, editable IDE archetype views with named animation flags.
|
|
41
|
+
- Target-independent skeletal transforms, poses, clips, and separately modeled mover/root-motion tracks.
|
|
42
|
+
- Optional skeletal binding with hierarchy, skeleton signatures, bind-pose matrices, strict validation, and explicit unresolved targets.
|
|
43
|
+
- Explicit MLO archetypes with typed entities, rooms, portals, bounds, time flags, cross-references, internal LOD parenting, and topology validation.
|
|
44
|
+
- MLO hash registries, WPL placement resolution, and world-space entity, room, and portal projection.
|
|
45
|
+
- Primitive-data export and lossless MLO editing through the original IDE records.
|
|
46
|
+
- Lossless text IPL support with typed GTA IV occlusion boxes.
|
|
47
|
+
- Named layered-terrain shader parameters and drawable-light flags.
|
|
48
|
+
- Lightweight WBD dictionary-hash inspection.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
- Reorganized the monolithic WDR parser into the focused `fourfury.wdr` package while preserving its public API, type identities, pickle compatibility, and native-decoder patching.
|
|
52
|
+
- WPL section 8 is now modeled explicitly as `WplMloPortal`, with `WplStrBig` retained as a compatibility alias.
|
|
53
|
+
- WAD targets are modeled independently from their per-chunk encodings so converters can consume stable logical animation data.
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- WAD track-group sampling respects the shared boundary frame between adjacent groups.
|
|
57
|
+
- Stock UV-animation hashes and targets now follow their dictionary, material-slot, and UV-index conventions.
|
|
58
|
+
- WAD skeletal targets remain stable across encoding changes, with normalized shortest-path quaternion interpolation.
|
|
59
|
+
- WAD action-flags tracks are no longer misclassified as bone translations.
|
|
60
|
+
- WAD packed integer sequences decode their unary prefix before the Rice remainder.
|
|
61
|
+
|
|
62
|
+
### Performance
|
|
63
|
+
- Bounded IMG resource scanning uses roughly 4× less peak memory, while cached logical sizes avoid repeated zlib scans.
|
|
64
|
+
- Atomic streaming IMG and RPF writers use roughly 200× less peak memory when saving large archives.
|
|
65
|
+
- Lazy WAD channel decoding makes large animation dictionaries roughly 40× faster to parse while using about 11× less peak memory.
|
|
66
|
+
- Lazy WDR vertex decoding makes large drawables roughly 2.5× faster to parse while retaining about 1.5× less memory.
|
|
67
|
+
- Indexed animation, skeleton, texture, and track lookups make repeated UV sampling up to 75× faster and texture lookup roughly 55× faster.
|
|
68
|
+
|
|
69
|
+
## [0.1.0] - 2026-07-22
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- Initial public release of FourFury for GTA IV asset workflows on Python 3.11 and newer.
|
|
73
|
+
- RPF2, audio RPF3, and IMG3 archive reading and extraction, with creation and writing for RPF2 and IMG3.
|
|
74
|
+
- IDE, WPL, GTXD, NOD, and WNV map-data APIs, including explicit LOD parenting and format-neutral path graphs.
|
|
75
|
+
- RSC5 texture, drawable, fragment, and collision support through WTD, WDR, WDD, WFT, WBN, and WBD.
|
|
76
|
+
- Format-neutral model projection, stock shader and collision-material catalogs, and optional native acceleration for common decoding paths.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include CHANGELOG.md
|
fourfury-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fourfury
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Python library for Grand Theft Auto IV archive formats.
|
|
5
|
+
Author: fourfury contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# FourFury
|
|
11
|
+
|
|
12
|
+
FourFury is a Python library for reading, inspecting, extracting, and editing
|
|
13
|
+
Grand Theft Auto IV data files. It provides typed APIs for the game's archives,
|
|
14
|
+
world placements, collision resources, drawables, textures, navigation graphs,
|
|
15
|
+
animation dictionaries, and related metadata.
|
|
16
|
+
|
|
17
|
+
> [!IMPORTANT]
|
|
18
|
+
> FourFury is under active development. Read support is broader than write support,
|
|
19
|
+
> and some resource types intentionally permit only fixed-size edits.
|
|
20
|
+
|
|
21
|
+
## Format support
|
|
22
|
+
|
|
23
|
+
| Format | Read | Write | Notes |
|
|
24
|
+
| --- | :---: | :---: | --- |
|
|
25
|
+
| RPF2 | Yes | Yes | Search, extraction, creation, and unencrypted output |
|
|
26
|
+
| RPF3 | Yes | No | Audio archives; hash-only names remain hexadecimal |
|
|
27
|
+
| IMG3 | Yes | Yes | Search, extraction, creation, and resource padding handling |
|
|
28
|
+
| IDE | Yes | Yes | Lossless definitions with explicit MLO entities, rooms, portals, and validation |
|
|
29
|
+
| IPL | Yes | Yes | Lossless sectioned text with typed GTA IV OCCL boxes |
|
|
30
|
+
| water.dat | Yes | Yes | Lossless water triangles and quads, runtime flags, geometry queries, and neutral mesh export |
|
|
31
|
+
| WPL | Yes | Yes | Placements, MLO resolution, explicit LOD hierarchies, world portals, and instance flags |
|
|
32
|
+
| GTXD | Yes | Yes | Texture-parent chains and cycle detection |
|
|
33
|
+
| NOD | Yes | Yes | Navigation nodes, links, costs, and topology validation |
|
|
34
|
+
| WNV | Yes | Limited | Navigation meshes, edges, cover points, and quadtrees |
|
|
35
|
+
| WBN | Yes | Limited | Collision bounds and fixed-size edits |
|
|
36
|
+
| WBD | Yes | Limited | Collision dictionaries and fixed-size edits |
|
|
37
|
+
| WAD | Yes | No | Animation dictionaries, tracks, chunks, and decoded channels |
|
|
38
|
+
| WDD | Yes | No | Hash-addressed drawable dictionaries and neutral model projection |
|
|
39
|
+
| WDR | Yes | No | Drawables plus neutral model projection |
|
|
40
|
+
| WFT | Yes | No | Fragment drawables, physics hierarchy, collision bounds, and complete neutral fragment projection |
|
|
41
|
+
| WTD | Yes | No | Texture dictionaries and DDS export |
|
|
42
|
+
|
|
43
|
+
See [DOCUMENTATION.md](DOCUMENTATION.md) for examples, field behavior, writer
|
|
44
|
+
constraints, and current limitations.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
FourFury requires Python 3.11 or newer. Install it directly from GitHub:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
python -m pip install "fourfury @ git+https://github.com/Hancapo/fourfury.git"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For an editable installation:
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
git clone https://github.com/Hancapo/fourfury.git
|
|
58
|
+
cd fourfury
|
|
59
|
+
python -m pip install -e .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Quick start
|
|
63
|
+
|
|
64
|
+
Open an archive and read one of its entries:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from pathlib import Path
|
|
68
|
+
|
|
69
|
+
from fourfury import RpfArchive
|
|
70
|
+
|
|
71
|
+
game = Path(r"D:\Program Files (x86)\Steam\steamapps\common\Grand Theft Auto IV\GTAIV")
|
|
72
|
+
|
|
73
|
+
with RpfArchive.from_path(game / "pc/data/game.rpf") as archive:
|
|
74
|
+
entry = archive.find_entry("data/taskparams.txt")
|
|
75
|
+
if entry is not None:
|
|
76
|
+
print(entry.read().decode("utf-8"))
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Documentation
|
|
80
|
+
|
|
81
|
+
The [complete documentation](DOCUMENTATION.md) covers every supported format,
|
|
82
|
+
resource APIs, neutral WDR models, editing constraints, and known limitations.
|
|
83
|
+
|
|
84
|
+
Release notes live in [CHANGELOG.md](CHANGELOG.md).
|
fourfury-0.2.1/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# FourFury
|
|
2
|
+
|
|
3
|
+
FourFury is a Python library for reading, inspecting, extracting, and editing
|
|
4
|
+
Grand Theft Auto IV data files. It provides typed APIs for the game's archives,
|
|
5
|
+
world placements, collision resources, drawables, textures, navigation graphs,
|
|
6
|
+
animation dictionaries, and related metadata.
|
|
7
|
+
|
|
8
|
+
> [!IMPORTANT]
|
|
9
|
+
> FourFury is under active development. Read support is broader than write support,
|
|
10
|
+
> and some resource types intentionally permit only fixed-size edits.
|
|
11
|
+
|
|
12
|
+
## Format support
|
|
13
|
+
|
|
14
|
+
| Format | Read | Write | Notes |
|
|
15
|
+
| --- | :---: | :---: | --- |
|
|
16
|
+
| RPF2 | Yes | Yes | Search, extraction, creation, and unencrypted output |
|
|
17
|
+
| RPF3 | Yes | No | Audio archives; hash-only names remain hexadecimal |
|
|
18
|
+
| IMG3 | Yes | Yes | Search, extraction, creation, and resource padding handling |
|
|
19
|
+
| IDE | Yes | Yes | Lossless definitions with explicit MLO entities, rooms, portals, and validation |
|
|
20
|
+
| IPL | Yes | Yes | Lossless sectioned text with typed GTA IV OCCL boxes |
|
|
21
|
+
| water.dat | Yes | Yes | Lossless water triangles and quads, runtime flags, geometry queries, and neutral mesh export |
|
|
22
|
+
| WPL | Yes | Yes | Placements, MLO resolution, explicit LOD hierarchies, world portals, and instance flags |
|
|
23
|
+
| GTXD | Yes | Yes | Texture-parent chains and cycle detection |
|
|
24
|
+
| NOD | Yes | Yes | Navigation nodes, links, costs, and topology validation |
|
|
25
|
+
| WNV | Yes | Limited | Navigation meshes, edges, cover points, and quadtrees |
|
|
26
|
+
| WBN | Yes | Limited | Collision bounds and fixed-size edits |
|
|
27
|
+
| WBD | Yes | Limited | Collision dictionaries and fixed-size edits |
|
|
28
|
+
| WAD | Yes | No | Animation dictionaries, tracks, chunks, and decoded channels |
|
|
29
|
+
| WDD | Yes | No | Hash-addressed drawable dictionaries and neutral model projection |
|
|
30
|
+
| WDR | Yes | No | Drawables plus neutral model projection |
|
|
31
|
+
| WFT | Yes | No | Fragment drawables, physics hierarchy, collision bounds, and complete neutral fragment projection |
|
|
32
|
+
| WTD | Yes | No | Texture dictionaries and DDS export |
|
|
33
|
+
|
|
34
|
+
See [DOCUMENTATION.md](DOCUMENTATION.md) for examples, field behavior, writer
|
|
35
|
+
constraints, and current limitations.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
FourFury requires Python 3.11 or newer. Install it directly from GitHub:
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
python -m pip install "fourfury @ git+https://github.com/Hancapo/fourfury.git"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For an editable installation:
|
|
46
|
+
|
|
47
|
+
```powershell
|
|
48
|
+
git clone https://github.com/Hancapo/fourfury.git
|
|
49
|
+
cd fourfury
|
|
50
|
+
python -m pip install -e .
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
Open an archive and read one of its entries:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from pathlib import Path
|
|
59
|
+
|
|
60
|
+
from fourfury import RpfArchive
|
|
61
|
+
|
|
62
|
+
game = Path(r"D:\Program Files (x86)\Steam\steamapps\common\Grand Theft Auto IV\GTAIV")
|
|
63
|
+
|
|
64
|
+
with RpfArchive.from_path(game / "pc/data/game.rpf") as archive:
|
|
65
|
+
entry = archive.find_entry("data/taskparams.txt")
|
|
66
|
+
if entry is not None:
|
|
67
|
+
print(entry.read().decode("utf-8"))
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
The [complete documentation](DOCUMENTATION.md) covers every supported format,
|
|
73
|
+
resource APIs, neutral WDR models, editing constraints, and known limitations.
|
|
74
|
+
|
|
75
|
+
Release notes live in [CHANGELOG.md](CHANGELOG.md).
|