HN user

ginsweater

724 karma
Posts7
Comments15
View on HN

I wrote one of those once! It was a nightmare morass of one-pixel errors. Maybe there was some clever simplification I missed that would have made it all easy, but these days I use the libraries. :P

I know that's how stb_truetype's renderer works, incidentally. Don't know if Freetype is the same, but I'd be mildly surprised to find it wasn't.

The geometry may be flat, but relationships between objects are still arbitrary, so light can still hit things from any angle. Try as you might, you can't escape curves. ;)

That article's a classic; definitely worth a read for anyone interested in graphics.

Whoops, yeah, you caught me. As I handwaved in the post, there's a little bit of implementation detail in the real code that I removed to clarify the algorithm. Fixed now, thanks.

Especially of interest to HN readers is Part 3, which is about the economics of streaming anime - the ad-revenue numbers they present are shockingly low.

Yeah, this article seriously rubs me the wrong way. The tone throughout is "Rich Nerd Buys Cool Toy." And in that context a lot of the talk about the clock's "greater purpose" comes off as bootlicking.

If I were Bezos, I'd be particularly upset about what the writer puts into his mouth about the Gates Foundation and other charities - "Well, Bill Gates has already cured AIDS and malaria, so all that's left for me is to build a fuck-off huge clock!"

It's not just that - even when we're talking Warren Buffett here, the scale of the US govt is totally different. Buffett's entire fortune ($50B according to Wikipedia) would only cover a few weeks' worth of borrowing and then we're right back where we started only Warren Buffett has no more fortune. It's silly to say we should expect him to do that.

What he's saying by advocating tax raises is "I will pay more if I know that everyone else will also pay more." He's not interested in paying $XM to reduce the debt by $XM, but he would happily pay a personal cost of $XM if it meant reducing the debt by $XB.

(This is called "collective action," and it's also Groupon's business model.)

This is the article that introduced me to monofur, which I dearly love even though it seems fairly unpopular. Take a look[1] and you'll either think that lowercase L is a terrible idea or exactly the thing to distinguish it from the number 1. The rounded friendliness distinguishes it from all the other fonts I use; now when I see monofur (in the zenburn color scheme), it says "programming time" to my brain.

[1] http://www.dafont.com/monofur.font

Uncharted uses a DSL for gameplay scripting. The compiler is implemented in Racket. You can see what it looks like in Jason Gregory's 2009 presentation: http://www.gameenginebook.com/gdc09-statescripting-uncharted...

The compiler is written on top of the low-level system in Dan Liebgold's 2008 presentation: http://www.naughtydog.com/docs/Naughty-Dog-GDC08-Adventures-...

More or less, the sexps that define a state-script get run through a maze of Scheme macros - there's even a pretty decent expression language in there which is compiled to bytecode - and the result is big honking C++ structure which is fed to the Uncharted runtime and interpreted.

In particular, note all those wait-blah-blah calls; those are using call/cc to implement coroutines. Which is something you really really want in a game but which C++ of course doesn't have. (GOAL had native coroutines.)

It's also nice to be able to iterate on the language syntax without having to fool with BNF grammars and so on.

That doesn't match Amazon's behavior. If they thought they could optimize prices for the benefit of app developers, I would expect them to offer the option. "Is setting your price a headache? Let our team of specialists do it for you!" Over time, as devs saw the benefits accrue to those who opted-in, more and more would switch to Amazon's model.

The fact that they require price control, as a condition of doing business, tells me that Amazon expects this policy to hurt developers.

The distinction I'm trying to make is between parsing the text once (using a compiler-like utility which is separate from the game runtime) then shipping the "compiled" binary format, versus shipping the text file and parsing it every time it's loaded by the game.

I took the parent post to be suggesting linking JSON into the game and parsing on each load -- IMO, the separate-data-compiler approach is superior for large projects, as it speeds up loading by a couple orders of magnitude. That's what I was trying to say.

(On the other hand, linking the entire Common Lisp runtime into your game just to load text files is a terrible idea. Obviously JSON is better for runtime parsing, but I don't think that's what the author is doing.)

So, if you then ask what language the separate data compiler should be written in, it seems like Lisp is a nice approach since it has a nice native object format with a built-in parser. Presumably you could also write it in JavaScript or some other language with excellent JSON support (Ruby? I'm getting outside my expertise here) and get a similar benefit vis-a-vis not having to write a parser.

Edit: I'm betraying my C heritage by saying "linking the Common Lisp runtime." Does that make any sense at all? Assume I mean some viable method of shipping Lisp with the game and making external calls to it somehow. ;)

But using JSON would have required parsing text in order to load the file. That's fine in a lot of domains, but games often have to load megs and megs of data in a very short time.

To speed things up, lots of games have this sort of external program that reads in a human-readable text format and outputs cooked binary files (with appropriate endianness and so forth) for the game runtime to consume. The fact that this utility is an external program means that there's not a reason not to use a nice language instead of a C library.

For a toy example like this, the advantage isn't obvious, but when you're consuming dozens or hundreds of megs of compiled text, it's indispensable.

This always makes me think of Isaac Asimov's classic essay, "Forget It!" in which he gets a hold of a hundred-year-old math textbook and writes about what's in there that isn't taught anymore. (A lot of stuff about computation using long-forgotten English units of measurement, for one.)

Anyone know if it's online? I have a print copy, but I can't find anything with a quick Googling.

A good university is the best place in the world to meet other programmers. Go to the best school you can - once you're there, you'll be shocked how fast you improve when you're surrounded by other young hackers. The classes are a bonus - you won't be able to tell in advance which they are, but there will be a couple that will blow your mind wide open.

The hacker crowd is not necessarily obvious at first glance; even the best schools are full of "thirteenth graders" and disaffected professors. But rest assured it's there. (The local ACM chapter is often a good place to start looking.)

Applying doesn't cost much; don't be afraid to apply to MIT and Caltech. You might get in! The usual strategy is to apply to a couple "stretch schools," three or four you think you'll probably get into, and a "safety school." (Write the applications for your safety schools first - the essays get easier fast.)

Community college is a backup. Work towards selective schools for now - they have early application deadlines. Community college, on the other hand, you can wait until practically the day before school starts. They're always there if you need them. That's what they're for.

Finally, don't worry about money. That's what financial aid officers are for. If you get accepted, they'll figure out a way you can afford to attend.