Blog of Josh "Renanse" Slack

Updates and commentary from the depths of a 3d Java code spinner's mind.

Friday, March 23, 2007

Need a job?

Via a posting to the jMonkeyEngine blog today, we've announced that the Java team here at NCsoft is looking to add skilled Java programmers. Head count figures, salary, benefits, or any of the typical questions you might have are not available because at this point we are simply looking for resumes. However, I personally recommend sending us your resume now if you have the skills and a sincere interest in working on Java gaming technology in Austin, TX. Sometimes things move and opportunities close faster than you expect.

See the official posting for more information
.

Labels: , , ,

Tuesday, March 20, 2007

GDC session notes

As promised in my last post...

My GDC 2007 Conference/Session Notes (in order of attendance):


ATI Graphics Performance Development Tools:

ATI has been hard at work improving their suite of tools. Their main showing was PerfStudio, a visual analysis tool that tracks graphics API calls and card and application statistics (for example, hardware utilization, time spent waiting for vertex processing vs. pixel processing, overdraw, etc.) It also allows for setting break points and inspecting shader code. Being from OpenGL land, I can’t really compare the power of this tool with any other graphics api performance / debugging tool because we don’t really have a good one to speak of (except for gDEBugger, which is pricey and I haven’t used that myself.) That said, I thought it looked useful. Currently you can download a version that works with DirectX 9 here: http://ati.amd.com/developer/gpups/index.html The DirectX 10 / OpenGL version will be released in Q2 with their new cards.

Beyond PerfStudio they also showed off ShaderAnalyzer, a tool that helps you measure the performance impact and functionality of your shaders. It supports GLSL, HLSL, ARB and assembly shaders. It also allows you to see the native compilation of the shader against various driver releases. Other tools included Tootle and Compressonator, both of which looked interesting, especially as part of a tools pipeline. The first helps you optimize meshes for reducing overdraw and vertex caching. The second is a tool for reducing texture image size. These two tools are non-ATI specific for the most part, meaning using them will also produce benefits on nVidia cards.


ATI – Massive Multi-Core CPUs and Gaming:

This session focused primarily on the CPUs having more than just 2, 4 or even 16 cores on a chip in the future, rather they wanted us to start thinking about having dozens or even hundreds of cores on a single CPU. Due to physics (too hot!) and power requirements, they feel the clock speed of a single core is about as fast as it is going to get. The only way to move forward in computing power is therefore to go massively parallel. AMD’s quad core chip is due out in the 2nd half of 2007 and they felt that Moore’s law was now about cores per chip, predicting 8 by 2009, 16 by 2010/11, 32 by 2013, and so forth.

Typical current threading usage in games has been at the system level – i.e. having a thread for audio, a thread for physics, maybe a thread for AI, etc. This approach is not scalable moving forward to these “massive multi-core” chips. Instead, they argued the focus should be on Thread Level Parallelization – things like spawning off threads to run subsections of a "for loop" in parallel, etc. The presenters offered a number of tips for doing this effectively which are probably best understood by reading their presentation slides. Here is a short list: (Much of it is not something I would deal with in Java so they I am probably not doing proper justice.)
  1. Cache optimization is extremely important. Keep your structs as tight as possible with as little byte padding as possible (e.g. use a one byte value instead of a full four byte variable in situations where you are storing values <>
  2. Lock as late as possible and release as early as possible.
  3. Do not thread / synchronize at the system level. Use thread pools, OpenMP, etc.
  4. Keep variables on separate 64byte cache lines to prevent false sharing.
  5. Try to keep memory local to the CPU of the thread using it. You can use NUMA information (getNUMANodeProcessorMask in 2000/XP) to help in determining this.
  6. Keep your producer and consumer threads on the same NUMA node.
  7. When detecting the number of cores you have on the system for setting up your thread pool, rely on the OS instead of low level detection methods. (Vista – GetLogicalProcessorInformation. XP/2000 – GetSystemInfo) Relying on the OS keeps you compatible with virtualization.
  8. Use a central thread pool and target a 1-1 ratio of working thread to CPU core.
Another topic discussed in the session was SSE128 which as the name suggests doubles vectorized throughput by enabling reading 128bits in a pass. According to AMD, matrix multiplication is sped up through use of SSE128 instructions by 85%, other math operations by 10-50%. No speed improvement is made for scalar code. AMD has released a free library called AMD Performance Library (available for 32/64 bit windows and Linux) which consists currently of math and image manipulation routines that use this instruction set. You can check that out at: http://developer.amd.com/apl.jsp


The Future of Storytelling in Next-Generation Game Development



Warren Spector gave an interesting talk on his feelings about the importance and direction of story telling in gaming. The main points of his talk were:
  1. The story of a game and the telling of that story are important factors in drawing new players into gaming because story telling in general is a universal quality of the human race.
  2. The story of a game should provide a context for player action. It should not dictate the player’s actions, but it should make the player’s actions feel more meaningful. Still, having a story provides some limits and guidelines to the game world, which makes it easier for the players to make decisions.
  3. Story pacing and path gating should be based more often on trend tracking rather than a single critical “go down path A or path B?” point. Track the way a user interacts with the world and with others and use that information to push players down different story lines.
  4. Allow players the ability to take part in the story telling.
  5. Let your players “off the rails”. Allow them time or ability to explore the inner lives of the characters. He used the Hong Kong level in Deus Ex as an example.
  6. Iconic vs. photo-realistic. Too much emphasis has been placed on photo-realism in games, especially on the next generation platforms. While he conceded that still shots of the characters in these games look great, almost perfect, he contended that when animated, the realism often left much to be desired. It is important to have empathy with your characters and he felt the continued push towards photo-realism actually has moved us further from the ability to feel that empathy. He put up a picture of Mickey Mouse and one of a girl from a current title and said he felt the first one had more potential for conveying emotion and creating emotional bonds with the player.
  7. Hire world builders and designers that have the ability to truly believe a world location is “real”. This ability to immerse fully in the game locations and content will translate to the player when they are experiencing the game.
(Warren also commended work done in the area of believable, immersive story telling by Ken Perlin and Paul Ekman. He did not mention the details and I’m only familiar with Ken from Perlin noise, but if you are interested in this topic, it might be worth googling work by these gentlemen.)


Intel Multi-Threaded Building Blocks:

Intel was basically pitching their threading library here which consists of basic components you can snap together to make multithreaded apps. Intel’s approach to threading here is to define code in “tasks,” leaving it to their threading library to break these up and execute them on individual threads as needed/possible. Division of tasks is done by placing the task on the stack and dividing it in two. The first half is then processed leaving the second half to be processed by another thread if available or by the initial thread once the first half is done. This division is done recursively until the task size is less than a given task “grain” size.

Intel’s MTBB library also provides safe concurrent containers such as hash, queue and vector. It also provides some kind of scalable memory management. Their library is supposed to work equally well on AMD. I zoned out a bit because the talk felt extremely “pitchy” so if you want a better understanding of the library I would suggest reading about it here: http://www.intel.com/software/products/tbb Intel’s GDC presentations are also available here: http://www.intel.com/software/gdc


Shigeru Miyamoto’s Keynote “A Creative Vision”:

Wow, lots of people lined up to hear Miyamoto talk about how his vision works. After waiting in line for about 30-45 min we were finally allowed into the auditorium where we proceeded to wait for a while longer.

Miyamoto’s entrance onto the stage with played up using the Wii’s Mii channel, showing someone creating his Mii avatar upon which he suddenly popped onto the stage. Interestingly enough, Miyamoto used the Wii photo channel to give his slideshow presentation.

You might think I am going into a lot of detail about some fairly trivial things. I am. That’s because the actual presentation was basically a recap of Nintendo’s history, the console controller’s history, and his own personal history, as well as a long summary on Nintendo’s corporate mottos.

All that stuck in my mind after this long presentation (it went forty five minutes or more over time) was how he presented his litmus test of a game’s mass market appeal. He did this via his “Wife-o-meter,” basically a measure of how much a game he had worked on appealed to his wife. Evidently she really likes Wii sports.


Innovations in Fable 2:


I arrived a little bit late to Peter Molyneux’s talk on Fable 2 to find him talking about sex and bawling on stage. The talk was on the new innovations of the sequel to Fable, and from my well timed late entrance, I gathered you can buy condoms and have protected/unprotected sex. Having unprotected sex means you may have children. Children in Fable 2 are like mini versions of you. They like the same things that you like, are evil bastards or saints like you, and they worship the ground you walk on. When you come home from adventuring you can play with your kid and just generally watch him/her grow up. Touching right? (Thus the bawling… he’s quite the actor.)

Besides a virtual family, you have more virtual property. In Fable 2 you will be able to buy any building in town (or all buildings in town) including homes, shops, etc. Buying these places will unlock related quests such as “go collect 10 rat pelts to sell at the little shop you just bought.” The money you make will be “physical” meaning there will be a room with all your money in it that you can go to and swim through the yellow stuff, (or perhaps cry over cobwebs if you’re poor?)

How you react to quests also will affect the world. Similar to Fable, people will remember your local actions and react to you accordingly. Peter says Fable 2 will take this further by having your actions affect actual world content. For example, if you decline to help save an old man living alone in a hut in the forest, there may be nothing left the next time you pass by. Conversely, helping him out might encourage more residents to gather in that area and an entirely new town to appear over time. (At this point I had acorns and trees dancing in my head.)

Your new canine sidekick was of course the real talk of the presentation and probably something you’ve already heard buzz about. Also a reflection of your actions, your dog will change with you, becoming more evil or virtuous looking as your looks change. Peter called the dog a “canine simulation” several times, mentioning that knowledge from the Black & White series and the original Fable went into the simulation code for your dog. The dog has a few core directives, somewhat similar to Asimov’s three robot laws. He loves you without question, wants to protect you, and wants to protect himself. (Evidently they added the last directive because beta testers were throwing tennis balls off cliffs to watch the dog dutifully leap to his death.)

You have no direct control over the dog, only interacting by emotes and the cues of your own actions. Your dog will learn to attack monsters, will sniff out treasure, will scout ahead, and will crawl back to your feet at the pub a bloody mess if you run away and leave him behind. Evidently they’ve removed the 2d map/compass in favor of using the dog as scout to lead you down paths. It will be interesting to see what if any of this makes it into the game.


Free to Play, Pay for Stuff! The Virtual Item and Micro-Currency Frontier:


This was an interesting round table attended by lots of industry players such as people from Sulake (Habbo Hotel), Hasbro (Magic the Gathering), Three Rings (Puzzle Pirates), Iron Realms Entertainment (Achaea), SOE (Station Exchange), Viacom (Neopets), and more.

Interesting points discussed:
  1. Having two (or even more) currencies is something many of the big players are doing to encourage and balance a broader audience. The currencies each have a root in a play style or demographic if you will, the two main currencies being for people who spend a lot of time playing (currency you get for grinding) and for people who have money to burn (currency you get via purchasing with real money.) Other currency bases included currency gained by being there at certain key game moments and currency for having great skill in the game. These last two generally manifested as unique in-game items.
  2. An unscientific poll was taken of the room asking what the percentage of players bought items in a given month. The range was 10-20%.
  3. You can drive more sales via in-store trading cards that are redeemable for random in-game items. Players who may not be willing to spend $5 on a suit of plate mail are likely to spend $25+ on cards in the hope one of them will contain a rare item. (Think lottery effect.)
  4. New opportunities for micro-transactions (for example, new "furni" for your player housing, new patterns, etc.) can be added to the game in scheduled updates (e.g. every Tuesday – weekly was mentioned as having the most impact) to promote players to login often to buy more.
  5. Play with supply and demand… Limiting item availability will drive up how much you can charge for an item. (New plaid knapsack available for $25! Only 1,000 units will be sold!!!)
  6. Inflation can be avoided to a degree by having items purchasable via micro-currency all have unique abilities / appeal. Selling a longsword+3 just makes all of the longswords+2 out there worthless.

  7. A browser based game I hadn’t heard of before called Seafight – (http://www.seafight.com/) claimed revenue of 14 million euros last year. They appear to have close to a million registered users.
  8. In a later meeting, but related: Puzzle Pirates laid out their sales figures and showed that the $19.95 price point for buying in-game currency was the biggest money maker, but having multiple price points was still useful for pulling in more business.


Skinning with Dual Quaternions:


This session was in one of the larger rooms and was still packed wall to wall which was surprising to me for something so math heavy. Basically, the session was a recap of a PHD thesis paper written on using a “dual quaternion” to replace a three dimensional rigid transform. A dual quaternion in a data sense is essentially a 2x4 matrix (or two quaternions as the name suggests.)

Allow me to butcher the talk: You can convert a quaternion and translation vector into a dual quaternion by placing the quaternion into the first column of the matrix and then using a formula on the translation vector to fill the second column. The second column in the matrix represents a screw transform, which you can imagine as a screw orientated about a certain arbitrary axis and rotated a given number of degrees.

Since Dual Quaternions can describe any arbitrary rigid transform, it is possible to use them for skinning. In a long presentation on the limitations of various skinning techniques, we were shown why the DQ method is superior to anything else out there. I will leave it up to the reader to go over the write up and decide for themselves, but they claim you can retrofit an existing skinning solution to perform DQ skinning in an hour or so to test the approach for yourself.

See http://isg.cs.tcd.ie/projects/DualQuaternions/ where you can find C and Cg source (the technique is shader based.)

Labels:

Late notes on GDC

As some of you may know, I was at GDC in San Francisco about two weeks ago. I expected to put up some of my thoughts and experiences right afterwards but decided to wait until a certain video blogger had uploaded a short interview I had done there. Time ticked by and that never happened, so without further ado, on with the GDC notes...


This year’s GDC was anticipated by many to be an insane answer to the implosion of E3. Fortunately, walking around the expo and sitting in on conferences, I did not seem to find this the case. The show felt bigger than the last time I attended (2005) but gaudy booths and deafening music were not the order of the day.
Joshua Slack and Chris Melissinos at GDC 2007
I spent a little time at the Sun booth talking to various Sun guys about Project DarkStar, jME and Java in general. There is a very positive view of jME and its community amongst those I spoke with. The kiosk showing off the alpha version of Jadestone's hockey game drew in many passersby and all of the feedback I heard was the (by now) typical "Wow that's Java?" "You can do shaders in Java?" "I didn't know Java could look like that!" and "Is that really Java?" Keep up the good work guys!

I also attended a party or two, the best of which was definitely the one thrown by Three Rings on Thursday night. Themed as a drunken mad scientist convention,Joshua Slack and Michael Bayne at Three Rings party, GDC 2007 there was plenty of loud music and interactive party exhibits. In the corner they were showing off the beta of their new flash-based project, "Whirled" (formerly known as "Meta Soy".) I wish them luck on that. Judging from their past and present successes, they should have no problems producing another winner.

Which reminds me to give a virtual highfive to the Three Rings group for winning the Technical Excellence award at this year's Independent Games Festival for Bang! Howdy. (Gratifying on a personal level because this game uses the jMonkeyEngine.) They were also in the running for the Seumas McNally Grand Prize. Way to go guys!

Stay tuned for session notes...

Labels: , ,

Monday, March 19, 2007

Sitting with Fish

So I've been with NCsoft now for a year as I note in my last blog entry and in that time I've managed to have three different office mates. Am I that hard to work with??

My latest office mate is none other than Sean Fish of City of Heroes/Villains fame. So far I've found him to be a cool guy and a font of wisdom regarding all things role playing. It is great seeing people of his caliber coalescing around the project. It's almost like we're a real game team...

Labels:

Friday, March 02, 2007

Top Secret Information Inside...

Yesterday was my one year anniversary working for NCsoft. I can't believe the progress we've made in a year with less than a handful of people. It's awesome to see the little bits of technology we've written come together to make something fun.

Still, yes, we've developed lots of cool game technology (yay!) but until now we really have not been able to show any of it off (drat...). Well for those of you wanting to know just what it is they pay us to do, today I was finally given approval to share some of this great stuff on my blog. So without further ado, here is the shiny:



What?! You aren't impressed? Ok, so it's just a first little minigame I whipped together in a couple days using jME, some networking, and our GUI system, but hey, you never know where you might see it again. In any case, this little jME card game is all the leak I'm allowed to give at this time, so consider yourself lucky. ;)

Looks like I'll be working on minigames and sound for the next couple weeks, so if you have a great idea for a minigame, send it to me.

Labels:

My first Mac OSX woe

I've been using OSX on my laptop and on an iMac since it first came out. Up until last night, I've had zero complaints. Things run smoothly, no crashes, no Blue Screen of Death, it's been compatible with my printers, window's network, etc.

Unfortunately, last night I found my first fly in the ointment. It was pretty late and I planned to watch a new episode of Lost in iTunes on my PowerMac G4. When I logged in though, the password box just shook its head at me, denying me access. No caps lock on, must've typed it wrong. I tried several more times to no avail. Finally it asked me for my master password which it accepted, prompting me to change the password for my user account.

Ok, no harm, no foul - except that it continually rejected every attempt to set a new password. Complex, simple, used, unused... everything I tried failed. It looked like I was locked out.

Fortunately, internet to the rescue. Searching the web I came across this simple trick to accessing a locked mac:

Restart your computer, hold down Command-S and type in the following:

/sbin/fsck -y [Enter]
/sbin/mount -uaw [Enter]
rm /var/db/.AppleSetupDone [Enter]
reboot [Enter]


I was taken through the "new user" part of OSX's install process and setup a new admin user. When I got into OSX with this user, I opened the control panel and saw my old user account was still there, but I was STILL unable to edit the password for some reason (yes, I clicked the unlock icon.) What the heck??

Finally, brushing off some old unix/linux skills I opened up terminal and executed a passwd [username] command and logged out, praying that that did the trick. It did, and I was finally able to enjoy Lost. (Nice hippy van, Hurley!)

Labels: