Sign in to follow this  
macmoy

Why C# and not VB for game tools

Recommended Posts

Why use C# rather than VB in making game tools? for C#, how to make a simple mapeditor? will i be drawing a dx buffer inside a window(now whole window)? making a tool in C# meaning you'll use the tools in the toolbox such as buttons, textboxes, etc? or you'll make them by coding it? Please give some tips on how do professional game developers make their game tool in C#.. I made a tool once but I used VB6 not even VB.net. Thanks..

Share this post


Link to post
Share on other sites
Quote:

Why use C# rather than VB in making game tools?

Why not? As long as you're talking about VB.Net, they both offer basically equivalent language features. If you're just doing Windows Forms stuff and you know VB better than C#, VB would be fine.

Quote:

for C#, how to make a simple mapeditor?

That's really too involved of a question. You'll have to break it down.

Quote:

will i be drawing a dx buffer inside a window(now whole window)? making a tool in C# meaning you'll use the tools in the toolbox such as buttons, textboxes, etc? or you'll make them by coding it?

With managed APIs for DirectX, such as SlimDX, you can set things up so that you are rendering to a specific control -- often, people using Windows Forms use Panel controls, and pass the Handle property of the Panel control to the Direct3D setup routines.

The other parts of the tool -- buttons, list boxes, et cetera -- that are not the "engine viewport" (renderer) are generally done with the windowing API being used. This is usually Windows Forms or WPF.

Quote:

Please give some tips on how do professional game developers make their game tool in C#

Hundreds of different ways, most of which are irrelevant to you because you're not a professional game developer. What matters is what your needs are, not theirs. So figure out what you need from your editor and work from there.

Share this post


Link to post
Share on other sites
Ah i see.. Another question. Since some(including me) use C++ for game development, why not also use C++ for the tools?

Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
Ah i see.. Another question. Since some(including me) use C++ for game development, why not also use C++ for the tools?


C++ is used for tools. There is no specific language for tool development. Work with what best suits your needs.

Share this post


Link to post
Share on other sites
ahh okay.. thanks guys.. the only thing that confuses me is that my professional game developer friends always suggest me to use C#. anyway, thanks again ^_^

Share this post


Link to post
Share on other sites
C++ lacks some language features that can be extremely useful for tool development. Some of those can be provided in libraries, others can't. In the end you need to look at your requirements, your available skillset (and how that measures up against your requirements) and choose the toolchain that works for you. What other people use is largely irrelevant.

Share this post


Link to post
Share on other sites
Quote:

C++ lacks some language features that can be extremely useful for tool development.


please give example.. thanks..

Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
Why use C# rather than VB in making game tools?

for C#, how to make a simple mapeditor? will i be drawing a dx buffer inside a window(now whole window)? making a tool in C# meaning you'll use the tools in the toolbox such as buttons, textboxes, etc? or you'll make them by coding it?

Please give some tips on how do professional game developers make their game tool in C#.. I made a tool once but I used VB6 not even VB.net.

Thanks..


I wrote my map editor in C#, but that was simply because I feel more comfortable using C style syntax. It could have been done just as easily in VB.NET I suppose. Both use a Windows Forms editor to place controls. But either way you will likely need to write custom user controls that suit your needs. Use whichever you feel more comfortable in, or whichever one you want to learn/get better at.

Your friend may want you to use C# because the C style syntax is more common than the.... somewhat esoteric... VB syntax.

VB6 though... don't get me started. I could write a 10 page diatribe on that.


Edit: I just thought of something else. I think VB tries to hide the things going on under the hood from the developer, where as C# it's a bit more transparent. This would encourage a developer to delve a bit deeper and get a better understanding of the framework, instead of VB developers who like to remain blissfully ignorant. VB may be more appealing to beginners for this reason, but if you're courageous enough to jump into C# you'll likely end up a better programmer IMO.

An example that come to mind is using delegates for events in C# which I think better illustrates how they work as function pointers vs. using the WithEvents keyword in VB which illustrates nothing but "POOF, MAGIC!".

Of course, making things easier isn't necessarily a bad thing. If it was we would still all be using assembly language. But like most things, it's a trade off, and I think C# makes a great balance between making things easy, and revealing enough detail about what is actually going on in the code.

[Edited by - CandleJack on February 23, 2010 10:54:56 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
Quote:

C++ lacks some language features that can be extremely useful for tool development.


please give example.. thanks..


More accurately, the development environment lacks some things that make it useful for tool development. WinForms for example make setting up a basic UI dead simple (and quick) compared to what you need to do in C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
More accurately, the development environment lacks some things that make it useful for tool development. WinForms for example make setting up a basic UI dead simple (and quick) compared to what you need to do in C++.


Back when I swung that way, I made my apps dialog boxes instead of standard windows. Then I could just use the resource editor to add my UI parts. Could do fairly complicated GUI apps this way (did lots actually). Not a lot more effort then it would take to do it in C#. But today its just much easier to do it all in WinForms and be done with it.

I use C# because the syntax is very similar to C++ so its easy to go back and forth. I've been doing some ActionScript programming lately and if I don't watch it when I go back to C++ I start declaring variables and functions the ActionScript way. Going back and forth from C# to C++ doesn't cause this problem. Probably the reason why most other people do it as well.

Share this post


Link to post
Share on other sites
Quote:

More accurately, the development environment lacks some things that make it useful for tool development.

I was actually referring to real language features -- reflection, GC, et cetera -- that allow for either powerful mechanisms to write less code to cope with data (the former) or write less boilerplate management code (the latter). And so on.

Share this post


Link to post
Share on other sites
Quote:
Original post by jpetrie
Quote:

More accurately, the development environment lacks some things that make it useful for tool development.

I was actually referring to real language features -- reflection, GC, et cetera -- that allow for either powerful mechanisms to write less code to cope with data (the former) or write less boilerplate management code (the latter). And so on.


Sure, that makes sense. The standard library disparity is what always leaps out at me... it tends to obscure some of these other benefits.

Share this post


Link to post
Share on other sites
I used Java for tool dev for the same reason one would use C# or VB.net. These languages are pushed for "Rapid Application Development" and if you know how to use them, they do exactly as it says on the tin.

C++ is supported on platforms you won't run your tools on and has performance advantages that do not apply to tools (or any amateur level games I've ever seen).

.NET offers Winforms which makes it easy to develop GUIs. It has managed memory which is a development time saver. These are things you need to make your tools.

Quote:
how to make a simple mapeditor? will i be drawing a dx buffer inside a window(now whole window)?


I used the basic Java Graphics API to draw into a Component. Buttons and all these things are components. You can make most of your GUI in Winforms, then use a lower level graphics API (whatever it is in .NET) to paint your level visualization. You could use DX or whatever is quickest and easiest to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by jtagge75
Back when I swung that way, I made my apps dialog boxes instead of standard windows. Then I could just use the resource editor to add my UI parts. Could do fairly complicated GUI apps this way (did lots actually).

I once worked with a tool that was built like that. The thing captured key combinations like Ctrl + S, disabling quick saving in any other program I had open at that time, and if I accidentally pressed escape while working with it, it would close immediately... not sure if that behavior is inherent to dialog boxes, but it sure was annoying. ;)


And yeah, for GUI apps, C# is a good first choice. Others said it already: it's easy to set up an interface and it's a nice language for tools. I prefer Python for most other tools though. Automated data-processing scripts, data visualizers, that sort of stuff.

Share this post


Link to post
Share on other sites
I've made tools in C++ and C#. C++ using GDI allows you to do some things that .NET doesn't allow you to do easily, like a NOT Pen (changing the colour of the line you are drawing depending on the colour you are drawing over, ie drawing a line that is black over white and white over black), but it gives you so much control that unless you are very careful you run the risk of making something that reacts differently to any other program.
The advantage of a GUI is that you don't have to relearn a lot of different things to use a new program. Unless you are careful and put a huge amount of effort into making your tool comply with all of the little conventions you won't have that advantage and everyone who wants to use your tool will have to learn it. That is a huge problem and increases the difficulty of making a good tool.

The advantage of C# and other .NET languages is that it provides a huge amount of functionality that works the same way as everything else in the system. So it reduces the total amount of work required. Any language that provides similar advantages is good, pick the one you are most familiar with.

Share this post


Link to post
Share on other sites

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

Sign in to follow this