[.net] 3d engine on .Net , worth?

Started by
70 comments, last by GameDev.net 19 years, 4 months ago
having read through all the replies, I thought I'd just share my experience.


About one and a half months ago, I started perliminary work on a new engine. This one was based off existing code from my old engine, and was basically a reworked design to make it much more flexible. Standard C++...
I hadn't had that much time to work on it, but it was at the stage that a window was showing, using a rendering control layer api in a seperate dll, and a rendering api interaction layer in another dll (this one actually made the calls to directX) - plus some other bits and peices.

Anyway. At the same time I was working on a test of an idea for raytracing.. In C# not my usual C++ simply because it's much quicker to develop ideas in. Anyway, I eventually did a C++ port of this raytracer to see how it performed. To my surprise, not only did the port take a very long time, it also ended up runing noticably slower.

This got me thinking, and after a bit of time, I decided the future of my new engine was better off using C#/.net - various reasons. It wasn't any easy decision, but I felt that the project was only so far along, so changing now wouldn't be too difficult and would hopfully pay off in the long run.

So I started from scratch with what I had done.

The thing is, that probably more than half the C++ code I had is already implemented in the .net framework. Simple things like referenced pointers and GC arn't trivial in C++ like C#, yet once you have them you can't really live without them.
In the end, it took 3 days to get to where I had been previously. Practically exactly the same class/namespace structure and all. Just lacking the rather large 'internal' namespace...
It really, really surprised me. Yes, most of the code could be simply copy and pasted and modified, but still, it was very quick to do.
Things generally ended up much neater.

The extra language features also gave me the opportunity to rework how things were done too (using get/set instead of actual getters makes code so much cleaner for a small example) - etc.
I just really ended up liking how strict things were.


In the end, I'm very happy. I have a lot less to worry about (eg, memory managment for one) and can concentrate more on the design of the engine.


I'm very pleased with .net. It just seems to do everything logically. Managd DirectX is a real pleasure too (although a tad buggy at the moment, but thats being worked on)



Plus the thought that when I finish it should be pretty much completly portable is wonderful. I found in my C++ version there were several places where I was using #ifdef WIN32 .... #else #error ... etc.
Advertisement
yep. really cutting code size down is one of my favourite pros of .net.
the c++ dude missing the stl in the .net world will be having fun again with v2.0 when verifiable stl.net for c++/cli comes out.

Also to those people complaining about jit performance. you're supposed to run ngen right after setup on the target machine anyways. it performs a msil translation most suitable for the target machine.

This topic is closed to new replies.

Advertisement