Sunday 10 January 2010

Where do we go from here?

The client sockets code I was planning on implementing is now complete and fully working, this just connects to a remote server, authenticates the user and returns their connection token, the name of the region they are currently in, and an IP address and port of the simulator they were last connected to.

I have added validation to the login boxes on the Globe client, so that a name and password has to be entered before the system will attempt login. I improved the text boxes a bit by widening the possible characters it can contain.

At this point I was dying to get my teeth into some 3D programming, so decided to make an XNA content pipeline extension to generate skyboxes. With some tinkering this started working very nicely.

So now, the process as it stands - You execute the client application and are presented with the login screen, you enter your Globe name and password and the system makes an authentication request to a TCP login server. If successful, the login screen disappears and the skybox (only) is shown.

This is all very good, I have made great progress in just a couple of days, but a comment Artiom posted a couple of posts ago would not leave my head. "Why not use OpenGL?"

Is the best solution to use XNA? or DirectX? or OpenGL? I did some research.

OpenGL looks like a great option, many operating systems support it to varying degrees, it is open standards, faster rendering, but it is a low level C library and although several C# wrapper libraries exist for it, Ideally any application written for OpenGL would be C++ or you would be killing the cross platform compatibility.

XNA looked like a great option when I started, but as I go further into it, I find it can be quite restrictive. For example, key states can be checked easily, but there is no easy way to tell which character should appear in a textbox from the key press. It has good networking support.

I originally planned to make the application XBox compatible, through the use of the XNA framework, but I have hit a show stopper there. All XBox game content must be precompiled up front, and this kind of contradicts the concept of content streaming from asset servers. It is not possible to consume user generated content on an Xbox. So XNA in this case will only support Windows.

In an effort to investigate the latest DirectX offering, I downloaded DirectX 11 SDK. I created a couple of small applications both just to initialize a DirectX device. One in managed C# and one in unmanaged C++. The C# application felt like a hack to be honest, trying to render a Direct3D device on a .net form felt wrong. Also all the DirectX code samples all the way back to version 9 are in C++. There are some awesome new effects in DirectX 11, such as deferred particles which give an effect of rubble as a building falls down. Very nice indeed. The problem with that is over half of Windows users still use Windows XP, so the application wouldn't work for them.

My feeling at this point is to investigate OpenGL in C++ further as this will give maximum exposure to a wide range of platforms including Windows, Linux, MacOSX and Wii.

Please comment - I need your help ! :)

.........................
[Edit] 3 Hours later ....

I successfully linked an OpenGL C++ project that creates a window and a device and spins a triangle around on the screen.

OpenGL seems awesome and I would definitely go down this road if I had more experience in using OpenGL, but I have never used it before, so development time would increase while I learned the pit falls, and a lot more work would be needed in other areas. For example loading an image file is no easy task with C++.

Some alternative options would be:

Use DirectX 9 which is a bit older now, but is in Windows XP.
So that would allow basically all Windows users to run the application.

Use the Irrlicht 3D engine with C++, as this can run using DirectX, OpenGL or software drivers.
The engine also contains functionality for loading content and a lot more.

For now, I am going to stick with the XNA framework.

.........................
[Edit] 10 Minutes later ....

I once did a project with Irrlicht and it was very easy to use.
The engine is also cross platform, and open source so it deserves investigation.

Next stop Irrlicht 3D engine prototype Globe Client application.
Wish me luck !

No comments:

Post a Comment