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 82 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 5, 2016, 19:53 Post #1
So, after 8 years of not touching my old mod stuff, I decided to get back into it a little.

As a start, I'm working on figuring out the binary specification of these maps.
If anyone has more info, let me know.


Begin Procedure "EntryPoint"

Begin with little endian 0xd4bada55
The next byte represents a version. For whatever reason this must be between 0x28 and 0xc8
The next 23 bytes are a mystery.
Result of "GetText" is the map name.
The next 2 bytes should be 0, mystery.
Result of "GetTextArray" (0) is the list of textures needed in this map.
Result of "GetTextArray" (1) is the list of character models in this map?
Discard result of "ConsumePadding"
Result of "GetTextArray" (2) is the list of animations or animatable models in this map.
Discard result of "ConsumePadding"
Result of "GetTextArray" (3) is the list of static models in this map.
Discard result of "ConsumePadding"
Result of "GetTextArray" (4) is the list of effects used in this map.

Discard remainder, currently a mystery.

End Procedure

Begin Procedure "GetText"
Take little endian word 16, this is the "length" of the text / string.
Take N bytes, where N is the "length".
Return Bytes as string.
End Procedure

Begin Procedure "GetTextArray" with parameter "position"
The next byte should be equal to "position"
The next byte should be 0x70.
The next 6 bytes are a mystery.
Take little endian word 16, this is the "count" of elements in the array.
Let "results" be "GetText" replicated "count" times.
Return "results"
End Procedure

Begin Procedure "ConsumePadding"
Note: I don't know what this padding seems to be for, but between some of the text arrays, there seems to be variable
Note: padding that I cannot yet see a reason for.
Note: Usually the data looks like 0x0100 0000 0100 0000 0300 0000 ...

Peek at the next little endian word 16, as "test"
If "test" is < 16 Then
consume word16
The next word 16 should be 0.
Recurse "ConsumePadding"
End If
End Procedure


It doesn't help that I'm trying to do this on a mac, RED and REDPF don't work well in wine. (The left side goes black)
Win10 doesn't seem to be able to start the map from either RED or REDPF for making a couple basic maps.
That and Microsoft with its love for chm files, doesn't seem to have a KB installer for help support. And I dun know the short cuts :sp:
Edited by Cordite at June 5, 2016, 19:59

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

likes this
(Y)

Posted: June 6, 2016, 0:09 Post #2
what exactly are you trying to do?

shortcuts for redpf? rfrun.net has a list but its been in "maintenance" for weeks

"Win10 doesn't seem to be able to start the map from either RED or REDPF for making a couple basic maps"
you can't load any of the maps? what does the error say
Edited by N/A at June 6, 2016, 0:11

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

likes this
(Y)

Posted: June 6, 2016, 2:02 Post #3
Quoting Haze202
what exactly are you trying to do?

Don't quite know yet, guess I'm doing it for the funs right now.


Quoting Haze202
"Win10 doesn't seem to be able to start the map from either RED or REDPF for making a couple basic maps"
you can't load any of the maps? what does the error say


So, REDPF opens up purefaction in windowed mode, but doesn't do anything special, it opens up to the main menu.

RED however opens up RF, and then it displays
"Couldn't load level <my map name>.rfl
Couldn't open level file"

I am using RedFaction from steam, so the file path to RF has spaces in it. Not sure if this is an issue. I've tried to save to a path without spaces, and this has identical behavior.

Note: I am running all RF related apps in compatibility for XP SP2


---

In the mean time, I did learn one of the words in the map file in the mystery section is a unix timestamp.

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

likes this
(Y)

Posted: June 6, 2016, 2:27 Post #4
you need to have your rf folder at
C:\games\RedFaction\user_maps\single
and save your rfl files in single folder

yeah but what is this binary stuff? what can you achieve with this? can you code? ive never seen anything like it
Edited by N/A at June 6, 2016, 2:30

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

likes this
(Y)

Posted: June 6, 2016, 3:32 Post #5
Quoting Haze202
you need to have your rf folder at
C:\games\RedFaction\user_maps\single
and save your rfl files in single folder

yeah but what is this binary stuff? what can you achieve with this? can you code? ive never seen anything like it


Looks like that worked, and the steam version isn't against copying.

Yes, I can code, I'm testing with codes.

