Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163635

Design??????

Sign in to follow this  
Scet

81 views

Alright I have a design question for you all. Basically each Quake engine is built of the last one and so most of the file formats are similar. This brings up the problem of some classes being exactly the same. Here's an example of the current layout:


- Quake namespace
- MDL namespace
- Model
- Frame
- Triangle
- TextureCoordinate
- Vertex
- Normals
- Quake2 namespace
- MD2 namespace
- Model
- Frame
- Triangle
- TextureCoordinate
- Vertex
- Normals


The vertex and normals classes are exactly the same in both namespaces. I was thinking of creating another namespace in the Quake one called "Shared" which would be for classes shared across namespaces.


- Quake namespace
- Shared namespace
- Normals
- Vertex
- MDL namespace
- Model
- Frame
- Triangle
- TextureCoordinate
- Quake2 namespace
- MD2 namespace
- Model
- Frame
- Triangle
- TextureCoordinate


This seems messy and may be somewhat confusing too since Quake 3 will have a normals and vertex class of its own.

I'm also unsure about the namespace names. The current one goes "Quake2.MDL.Model", but I was thinking of also going with "Quake2.Model.Model" or "Quake2.Model.File". This is because there are classes that can be used for both models and bsp levels, so naming the namespace after the file extension might also get confusing.

Edit: Now I'm thinking of using partial classes and giving each game its own DLL. So it would look this this:


- Quake namespace / DLL
- Model class
- Normals class
- Vertex class
- Frame class
- Triangle class
- TextureCoordinate class

- Quake2 namespace / DLL
- Model class
- Normals class
- Vertex class
- Frame class
- Triangle class
- TextureCoordinate class


I'm leaning towards this method now. It looks much moire organized and eliminates the issue of naming namespaces / classes after file extensions.

So does anyone have any suggestions?

As for actual development, I've implemented MD2 loading. I'll probably go out and buy a copy of Doom3 so that I can work on formats made this century.

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now