GSF dissection

Contains information and downloads about the GSF file format reverse engineering progress and the GSF Unpacker.
Post Reply
User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

GSF dissection

Post by DryFun » Tue Mar 06, 2018 17:39 pm

AyCe said to write this post

https://github.com/BlasSoriano/Paraworld
https://zenhax.com/viewtopic.php?f=9&t=6998

icewaste_animals.gsf 21.06.2009

Code: Select all

0x00000000		GSF_PACK_HEADER
47 53 46 00		"GSF 00"
00 00 00 00		FormatVersion = 0
00 00 01 00		ContentsTableOffset = 0x00010000


0x0000000C		TREE_NODES
From 0x0000000C to unknown (it needs to be parsed) #Models,anims,sounds,classes(not included in that .gsf),walktransition lists


0x000003F9		SOUNDS
After models and anims list to unknown	
27 00 00 00		#All sounds count

25 00 00 00		#MaxCharsCount in sound name.
30 30 5F 6E 70 63 2F 6E 70 63 5F 64 69 6E 6F 5F 68 75 67 65 31 5F 77 61 74 65 72 5F 61 74 74 31 2E 77 61 76 00    00_npc/npc_dino_huge1_water_att1.wav
01 00 00 00		#The frame on which the sound starts
63 00 00 00		#Volume
66 66 66 3F		#Sound speed
00 00 00 00
00 00 00 41		
00 00 96 42		#42=const
00 00 98 42		#42=const
01 00 00 00
00				#Splitter (Used to split blocks if the sound is used more than once in the animation)
and 36 more empty entries, 74 bytes each(except 04_step/step_dino_swim5.wav because there the sound should play 3 times per animation) upto 0x00000E1A


0x00000E1B		WALK_TRANSITIONS_TABLE
00 00 00 00
00 00 00 00
02 00 00 00		#walktransitions count
09 00 00 00		#CharsCount
41 6E 69 6D 61 6C 73 31 00		Animals1
09 00 00 00		#CharsCount
41 6E 69 6D 61 6C 73 33 00		Animals3


0x00000E41		PADDING
From unknown to 0x0000FFFF		#Except when the TREE_NODES is larger 0x00010000 (all_characters.gsf,all_animals.gsf ...)

0x00010000		CONTENTS_TABLE
00 00 00 00		0=const
05 00 00 00		ObjectsCount = 5 #AllModelsCount
0B 00 00 00		SubObjectsCount = 11 #AllAnimsCount
00 00 00 00		0=const
1C 00 00 00		ObjectsTableOffset = 0x1C + 0x00010010 = 0x0001002C #Offset to models classes
05 00 00 00		ObjectsCount = 5 #Models classes count										
B8 01 00 00		SubObjectsTableOffset = 0x1B8 + 0x00010010 = 0x000101D0 #Offset to anims classes
0B 00 00 00		SubObjectsCount = 11 #Anim classes count


0x00010020		MATERIALS_HEADER
06 00 00 00		MaterialsCount = 6
4C A0 00 00		MaterialsTableOffset = 0xA04C + 0x00010024 = 0x0001A070
E8 03 00 00		TotalEntries = 1000


