Live data from Hacker News

Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

plus.google.com

111–120 of 265 posts

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#111

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

That's how people are going to cheat at your game.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#112

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

Why does using a Lua-basef format stop the files being corrupted?

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#113
post #105
post #85

Earlier quoted context omitted.

Not sure what you are referring to. What are some common ways "expert users" manage to "trash their repositories?"

Let's start here: http://randyfay.com/content/avoiding-git-disasters-gory-stor... So, the solution to the fact that the merging UI is a pile of garbage is HAVE A SINGLE PERSON ALWAYS DO THE MERGE . Excuse me? The whole point of a distributed revision control system is so I don't have to have a single choke point. That's the definition of distributed . Then there was the KDE disaster: http://jefferai.org/2013/03/29/di…

The issues in the randyfay.com post are due to a misunderstanding when using git as a "centralized" repo like SVN. Git, by design, does not enforce a central repo even if you designate one logically. These issues can be completely avoided if you merge the right way:

http://tech.novapost.fr/merging-the-right-way-en.html

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#114
post #111

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

That's how people are going to cheat at your game.

It's only cheating if the developer disapproves.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#115
post #63

Earlier quoted context omitted.

Let's break this down into two statements: XML doesn't have strings (or types at all really) JSON strings are strings. There is a massive semantic difference here when it comes to parsing.

What is that massive semantic difference? If you want the number represented by 1e999 as the value for salary, at some point, something has to take "1e999", whether you call it a string or a something-with-no-type, and turn it into a number. Your deserializer has to know to do that in either case.

As follows. It's more how the abstraction works.

XML:

  ->[byte stream]->[deserializer]->[bignum]
JSON:

  ->[byte stream]->[json reader]->[string]->[deserializer]->[bignum]
The latter is, well, wrong.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#116

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

That Lua was originally designed as a configuration language becomes really clear when you start doing things like this. Having my code and configuration being separate but equal was really a paradigm shift for me.

Also, the Tiled Map Editor exports directly to Lua.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#117
post #111

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

That's how people are going to cheat at your game.

Hash the information and include the hash in the file. If the hash and the contents don't match when you try to load it, you can refuse it.

If not loading things is important to you, mind.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#118
post #111

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

That's how people are going to cheat at your game.

Does it matter unless the game is multiplayer, in which case you should assume that client files are untrustworthy anyways.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#119
post #44
post #15

What's with all the XML hate? Of course, doing everything in XML is a stupid idea (e.g. XSLT and Ant) and thanks heaven that hype is over. But if I want something that is able to express data structures customized by myself, usually with hierarchical data that can be verified for validity and syntax (XML Schemas or old-school DTD), what other options are there? Doing hierarchical data in SQL is a bitch and if you wan…

I personally miss having schemas and XSLT in JSON. > doing everything in XML is a stupid idea (e.g. XSLT and Ant) XSLT actually made a lot of sense. If everyone writes code to transform format1 to format2 then what you end up with a lot of slightly different transformations. Its main downfall, just like XML itself, was that it was annoying and time consuming to write. How would you replace all this if you moved away…

There are schemas in JSON (see, for example, Kwalify) although they are not something that is built into the specification. I don't think the equivalent of XSLT is as necessary when the document readily translates to data structures in a scripting language.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#120
post #68
post #32

Earlier quoted context omitted.

One of the core aspects of XML that is really important is that no typing is inferred by the structure of the file unlike JSON. JSON is by nature tied to the JavaScript type system which is sparse and inaccurate. For example, if you look at the following: { "name": "bob", "salary": 1e999 } Ah crap! Deserializer blew (in most cases silently converting the number to null) bob 1e999 No problem. The consumer can throw th…

The equivalent of your XML would be: {"name": "bob", "salary": "1e999"}

I believe that creates a string with the characters "1e999", not the number 1e999.
Post reply on HN