Not logged inOpenClonk Forum
Up Topic General / General / Change file extensions to *.c5?
- - By Clonk-Karl [de] Date 2010-12-29 23:50
As pointed out by Cmdr. Adler in this post in the German forums there are conflicts between CR and OC files. Especially since OC is not meant to replace CR it would be good if they would not get into conflict with each other. So should we change the file extensions of OC files to *.c5?, and what are possible side effects of doing so? I think C4Update does not support renaming files, so we could not provide an update package (though on Windows we can't anyway since the fix to the previous problem requires an updated engine already). Anything else?
Parent - By MimmoO Date 2010-12-29 23:55
I would agree. Since the version is also 5.x, the files should be named after that aswell. The other arguments you mentioned sound also valid.
Parent - - By PeterW [de] Date 2010-12-30 00:04
It should probably be changed to ".oc?", so we don't clash with CX files.
Parent - - By Clonk-Karl [de] Date 2010-12-30 01:29
Well, we also clashed with CX's version number already :)
Parent - By Caesar [de] Date 2011-01-01 21:18
That doesn't mean it makes sense to do that with the file extensions, too.
Parent - - By Günther [de] Date 2010-12-30 00:04
The file format didn't change, though, so using a different extension would be weird. I'd rather make sure that the "Open With" functionality works.
Parent - - By Clonk-Karl [de] Date 2010-12-30 01:29
Is that even possible? How do we know whether to apply a given update to OC or CR? We could guess from the filename but that does not sound very sane to me. Plus things start to break again when CR re-acquires the .c4u registration (does it?).
Parent - - By Günther [de] Date 2010-12-30 02:40
The user would have to choose, obviously. That's what the "open with" functionality is there for: Having multiple applications associated with one file type. Probably requires that OC uses different registry paths but the same file extension. And a different file name for the .desktop file on Linux.
Parent - By Clonk-Karl [de] Date 2010-12-30 16:50
Actually I would prefer it if we kept the mechanism automatic. I think that's also more convenient to players.
Parent - By Fireknight [ch] Date 2010-12-30 18:14
What about changing the version numbers in the c4group header? (offset 28 and 32)
Parent - - By Mortimer [de] Date 2010-12-31 15:35
How about changing the extension of script files while at it? Less conflicts with C source files :)
Parent - - By Mafi [de] Date 2010-12-31 21:58
Yeah, let's change it to .cs for "Clonk-script". :-P
Anyways, I would like to see this change.
Parent - - By Luchs [de] Date 2011-01-01 02:39
.cs wouldn't be much better, as it's already used for C#.
Parent - Date 2011-01-01 12:13
Parent - By MrBeast [de] Date 2011-01-03 05:39 Edited 2011-01-03 05:56
could be good, I just got an error of the opensuse build service because it thinks the .c files are development files. I could easily walkarround that but it shows what such conflicting endings can cause.

>openclonk.x86_64: E: devel-file-in-non-devel-package (Badness: 50) /usr/share/openclonk/planet/Objects.c4d/Items.c4d/Resources.c4d/Ice.c4d/Script.c
>A development file (usually source code) is located in a non-devel package. If you want to include source code in your package, be sure to create a development package.
>(none): E: badness 12800 exceeds threshold 1000, aborting.

Parent - - By Clonk-Karl [de] Date 2011-01-01 16:44
Of course we also need new icons if we do this (at least for the ones that have "c4" on them, such as c4d, c4f, c4g, c4m etc.). There are contained in src/res. Anyone? :)
Parent - - By MimmoO Date 2011-01-01 17:57
i guess thats not the problem. we have enough people who can do this, we should rather decide on an file extension name first, or do we stick to *.c5x now?
Parent - - By Newton [de] Date 2011-01-01 18:23
.oc* would also be an option.
Parent - By bahamada [de] Date 2011-01-01 20:23
I also think that .oc* is very good... the number in the suffix sound a bit cryptic ;)
Parent - By Clonk-Karl [de] Date 2011-01-01 18:34
I don't mind actually. *.c5? was just the first thing that came to my mind, but I am also OK with any other.
Parent - By MimmoO Date 2011-01-01 18:45 Edited 2011-01-01 18:49
i quickly made .c5d, .c5f, .ocd and .ocf (for object and folders, obviously) :

