Uber Update – The secret Pyro Update

Again with the secret updates! Today, there is a hidden pyro update in addition to “World War Wednesday” Uber Update page. Right there as soon as you load the page. Yep, on the blackboard, a picture of a pyro with a great big arrow pointing to it – it’s a link to the pyro update.

Only one new weapon this time, “The Detonator”. Seems like a good name for it too, seeing as it’s a flare gun that detonates. Nice and simple! Details are scarce – “Alt fire detonates explosive flare” – but let’s take a guess – we shoot the flare, detonate it, and set nearby targets on fire. As benefits are rarely without drawbacks, I’ll take a guess at slightly lower damage, a slower moving flare, or increased reload time, though that’s pure speculation.

Sounds like a great weapon for setting distant enemy groups on fire, and a great addition for spy checking at a distance. Anyway, once again it’s exciting to find another secret. Makes me wonder if there’s a missed secret on page 1 – has anyone found one?

Team Fortress 2 – The Semi Secret Uber Update For Scout

Alongside the easily seen Mobster Monday and Timbuk Tuesday is a subtly (or not so) hidden scout update. Lurking at the bottom of the Timbuk Tuesday page is a can of what looks like bonk atomic punch. It’s a link! Click the can and you are led to a page detailing a new weapon set for the scout, “The #1 Fan”

Valve's scoutpack update
Awesome artwork as ever, courtesy of Valve.

“The Soda Popper” looks like another weapon rewarding you for killing effectively, like the Bazaar Bargain, building up ‘hype’ ready for a rain of minicrits. A smaller clip size is your downside, much like the Force-A-nature. A rain of minicrits from behind could cause total disarray to an unsuspecting team.

Next up is a bat – “The Atomizer”, which looks like an ‘access’ weapon – useful for getting behind enemy lines, grabbing a health pack, then wreaking havoc on the enemy team (or their teleporters). I imagine that third jump will also give an interesting edge in combat during the first few weeks when no one is expecting it! Combined with the force-a-nature, will this give the scout a quadruple jump… One can only imagine so, and the prospect is awesome.

The last new weapon, “The Winger” seems like a standard but nonetheless useful pistol replacement. The extra damage, presumably without scatter, looks like a great opportunity to sneak behind enemy lines and snipe their sentries/medics/etc when they least expect it.

Hidden updates somehow always excite me more than the obviously stated updates, it’s somewhat like a treasure trail…

How can I change the interpolation mode of a WPF image?

I needed an application to show images as actual pixels when zooming in – the application was specifically for drawing pixel differences. The default WPF image however, was using some funny sampling (fant sampling, it seems), so when zoomed in, pixels became blurry soup. What I wanted was nearest neighbour sampling.

Searching the web I couldn’t find any messages saying ‘do this!’, in fact all the messages were saying ‘this feature is not yet available’. Well, it turns out that it is now available and really easy to do. Just add the property to your image like this:

<Image name="myImage" RenderOptions.BitmapScalingMode="NearestNeighbor"/>

This did exactly what I wanted. There’s a  range of other sampling modes available too, if you know what you want.

Tips for improving mouse(cursor) input

Whether you’re drawing a fine line, trying to click small buttons, or sniping your girlfriend as she learns to play team fortress (sorry!), you need precise control. Depending on the situation, you might also need to respond rapidly.  Here’s a few tips for getting the precision you need, in hybrid importance+price order:

  • Disable mouse acceleration. With acceleration disabled, moving the mouse 5 cm should move x pixels on-screen – regardless of how fast you move it those 5 cm. There are situations where acceleration is useful, so you might want to disable this in separate application settings
  • Use a better mouse mat/surface. I recently got myself a Razer pro solutions mousepad, and it’s far more pleasant than using the desk surface. It wasn’t expensive either.  After using desk surfaces for years, the upgrade is amazing. When looking for a pad try to combine a ‘glidey’ surface with a texture good for your mouse sensor.
  • Disentangle wires – you don’t want to run out of mouse cable mid stroke or while tracking your target. Prioritise the mouse cable over static cables like the keyboard, simply unplugging the mouse, moving it out of your current desk setup, and plugging it in again could gain you a good 10cm of cable. Wireless is an option if cables just won’t reach, but I prefer a cable (cheaper, less batteries).
  • Use a better mouse – Your mouse should fit comfortably in your hand, move smoothly across the surface it’s on, click easily but not too easily, and be reasonably durable. I personally ignore DPI figures, as long as they’re not depressingly low. Use a USB mouse. The old Ps2 connection isn’t as good. I use a Logitech Mx518 everywhere I use a mouse.
  • Get a mouse with variable sensitivity. This can take some getting used to, but switching sensitivity is great for changing from sweeping strokes to fine detail, or from 360° coverage to precise sniping.
  • Use a different style device (tablet/space navigator/gamepad). Mice are great general purpose tools, but they aren’t perfect for everything. Tablets offer pen control mapped to the display, mirroring your gestures exactly on the screen. A decent tablet can radically improve your digital art  quality. Space navigators are a great alternative for navigating through 3D space. Gamepads are great for driving and flying thanks to their continuous style input (you can continue to turn left infinitely without repositioning).

If you have any other tips or getting more out of your pointer, let us know in the comments!

Another CUDA post – how to move to cuda compute 1.3 safely

