Chapter 6: What Programming Language or Tools Should You Use?


In this chapter, we are going to look at several development tools. Although this book is based on the premise of game creation without programming, you may eventually wish to look into the development side of things. Additionally, it will allow you to appreciate the types of games you can create and, more importantly, the tools that will allow you to create the games without writing a single line of code.

Overview

While many issues are debated in game development, the ones that get the most attention and are the most heated are those related to the choice of programming languages and tools. Game programming is certainly not immune to the argument, and depending on who you are talking to at any given time, you will receive a completely different answer to the same question. Therefore, rather than try to direct you to a specific language or development environment, we’ll look at several, discuss their strengths and weaknesses, and let you decide which language is best for you. This book is slanted toward game creation without programming; that being said, this chapter takes a well-rounded approach to the topic by looking at some traditional programming languages and some game creation tools.

One of the most important things to remember is that a good game design can often overcome a slower language and bad programming practices. This is not to say that the tool you choose isn’t important, it is obviously the largest focal point of any project. It’s just to serve as a reminder that nothing in game development, including programming languages and environments, is as important as becoming comfortable with any tools you choose.

Assembly

Assembly was the first computer language and is a representation of the actual instructions a computer processor runs. It has a very bad reputation that is hard to overcome. Many programmers feel that there aren’t enough benefits in using a language such as assembly. This line of thinking is becoming more prevalent as the speed and storage capacity of computers continue to rise at a seemingly exponential pace.

The most often heard complaint about assembly language is that it is hard to learn. While this is true, it is probably not tremendously more difficult than any other programming language you are learning. As a whole, learning assembly is probably not much more difficult than learning any other programming language, especially when you consider that most programs are not based on assembly alone.

Historically, many games have used assembly in places where it could benefit the most. For instance, most 3D engines have been written in C or C++, but many of them have a few bits of code that were coded in assembly to improve performance. Most often, these routines are used for displaying information to the screen and are called thousands of times in the execution of a program.

Advantages

A programmer who is well versed in assembly can be a huge asset to a programming team. While most will use other languages such as C to do some of their programming, they will use the speed of assembly in the routines that need it. Thousands of games have used assembly to optimize their performance.

Disadvantages

It is not portable in any way because it is designed for a single processor. It has been given such a bad name in programming circles that many are afraid of attempting to learn it. It also takes a little longer to program a sequence in assembly than in any of the high-level languages.

Additional Information

If you are planning to write for a specific platform, you should check out the Web sites of the hardware manufacturers for that particular platform. For instance, for X86 machines, you should check out Intel and AMD, the two biggest producers of processors for PCs.

C

Dennis Ritchie created C in the 1970s. Its original purpose was for writing system-level programs such as operating systems, but at the same time, it was intended to be a language that anyone could use and learn. Before its introduction, operating systems were coded in assembly language, a very arduous task even under the best of circumstances. Because of its initial purposes, it interfaces well with assembly language, which, as we mentioned in the previous section, can be an advantage when you are trying to squeeze everything you can out of a system.

Advantages

C is at its best when writing small and very fast programs. As was previously mentioned, it can be interfaced with assembly languages very easily. It is also very standardized, so platform changes are not nearly as noticeable in C when comparing it to other languages. Many aspects of the language are platform independent, although you are generally required to write user interfaces for every platform you intend to use. It’s not too difficult a process, which makes C a popular choice for multiple platforms.

Disadvantages

The syntax of the C language takes some time to get used to and might not be the best choice for beginning programmers. It does not lend itself to object-oriented techniques, which can be problematic for individuals who are used to object-oriented programming (OOP).

Additional Information

There are so many books and so much documentation available for the C language that it could conceivably take an entire chapter to simply list them. With that in mind, you can look in discussion groups or online bookstores such as Barnes and Noble (www.bn.com) to look at the most popular of the many books.

C++

C++ is an object-oriented successor to C. If you are unfamiliar with the concept of OOP, it simply means that the programs are built out of objects. Theoretically, using this type of programming allows you to create an application with libraries designed by yourself or others, piecing them together as needed. There are countless libraries available for C++, covering everything from sound to graphics and databases. It’s often a much easier solution for programming, but many game developers do not embrace C++ because it often adds overhead to a game, which slows it down. Obviously, this is not what most game programmers are looking for.