0x0001002C		OBJECTS_TABLE
43 68 61 72		"Char"
38 FE 00 00		ObjectNameOffset = 0xFE38 + 0x00010030 = 0x0001FE68
2C FE 00 00		PartDefOffsetsTableOffset = 0xFE2C + 0x00010034 = 0x0001FE60 #offsets to base mesh and flags meshes
02 00 00 00		PartsCount = 2
1C A0 00 00		UsedMaterialsTableOffset = 0xA01C + 0x0001003C = 0x0001A058
01 00 00 00		#0F 00 00 00 (other values breaks the model)
00 00 00 00		2 shorts #Short and Additional effects count
FF FF 00 00		2 shorts #Links offset (where the links table should start or something like that) and links count
00 01 00 00		#00 01 01 02 #01 01 00 00 #01 00 00 07
FF 00 00 00		#FF 00 01 00
00 00 00 80		Some Offset = null
00 00 00 80		#Offset to model collision (plane or planes for buildings, model for others)
00 00 00 00		#4 bytes #1=PF planes to render (green) #2= 01=render all volumes 02=render all volumes + nm sphere? #3= Pathfinder blocker size(max:128x128) #4= unknown
48 AF 10 BF		BoundingBoxMinX = -0.565175
FB 41 7E BF		BoundingBoxMinY = -0.993194
64 B8 37 BE		BoundingBoxMinZ = -0.179414
4A AF 90 3F		BoundingBoxMaxX = 1.13035
DA B5 FD 3F		BoundingBoxMaxY = 1.98211
57 E6 E1 3E		BoundingBoxMaxZ = 0.44121
10 FE 00 00		#Offset to next model
03 00 00 00		#Animations count

From 0x0001002C to 0x0001007F (0x54 = 84 bytes) Char (bothriolepis)
From 0x00010080 to 0x000100D3 (0x54 = 84 bytes) Char (dunkleosteus)
From 0x000100D4 to 0x00010127 (0x54 = 84 bytes) Anim (henodus)
From 0x00010128 to 0x0001017B (0x54 = 84 bytes) Anim (quetzalcoatlus)
From 0x0001017C to 0x000101CF (0x54 = 84 bytes) Char (quetzalcoatlus_boden)


0x000101D0		ANIMATIONS_CLASSES_TABLE
43 68 61 72		"Char" animation class name almost always corresponds model class name
30 01 00 00		Offset to animation = 0x000101D4 + 130 = 0x00010304
74 04 00 00		MeshDefPointersTableAddress
01 00 00 00		MeshDefCount = 1
00 00 00 80		MaterialsDefsAddress = null #see test_objects.gsf dissection.txt
01 00 00 00		MaterialsDefsCount = 1
0A 00 00 00		Anim frames count = 10

From 0x000101D0 to 0x000101EB (0x1C = 28 bytes) Char 
From 0x000101EC to 0x00010207 (0x1C = 28 bytes) 00 00 00 00 (Yes, this is the class name)
From 0x00010208 to 0x00010223 (0x1C = 28 bytes) Char 
From 0x00010224 to 0x0001023F (0x1C = 28 bytes) Char 
From 0x00010240 to 0x0001025B (0x1C = 28 bytes) Char 
From 0x0001025C to 0x00010277 (0x1C = 28 bytes) Char 
From 0x00010278 to 0x00010293 (0x1C = 28 bytes) Anim 
From 0x00010294 to 0x000102AF (0x1C = 28 bytes) 00 00 00 00 (And this is too) 
From 0x000102B0 to 0x000102CB (0x1C = 28 bytes) Anim 
From 0x000102CC to 0x000102E7 (0x1C = 28 bytes) Char 
From 0x000102E8 to 0x00010303 (0x1C = 28 bytes) Anim 


0x00010304		ANIMATION (Anim can support scaling, or may not)
01 00 00 00		StringsCount = 1
14 00 00 00		#MaxCharsCount in anim name. If the name is more or equal 14 characters, then 24 00 00 00   (14=20)
08 00 00 00		CharsCount = 8
48 65 6C 70 65 72 30 31		"Helper01"

00 00 00 00 00 00 00 00 00 00 00 00 #Padding (MaxCharsCount)
05 00 00 40		ChunkType = 0x40000005
00 00 00 00		Attributes
5B F9 F4 16		Guid = 0x16F4F95B
00 00 00 80		
FF FF FF FF		#short2 - short1 = How many frames from the first should be played to loop walk anim (eg if 0A 00 32 00 then 32 - A = 28 = 40 frames)
00 00 80 BF		
00 00 01 00		
1C 00 00 00		DataChunkAddress = 0x00010340 + 0x001C = 0x0001035C
A8 01 00 00		NextHeaderAddress = 0x00010344 + 0x01A8 = 0x000104EC
01 00 00 00		NextHeadersCount = 1
0A 00 00 00		TransformationsCount = 10
00 00 00 00		#float. Change the speed or hell knows what idk how to describe
00 00 00 00		#float
00 00 00 00		#float

