Dec 21, 2008, 12:58 PM | |
I think it's the whole data block.
EDIT: My server is currently off-line so I'll just pastebin my source code. http://pastebin.com/m45d6c54c http://pastebin.com/m269ed95e
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
Dec 21, 2008, 08:16 PM | |
Okay, it looks like I can read and understand that. Thank you both!
|
Feb 4, 2009, 12:38 AM | |
This should be stickied.
__________________
"Are we not threatened with a flood of information? And is this not the monstrousness of it: that it crushes beauty by means of beauty, and annihilates truth by means of truth? For the sound of a million Shakespeares would produce the very same furious din and hubbub as the sound of a herd of prairie buffalo or sea billows." —Stanisław Lem, Imaginary Magnitude (1973) |
Feb 5, 2009, 11:07 AM | |
It's in ERE...
but as it's been bumped, I figure I may as well ask, is Code:
fileHeader.crc32 = crc32(0L, Z_NULL, 0); Code:
fileHeader.crc32 = 0; |
Feb 6, 2009, 11:11 PM | |
Not quite sure, but I believe the first line initializes the CRC32 for further calculation while the second line only sets it to zero. Check the output variable and see whether they are the same. I think they should differ.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
Feb 7, 2009, 09:45 AM | |
I don't use the language, though. The only semi-native CRC implementation at my disposal gets the CRC of an entire file, without asking me what polynomial I would like, so I'm rebuilding it by hand.
|
Feb 8, 2009, 09:07 PM | ||
Quote:
So yes, I certainly use it. More accurate specifications would certainly be welcome.
__________________
"Are we not threatened with a flood of information? And is this not the monstrousness of it: that it crushes beauty by means of beauty, and annihilates truth by means of truth? For the sound of a million Shakespeares would produce the very same furious din and hubbub as the sound of a herd of prairie buffalo or sea billows." —Stanisław Lem, Imaginary Magnitude (1973) |
Feb 8, 2009, 11:07 PM | |
isn't there already something for that called "tileset extractor?"
__________________
|
Feb 8, 2009, 11:33 PM | |
That renders tilesets as image files, but if you're making a game, it's simpler just to have the game read .j2t files directly.
|
Mar 10, 2009, 01:10 AM | |
J2l format reader in PHP
HELLO
I have coded some in PHP now, and I can read ALL J2L data and put it in nicely arrays. I'm even about to read out event-data, but those parameters are hardcoded. It uses JCS.ini for the event-names. The "Data3" stream is parsed into a easy to use array and all Level Properties too. I haven't yet finished the read-out of the level, with those "words" in Data3. ALL Layer Properties are parsed into an array, as the Help Strings are too. I love what you do Neobeo, and thanks the I C E Man's tileset-php code Have a look here (not complete): http://djazz.mine.nu/content/jj2rela...2_formats/j2l/ |
Mar 11, 2009, 09:28 PM | |
I ask again. I kind of need to be able to compile things... what is the result of this setting? As I understand it otherwise, taking the CRC (with any polynomial) of 0 is just going to be 0, so there's got to be some sort of starting value, but what is it? Or do I just totally misunderstand the process?
|
Mar 26, 2009, 02:57 AM | |
May 4, 2009, 04:08 PM | |
I made a J2T image generator thingy (in PHP) for J2O today and decided to share it.
Documentation: http://www.stijnpeeters.nl/j2o/class.Tileset/ Source: http://stijnpeeters.nl/j2o/class.Tileset/source.php It's very basic and doesn't do any file integrity checks, but perhaps it is of use to someone. (Props to Neobeo, Ice M A N and Grytolle for hints/input/posts in this thread) |
May 4, 2009, 11:12 PM | |
Can anyone answer my question? Please? Or do I just need to go learn a new programming language for one simple task?
|
May 5, 2009, 01:27 AM | |
Ok here is the source:
http://djazz.mine.nu/content/jj2rela...j2l/index.phps I haven't modified it since last post
__________________
WebJCS 2 (new and in progress) WebJCS 1 (old but complete) SGIP Simple Games in Progress list Level Packer v2 - With a GUI! PHP Tileset Compiler |
May 6, 2009, 10:10 AM | |
Another question (though the first remains open), has anyone tried zlibbing the blocks with compression rates other than that which JCS uses? Can JJ2 still read them?
|
May 6, 2009, 10:15 AM | |||
Quote:
Quote:
Yes, it can.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
May 6, 2009, 11:38 AM | |
I'm asking what this required initial value is. The example usage there is the same as in your source code (albeit with while instead of for), and I think I've managed to hardcode the crc-ing of the four buffers with respect to an existing polynomial, but I don't know what the polynomial should start as, because I don't know what the value of crc32(0L, Z_NULL, 0) is.
|
May 6, 2009, 12:09 PM | |
Why do you want to hardcode it in? Last time I checked crc32(0L, Z_NULL, 0), it returned a zero, but I am not sure whether this is always the case. That's why I always initialize the crc variable with whatever value the crc32(0L, Z_NULL, 0) function call returns.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
May 6, 2009, 12:22 PM | |
Unless I go learn a new language, the only semi-native CRC support I have is extremely limited and seems only to use a fixed polynomial. Therefore I go through the bit stream and gradually xor onto the polynomial manually, a bit at a time. But if the initial polynomial is 0, then xor isn't going to do a thing and the final CRC will still be 0, right?
|
May 6, 2009, 12:34 PM | |
Ah, now I understand your problem. You're not using the zlib library and/or C++ language. Personally I am not sure how the code you're using works, but I've checked the zlib source code and apparently the crc32 function always returns zero when the buffer param is set to Z_NULL. So in this case crc32(0L, Z_NULL, 0) = 0. If you pass a zero to your function, it won't work?
Code:
unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; unsigned len; { if (buf == Z_NULL) return 0UL; #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ #ifdef BYFOUR if (sizeof(void *) == sizeof(ptrdiff_t)) { u4 endian; endian = 1; if (*((unsigned char *)(&endian))) return crc32_little(crc, buf, len); else return crc32_big(crc, buf, len); } #endif /* BYFOUR */ crc = crc ^ 0xffffffffUL; while (len >= 8) { DO8; len -= 8; } if (len) do { DO1; } while (--len); return crc ^ 0xffffffffUL; }
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
May 9, 2009, 10:40 AM | |
Huh. I guess I just don't understand the function somehow, then... I'll have to do some more digging around and find an explanation of CRC that doesn't instruct me to xor lots of stuff by 0. Thanks.
|
May 25, 2009, 05:08 AM | |
I updated my Tileset class and wrote a Level class, capable of rendering a preview of an arbitrary layer in a level. Note that especially the Level class is very basic and neither have error handling or checksum checking or stuff like that built-in.
Source code: http://www.jazz2online.com/junk/sour...lass.Level.php http://www.jazz2online.com/junk/sour...ss.Tileset.php Thanks to Neobeo/J2NSM for Last edited by Stijn; Sep 11, 2011 at 02:26 PM. |
May 31, 2009, 10:47 AM | |
Wow, fantastic Stijn
I haven't tried it out yet, but I will! Your code looks much better than mine too. You maybe should add an example showing how to use? GJ! ________ Edit: I got some errors that's listed below: PHP Code:
Do you know how to fix this? I have tried with multiple j2l files. my code for the classes: PHP Code:
__________________
WebJCS 2 (new and in progress) WebJCS 1 (old but complete) SGIP Simple Games in Progress list Level Packer v2 - With a GUI! PHP Tileset Compiler Last edited by djazz; May 31, 2009 at 11:08 AM. Reason: New.. |
May 31, 2009, 11:06 AM | |
Code:
<?php require 'class.Level.php'; require 'class.Tileset.php'; $oLevel = new Level('battle1.j2l'); header('Content-type: image/png'); echo $oLevel->getRealPreview(); I've made a few tweaks to it since I published the code there, I'll probably put an updated version online soon. |
May 31, 2009, 11:11 AM | |
Sorry still not working for me
And please make the source files downloadable, that copy-paste adds # signs
__________________
WebJCS 2 (new and in progress) WebJCS 1 (old but complete) SGIP Simple Games in Progress list Level Packer v2 - With a GUI! PHP Tileset Compiler |
May 31, 2009, 11:12 AM | |
Source and documentation updated now... several changes to the code structure, but the most interesting improvement will be that animated, flipped and translucent tiles are now supported.
What does not work for you? It might be hard to debug since the classes still lack proper error handling. I've had little need for that since they work for their primary purpose - previews on J2O - but it's open source so feel free to improve that by yourself |
May 31, 2009, 12:06 PM | |
Oh, I see the errors you pasted - strange... "tiles" should be defined at that point since the method that defines it is called from the object constructor... unless the constructor terminates before it reaches that point because it can't find the tileset file. Are you 100% sure the tileset path passed on to the Tileset constructor (line 596, class.Level.php) is correct? Did you perhaps forget to change the Level::ROOT_DIR constant to point to the correct location?
|
May 31, 2009, 02:03 PM | ||
Quote:
EDIT: I just noticed the foreground layer tiling doesn't seem to work. http://www.jazz2online.com/J2Ov2/dow...=160&sizey=248 EDIT2: Is it just me or is this level displayed entirely black? http://www.jazz2online.com/J2Ov2/dow...024&sizey=1024
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> Last edited by Cpp; May 31, 2009 at 02:22 PM. |
May 31, 2009, 03:09 PM | |
Yes @ both. When a tileset is not found it will use black tiles.
We will not allow downloading individual files I think, simply because people upload their stuff as archives to our site, not as individual files An option to, for example, ignore music files might be implemented later though. EDIT: In the case of this particular level it appears that there are two different sets named "pk2.j2t" on J2O. Since there is no way to determine which one is correct based on the J2L file alone, it uses the wrong tileset. The black tiles are references to tiles that don't exist in the "other" pk2.j2t. |
May 31, 2009, 10:49 PM | ||
Quote:
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a> |
Jun 1, 2009, 06:56 AM | |
Ok, got it fixed, I don't know how but it's working
Are there any todos left? flipped tiles, have you fixed them? Here is a code for flipping images: http://se2.php.net/manual/en/functio...copy.php#85992 More improovements is to put an image where it should be a event
__________________
WebJCS 2 (new and in progress) WebJCS 1 (old but complete) SGIP Simple Games in Progress list Level Packer v2 - With a GUI! PHP Tileset Compiler |
Jun 1, 2009, 12:04 PM | |
See you've updated the source, but, could you please add a download link, it's so hard to remove all # signs and extra linebreaks
The PHP works rly nice, but it's very slow
__________________
WebJCS 2 (new and in progress) WebJCS 1 (old but complete) SGIP Simple Games in Progress list Level Packer v2 - With a GUI! PHP Tileset Compiler Last edited by djazz; Jun 2, 2009 at 08:02 AM. |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 04:09 PM.
Jazz2Online © 1999-INFINITY (Site Credits). Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats. Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Original site design by Ovi Demetrian. DrJones is the puppet master. Eat your lima beans, Johnny.