The binary is the .rfl stuffs.

Right now, this is what I'm getting out.
RedMap {mapName = "No Level Name", mapVersion = 200, mapTextures = ["glowball.tga"], mapBodyModels = ["miner.vcm"], mapAnimations = ["miner_corpse_carry.mvf","miner_dead.mvf","miner_talk.mvf","miner_talk_short.mvf","park_Death_crouch.mvf","park_Death_head_backwards.mvf","park_HG_crouch_walk.mvf","park_jeep_driver.mvf","park_jeep_gunner.mvf","park_run.mvf","park_run_flail.mvf","park_swim_stand.mvf","park_swim_walk.mvf","ult2_attack_crouch01.mvf","ult2_attack_run.mvf","ult2_attack_stand.mvf","ult2_attack_walk.mvf","ult2_corpse_drop.mvf","ult2_corpsecarry_stand.mvf","ult2_corpsecarry_walk.mvf","ult2_cower.mvf","ult2_crouch.mvf","ult2_Death_blast_forwards.mvf","ult2_Death_chest_backward.mvf","ult2_Death_chest_forward.mvf","ult2_Death_Generic.mvf","ult2_Death_head_forwards.mvf","ult2_Death_leg_Left.mvf","ult2_Death_leg_Right.mvf","ult2_draw.mvf","ult2_firing_crouch.mvf","ult2_firing_stand.mvf","Ult2_flee_run.mvf","ult2_flinch_astand.mvf","Ult2_Flinch_ChestB.mvf","Ult2_Flinch_ChestF.mvf","Ult2_Flinch_LegL.mvf","Ult2_Flinch_LegR.mvf","ult2_flinch_stand.mvf","ult2_idle_HitHead.mvf","ult2_jump.mvf","ult2_reload.mvf","ult2_silencer.mvf","ult2_stand.mvf","ult2_walk.mvf"], mapStaticModels = ["powerup_flamecan.V3D","Weapon_Aslt_Rifle2.V3D","weapon_fthrower.v3d","weapon_grenade.v3d","weapon_heavymgun.v3d","weapon_machinep.v3d","weapon_railrifle.v3d","weapon_riotshield.v3d","weapon_riotstick.v3d","Weapon_RocketLauncher.v3d","weapon_shotgun.v3d","Weapon_shoulder.v3d","Weapon_SniperRifle.v3d","weapon_ultorgun.v3d"], mapEffects = ["DrillMissile01.VFX","ShellTest.vfx"]}
Edited by Cordite at June 6, 2016, 3:56

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

likes this
(Y)

Posted: June 6, 2016, 4:27 Post #6
how good is your coding ability? say for example would you be capable of recreating pf, and what languages can you code in
Edited by N/A at June 6, 2016, 4:29

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

likes this
(Y)

Posted: June 6, 2016, 4:49 Post #7
Quoting Haze202
how good is your coding ability? say for example would you be capable of recreating pf, and what languages can you code in


I've been coding for over half of my life.
My occupation is in software development.

I suppose recreating something like PF is a possible outcome, but not a grand scale for what I am aiming for... Considering I don't quite know what I am aiming for.

This originally stemmed from trying to figure out which story dialog files aren't actually used in the game.

As for languages, many. Not just C, C++, and so on.
Though right now I'm writing my decoder in Haskell.

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

likes this
(Y)

Posted: June 6, 2016, 5:59 Post #8
do you have skype

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

likes this
(Y)

Posted: June 6, 2016, 12:16 Post #9
Quoting Haze202
do you have skype

I do. Check PM for details.

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

likes this
(Y)

Posted: June 8, 2016, 3:35 Post #10
After staring at this for half an hour, I realized that some of the data after the default map settings were indexes into which texture to use.

Posted Image


Testing seems to have confirmed that hypothesis,

However it appears that using "apply map" changes waaaay more than just info on that texture.
Will play with UV mapping and see how that goes next.

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

likes this
(Y)

Posted: June 8, 2016, 7:20 Post #11
improve UV light texture res :124:

P.S. Most of that stuff was figured out 5 years ago in OpenFaction. Infact even earlier, I did some basic stuff 8 years ago with my basic map loader

For one example from OpenFaction, look at some this code
Edited by N/A at June 8, 2016, 7:44

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

likes this
(Y)