0x0001035C		ANIMATION_DATA	(Helper01)
From 0x0001035C to 0x0001064F

40 bytes * 10 transformations = 400 bytes = 0x0190 up to 0x000104EB #model position in the world

0x000104EC		Header
01 02 01 00		
0C 00 00 00		DataChunkAddress = 0x000104F0 + 0x000C = 0x000104FC
A8 00 00 00		NextHeaderAddress = 0x000104F4 + 0x00A8 = 0x0001059C
01 00 00 00		NextHeadersCount = 1
From 0x000104FC to 0x0001059B #mesh1 transformations
02 02 00 00
0C 00 00 00
00 00 00 80
00 00 00 00
00 00 00 00
00 00 00 00
00 00 C0 A0		#maybe 105BB - 104FC = C0  1065B - 105BC = A0
00 00 80 3F
From 0x000105BC to 0x00010647 #mesh2 transformations
00 00 80 3F
D8 FC FF FF		#0x0001064C - 808 = 0x00010324 Offset to animation start

next ANIMATION+ANIMATION_DATA	(Helper01)
From 0x00010650 to 0x00011F73

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x00011F74 to 0x000130A7

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x00011F74 to 0x00013C8B

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x00013C8C to 0x000145C7

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x000145C8 to 0x0001470B

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x0001470C to 0x000147E7

next ANIMATION+ANIMATION_DATA	(Helper01)
From 0x000147E8 to 0x00015B1B

next ANIMATION+ANIMATION_DATA	(Dunkleosteus_helper)
From 0x00015B1C to 0x0001719F

next ANIMATION+ANIMATION_DATA	(Helper01)
From 0x000171A0 to 0x000190D3

next ANIMATION+ANIMATION_DATA	(Henodus_Helper)
From 0x000190D4 to 0x000195A7


0x000195A8		BOTHRIOLEPIS_MODEL
From 0x000195A8 to 0x0001A057 (including 3 bytes padding after model data)


0x0001A058		USED_MATERIALS_TABLE
A8 5F FF FF		ContentsTableOffset
C4 5F FF FF		MaterialsHeaderOffset
0C 00 00 00		Type = 12
01 00 00 00		MaterialsCount = 1
01 00 00 00		
00 00 00 00		AdditionalMaterialIndex1 = 0 (Additional effects)
00 00 00 00		AdditionalMaterialIndex2 = 0 (Textures with alpha channel)


0x0001FE68		OBJECT_NAME_OFFSET
01 00 00 00		StringsCount = 1
14 00 00 00		#MaxCharsCount in model name. If the name is more or equal 14 characters, then 24 00 00 00
0C 00 00 00		CharsCount = 12
62 6F 74 68 72 69 6F 6C 65 70 69 73		"bothriolepis"
00 00 00 00 00 00 00 00					Padding
Each vertex stores 8 bytes (64 bits) in the table of vertices, but just the first 39 bits (0-12 for x, 13 to-25 for y, 26-38 for z) are used for the vertex coordinates
bits 0-12: x
bits 13-25: y
bits 26-38: z
bits 39-47: normals (nx ny nz)
bits 48-55: u
bits 56-63: v
PW vertex data to .obj.txt
by BSM
(2.27 KiB) Downloaded 10 times
test_objects.gsf dissection.txt
Completely dissected test_objects.gsf
(10.62 KiB) Downloaded 13 times
Last update: 09.04.2018
To be continued...
Attachments
PW vertex data to .obj.txt
by BSM
(2.27 KiB) Downloaded 13 times
Last edited by DryFun on Mon Apr 09, 2018 14:18 pm, edited 3 times in total.
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Sun Mar 18, 2018 8:41 am