Edit: the C/5 from the folder icons is not red enough, blame the lighting.
Parent - - By MrBeast [de] Date 2011-01-01 18:20
Regarding that replacing C4Groups with Zips is on the (imaginary) todo-list:

Parent - - By bahamada [de] Date 2011-01-01 18:24
changing the magic header should be enough or? So it could keep a extension that is related to clonk...
Like the .jar File for Java which is a Zip file only with a different suffix...
So keep that in mind before moving to a .zip extension... it is basically not necessary to rename...
Parent - - By MrBeast [de] Date 2011-01-01 18:41
Well, .zip would have the advantage that the users could use their regular tools for packing their modifications/scenarios. If changing the magical bytes than that wouldn't be possible. Using the same bytes but an different extension would be possible. However.
Parent - - By bahamada [de] Date 2011-01-01 21:49
right click open with... ;)
Parent - - By Luchs [de] Date 2011-01-02 01:42
Huh? Most packers probably refuse files without a correct header, so that wouldn't work.
Parent - - By bahamada [de] Date 2011-01-02 16:06
Thats what I explained in the irc in advanced...
So here the summary again...
A normal zip file with a suffix like *.ocd or *.ocs.

The current state is that it is a zip file with a changed header...
So all we need is a zip compatible header and this is completly independent of the name, the suffix, the extension...

I hope that makes the things clear..
Parent - By Newton [de] Date 2011-01-02 16:27

>The current state is that it is a zip file with a changed header...

Parent - By Isilkor Date 2011-01-02 17:16

> The current state is that it is a zip file with a changed header...

It's a GZIP file with a changed header, and a custom archive format inside the GZIP container.
Parent - - By Clonk-Karl [de] Date 2011-01-02 15:20
To me it seems like *.oc? is slightly preferred over *.c5?, so I'd suggest to use that. If nobody objects I'll try to do the necessary changes in the upcoming week.
Parent - - By MimmoO Date 2011-01-02 18:08
i agree. since i already made a few icons with the OC-label on them, i will make the rest of them too. while opened the .ico-files, i noticed, that i can turn through 6 pages, with the same icon in different sizes, with anti aliasing and without. what are the meaning of those?

also, i will use the Silver/Red color scheme, since it was the same with .c4? files, only with silver/blue, if no one objects.
Parent - By MrBeast [de] Date 2011-01-02 18:48

>while opened the .ico-files, i noticed, that i can turn through 6 pages, with the same icon in different sizes, with anti aliasing and without. what are the meaning of those?