As was previously mentioned, the advocates of a particular language or environment are very quick to point out the weaknesses in other development environments. The C versus C++ argument is probably going on right now in a discussion group or online chat room. You usually will find individuals who are on one side or the other, although you will occasionally find someone who likes both and understands the strengths and weaknesses of each. The independent members of the discussions usually will point out that C++ is much easier to use and that the extra overhead associated with it is more than worth it.

A smaller problem within this much larger one is that many individuals try to decide which language they should learn first, C or C++. Again, this is not easy to determine. Although C is probably easier for a beginning programmer to learn, you will not learn object-oriented approaches and will therefore be required to relearn a new way of programming if you want to use most of the newer programming languages.

Advantages

With its object-oriented approach, C++ is much easier to use, and some people like the enormous number of libraries that are available. It is probably easier to manage programs in C++ than in C, too, especially when they can become extremely large and complicated, as games tend to do. It’s slightly more portable than C, and the vast majority of commercial games is probably written in C or C++. Also, tremendous IDEs for C++ exist, such as Visual C++ (seen in Figure 6.1) and C++ Builder.

click to expand
Figure 6.1: The Visual C++ IDE is an advantage for developers.

Disadvantages

Depending on the situation, C++ may be slower than its C counterpart. It can also take some time to get used to if you are unfamiliar with structured programming.

Additional Information

Like C, there are too many resources to limit this to only a list. Check the listings at any online bookseller’s Web site to determine which books are best for the version of C++ you are using. There are also many good programming classes at your local community college that might be helpful to a new programmer.

Visual Basic

Basic has been around for some time now, although Microsoft has clearly captured the market with one of the most popular languages for development of business applications. It is the most widely used language in the world because often it is easier for beginners to learn and use. One of the problems with Visual Basic has been its lack of support for heavy-duty multimedia work, although this problem has quickly disappeared with many third-party 3D engines and tools written exclusively for the VB programmer. Also, DirectX has had support for VB since Version 7.

Visual Basic’s strength lies in its ease of use. It is nearly impossible to write an application in C or C++ and do it as quickly as you can in VB. Most of its users are corporate programmers developing databases with VB on a daily basis. However, because it is the most popular language in the world, it was only a matter of time before support was available for multimedia and games. During the past several years, third parties have released countless ActiveX controls and add-ons that allow VB programmers to take advantage of DirectX and OpenGL. The controls allow VB programmers to do things they had only wished for. Now that Microsoft is supporting VB with DirectX, the language is becoming more popular for game programmers, and with the impending .NET release, it appears VB is poised to become a serious contender for game developers.

Advantages

It is the most popular language in the world and has a tremendous user base and support system. The VB IDE, which can be seen in Figure 6.2, is excellent, and even a novice programmer can pick it up and use it rather easily. Visual Basic can use DirectX, which enables it to compete with historically more popular game programming languages such as C and C++. Over the next few years, we are certain to see more commercial games written entirely in Visual Basic.

click to expand
Figure 6.2: The VB IDE is easy for beginners to pick up.

Disadvantages

The biggest disadvantage for VB is that it is a proprietary language. That is, a program developed in VB can run only on the Windows platform. That being said, many games are written only for Windows anyway because it is by far the most popular operating system on computers today. Additionally, the .NET framework may change all of this.

Additional Information

There are countless user groups and training materials for Visual Basic, and like C and C++ it would be impossible to list even a fraction of them. Most colleges offer low cost courses in Visual Basic. For beginning programmers, you can check out the book Learning Visual Basic with Applications. It’s a shameless plug, but it is a good beginner and intermediate programmers’ book, with complete instructions on building many types of applications, ranging from games to an MP3 player to a paint program.




Awesome 3d Game Development(c) No Programming Required
Awesome 3d Game Development: No Programming Required (Charles River Media Game Development)
ISBN: 1584503254
EAN: 2147483647
Year: 2006
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net