• What Are You Working On? - August 2014
    1,181 replies, posted
[QUOTE=Tamschi;45667139]Why would you edit anything on a server anyway? I don't know much cases where it wouldn't be better to work locally and then upload everything in one go after testing the changes.[/QUOTE] Yeah local working is clearly the optimal environment - however I like to work in the same environment as production if possible (usually because production for me is Linux and development is Windows). This avoids having to setup certain things twice. Off the top of my head, an example is cron jobs. It's nice to be able to test stuff on the same box as production, purely convenience (or maybe laziness) more than anything
What are the main differences between XML and JSON?
[QUOTE=Trumple;45667274]Yeah local working is clearly the optimal environment - however I like to work in the same environment as production if possible (usually because production for me is Linux and development is Windows). This avoids having to setup certain things twice. Off the top of my head, an example is cron jobs. It's nice to be able to test stuff on the same box as production, purely convenience (or maybe laziness) more than anything[/QUOTE] That sounds like an accident waiting to happen. [editline]12th August 2014[/editline] [QUOTE=Lumaio;45667284]What are the main differences between XML and JSON?[/QUOTE] The latter is a bit less ugly. XML has a distinction between attributes and content.
[QUOTE=Tamschi;45667306]That sounds like an accident waiting to happen.[/QUOTE] No more dangerous than running two separate sites on the same machine surely - just one is dev and one is production
[QUOTE=Lumaio;45667284]What are the main differences between XML and JSON?[/QUOTE] The syntax mostly. You can compare the libraries for them too but it depends on the platform. They are both human readable tree style data formats. [code] { "base": { "string" : "Hello World" } } [/code] [code] <base> <string>Hello World</string> </base> [/code] I prefer XML but there are no meaningful differences.
XML is a markup language, JSON is a format for serialization/object storage. So JSON has arrays, while XML lets you do stuff like this: [code] <root> <foos> <foo>the quick <bar>brown </bar>fox</foo> <!-- Lots more <foo></foo> --> </foos> </root> [/code] JSON doesn't really have an equivalent. The main advantage of JSON is that it's more compact.
[QUOTE=Natrox;45667267]NtxPackage[/QUOTE] Don't know what extension you're going to use and it probably isn't going to bother you, but just so you know there's a shitty korean MMO that uses a texture package format they made with the .ntx extension.
[QUOTE=ECrownofFire;45667434]XML is a markup language, JSON is a format for serialization/object storage. So JSON has arrays, while XML lets you do stuff like this: [code] <root> <foos> <foo>the quick <bar>brown </bar>fox</foo> <!-- Lots more <foo></foo> --> </foos> </root> [/code] JSON doesn't really have an equivalent. The main advantage of JSON is that it's more compact.[/QUOTE] The structure of both is slightly different and serve different purposes. JSON has an equivalent but the structure differs and would look something like: [code] { root : { foos : { [0] : {/*some serialized data stuff*/}, [1] : {/*some serialized data stuff*/} } } } [/code] JSON is more for serialization and can be used across multiple platforms including mobile and web. I think XML is more for schemas since HTML is based off it and Android uses XML for its UI layout, but it does server other purposes.
I think XML's syntax is more intuitive, but JSON saves so many lines of code and the serialization is so good i've not used XML in a long time.
It even says on the [URL="http://en.wikipedia.org/wiki/W3C"]wiki page[/URL] that XML is supposed to to be human readable AND computer readable, so thats why its so intuitive. JSON doesnt even care since there are a number of parsers that take the grunt work out of it and return a more human readable result.
[QUOTE=Perl;45667463]Don't know what extension you're going to use and it probably isn't going to bother you, but just so you know there's a shitty korean MMO that uses a texture package format they made with the .ntx extension.[/QUOTE] File extensions dont determine anything though, you could have your entire prerendered character mappings in .txt files and still call them TeXTure files, even though they contain no text data. The Windows way of determing if a file is an mp3 is old as balls and doesn't even work in most cases anyway. The file content should always be determined through some content of the file, such as the header, and MIME-data.
[QUOTE=mastersrp;45667609]The Windows way of determing if a file is an mp3 is old as balls and doesn't even work in most cases anyway. The file content should always be determined through some content of the file, such as the header, and MIME-data.[/QUOTE] I agree. But at the same time, being able to tell the type of a file by just glancing at the name is very useful. I don't know how a UI would easily show the type of file if you determine it from the file contents.
[QUOTE=Natrox;45667267]I am working on a new version of my package format. It is aimed at games. Still working on the whole idea of it, so have a diagram showing the structure I have planned; [img]http://i.imgur.com/oV6o5nz.png[/img] For comparison, here's the previous version from about 2 years ago; [img]http://i.imgur.com/4YQWRFt.png[/img][/QUOTE] I never got how reading files and getting data from headers is done, can someone enlighten me?
[QUOTE=eirexe;45667767]I never got how reading files and getting data from headers is done, can someone enlighten me?[/QUOTE] You should have a look at the binary IO functions of the language you're using. In C/C++ you [del]could just cast the buffer pointer to the desired structure[/del] ??gypsy magic??, in C# you could use BinaryReader/Writer. [editline]12th August 2014[/editline] [QUOTE=mastersrp;45667609]File extensions dont determine anything though, you could have your entire prerendered character mappings in .txt files and still call them TeXTure files, even though they contain no text data. The Windows way of determing if a file is an mp3 is old as balls and doesn't even work in most cases anyway. The file content should always be determined through some content of the file, such as the header, and MIME-data.[/QUOTE] Of course, but for example it would be kind of silly to make a config format and use the extension .png.
[QUOTE=Z_guy;45667748]I agree. But at the same time, being able to tell the type of a file by just glancing at the name is very useful. I don't know how a UI would easily show the type of file if you determine it from the file contents.[/QUOTE] By using icons.
[QUOTE=Perl;45667782][B]In C/C++ you could just cast the buffer pointer to the desired structure[/B][/QUOTE] nononono that's not a good idea. It's not portable, and might cause issues with memory packing/alignment. There are workarounds but I still don't like the idea. [QUOTE=eirexe;45667767]I never got how reading files and getting data from headers is done, can someone enlighten me?[/QUOTE] You open the file, seek to position if needs be, and read the amount of bytes you need and put it somewhere. There's no magic or anything. Just read from the file and into a buffer and then sort it from there, which gives you ease of portability in the future if you need to deal with endianess and whatnot. (you probably won't have to, but whatever, just cover them basis :v:)
I made a cool ping graph thing with Consor. [IMG]http://self.kateadams.eu/tty/ping.png[/IMG] Watch it live here: [URL="http://77.100.236.24/tty/ping"]http://self.kateadams.eu/tty/ping[/URL]
[QUOTE=JohnnyOnFlame;45667954]nononono that's not a good idea. It's not portable, and might cause issues with memory packing/alignment. There are workarounds but I still don't like the idea. You open the file, seek to position if needs be, and read the amount of bytes you need and put it somewhere. There's no magic or anything. Just read from the file and into a buffer and then sort it from there, which gives you ease of portability in the future if you need to deal with endianess and whatnot. (you probably won't have to, but whatever, just cover them basis :v:)[/QUOTE] I get it now, thanks. Also I just discovered something really great for using git with flash files, apparently flas are just ZIPs (Since cs5) and they contain XML's for vectors and some files (there's a mail xfl file that flash can open), so you can source control flash files easily. [t]http://i.imgur.com/eeIGE1k.png[/t] [t]http://i.imgur.com/tDs1B8S.png[/t] [t]http://i.imgur.com/uhQ8OyA.png[/t]
[QUOTE=mastersrp;45667872]By using icons.[/QUOTE] How about when using "ls" or "dir"? Having the type as part of the name is very convenient, even though I agree that the technique is outdated.
[QUOTE=Z_guy;45668321]How about when using "ls" or "dir"? Having the type as part of the name is very convenient, even though I agree that the technique is outdated.[/QUOTE] On Linux at least, we have file to identify what type of file a file really is. Besides, when you're working with files in the commandline, changes are they won't be your ordinary mp3s and jpegs, and you probably won't know for sure what a file is anyway just based on the extension.
[QUOTE=mastersrp;45668343]On Linux at least, we have file to identify what type of file a file really is. Besides, when you're working with files in the commandline, changes are they won't be your ordinary mp3s and jpegs, and you probably won't know for sure what a file is anyway just based on the extension.[/QUOTE] Do you have a file to identify the type of a file for the file to indentify the type of a file?
[QUOTE=cartman300;45668426]Do you have a file to identify the type of a file for the file to indentify the type of a file?[/QUOTE] It's not "a file" though, but the binary executable "file". And yes, it will identify itself as well.
[code]dan ~ $ file `which file` /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=00ee4a942cb2a9e2a8dc9bfb4bc0a0d75bd58bd1, stripped[/code] But it's a shell not a file browser, if I wanted to look at a bunch of files at once I'd probably open dolphin.
Congratulations to Layla for becoming a member of the FacePunch staff!
I finally put together a blog post about kd-trees. [url]http://thingsiamdoing.com/kd-tree-implementation/[/url]
We talked about it in fpp don't worry. I made sure he knew I was gonna post it to check if there was a problem. Sorry for being excited for him geez! [editline]12th August 2014[/editline] Also it says "Facepunch Staff" under his name.
Using behaviors trees to get some AI done. This tree: [IMG]http://puu.sh/aPxxB/ad95173b04.png[/IMG] Makes each entity do stuff like this: [IMG]http://puu.sh/aPxDN/c266dc0253.gif[/IMG]
[QUOTE=adnzzzzZ;45669877]Using behaviors trees to get some AI done. This tree: ... Makes each entity do stuff like this: ...[/QUOTE] Can you make a blog or something, so I have these posts on one place ?
[QUOTE=Handsome Matt;45669607]Pretty sure he wanted to keep this quiet for a while..[/QUOTE] Staying quiet about it is overrated.
LAYLA YOU HAVE NO EXCUSE TO NOT GET GOOD ART MADE AND RELEASE YOUR GAME NOWWWW
Sorry, you need to Log In to post a reply to this thread.