6 sizes where automatically the nearest will be choosen, with anti-aliasing are the 32 Bit versions, the icons which will be used on systems with 32 Bit colors, without are the 256 colors versions for those systems with less.
Parent - By Günther [de] Date 2011-01-10 02:47
While you're editing the windows registry, you could install the registry keys necessary for extracting packed files with c4group with the installer. (And we could start shipping a that creates the connection on Linux...)
Parent - By Clonk-Karl [de] Date 2011-03-13 17:46
So I finally got around to finishing this. There might be some hidden side effects or bugs caused by this change so please file bugs and assign to me if you encounter any.
Parent - By MimmoO Date 2011-01-06 14:14
i made some icons.
Attachment: res.rar (121k)
Attachment: ObenGlonk_Icons.hg (666k)
Parent - - By Günther [de] Date 2011-03-13 18:46
I don't think we should rename player files. The only reason is consistency with the other file extensions, but consistency with 5.1 is more important, because it actually affects players: you can't continue playing with your player file in the other engine. So either we'd do a conversion at startup, removing the player file from the point of view of the 5.1 engine, harassing players who help us test the nightlies, or leaving stale files lying around, or we essentially throw away the player profile for normal players on update. So the engine should continue to work with unmodified old player files. (Brand new player files are a different story, but I don't like making the engine more complicated for aesthetics alone.)
Parent - - By Clonk-Karl [de] Date 2011-03-18 11:42
What about this: Let's do a conversion at startup but keep the old .c4p file around until a few days before the 5.2 release at which point we switch to deleting .c4p files?
Parent - - By Günther [de] Date 2011-03-18 17:01
That's still a lot of effort for no particular gain. But thinking about that, switching the player files to a more efficient format would be helpful. So how about postponing the renaming until someone does the work of implementing a better format?
Parent - - By Clonk-Karl [de] Date 2011-03-18 17:32
What kind of optimizations are you thinking about?
Parent - - By Günther [de] Date 2011-03-19 00:55
Not creating an entire c4group for every crewmember. At least with c4group all those tiny files are packed together, with ZIP it would be even more inefficient.

A better format would have either one file containing all information for all crewmembers, or at least give every crewmember only a single file, not their own subdirectory.
Parent - - By forty [se] Date 2011-03-23 02:01

What is the reason to want a good compression of the packages? Nowadays people have generally big hard drives and good network connexion. If it is to save HD bandwidth, then you seem to say that player files are small, so it won't save much, will it?

/Forty (just some old clonk player who has just started playing with OC and would really like to be able to unpack C4 packs with his usual archive/compression tools)
Parent - - By B_E [de] Date 2011-03-23 09:52
Hi there too, welcome to the OC forum,

Currently every player in an online round needs the playerfile of every other player. This might be good enough for beginners with small player files, but you always noticed it in CR when there where many players with big player files - consisting of all the crew members of all the different rounds, thus making the files bigger and bigger. Therefore it just would be better to optimize this as good as possible, minimizing traffic and in the end, nothing is wrong in saving space.

Also in Windows you can use C4Group as a context menu extension to pack and explode groups quickly. Alternatively you just could add c4group to your PATH somewhere, so it isn't so inconvenient.
Parent - By Newton [de] Date 2011-03-23 10:49
The player files were just big because of the portraits stored in there. This "feature" has been (partly) eliminated already.

Personally, I don't see any reason why the packages are still packed in c4groups. Other than that it would require considerable implementation effort to remove this feature and perhaps temporarily pack them in zip for network transmission. And simply... no one did that yet. I think that's the best answer to forty.
Parent - - By forty [se] Date 2011-03-23 10:51 Edited 2011-03-23 11:14
Ok I understand. What about tar.gz or tar.bz2 or even tar.lzma archiving then? Since the whole archive is compressed as one file it is possible to achieve much better compression. Of course, random access possibility would be lost.
The other solution to have only one file would work as well but a way to embed images in the text file must be found. Base64 encoding is generally used for that.

Does C4group works for Linux as well? I used to play clonk on Windows but I don't have any Windows any more.


Edit : found the answer to my question :)
Parent - - By Caesar [de] Date 2011-03-27 16:21
C4group is pretty much tar.gz.
Parent - By Isilkor Date 2011-03-29 18:27
Except not quite as bad because it has its index up front. And it doesn't pad files.
Parent - By Günther [de] Date 2011-03-23 15:28
The argument I was making is independant of the package format. C4Group transparently deals with unpacked and packed data the same way. At the moment, a player consists of a few files describing the player, and for every crewmember one subdirectory with one file in it. I want to replace that with a list of crewmembers stored in one text file, mostly because that's simpler. It would also use fewer c4group API calls, making an eventual transition easier. Both forms would end up as one physical file on disk with minimal size differences (though for network transfer every byte still counts due to slow uplinks).
Up Topic General / General / Change file extensions to *.c5?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill