FF Logo
Hello Guest | Login | Register
Join us on Discord!
Latest reviews
· RF1 Russian Translation Pac... 
Reviewed by Uzbek

· Crook$ And C@stles 
Reviewed by MysticaL-AceR

· RFU5 - Midwich V5 
Reviewed by dvl_iac

· Br@in$can 
Reviewed by dvl_iac

· DM_C@nnonBaLLzZz 
Reviewed by dvl_iac

· Halloween Pumpkins 1.1 
Reviewed by dvl_iac

· RF Manor 
Reviewed by kerpal

· WMP-Rocky Horror 
Reviewed by kerpal

· RFU5 - Midwich V5 
Reviewed by kerpal

· Catacomb 
Reviewed by Mikelice

· Cyrus Cio Park 2 
Reviewed by Mikelice

· SWA Ghost House 
Reviewed by Mikelice

· WMP-Rocky Horror 
Reviewed by Mikelice

· RFU5 - Midwich V5 
Reviewed by Mikelice

· Ascension Reg 
Reviewed by Mikelice

Who's online?
0 users and 152 guests
The FactionFiles forums are archived. Please join the community on our Discord for all Red Faction discussions.
Pages: [1 2 3 4 5]
Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 1:45 Post #18
Digi, I ran into that very exact issue that you described, though your solution wasn't working.

I then wrote a thing to brute force, and when it went too far, it would see if "tga" was mentioned, since that meant we probably overlapped.
I had to do this because it turns out, it is not a constant amount.

However, it seems that it is related to unknown1.
After parsing life, and the next unknown, I needed to take 96 * unknown1. This suggests a set of 24 words for every count mentioned in unknown1.

Looks like next I got light map data, though I'll just drop / skip that data for now.

Users Avatar
Mitzi
Posts: 400
Joined: September 11, 2009, 17:01

likes this
(Y)

Posted: June 13, 2016, 4:24 Post #19
here is my actual code, it's a mess and is in php. this is directly after the faces part of the brush

$brushunk3 = $this->vfunpack(TYPE_UINT32);
//echo("got unk3 $brushunk3\n");
for ($j=1;$j<=$brushunk3;++$j) {
$this->vfseek(4); //skip the unk3help, we set it manually below because it seems to be W R O N G
$unk3help = 0x15; //$this->vfunpack(TYPE_UINT32);
$this->vfseek(4*$unk3help);
$this->vfseek(8); //small float and 0xffffffff
}
$brush['flags'] = $this->vfunpack(TYPE_UINT32);
$brush['life'] = $this->vfunpack(TYPE_UINT32);
$this->vfseek(4); //unk4

IIRC this worked on every map i tried it on (dozens)

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 4:29 Post #20
This may change things.

So you are reading the big chunk immediately after that unknown, not after life, etc.?

I'll have to try it out later to see how it goes.

Users Avatar
Mitzi
Posts: 400
Joined: September 11, 2009, 17:01

likes this
(Y)

Posted: June 13, 2016, 4:34 Post #21
Yeah. Just to be sure, I'm talking about the brush section, not static geometry or anything else

Easiest thing to do is probably just check the UIDs as you go along and make sure they stay sane. If it suddenly gives you a ridiculous number then you know something is wrong

Users Avatar
Mitzi
Posts: 400
Joined: September 11, 2009, 17:01

likes this
(Y)

Posted: June 13, 2016, 4:44 Post #22
Ok so mine doesn't work on L1S1 (and i'm guessing other single player maps as well). Different version

One map I used to test was pdm_DemonRun2_part1.rfl specifically because it was one that broke the brush parsing.

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 10:42 Post #23
Quoting Mitzi
One map I used to test was pdm_DemonRun2_part1.rfl specifically because it was one that broke the brush parsing.


Would you kindly link to it?

I'm guessing you wrote a parser in PHP for the files uploaded here?

Users Avatar
Mitzi
Posts: 400
Joined: September 11, 2009, 17:01

likes this
(Y)

Posted: June 13, 2016, 14:29 Post #24
https://www.factionfiles.com/ff.php?action=file&id=3138

Yup it was for an unfinished project for here

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 22:47 Post #25
I hit the problem indeed.

Now to investigate..


Un2: 0x00002
Brush has ID: 29718
Brush has 1 textures
Brush textures: ["metal plate floor ext.tga"]
Brush has 8 vertexes
Brush has 6 faces
Un1: 0x00006
Un2: 0x00002
Brush has ID: 29719
Brush has 1 textures
Brush textures: ["metal plate floor ext.tga"]
Brush has 8 vertexes
Brush has 6 faces
Un1: 0x00006
Un2: 0x00002
Brush has ID: 29747
Brush has 1 textures
Brush textures: ["metal plate floor ext.tga"]
Brush has 3419 vertexes
Brush has 4294967295 faces
Face reports 1056125744 vertexes. This is probably bad.
Returning
*** Exception: endOfInput


And can someone adjust the teletype double-line thing? It seems silly.

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 23:03 Post #26
So, the take 16 bytes part, appears to be different here. BUH WHAIH

Brush UA2: "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL"
Brush UA2: 00000000000000000000000000000000
Brush has 8 vertexes
Brush has 6 faces
Un1: 0x00006
Un2: 0x00002
Brush has ID: 29719
Brush has 1 textures
Brush textures: ["metal plate floor ext.tga"]
Brush UA2: "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL"
Brush UA2: 00000000000000000000000000000000
Brush has 8 vertexes
Brush has 6 faces
Un1: 0x00006
Un2: 0x00002
Brush has ID: 29747
Brush has 1 textures
Brush textures: ["metal plate floor ext.tga"]
Brush UA2: "\ACK\NUL\NUL\NULZ\r\NUL\NUL\n\215#<\NUL\NUL\NUL\NUL"
Brush UA2: 060000005a0d00000ad7233c00000000
Brush has 3419 vertexes
Brush has 4294967295 faces
Face reports 1056125744 vertexes. This is probably bad.
Returning
*** Exception: endOfInput

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 13, 2016, 23:34 Post #27
It looks like this UA2 which normally is just a bunch of 0's, is supposed to be a list (BUH WHAIH)

I have to consume 84 bytes after the count.

06 00 00 00 5A 0D 00 00 0A D7 23 3C 00 00 00 00 5B 0D 00 00 0A D7 23 3C 00 00 00 00 5C 0D 00 00 0A D7 23 3C 00 00 00 00 5D 0D 00 00 0A D7 23 3C 00 00 00 00 5E 0D 00 00 0A D7 23 3C 00 00 00 00 5F 0D 00 00 0A D7 23 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


However.. this is only one of the cases, if I just do (count) * 14, it solves that one, but fails later.

This next one has a count of 8.
Though it wants 108 bytes.

08 00 00 00 8A 17 00 00 00 00 00 00 33 33 B3 BF 8B 17 00 00 00 00 00 00 33 33 B3 BF 8C 17 00 00 00 00 00 00 33 33 B3 BF 8D 17 00 00 00 00 00 00 33 33 B3 BF 86 17 00 00 00 00 00 00 33 33 B3 BF 87 17 00 00 00 00 00 00 33 33 B3 BF 88 17 00 00 00 00 00 00 33 33 B3 BF 89 17 00 00 00 00 00 00 33 33 B3 BF 00 00 00 00 00 00 00 00 00 00 00 00


Aaah, to find the magic equation that converts 6 to 84, and 8 to 108.

And with some brute force magic, I get 12 * count + 12
[(i,j) | i <- [0..64], j <- [0..64], 6 * i + j == 84, 8 * i + j == 108]

Which actually seems clean, as I would otherwise take 12 bytes for the unknown array.

And beeeeeewwwwm, that difficult map parses with the brushes. :00:

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 14, 2016, 0:05 Post #28
Inspecting this extra data suggests that these are all floats.

Purpose, not known :D


Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 14, 2016, 1:55 Post #29
Here are the sections I have left to parse:

