12-29-08 - Junk

Bill Clinton was perhaps the best Republican president this country has ever had.

Israel's overreactions to nuisance attacks from Hamas has made them a liability to US global interests. It is no longer a tenable political position to stand by them. This is not a question of who's right or wrong or morality, it's simply realpolitik.

Any reasonable investment these days returns far less than inflation (eg. a CD is around 3% which is not enough). Any money you have sitting around is losing value in real dollars. We may well be in a period similar to 1964 to 1984 where we could go 10-20 years with investments either showing no gain or a loss in real dollars. The only good option is to spend immediately on hookers and blow before the money loses more value.

Capitol Hill Snow Slideshow at Seattle Weekly ; most of these pictures are from right outside our house. I love the way people go nuts here when the weather's wacky. When it dumps snow nobody drives, everything is cancelled, and people just play. (people go nuts here in the summer too when the days are so long and it's too hot to sleep, everyone stays up late and wanders outside). We were flying that day, but I just wanted to cancel it and stay home and have snowball fights and drink cocoa. It's funny walking around and seeing the cars abandoned on the steep hills where people realized they couldn't make it (why wouldn't you just go back down to the bottom of the hill and park properly?).

I hate video games that change my resolution to go full screen. My laptop runs on a 1920x1200 external LCD. Any res except native looks like pure ass (the exception is 1600x1200 or 800x600 in center mode, not stretched). Furthermore, because I run over analog VGA, changing res causes the monitor to go through its autoadjust which takes a solid 30 seconds or os. That means absolutely any resolution change pisses me off (and it has to adjust when the game starts, then again when I quit, and when it crashes, which is like inevitable, it always leaves me in fucking 800x600 desktop mode and screws up all my icons; URG).

For my own 3d work I've always used the method of just grabbing the desktop res and going fullscreen with that res (then let the user down-res if they want, but never change the res unless they ask for it). But my GPU is too slow to run most games at full 1920x1200. The way that I'd like to see more games handle this is to let me stay in 1920x1200 but render only a portion of the screen. eg. 1600x1200 centered would be okay, but hell you could also just let me do a 1600x1000 wide aspect centered window and that would be fine too. Actually while I'm at it, I just wish most games and 3d apps didn't go fullscreen AT ALL without me telling them to. The default initial startup should always be windowed mode (since I'm going to have to watch it load for half an hour, I'd like to keep the use of my web browser thank you very much).

One of the weird things about Vegas is the way it's just a complete shambles as soon as you step off the strip. In fact, they don't even try to hide it much on the strip, like even at the Bellagio if you look behind a bush you'll see the walls are some kind of paper-mache plaster kind of thing and there are just gaps and dented spots all over. If you look out the back windows there will be the heating/cooling plants, piles of construction equipment, etc. Off the strip it really reminds me of Cancun or Mexico in general - piles of dirt, construction equipment everywhere, tons of stuff half built that nobody seems to be working on actively.

I hate that I'm writing all this nonsense. I hate sitting at the computer all the time, it gives me no happiness. I just don't know what else to do with myself. It's miserable outside. My shoulders are wrecked, probably forever, I can't work out and I'm fat. I feel like I'm not doing good work right now and I'm racking my brain trying to fix my coding process. When my work suffers I get depressed since it's about the only thing that gives me any sense of self worth.

I'm trying to avoid doing allocations in CINIT ; we've made our own allocator now just fail if you call it at cinit, but that's not catching everything for me because of the difficulty of making sure you've replaced every bit of code that tries to use "new" or "malloc" or whatever. One annoying thing I found : almost every STL container can be declared static in a file and it doesn't do any initialization, the constructor just zeros out some members - but hash_map actually does an alloc :

static std::hash_map<int,int> s_hash;

will allocate a 193 member table. That sucks. Empty containers should not do any allocations IMO since there are many usage patterns where you might declare a container but never actually put anything in it. (note that of course in real Oodle I don't use any STL, this was just in some test code).

Does the gmail "Report Spam" actually do anything? In any case I'm pretty happy with my gmail email pass-through.

When I see a "baby on board" sticker, it makes me really want to ram my car into the person. Is that wrong? Also, 1980 called, they want their sticker back.

I mentioned before how I think the bilateral filter is a pretty mediocre way of denoising or super-res'ing images, because it basically gives you a piecewise constant model. On the other hand, it's a great way to deal with things that actually ARE piecewise constant - and lighting in graphics is pretty close to piecewise constant. (a symmetric bilateral filter can do piecewise linear ; really what you want is piecewise quadratic). There are some good new papers around about new realtime GI techniques.

The new Fog Creek Office is pretty nice, and as usual Joel is right on about spending money to make programmers more productive. I disagree with some of the details, they don't really need to spend so much on fancy design and the common areas, but stuff like the mechanical height adjustable desks is super awesome. Of course you've got to offer a lot of perks to get people to work on FogBugz. ZOMG that's got to be some of the more boring programming work in the universe. Also, WTF how many people does it take to make fucking FogBugz !? We evaluated a bunch of bug trackers at OddWorld, and FogBugz was okay, but it's very simple and very restrictive, it's not overloaded with crazy features the way the competitors are; it literally looks like something written by 1-3 people (1 Casey or 3 normal people). I guess it's because if you're a programmer working on FogBugz you only spend 1 hour a day actually working and you spend the rest of the day dreaming about quitting or killing yourself.


castano said...

> Empty containers should not do any allocations IMO

Yep, that's one of the proposals of the EASTL:

"All containers guarantee that there is no memory allocation upon being newly empty-constructed."



Autodidactic Asphyxiation said...

Also, hash maps also seem to have a crazily large minimum size. Anyway, I just avoid using non-POD globals altogether (although for some random test code, why not?)

800poundgames said...

one thing we did here at work was define our own version of new (eg. my_new)

then we overloaded the default new operator, so that any allocations to it would be caught via a halt operation.

With GCC you can also override malloc/free etc. with the --wrap linker option.

I'm not sure if there is an equivalent for MSVC.


cbloom said...

"one thing we did here at work was define our own version of new (eg. my_new)

then we overloaded the default new operator, so that any allocations to it would be caught via a halt operation.

You have to use #defines to override the default new right? The problem I always have with that is placement new. You can make it work okay within one codebase, but when you try to mix codebases I get big ugly spots where you have to undef then redef and so on.

cbloom said...

Have I not posted about EASTL ? It's quite sensible and basically what any good game dev using STL does. It would be awesome if they actually made that into a public open source project, but my hopes are not high.

(Also, many of the things they ask for can be done pretty easily using just simple modifications to STLport; for example, it's pretty easy to completely rip the entire allocator system out of the STL and either replace it with something new and simpler or just make it call "MyAlloc" all the time and then put the smarts in your alloc)

800poundgames said...

Well placement new takes has a different signature, so that still works as normal. eg.

char* foo = my_new char[2];
char buff[sizeof(MyStruct)];
MyStruct* bags = new (buff) MyStruct(a,b,c,d);

my_new is simply a macro which redirects to an overloaded version of 'new'. eg.

#define my_new new(__FILE__, __LINE__)

(plus other variants)

You have piqued my interest about a cross platform way to override malloc and new, as this is pretty non-standard stuff, but I found this great blog post about it here-


Cheers, Tom.

800poundgames said...

Further thought- we mainly use the 'new override' for profiling purposes, because we hook into Deja which requires the file/line number of each allocation. You can probably just get away with overriding malloc/free for your purposes.


800poundgames said...

Followup to that blog entry-


Autodidactic Asphyxiation said...

EASTL was just released:


Also, obligatory plug for tcmalloc and the profiling tools:


cbloom said...

Dude, that GameSTL is a sick level.

Autodidactic Asphyxiation said...

Oh, I guess it isn't EASTL technically. But I think it has a similar provenance.

cbloom said...

I'm Loling that he couldn't even get vector right. Not even close to right apparently.

RDESTL is much more mature :


There're a million hacker's versions of STL out there (including mine) and adding more doesn't help anything unless it really gets some steam and smart people work on it and do it right.

Hell, Dave and I could do a cool GameSTL for RAD but I doubt we'd find many customers.

Autodidactic Asphyxiation said...

Yeah, after looking closer at GameSTL obviously it is a total disaster. Serves me right for trusting things posted on gamedev.net.

cbloom said...

The promising thing is that there's clearly a critical mass building that might actually make this happen.

The thing that would really suck is if a crappy version becomes the standard.

Sam said...

I love a lot of Joel's articles, but you're right, why the hell does he need that many programmers? And what's with needing the 99.9% of top programmers or whatever; it's not like you need a rocket scientist to write some PHP/SQL product! Talk about excess..

brian said...

Unrelated: I assume, but haven't verified, that GMail's "report spam" is a vote to consider that email spam for all other users who received it.

In fact, a friend who runs a mailing list for casual games once implored all of us on the mailing list, if we wanted off, to let her know and not just Report Spam every time a mail came through, because she said it does increase the chances it'll get auto-trashed as spam for other recipients who actually want to get it. So yeah. I'm sure the heuristic is elaborate, but I'm fairly sure Report Spam feeds into it significantly.

jfb said...

The problem with running at the desktop resolution is that many people are _not_ running at their native resolution, and have become used to a horrible-looking display. One can't just use the highest supported resolution either, as many LCD monitors (mine included) reveal an extra mode which is higher than max native and looks awful. Would be great if an API existed to query native resolution, AFAIK none exists..

cbloom said...

" The problem with running at the desktop resolution is that many people are _not_ running at their native resolution, and have become used to a horrible-looking display. "

Yeah, but at least you get it right for people who *are* running their desktop at native res. Many games simply go fullscreen in the wrong res and don't give me any option to get to the right res. (my old lappy had a native res of 1440x1050 which games would never enumerate unless they used desktop res)

old rants