Let's say that we have almost everything for simple vetrex and triangles unpacker
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Sat Mar 24, 2018 9:42 am

Somebody say something
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
Scrat
- Mod -
Posts: 14035
Joined: Sat Jul 14, 2007 15:44 pm
Location: Seldwyla
Contact:

Re: GSF dissection

Post by Scrat » Sat Mar 24, 2018 10:12 am

hi :)

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Sat Mar 24, 2018 13:36 pm

I asked for it myself ...
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Sat Mar 24, 2018 19:30 pm

Anybody want to help me with the c# code?
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
AnthonyCole
- Admin -
Posts: 1985
Joined: Sat Apr 18, 2009 14:17 pm

Re: GSF dissection

Post by AnthonyCole » Wed Mar 28, 2018 15:47 pm

What do you need help with?

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Sun Apr 01, 2018 13:08 pm

There are some problems with unpacking
One of the coordinates (z) doesnt change for some reason

(Allo model)
front.jpg
front.jpg (75.94 KiB) Viewed 269 times
top.jpg
top.jpg (53.02 KiB) Viewed 269 times
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Tue Apr 03, 2018 10:35 am

Found pathfinder blocker size scale factor
Now we can fix the seas buildings
scr_20180403_142829.jpg
scr_20180403_142829.jpg (237.32 KiB) Viewed 252 times
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
AnthonyCole
- Admin -
Posts: 1985
Joined: Sat Apr 18, 2009 14:17 pm

Re: GSF dissection

Post by AnthonyCole » Mon Apr 09, 2018 7:47 am

Cool! It's defined in the GSF? So we would have to include a "copy&patcher" or redistribute the fixed GSF files in the mods?

User avatar
Scrat
- Mod -
Posts: 14035
Joined: Sat Jul 14, 2007 15:44 pm
Location: Seldwyla
Contact:

Re: GSF dissection

Post by Scrat » Mon Apr 09, 2018 8:04 am

absolutely awesome :shock: finally!

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Mon Apr 09, 2018 14:14 pm

It is a bad idea
I could do so that the buildings couldnt be built close together but it will break pathfinder blocker
And I think we cant add a blocker to models that dont have it

If I try to change pf blocker size the game is almost always crashes Urs.Server.Pathfinder ERROR:PF Blocker 'hu_fireplace_0' too large [3.713e+013 1.701e+038]! (max:128x128) even if change only 00 to 01 Urs.Server.Pathfinder ERROR:PF Blocker 'hu_fireplace_1' too large [1.#IO 1.#IO]! (max:128x128)
Last edited by DryFun on Mon Apr 09, 2018 14:20 pm, edited 1 time in total.
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Mon Apr 09, 2018 14:16 pm

From the good news:
We solved the problem with z coord and textures
flxdpCDvXCA.jpg
flxdpCDvXCA.jpg (224.62 KiB) Viewed 194 times
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Fri Apr 20, 2018 12:11 pm

I can change the position and size of existing pf blockers
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

User avatar
Scrat
- Mod -
Posts: 14035
Joined: Sat Jul 14, 2007 15:44 pm
Location: Seldwyla
Contact:

Re: GSF dissection

Post by Scrat » Mon Apr 23, 2018 12:17 pm

which means we can rescale the size of seas building grounds, and the blocking properties accordingly?

User avatar
DryFun
- Dragon Clan -
- Dragon Clan -
Posts: 128
Joined: Tue Mar 24, 2015 14:53 pm
Contact:

Re: GSF dissection

Post by DryFun » Mon Apr 23, 2018 12:42 pm

I dont think that we should change anything, except for the seas big cannon.But it's already completed
Image
Image
Image
Image
Image
Image
Image
still alive
still without devtools

Post Reply

Return to “GSF Modding”