More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Todd's spacePhotosProfileFriendsMore Tools Explore the Spaces community

Todd's space

View space
Björn
View space
Charles
View space
rozita
View space
Todd
View space
DodongoXP
View space
Rohan Thomas

Thanks for visiting!
  • December 08 7:04 PM
    Hello Todd,
     
    Congratulations on your brand new condo!!!
    Hope I can visit your loveyly place one day in the near future.
    Please keep the place cleaned & tidy ยิ้มแฉ่ง
     
    Chotika
     
     
     
     
     
  • November 11 10:23 PM
    Hey Todd!
    Your place is just so so so neat!! Wonder what it was like pre-feng shui kitchen days.......
    Congrats on your new place.
    Cheers
    David
  • November 10 9:26 PM
    Hi Todd,

    if I ever go to your place, I'll let you know. Thanks for all the good advices :)

    Keep the good work up,

    Chloé
June 14

Game engine update #3

This is a video I made using FRAPS of the game engine I've been working on.

This is not actually my game, nor does it look like or have any resemblance to the game I'm developing - it's just a demonstration of the game engine.

So far, highlights of the game engine supports:

  1. Double precision for all displacements/positions
  2. Normal mapping, ambient occlusion mapping (self shadowing) for objects
  3. Full range Quaternion camera control
  4. Real physics based objects (all objects are tied to a physics object for smooth, realistic motion)
  5. Octree/Frustum culling

There's more, but I'll leave it at that as the demo doesn't show a lot of the other things.  I just wanted to update this blog that has been sitting here.

In the meantime, almost 90% of my time is going into the server-side (scalable massively multiplayer) development.  In a few months time, I expect to have a very very primitive implementation of an alpha test client.

Although the video appears grainy and jumpy at times, the actual image is extremely smooth and clear.  It's the codec compression/decompression of this video that makes it look poor quality.

Anyways, this very short video is a demo of what I'm currently working on:

 

More to come soon!

-Todd

March 08

Game engine update #2: Asteroid Belt!

Well it's been a while since I've last updated my blog - and really have nothing interesting to report in my life (well, ok, maybe something soon :), but for now, these are some of the lastest pics of my game graphic engine. 

Not really much new, except that I'm very close to completing a custom importer from 3DS Max to a custom model format that my game uses.

Those using XNA may ask, why "Yet Another Custom Format" ?

Well, I need the flexibility of using multiple vertex streams, the ability to reduce complexity of models that are far away, normal mapping importing with some advanced lighting as well...

Anyway, here are a few pics of some asteroids that I created in 3DS Max and imported into my game - the importer creates the DDS files automatically and the C# code as well - all I need to do is copy/paste to Visual Studio 2008 and I'm all set.

 

2000 Polygon count asteroids:

 

Asteroid1

 

Asteroid2

 

100 Polygon count asteroids:

 

Asteroid_100Polys

 

The first two screen shots contain asteroids that are actually medium polygon objects (<2000 polygons per asteroid).  They are 'normal mapped' which basically means that there is a 'picture' that covers each asteroid that gives it lighting instructions that give it the great detail you see. 

In the last screen shot (just above), the asteroids are low polygon objects (only using 100 polygons per asteroid), yet they look almost as well defined.  (Can you see the differences?)

Thanks to 'Normal Mapping', very low polygon objects can still look highly detailed.

Low polygon models are important in games because the less polygons you have per model, the faster your game will render!  Which means you can have more explosions, ships, etc.

These renderings of an asteroid are my first attempt at creating a model in 3DS Max, and as you can see, it isn't too bad.  I'll be hiring a professional modeler to do the 'real' game objects when I am ready for that.

The importer program I am writing looks like this:

image

And the exporter:

image

Well, that's it for now.

Back to work for me!

Also, just want to say 'hi' to the guys in #XNA on EFNet.

-Todd

February 15

Game engine progress...

Haven't made much progress lately, but I did manage to implement normal mapping and true specular lighting using the Phong shading model for specular highlighting.  This does not use the Phong-Blinn utilizing the half vector for faster calculations, it uses the more accurate Phong model.

The Phong-Blinn makes assumptions that the viewer and light source are at infinite distances.  Getting in close to the cubes produced a far different specular image when I compared the two, and I wanted accuracy over getting a 3% performance improvement.  Besides, by the time I ever get something released, the GeForce 10000 will be out :)

Currently, I'm working on creating simple GUI controls in XNA such as buttons, labels, etc.

Hopefully will have something soon.

This image depicts about 3000 cubes rotating around the 'center' of the scene.  Currently getting 62FPS in debug mode... in Release, it's coming to about 120FPS so far. 

-Todd

image

December 16

64 Bit code really is faster than 32 bit. Really.

Ok, so I haven't updated my blog in a while, and I needed a topic.  So this is it.

Now, granted, I *was* going to write about quaternions and their use in 3D graphics and how handy they are.  But I'm going to save that topic for another time because I'm looking at some old code using quaternions and frankly speaking I just don't know how the @!^&$ it worked before.  I mean it shouldn't...

So, 64 bits.  There are a lot of myths about 64 bits.  So what are some of the advantages of using a 64-bit OS?

  1. Increased overall memory capacity.  Today's operating systems (OSes) are limited to 4 gigabytes of physical RAM.  This is a processor limitation, not an OS limitation.  The reason we say '32-bits' or '64-bits' for OSes is the actual physical count of 'address' lines on the hardware address bus.  So, if you have 32 individual address lines, you can address up to 2^32 individual memory locations.  That comes out to: 4,294,967,296 bytes of memory, or 4 gigabytes (4GB).

    Theoretically, a 64-bit OS can address up to 2^64 bytes of memory.  That's 18,446,744,073,709,551,616 bytes of memory, or ummm well a hell of a lot of memory which I assure you at 2007 prices would be quite expensive. :)  I'm not even sure that amount of RAM exists.  Anyway, you can see why 64-bit OSes will be around for a while.  I won't be alive when 128 bit OSes become necessary. 

    You might think that 4GB is a lot and that OSes are so bloated now and Microsoft is just producing bloated code, blah blah blah... (insert more whines here and evil Microsoft monopoly comments and how people are forced to use Windows, etc. etc.)

    The facts are quite different.  Just take a standard high resolution image from a camera these days.  An image can easily take up megabytes of memory, and a video can take up 100's of megabytes or gigabytes.  Video editing applications, photo editing applications and the like require enormous amounts of RAM just to function smoothly.  You complain that Vista requires a gigabyte of RAM just to function?  Consider that Vista is doing many things in the background.  *One* application that edits photos or videos can easily require more than one gigabyte to function smoothly.  Anyway, I've digressed :)

    Oh, and if you are thinking "Well Linux takes up just x amount of RAM to function, therefore Vista is bloated"... well, consider my CALCULATOR takes less than a megabyte of RAM and boots up INSTANTLY.  That does NOT mean my calculator is more functional that Vista simply because it uses less RAM and boots up faster.  'Nuff said.

    Some 32 bit OSes deal with this 4GB limitation better than others.  But the bottom line is, if you put 4 gigabytes in your computer, you will only be able to use anywhere from 2GB-4GB of this. 

    Using 64-bit Vista Ultimate, you can use 128+ gigabytes of memory.  This should be future proof for a while :)  I say '128+' because as 128 gigabytes becomes the norm, Microsoft can easily increase this limit up to the physical limitations of a 64-bit processor (2^64 bytes - see above).
  2. Increased memory for applications (processes). 

    Did you know that each application on a 32-bit Windows OS can access a MAXIMUM of only 2 gigabytes of memory no matter how much memory you have installed on your computer? 

    With a 64-bit OS, this limitation is no longer present.  Serious server applications and games will really benefit from being able to access more memory.  For example, "Supreme Commander" uses upwards of 4 gigabytes on large skirmish maps... a 64-bit OS is becoming a necessity for gamers.

    Photo and video editing applications can now request as much memory as they need.  There are tons of other examples, but this blog listing will be a book by the time I'm finished.
  3. Performance increases.

    Yes, it's true.  64-bit applications for the most part will run FASTER than 32-bit applications on the same hardware. 

    Want a 5-20% increase in performance?  Install a 64-bit OS.

    What's the reason for this?  Well, here are a few:
    1. More internal 'registers' on the CPU allows the code to be smaller, lighter, and faster using the internal CPU registers instead of accessing physical memory (very very slow), or cache memory (somewhat slow).
    2. Guaranteed access to SSE(2) and other stuff.  Compilers 'know' that if you are compiling to 64-bit, then the processor will have minimum capabilities.  One of these is SSE which allows super fast floating point operations.  This benefits scientific applications, anything that does calculations (spreadsheets), 3D code and games :)  And a LOT more.
    3. Microsoft has changed the way that functions in code are called now.  Before, 'arguments' to functions were passed on the stack.  64-bit code passes the first three arguments using CPU registers (see #1) - so code that calls lots of functions benefits tremendously.  It takes less memory and less execution time to call functions in 64-bit code now.

This post is way too long now.  I'm going to leave you with some thoughts.  I've been using Vista Ultimate 64-bit version for about 6 months now and have not encountered any piece of new hardware or application that doesn't function just fine on 64-bit Vista.  In fact, you won't even be able to tell you are running 64-bits... everything looks and feels *exactly* the same.  The only difference is that things may perform a bit faster... :) 

Why not try it out?  If you buy Vista Ultimate, you get *two* DVDs in the box; one 32-bit DVD and one 64-bit DVD.  You can try out the 64-bit first (you do NOT need to enter a serial number or activate any version of Vista for an entire month).  So give the 64-bit version a try... you can always go 'back' to the 32-bit version of for some reason the 64-bit version doesn't work out.

Finally, I've been writing a game engine for a while now, and when I compile to 64-bits (I don't need to change any code!), the 64-bit version is running about 20% faster.  Amazing considering I didn't have to change anything.  I just get a 20% performance increase simply by running 64-bit Vista.

Keep in mind that you need a 64-bit processor :)  Most computers sold today have 64-bit capability.

There are actually a lot more benefits specific to 64-bit Vista.  Most of these center on security.  But that's a different topic.

Hope you learned something, this blog entry is definitely not complete with regards to the benefits of using a 64-bit OS. 

-Todd

November 16

Font to Texture application

I've been working on a game in XNA, and one of the things I need to create is a very flexible control library (labels, textbox, buttons, etc.).  The first of these must be the label so I can display some text.

Although XNA comes with text output functions, I needed more precision, performance and flexibility for text output.

The first step is to decide how to display text.  Do you convert font glyphs to triangles and render the text as true 3D?  What about creating a vector font? I decided that what I needed for most applications was high performance '2D' text that I could use for my upcoming control library - and that meant at the very basic level: using 'Quads' for each character and texturing the quads. 

Later on, in the control library, I can use many performance enhancements to render the labels.  For example, if the text doesn't change, we can render the text once using multiple quads, then render that to the label's 'panel'.  This way, we can simply use one quad for any string of static text.  Anyway, there are many ways to do it with various tradeoffs.

This is a screen shot of the application I am writing in Windows Forms (.Net 3.5 on Visual Studio 2008):

image

This application gives you many text output options, which I won't go into here :)  But I'm designing it such that it is very flexible.

Here is a directory listing in Vista that shows some of the characters generated:

FontToTexture2

I've got a few things to add yet and of course, the obligatory code cleanup and stuff that you always put off at the very end :D

Looking forward to getting some text into my game.  But first, I've got to write a text library, a control library, then... ummm well I better get back to work.

Enjoy :)

-Todd

View more entries