Skip to main content
gamedev.net
🔒 Locked

[MDX/C#] Creating a COMPLETE engine?

Started by TFS_Waldo Apr 25, 2006 at 11:18 AM 9 replies 1.3k views
Original Post
TFS_Waldo
TFS_Waldo
Well, since I'm starting to learn more about programming in Managed DirectX 9 using C# (VS .NET 2005 Pro), I have a question. Before I start a project or anything, I was wondering how I should go about creating a complete engine. I mean, isn't it more efficient/neat to create the engine in a set of classes, functions, etc., than to put engine AND game code all together in the same project? I haven't looked into anything but "Windows Application" as far as C# projects go. But I have noticed the "Class Library" project. Would that possibly be the solution? If you can help me out I'd greatly appreciate it. Or point me to other links/resources. =) Thanks in advance, Matt U.
:==- Why don't the voices just leave me alone?! -==:
thezbuffer
thezbuffer
Quote:
Original post by TFS_Waldo
I mean, isn't it more efficient/neat to create the engine in a set of classes, functions, etc., than to put engine AND game code all together in the same project?

Yes
Quote:
Original post by TFS_Waldo
I haven't looked into anything but "Windows Application" as far as C# projects go. But I have noticed the "Class Library" project. Would that possibly be the solution?

Yes

You can have multiple projects in a solution too which means you only open a single solution and you can debug/step through your application and all of your libraries. Create your app, then right click the solution and select add project. Make the 2nd (3rd, 4th...) projects class libraries and you are all set.



ZMan
idloco
idloco
Quote:
Original post by TFS_Waldo
isn't it more efficient/neat to create the engine in a set of classes, functions, etc., than to put engine AND game code all together in the same project?

IMHO it is..
Quote:
Original post by TFS_Waldo
Would that possibly be the solution?

Yes

Ok about the links, here are some sites and blogs that i know are good about managed dx
The ZBuffer
they have a comparative list about MDX engines, you could see the code of some of them to give you an example of how they do the things
List of engines

You should check this sites/blogs too
Tom Miller's Blog
Coding for fun // they have a series of webcasts about mdx game programming, its a good place to start.

Hope that help

EDIT: Beaten by the ZBuffer...got to get better typing skills
------------------------------------ IDLoco Game Studios
TFS_Waldo
TFS_Waldo
Okay, thanks to both of you. And thanks for the links. =)

Is there really anything to creating a library in C#? Or do I just add my classes as necessary, etc.? And how would I go about using the library in a project, say for testing the library?

I'll Google for it. But I figured I could go ahead and ask, if it's no big deal. =)

Thanks again,
Matt U.
:==- Why don't the voices just leave me alone?! -==:
Jonas B
Jonas B
(No offense to you personally!)
Many people want to create their own engine first thing when starting with game programming.

Sure, you learn a lot about the basics, what's going on behind the scenes in games etc. But, and it's a big but, you'll probably write a pretty crappy API since you have little or no feeling for what your API needs are as a game programmer.

And it'll take a long time before you're likely to achieve the performance and feature sets that you can find in many free or cheap engines out there.

I *strongly* recommend using a few other engines first, writing real, polished games with them, to see what you like (and maybe more importantly: what you don't like) about them. When you're certain that you can do better, that's when you should start your own engine.

Even if the main objective is to write an engine, not games, this is the way to go.

Off to the zbuffer engine list with you! ;)
TFS_Waldo
TFS_Waldo
I have a great understanding about game programming. And when I started game programming (about 3 years ago) I did want to jump right in and make an engine and all that. But I've learned SOOOO much more about it since then.

It's not the game programming that I'm just starting. It's Managed DirectX that I'm still pretty new to. I did quite a bit of DirectX 8 in VC++ 6.0 though.

I just wasn't sure about creating a library in C#, as I know you just create a static lib. or DLL project in VC++. And it seemed pretty obvious that "Class Library" was the way to go. I just wanted to make sure before I got into it.

And I was asking this, in the first place, because I want to know which way to go when I DO get started. Once I'm more comfortable with MDX, I'll look into writing an engine. And I've created a small engine in SDL. It did all I needed it to.

And I'm not looking for a HUGE performance jump compared to third-party engines or anything. I just want to do it for my own experience. Depending on how far I can get with MDX will determine whether or not I try to make a COMPLETE engine anyhow.

But thanks anyhow. =) No offense taken, BTW. I know it sounded like I was trying to jump into game programming too quickly, but that's not it. Just MDX. =P
:==- Why don't the voices just leave me alone?! -==:
Jonas B
Jonas B
OK, sorry for jumping to conclusions and welcome to the wonderful world of MDX!

Quote:
Original post by TFS_Waldo
Is there really anything to creating a library in C#? Or do I just add my classes as necessary, etc.? And how would I go about using the library in a project, say for testing the library?


There's really nothing to it. For testing, I usually add some test Application Projects to the solution, but I know I should also learn to use NUnit.

As I still haven't found the COMPLETE MDX engine (or one that has all the features I need) - let me know when you're done with it! ;)
Armadon
Armadon
You have the option of always seperating your components into different objects. This makes things a little more modular and usefull in the sense that you have the ability to use them all over. Your renderer can be placed in a library and then be called and used all over in different projects.

I like the modular approach as it tends to keep code tidy and packages managable.
I suggest prototyping what you need to.
Start off with rendering and getting something on the screen. From there you work on getting your objects batched and managed by some scene management and then controls and so forth.

I hope this helps.
Take care.
Jonas B
Jonas B
About modularity:

When adding a new feature, I always ask myself if I (or anyone else) might want to substitute it with another system. If so, use the a design pattern that allows completely modular assemblies, so the engine can use whichever dll is present. Plugins, in essence.

For rendering, sound, and vector graphics I consider this a given. You should in principle be able to plug in DirectX, OpenGL or different software renderers; GDI+, Cairo or AGG for 2D etc etc.

Other areas can include GUI, AI, integrated editors, physics, serialization, scripting.

HTH and good luck!

Edit: This is the way I try to do things in http://www.codeproject.com/csharp/endogine.asp, you might have some help from looking at the project even though the graphics side is currently 2D only.
TFS_Waldo
TFS_Waldo
Well, thank you all. =)

And it's alright Jonas B. I didn't take it the wrong way. I know exactly what you were talking about. I could've explained a little more clear when I originally posted.

But I searched Google, and found out that all I have to do is this. Create a "Class Library" project, add necessary classes for the project, build it, make sure there are no errors/warnings. Then, add a test application to the solution, "Add Reference", and "Browse" for my class library DLL. =) It's that easy.

I may start on it sometime tonight. Just so I know I can do it. And that way the project is already there when I decide to start real work on the engine. I may go ahead and get the D3D initialization and all that in there, as I have that down.

But thanks again. I'll be back if I need anymore information/help. =)
:==- Why don't the voices just leave me alone?! -==:

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.