CUDA compute1.3 (and higher) add features that you might want to use, but they also add double support. This can be troublesome in performance applications, as double performance is much slower than float. Here are some tips for making your code use only floats. Please comment with any other tips you have!

The solution should just be to explicitly label any floats. For an example of the problem, 0.1 will be interpreted by the compiler as a double. This could propagate through your code and in an inner loop could seriously impact your performance. Whenever you use a floating point number and don’t want a double, add an ‘f’ to the end, thus: ‘0.1f’.

If you’ve already written a massive amount of code without this, here are some tips for finding doubles that have crept in.

  • Regex for “0.[0-9]+”, and match the whole word (add word start and end tags, or tick match whole word in your editor). This will identify all ‘0.0’s, and ignores all ‘0.0f’s (this tip works for non CUDA code too)
  • Add -keep to the NVCC compile options. You can then open the PTX in a text editor, and search for f64. If there are any occurrences of f64, your code is using doubles at some point. If you successfully did the above step there should be none.
  • Watch the compiler output for warnings about float and double conversion.

x not a function or static data member, in CUDA

This error message misled me for a while. It was telling me that my templated CUDA kernel was “not a function or static data member” – this after I added a struct pointer as a parameter. If I changed the struct to an int parameter, it worked fine (except being semantically stupid). I didn’t see anything wrong with my declaration of the struct, but on closer inspection, I had mis-capitalised one letter. Not the error message I’d expect for this problem, so it took longer than expected to find.

Hope this helps if you have the same problem…

Reacquiring your ‘gaming mojo’

After reading this, I wanted to put some thoughts down. http://ask.slashdot.org/story/10/11/25/067219/Have-I-Lost-My-Gaming-Mojo?from=rss

I can think of two ways you might lose your gaming ‘mojo’. At least these are the two I’ve experienced myself.

The first case is when I find myself getting slaughtered in x game (or genre of game), when I remember that I used to win easily… I’ve had this with first person shooters, strategy games, and specific titles. Mostly this is a multi player phenomenon, but in some cases also single player. I’ve put this ‘sudden’ degradation in ability down to an unnoticed learning curve. In these games, I got good through practising, but without noticing an increase in talent.

When I come back to them I expect to be good, get beaten, and as a result feel, well, quite bad. Sometimes I just put the game away and resign it to the past. If I care, for whatever reason, I usually go to train in a harder game to bring my skill level back up (playing, for example, red orchestra for an hour or two before, say, team fortress gives me an epic boost in kills).

The second case is when I can’t find a game I actually want to play. I have plenty of choice (really, woe is me) but I just can’t get into anything. I flit off to other things, coding, walking,e eating, but can’t play. Sometimes I just go with this, and get on with non game life – but sometimes it feels like “I don’t want to play anything any more, maybe I should even sell my pc!”. Then I get worried that an important part of ‘me’ is missing, and desperately want to get into a game. What does it take for this? Well, something good usually.

And recently I noticed something remarkable – while I’ve lost interest in strategy gaming, I picked up total annihilation the other day, and as dragged in, despite being tired, cold, and uncomfortable… While first person shooters have recently been quite good, F.E.A.R. and Red Faction captivated me in a compelling way. And I can’t tell you why. But I will try to work it out. All I can really say is, many games recently are missing elements common to these addictive classics.

Calculating the FLOPS of your NVIDIA gpu

This is the formula for calculating the peak FLOPS on your cuda enabled gpu. (as uses by NVIDIA) This is useful as a comparison when evaluating how many FLOPS your cuda kernel is achieving, and how much you can hope to gain through optimization. You can get the numbers needed from the NVIDIA control panel’s system information option.

If your card is pre-fermi:
Processor clock*cuda cores*3

If your card is fermi based: (or higher?)
Processor clock*cuda cores*2

Original Source here.

Internal server error 500 using SVNKit (hudson problem)

Had trouble checking out from SVN on a Hudson client, the error rather cryptically just “internal server error: 500”. The exact same project, but checking out onto a different client, worked fine.
After some hunting around and trying various stuff in vain, I deleted the SVN authentication details stored on the client at %APPDATA%/subversion/auth/svn.simple and the checkout started worked properly.
I assume this is because the client in question had been previously used to check out from SVN with other applications and that the cached credentials were somehow not-quite-right, but that’s speculation.

Paste unformatted text in Word 2003

Annoyed that Word keeps trying to paste your copied text in the original format? Record a new macro to fix it!

Tools -> Macro -> Record New macro
Give it a name – I called mine “PasteUnformatted”. The name can’t have spaces.
Click keyboard shortcut and give it a shortcut, I used Ctrl+v (this means the default paste behaviour on ctrl+v is ignored, but I never want the default behaviour)
Click Ok. The macro starts recording.
Click Edit -> Paste Special -> Select ‘Unformatted text’, then stop recording the macro with the macro toolbar.
This doesn’t quite work, as it forgets the unformatted bit (don’t ask me why, this is Microsoft), so open tools->Macro->Macros.
Select your macro and pick edit. Change the line to this:

Selection.PasteAndFormat (wdFormatPlainText)

Save and exit the macro editer.

now when you press ctrl+v you should get unformatted text (so it should match your document’s current formatting)

There are better ways to do this in Word 2007.