Posted: June 8, 2016, 10:02 Post #12
Quoting 2kool4skool
improve UV light texture res :124:

P.S. Most of that stuff was figured out 5 years ago in OpenFaction. Infact even earlier, I did some basic stuff 8 years ago with my basic map loader

For one example from OpenFaction, look at some this code


This is why I am posting, to make my life easier maybe :P

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

likes this
(Y)

Posted: June 11, 2016, 22:52 Post #13
Check this. It has some errors and is missing some data but it's a good starting point
https://raw.githubusercontent.com/rafalh/openfaction/master/include/rfl_format.h

nvm helps if i read the thread

Friend & i worked on top of it for a while and there are a few errors in that version and some other stuff that wasn't included. Been saying this for a year or more but I need to get my code converted into documentation.

s o o n




ok i found some of the horrible shit i put down
groups
ambient sounds
geo regions
our main problem was with the brush stuff, it would break on some maps
and i think the gist of fixing it was as follows:
in openfaction struct rfl_brush_t
after unknown3, for 1 -> unknown3 (as in, if unknown3 is 0 then do nothing further):
skip 4 + (0x15*4) + 8 bytes


hth
Edited by Mitzi at June 12, 2016, 4:18

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

likes this
(Y)

Posted: June 12, 2016, 18:30 Post #14
Thanks digi, I hope to incorporate this information as soon as I get deeper into it.

I spent several hours translating the RFL data structure as defined in openfaction's link into my own stuff.
That is, I made the data structures, but not necessarily all the parsers yet.

So far here's the anatomy of a basic test case (one brush room).

RFL
{rflHeader = RFLHeader {rflVersion = 200, rflUnixTimestamp = 3698, rflOffsetPlayerStart = 2614, rflOffsetLevelInfo = 2694, rflSectionsCount = 13, rflUnknown = 3698, rflLevelName = "No Level NameX", rflModName = ""}
, rflSections =
[RFLSectionHeader {rflSectionType = RFLTGAList, rflSectionLength = 18}
,RFLSectionHeader {rflSectionType = RFLVCMList, rflSectionLength = 19}
,RFLSectionHeader {rflSectionType = RFLMVFList, rflSectionLength = 1184}
,RFLSectionHeader {rflSectionType = RFLV3DList, rflSectionLength = 370}
,RFLSectionHeader {rflSectionType = RFLVFXList, rflSectionLength = 47}
,RFLSectionHeader {rflSectionType = RFLLevelProperties, rflSectionLength = 33}
,RFLSectionHeader {rflSectionType = RFLStaticGeo, rflSectionLength = 829}
,RFLSectionHeader {rflSectionType = RFLUnknown, rflSectionLength = 4}
,RFLSectionHeader {rflSectionType = RFLPlayerStart, rflSectionLength = 48}
,RFLSectionHeader {rflSectionType = RFLUnknown, rflSectionLength = 4}
,RFLSectionHeader {rflSectionType = RFLNavPoints, rflSectionLength = 4}
,RFLSectionHeader {rflSectionType = RFLLevelInfo, rflSectionLength = 291}
,RFLSectionHeader {rflSectionType = RFLBrushes, rflSectionLength = 847}
,RFLSectionHeader {rflSectionType = RFLEnd, rflSectionLength = 0}
]
}


Next I will be adding parsing for the respective sections of interest.
Edited by Cordite at June 12, 2016, 18:38

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

likes this
(Y)

Posted: June 12, 2016, 22:31 Post #15
Made progress with static geometry.

Again, for my basic 1-brush test case map.


(RFLSectionHeader{
rflSectionType = RFLStaticGeo,
rflSectionLength = 829
},
RFLSectSG (RFLSectionRooms{
rflSectRoomUnknownArr2A = "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL",
rflSectRoomTextureCount = 1,
rflSectRoomTextures = [
"Rck_Defaula"
],
rflSectRoomScrollCount = 0,
rflSectRoomScrolls =[],
rflSectRoomRoomCount = 1,
rflSectRoomRooms = [
RF
rflRoomID = 2147483646,
rflRoomAABB = RFAABB {
rfaabbMin = RFV3 {
rfV3x = -2.0001,
rfV3y = -2.0001,
rfV3z = -2.0001
},
rfaabbMax = RFV3 {
rfV3x = 2.0001,
rfV3y = 2.0001,
rfV3z = 2.0001
}
},
rflRoomIsSkyRoom = 0,
rflRoomIsCold = 0,
rflRoomIsOutside = 0,
rflRoomIsAirlock = 0,
rflRoomIsLiquid = 0,
rflRoomIsAmbientLight = 0,
rflRoomIsSubroom = 0,
rflRoomUnknown = 0,
rflRoomLife = -1.0,
rflRoomEaxEffect = "",
rflRoomProperties = RFLRoomPropertiesNone
}
],
rflSectRoomMeshCount = 1,
rflSectRoomMeshes = [
RFLSectionRMeshLi{
rflSectRoomMeshID = 0,
rflSectRoomMeshLinkCount = 0,
rflSectRoomMeshLinks = [
]
}
],
rflSectRoomUnknownCount2 = 0,
rflSectRoomUnknownArr2B = "",
rflSectRoomVertexCount = 8,
rflSectRoomVertexes = [
rfV3x = -2.0,
rfV3y = 2.0,
rfV3z = 2.0
},
RF{
rfV3x = -2.0,
rfV3y = -2.0,
rfV3z = 2.0
},
RF{
rfV3x = -2.0,
rfV3y = -2.0,
rfV3z = -2.0
},
RF{
rfV3x = -2.0,
rfV3y = 2.0,
rfV3z = -2.0
},
RF{
rfV3x = 2.0,
rfV3y = -2.0,
rfV3z = 2.0
},
RF{
rfV3x = 2.0,
rfV3y = 2.0,
rfV3z = 2.0
},
RF{
rfV3x = 2.0,
rfV3y = -2.0,
rfV3z = -2.0
},
RF{
rfV3x = 2.0,
rfV3y = 2.0,
rfV3z = -2.0
}
],
rflSectRoomFaceCount = 6,
rflSectRoomFaces = [
RF
rflFaceNormal = RFV4 {
rfV4x = 0.0,
rfV4y = 1.0,
rfV4z = 0.0,
rfV4w = 2.0
},
rflFaceTextureID = 0,
rflFaceUnknown1 = 4294967295,
rflFaceUnknown2 = 0,
rflFaceUnknownArr8 = "\255\255\255\255\255\255\255\255",
rflFaceUnknown3 = 0,
rflFaceFlags = RFLFFNone,
rflFaceLightRes = 1,
rflFaceUnknownArr6 = "\NUL\NUL\NUL\NUL\NUL\NUL",
rflFaceRoomIndex = 0,
rflFaceVertexCount = 4,
rflFaceVertexes = [
RFLVertex {
rflVIndex = 2,
rflTexUV = RFUV {
rflu = -2.0,
rflv = -2.0
},
rflLightUV = Nothing
},
RFLVertex {
rflVIndex = 1,
rflTexUV = RFUV {
rflu = -2.0,
rflv = 2.0
},
rflLightUV = Nothing
},
RFLVertex {
rflVIndex = 4,
rflTexUV = RFUV {
rflu = 2.0,
rflv = 2.0
},
rflLightUV = Nothing
},
RFLVertex {
rflVIndex = 6,
rflTexUV = RFUV {
rflu = 2.0,
rflv = -2.0
},
rflLightUV = Nothing
}
]
},
<TRUNCATED>
rflSectRoomLightmapCount = 0,
rflSectRoomLightmaps = [],
rflSectRoomUnknown3 = Nothing
}))


Truncated so it isn't 40 pages long. (exaggeration) :lolpup:
Edited by Cordite at June 12, 2016, 22:32

Users Avatar
ice
Posts: 134
Joined: November 11, 2010, 5:03

likes this
(Y)

Posted: June 12, 2016, 23:54 Post #16
Been following this thread for the last few days, Not quite sure what your happening, but it sounds exciting.

NukeTown For RF bra!

Visit RFrun.net for Deathrun Related things!
Users Avatar
Cordite
Posts: 60
Joined: June 5, 2016, 19:21

likes this
(Y)

Posted: June 12, 2016, 23:55 Post #17
Wooohooo, got enough done to parse my basic test case. :D

Though when try on L1S1, I has problems ;dd


Rooms have 16 textures
There are 54 rooms
There are 54 meshes
There are 859953487 vertexes
Returning
*** Exception: endOfInput


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