docflabby's picture

Subspace II

JavelinParticle engine demo
Been meaning to do this for a long time. If you have any further questions about it feel free to ask me as I've probably missed something.

Aims

The basic premise of this project is to create a cross-platform sequel to the MMO game SubSpace which is currently played using the Continuum Client ( http://getcontinuum.com ). This game is over 10 years old and well due an update!

The goal is to augment the existing 2D graphics with 3D enviroment to enable new modes of play (think cross between asteroids and paper mario) whilst retaining the fun game play of the original. The current aim is to make a client that has the same functionality as the existing one then to extend it by adding new features.

One important aim is that i must run on older computers as well as newer computers. So OpenGL backwards compatabilitly is important.

Some techniques I have used that may be of interest are:

  • There is an mesh abstraction so meshs can be created regardless of your VBO support.
  • I also have ported a Milkshake3D Loader from C++/opengl to c#/opentk.
  • There is a texture and model manager.
  • There is alot of code dealing with rotation of objects in 3D space in a 2D plane.

Technology

  • Languages C# and C++
  • C# for game logic.
  • OpenTK is used for all ingame graphics.
  • Low Level Network code including reliable Subspace UDP implementation is written in C++.

All the interesting code is in the SVN client folder under my branch. The trunk is pretty old at the moment looking to merge it in a few days.

Demos
Website: http://subspace2.net
The Demo is not playable in any meaning full sence of the word.
Demo: http://subspace2.net/demo9.zip
Arrows - move
Esc - quit
pgup/pgdn - zoom
t/y - rotate view
enter = open chat console

This is my first real 3D graphics project and its been a really steep learning curve. I started with the Tao Framework but found OpenTK much easier and far far more logical. The little things like being able to easily write text to the screen make such a difference! The project was started in Jan 2008 and so far is the result of as a conservative estimate around 400 hours of work (mainly learning time)


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This looks excellent!

I was playing around with demo 9 on WinXP/VirtualBox and the speed was surprisingly good with software opengl (tested both microsoft GL1.1 and mesa GL2.1 - though the latter delivered significantly better visuals). In other words, compatibility with older cards should be great.

I'm now itching to give Continuum a try (ugh, must... not... exams!) :-)

docflabby's picture

thanks for testing the demo! heh I would strongly recommend waiting until after your exams continuum can be quite addictive!

objarni's picture

Cool!

Question: why did you write the network code in c++ ?

docflabby's picture

Re: Question: why did you write the network code in c++ ?
To be specific its only the network processing code. The actual UDP connection is handled in c# (check the Network class) it just passes off the data recieved and data to be sent to the C++ dll first. Bascially it works like black box I feed it packets and it gives me back the processed packets.

RECV: UDP Socket -> SubspaceStack.dll -> Program
SEND: Program -> SubspaceStack.dll -> UDP Socket

The reason i used C++ was that it has to interop with a server written in C/C++. To do this i had to include some arcane encryption techniques (which started out as essentially assembly rips but have gone though a number of permutations) and I really struggled to get c# to work with it, it also seemed to significantly slow down the program (mainly due to alot of wasteful array copying and type conversions). The C++ code does a lot of type unsafe things such as having to use an array as both a byte array and an int array at the same time.

The 2nd (more minor) reason is i want other people to be able to use the network processing code in other programs. Keeping it in c# would limit who could use it. (c# is not a particularly popular language in the SS community. C/C++ and Java are more popular.)

But bascially I found it too hard to get that part of the code to work in C#. I found it easier to get it working in C++.