Firefox
Thursday, May 23rd, 2013Looks like this blog doesn’t render properly in Internet Explorer. Oh well, no idea why. Use Firefox.
Looks like this blog doesn’t render properly in Internet Explorer. Oh well, no idea why. Use Firefox.
I got a bunch of questions about my last series of blog posts so I thought I’d add a quick note here - at the risk of confusing people even more.
The figures I posted are for the CPU part of PhysX only. This does not concern or affect the GPU parts of PhysX in any way. Those things are orthogonal. If we optimize the CPU parts and get a 10X speedup, it does not mean your GPU will suddenly provide 10X less value, because it is running others parts of PhysX anyway - neither the rigid bodies, nor the raycasts/sweeps.
Only a few features are GPU-accelerated, e.g. cloth or particles, mainly because they are the ones that map well to GPUs, and they are the ones for which the GPUs provide real X factors.
Now as shown in the recent “destruction video” I posted, people here are also working on GPU-optimized rigid bodies. This new module is called “GRB”, and it is currently not part of PhysX. But it does provide a speedup compared to our current CPU solution. In other words, it is still faster than PhysX 3.3 on CPU. You might have a hard time believing it, but people are trying to be fair and honest here. One of our tasks is to optimize the CPU rigid bodies as much as we possibly can, just to make sure that the GPU rigid bodies do provide some actual benefit and speedups. If you don’t do that, you release your GPU solution, it’s slower than a CPU solution, and you look like a fool. Like AGEIA. We are not making that mistake again. The CPU solution is here as a reality check for ourselves. I suppose we could just use Bullet or Havok for this, but… well… we think we can do better
Meanwhile, it is correct that the features that do work on GPU are currently only working on NVIDIA cards, simply because they are implemented using CUDA. There are both obvious political and technical reasons for this. It should be pretty clear that at the end of the day, NVIDIA would like you to choose one of their GPUs. If you are actually complaining about that, then there is little discussion left to have. Of course they want to sell their products, like every other company in the world. And of course they are going to use their own technology, CUDA, to do so. To me this is pretty much the same as what we had in the past with D3D caps. Some cards supported cubemaps, or PN-triangles, or whatever, and some didn’t. GPU PhysX is the same. It’s just an extra cap supported by some cards, and not by other. Complaining about this is silly to me. It would be like complaining that ATI didn’t make any effort to make PN-triangles work on NVIDIA cards. Seriously, what?
The deal is simple. NVIDIA gives you a free, efficient, robust physics engine. In exchange, if possible, add some extra GPU effects to give people an incentive to buy NVIDIA cards. Fair enough, right? I don’t see what the fuss is all about.
—-
Anyway, the usual disclaimer applies here: I’m not a spokesperson for NVIDIA, what I write are my own thoughts about it, and for all I know I may be completely wrong about their intentions. What I know for a fact though, is that most of the stuff I read online about PhysX is just completely insane wrong.
I’ve been optimizing rigid body simulation in NovodeX/PhysX for a long time now, and there’s no big conspiracy behind it. Again, all those engines are free and publicly available so I invite you to run your own experiments, do your own benchmarks, and see for yourselves. We really have nothing to hide.
Somebody posted this at work:
www.rockpapershotgun.com/2012/06/09/neal-stephensons-making-a-game-called-clang/
At 1′59 in the video, check out the Google search with its highlighted 1.990.000 results. This is supposed to show that there is a high demand for a knight-vs-samourai game.
Ok. So I am going to kickstart a game project featuring hamburgers shooting Americans. This gives me 54.200.000 results at time of writing, so clearly there must be a high demand for such a game!
Fucking bloody morons.
It seems there is one in every team. He is living by the book, following the rules to the letter. He considers himself bright and smart because he always knows the latest trends, the latest official Right Way to write things according to the C++ Standard. He follows it religiously, even the new rules not implemented yet by any compiler. And he looks down on you if you do not write “proper” code. He is the prophet. The Book is right. You must follow the rules.
His zealotry has no limits. He will conscientiously rewrite your “illegal” C++ when you are not looking. For your own good of course.
He will go and meticulously replace all your “i++” with “++i” in your vanilla integer for-loops.
He will go through incredible hoops to get rid of a lonely “goto”, used to skip a large block of code and jump to your function’s epilogue.
He will use unreadable, cryptic, unbelievable templates to replace your simple define, because “define is bad”.
He will tell you with a straight face that he went ahead and replaced all the “NULL” in the codebase with “0″ or “nullptr”, because “NULL is bad C++”.
He filled his head with many of those mantras, and he is obsessed with them. They are the rules. They must be followed.
Well, my dear prophet programmer, I have news for you: you are not bright. You are not smart. You are not clever. You’re a fucking robot. It does not take a genius to blindly follow recipes from your cookbook. You are a brain-washed moron doing a machine’s job. If you blindly follow the Standard, you end up with standard code, which by definition anybody can write.
The best programmers are not the ones blindly following anything. They are exactly the opposite of you. The best programmers are the ones who know when rules should be bent, when boundaries should be broken, and when envelopes should be pushed. The best programmers are the ones who, constantly, on a case by case basis, hundred times a day, stop for a moment and think about how to best solve a problem. They are not the ones turning off their brain to follow a recipe. They are not the ones trying to fit a preconceived solution (design pattern?) to everything. If a preconceived solution solves your problem, it was probably not really a problem worth solving - that is, it is such a common and tired issue that anybody can look up a standard answer in a book. How does solving such a thing in such a way makes you “smart” ?
The best programmers are creative. They have a big imagination, and they are not afraid to use it. They borrow techniques from one field and apply them successfully to an apparently unrelated field, discovering subtle links and connections between them in the process. They are never satisfied with the status quo.
The best programmers, the heroes, the top coders, like Nick of TCB did with the sync-scrolling eons ago, are the ones who invent new techniques to solve problems that nobody solved before them. By definition they are not standard. They are the very opposite of what you preach.
After maybe a decade using Win2K, I finally joined the modern world and bought a new PC, which came with a pre-installed, 64-bit version of Win7.
Man, what a disaster.
After just a few hours I suddenly remembered why I had not upgraded the machine for all those years.
I’m very tempted to just format the whole thing and re-install Win2K over the Win7 crap.
How clean your source code looks like is not as important as how clean your generated code looks like.
When supporting multiple platforms, your code not only has to work on the weakest machine. It also has to be compiled by the weakest compiler.
Don’t trust the compiler. No, it will not magically optimize your crap.
Let me make a bold statement:
All functions taking a “const String&” parameter as input are bad.
…where String is either your own custom string class, or std::string, whatever. This is bad, of course, because it forces your users to have a String around. If they get the string from an external source (typically as “const char*”) you just forced them to create a temporary String just to call the function (or worse, the temporary will get created without them even noticing). Since you pass it as a const, you will not modify the text and there is no reason to force people using a String. The proper API just takes a “const char*” parameter.
(Yeah, yeah, I know, it ignores Unicode stuff and loses some minor optimizations when the String class caches the length of the text, whatever, you get the idea of the bold statement. And also, any const function in the String class is stupid, as an old classic GOTW entry showed eons ago).
I hate you. I truly, terminally, passionately hate you. You’re a fucking piece of insane, mind-boggling junk. Having used computers for more than 2 decades now, I can assure you that you are, without a shred of a doubt, the crappiest, lamest machine I have ever used. It makes me sad that you’re the one who survived, because you obviously deserve it the least.
And now for the question of the day:
For all I can see, it looks like I wasted my money on one more piece of PC garbage, and I can just throw it away and buy another. This is fucking ridiculous. It makes my blood boil that this so-called “user friendly” PC is in fact a fucking clueless money-making bastard that couldn’t care less about users. If you would care about users you would allow me to install VC9 on Win2K, for a start!
While doing backups I found this picture of Araña, one of the characters in “Wanted - weapons of fate“. It has a special meaning for me. I see it both as a proof that the Barcelona office did have talented artists, and that “the management” (or whoever was behind the important decisions, it was never all that clear) was just living on another planet.

To me this is one of the most, if not the most awesome render ever created by our artists during the whole project. I think it is very obvious why it has potential. Why it would be a good idea to polish this secondary character, and give it some more screen time. Why it would draw hordes of nerds to the game. Why it would please all the fans (what do you mean you did not expect them to be disappointed when discovering that Angelina is not in the game?!). At the very least, if nothing else, put it somewhere on the box. Create posters. Send it to IGN and Gamespot, I don’t know. Something.
Instead… well, did you see that picture anywhere? Exactly my point.
They saved it for a mindbogglingly weird promotional stunt in a male magazine that should remain nameless. Of all the crappy decisions made during this project, this one has to take the cake. As if the readers of [Censored] were interested in buying video games !? I don’t know, maybe they got lifetime subscriptions out of that deal or something.
Damn it, this one still makes my blood boil!
Typical spanish rip off. I buy “pains au chocolat” in the Caprabo, here’s what I get. Notice how one of them, still sealed, is like 25% shorter than usual. It looks like a piece has been cut with a knife, probably a hungry employee in the pains-au-chocolat factory or something.
This is the 3rd time it happens to me, after buying yogurts already open and empty Nescafé packs (1 pack in a box of 10 containing no powder at all).
Fucking BS place.