RFLSectionHeader {rflSectionType = RFLLights, rflSectionLength = 23863}
RFLSectionHeader {rflSectionType = RFLCutsceneCameras, rflSectionLength = 265}
RFLSectionHeader {rflSectionType = RFLEvents, rflSectionLength = 9356}
RFLSectionHeader {rflSectionType = RFLUnknown, rflSectionLength = 4}
RFLSectionHeader {rflSectionType = RFLMultiPlayerRespawns, rflSectionLength = 1396}
RFLSectionHeader {rflSectionType = RFLParticleEmitters, rflSectionLength = 3135}
RFLSectionHeader {rflSectionType = RFLDecals, rflSectionLength = 1002}
RFLSectionHeader {rflSectionType = RFLPushRegions, rflSectionLength = 622}
RFLSectionHeader {rflSectionType = RFLRoomEffects, rflSectionLength = 952}
RFLSectionHeader {rflSectionType = RFLUnknown, rflSectionLength = 107}
RFLSectionHeader {rflSectionType = RFLBoltEmitters, rflSectionLength = 3436}
RFLSectionHeader {rflSectionType = RFLTargets, rflSectionLength = 832}
RFLSectionHeader {rflSectionType = RFLMovers, rflSectionLength = 1214317}
RFLSectionHeader {rflSectionType = RFLMovingGroups, rflSectionLength = 67082}
RFLSectionHeader {rflSectionType = RFLPlayerStart, rflSectionLength = 48}
RFLSectionHeader {rflSectionType = RFLUnknown, rflSectionLength = 4}
RFLSectionHeader {rflSectionType = RFLNavPoints, rflSectionLength = 4}
RFLSectionHeader {rflSectionType = RFLItems, rflSectionLength = 3680}
RFLSectionHeader {rflSectionType = RFLClutters, rflSectionLength = 9405}
RFLSectionHeader {rflSectionType = RFLTriggers, rflSectionLength = 7599}
RFLSectionHeader {rflSectionType = RFLGroups, rflSectionLength = 71192}


Triggers, events, and so on will be a challenge.

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 15, 2016, 0:28 Post #30
Looks like Open Faction never documented a structure on player start.
Nor "groups" or "movers" or "moving groups" or "ambient sounds" or "particle emitters" or "decals" or "room effects" or "cutscene cameras".

I guess I'll get to it at some point.

It also seems that my current parser can only handle the version REDPF puts out, so right now I'm using a re-exported level file until I get deep enough to consider multi-version support apart from what is obviously documented in open faction.

Users Avatar
Mitzi
Posts: 400
Joined: September 11, 2009, 17:01

likes this
(Y)

Posted: June 15, 2016, 1:21 Post #31
Check my post on page 1 for groups/movers. BTW nice work in post #27

REDPF is just a hack on top of whatever version of RED came with RF 1.2 so there shouldn't be any actual differences to the format. Not sure if you were referring to other custom maps or the single player files. AFAIK all released versions of RED (were there even other versions besides whatever came with 1.0?) output the same version maps

Also I'll look into turning the TT tag into a more proper code tag
Edited by Mitzi at June 15, 2016, 1:25

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 15, 2016, 13:18 Post #32
Yeah, I think that the count there is a list of Vec3's.

I wasn't sure about the differences of RED and REDPF in terms of export.
But thanks for that info.

Post #13, right? https://www.factionfiles.com/ff.php?action=viewthread&id=717&pageaction=viewpost&post=5042#post5042

It has groups and ambient sounds.

Users Avatar
[Deleted User]
Posts: N/A
Joined: N/A

likes this
(Y)

Posted: June 16, 2016, 8:01 Post #33
Quoting Mitzi
Also I'll look into turning the TT tag into a more proper code tag

Posted Image

Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 18, 2016, 19:55 Post #34
Looks like the openfaction spec for events is totally whack in order and conditionals, gotta reverse it from scratch.

The FactionFiles forums are archived. Please join the community on our Discord for all Red Faction discussions.
Pages: [1 2 3 4 5]

© 2009-2024 FactionFiles