Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 1:00 pm
All times are UTC + 0
Writing CSF files
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 7:20 am    Post subject:  Writing CSF files Reply with quote  Mark this post and the followings unread

Hi guys,

Anyone ever try to write a RA2/YR string table?
Well, I am!

With some help from AlexB I'm working on the code needed to write such a file.
I've taken Olaf's XCC code and looked at how he writes CSF files.

This is his code, for the sake of syntax highlighting I have created a paste of it: http://pastebin.com/H7Wz4hVe
This is the code I have: http://pastebin.com/uPBShnKw (ugly, because trial and error)
Note: writeToOfstream is a template, taking the data type of the passed value.
As you can see, there's no real difference in code. Olaf's does not seem to encode the value's wstring, but I could be wrong.
But somehow, mine breaks the format and causes the world to crash.

So I tried writing ra2.csf and I get a different file size than the original, straight from the MIX, CSF file.
Funny thing is, XCC also has a different file size. So there's 3 files, with 3 sizes.
I'm wondering, does anyone have experience writing these? Care to share some of the knowledge?

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Last edited by RP on Wed Feb 03, 2016 2:36 pm; edited 1 time in total

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Wed Feb 03, 2016 10:13 am    Post subject: Reply with quote  Mark this post and the followings unread


_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 2:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Alright, I got it to work.
There were some unknowns about writing empty values which is now fixed.


_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Wed Feb 03, 2016 9:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can you round trip an original csf file? Load an original from the game and save an identical one out?

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Feb 03, 2016 10:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

That I cannot. I don't know what the game does when saving such a file.
I can create a working string table like XCC produces, but that's it.

I use a map, the game's CSF is not ordered. So you cannot get an identical file.
I'm not going to use an unordered map because it's slower and goes directly against the principle of a map which is... being about sorted.
Does it have to be identical? I mean, if it creates a working string table without loss of quality, then what's the problem?

Is this btw the point where you say, "but I can Razz " ? xD

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Thu Feb 04, 2016 8:37 am    Post subject: Reply with quote  Mark this post and the followings unread

No, no rabbits out of the hat like that Wink

If its just the order that is different then it shouldn't matter, so long as the individual entries in the files are the same. I'm just mindful that "it works" and "it works optimally" aren't always the same thing, plus I like trying to figure out exactly how the original generators worked.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Thu Feb 04, 2016 9:02 am    Post subject: Reply with quote  Mark this post and the followings unread

True, if the data is correct, all is fine.
So far it works and it works optimally, haven't run into any issues.

I'm curious as well. They probably just entered them manually in the editor or some tool, which wrote them unsorted to the file.
Wouldn't be surprised if they did not have the option to add ExtraValue at all.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Thu Feb 04, 2016 9:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Matthias Wagner (IIRC) made the first string editor RA2StrEdit, if your interested TibEd also comes with a string editor...

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1425s ][ Queries: 11 (0.0071s) ][ Debug on ]