• Advertisement

Archived

This topic is now archived and is closed to further replies.

Looking for some direction

This topic is 5953 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm currently in my first year of a computer science degree, and am hoping to eventually get into games development. Im just wondering what subjects are important to learn from a games developers point of view. Im guessing maths and physics are both helpful, but is there any particular areas of them that are more beneficial than others (I found the linear algebra tutorial on this site which I will definately read). What about assembly? Is it necessary to know how to program in assembly? Just one other stupid question. What is directX and openGL. I realise (I think) that they are for doing graphics in a windows environment, but are they utilities, do you need to learn another programming language to use them, or is C++ a suitable pre-requisite to learning them. Anyway, any sort of advice would be much appreciated. Thanks. Edited by - shanemf on September 5, 2001 11:49:59 AM

Share this post


Link to post
Share on other sites
Advertisement
I cannot answer your first questions but DirectX and OpenGL are what we call APIs or Application Programming Interfaces. They are a set of Library functions that allow the programmer to turn the Windows enviroment into a games platform. Usually it will be difficult if not impossible to make a decent full screen game which is running in Windows, but DirectX allows you to do this by setting your graphics mode up and allowing you to write pixels to the screen and havinf control over ANY device plugged into your system with absolute ease.

Direct3D has functions for 3d graphics and can let you manipulate your 3d hardware. The good thing about DirectX is that it is compatible with any hardware such as

* Keyboard
* Mouse
* Joystick
* Monitor - Graphics card
* Or any other device you can plug in

What DirectX says is, that once the device is plugged in and has drivers for it (obviously), then it can be programmed easily. Unlike the days of DOS (Rest in peace) where you had to code for different types of Sound cards or graphics cards. It''s sort of like Windows finds your devices through DirectX and talks to it for you once the code has been written. I am not too sure about OpenGL though.

With DirectX all you need to know is C++ and u need to use Visual C++ by Microsoft. Well you dont have to use MS Visual C++ u could use Borland (Imprise) C++ or any other Windows C++ compilier but MS VC seems to be the popular one and around Gamedev.net forums, that''s all I seem to hear about (LOL).

DirectX is free, you can download it from Microsoft website, but it''s a heavy download, or you can order a free CD from them but the delivery is about $13 (American dollars) last time I checked (correct me anyone if I am wrong). You can get Direct SDK from some books like Andre LeMoths'' Tips and Tricks of Windows Game Programming Gurus. You also need DirectX drivers installed onto your computer to help run your codes and you can easily download the latest ones from the net or if you are a magazine subscriber and play the games from them, they sometimes or usually come with the latest Drivers, the latest DirectX is 8.0 (I think) and that''s what u should be aiming for.


I hope I helped.

Dark Star
UK

Share this post


Link to post
Share on other sites
Thanks heaps for the reply, its helped a lot.
I use Visual C++, so thats not a problem. I think I''ll have to get myself a copy of DirectX.

Share this post


Link to post
Share on other sites
Linear Algebra is pretty useful, I''m only halfway know it myself, so I should know .

Assembly isn''t required to program a game. Sometimes it is nice to know, but unless you know it well, you''ll get better performance out of a higher level language like C or C++, since the compiler would be better at optimizing than you are.

quote:
Original post by shanemf
Just one other stupid question. What is directX and openGL. I realise (I think) that they are for doing graphics in a windows environment, but are they utilities, do you need to learn another programming language to use them, or is C++ a suitable pre-requisite to learning them.


C++ (as well as C, which is normally considered the same language for the most part) is one of many languages you can use to access DirectX or OpenGL.

OpenGL is for doing hardware accelerated 2D and 3D graphics. DirectX does that as well input, networking, sound, and some other things. There are many other crossplatform libraries that are meant to be used alongside OpenGL that can handle the other stuff though (OpenAL, HawkNL, SDL, et cetera).

OpenGL isn''t just for Windows though, it works on a number of platforms (hardware, operating system, et cetera).

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Hi, I(newbie) would like to seek advice from the Pros regarding a comment.
Is it true that for beginners, we have to be familiar with C++, Windows WIN32 architecture, DirectX and openGL. And if it''s true, is there any books to recommend for those topics? please...


P.S. Any beginner books to recommend besides dummies?

savager-X

Share this post


Link to post
Share on other sites
savagerx: Check out the "For Beginners" section of this site for some good advice and suggestions for books. Personally, I think Bruce Eckel's "Thinking in C++" is a great intro for people who know programming but not C++ and "Secrets of the Windows Game Programming Gurus" (or something like that) are both great books to start with. I also hear the C++ for Dummies book is a good intro to C++.

For what it's worth...

-MightyM

Edited by - MightyM on September 7, 2001 11:04:26 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
another area of knowledge that seems to be overlooked here is software rendering. knowing how a scanline z-buffer is written or how a basic ray tracer is written goes a long way. many of the algorithms that these things use are applicable to just about every aspect of game programming.

knowing computer architecture in general is a good thing as well.

the more you know the better.




Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Only learn those things you absolutely need to know.
As you need to know more stuff, learn it then, not before that.

If you don''t know ANYTHING to begin with:

Learn Linear Algebra and basic Calculus, THEN learn C/C++.

After that, its up to you what to do:

Create A Game
OR
Create something more useful

The Game Learning:

First learn how your computer looks like inside and the basic works.
Then learn how games are generally structured.
Play alot of games.
Play even more games.
While playing, fool around alittle with OpenGL.
Fool around some more with OpenGL.
Learn linked lists.
Learn binary trees.
Learn I/O (std iostream or such are easy)
Learn from all examples on NeHe''s site.
And get your questions answered in OpenGL.org forums.

Welcome to a life of gaming&coding.

Share this post


Link to post
Share on other sites
Hrmm, some interesting posts here. I''ll try to give my perspective on some of the questions asked here. It''s long so beware.

I notice that a lot of people recommend specific math classes and such. These are useful classes to take in college because they will give you a heads up on how to handle some of the more complex aspects of graphics, but I think that this advice is missing a fundamental thing.

Just because you can use OpenGL or DirectX and some of your hard learned math skills to make a three dimensional ball bounce around on the screen doesn''t mean that you can design the basic infrastructure to actually make this easy to do and reproducable under the many conditions required by a game. Just knowing how to use the interfaces that a graphics API provide doesn''t mean that you will be able to use them in any way more meaningful than making a ball bounce back and forth.

Before you learn API''s and mathematics to do matrix transformations and the like you must learn how to design entire source code frameworks that operate with whatever graphics API you choose, that are independent of the mathematics you use.

The majority of ALL programming has nothing to do with which system you are programming on (there are exceptions, like operating systems programming) or which API for graphics you are using IF IF IF you design the system correctly.

The science of software design is really the ability to take a large task and break it down into small manageable pieces that have a limited reliance on other pieces yet still manage to complete their tasks. This is done through the use of generic interfaces (an interface is a collection of methods [functions] that provide a set of functionality. An interface NEVER changes in theory but can change in practice if you know what you are doing.)

In Comp Sci we call this weak coupling. In time you will learn that it is your best friend. REMEMBER THIS. To code and design a system right the first time will take MORE time in the INITIAL stages of programming but LESS time in the long run. Learn to think about system design and how to make REUSABLE design concepts. This doesn''t necessarily mean reusable in different projects as much as reusable in your current project.

So the class of study that I would recommend would be object oriented design. Many programmers will talk smack about it. I''m going to be arrogant here and say that this is because they don''t understand it. Mostly because they don''t study it. Also, realize that object oriented design has nothing to do with the language, it is all about how you construct the relationships between objects in your code. Get books on OOD. Live them, learn them, code with them and use them to help you design you own systems.

Here are some of the main portions of a game as I see them.

Graphics Rendering Engine (I use openGL but you COULD write your own, or use directX, SDL [simple direct layer])

3D graphics framework (Some API''s provide rudimentary functionality, like openGL and Direct3D)

Windowing framework (MVC [model view controller], DVA [document view architecture]. I use MVC because I think it is superior to DVA. Windows provides a DVA with MFC but most games have their own windowings system. I also use SDL to help with things like creating the main windows and such. You could also use DirectX for this. In any case I recommend insulating your design from any of these API packages so they can be easily replaced.)

Initialization/Game Loading system (I have a standard format that all of my config files follow and then I have a generic class that can read in config files of that type.)

Animation System (I load in animation set configuration files that tell me which graphics files make an animation. I also use some of the functionality of SDL for things like timers. The system that handles animation should be as separate from the Graphics API as possible.)

System Data containers and data structures. (This is usually broken down into modules internally where each module provides the mechanism to access, manipulate, and request notification of changes to its data. Remember, you should provide a central entrance point for all data modules through you main system data container. Usually this will be held in your Model [MVC] of in your document [DVA]. If you use "inline" functions for you data accessors [look this term up in your C++ book] you DONT have to worry about a performance hit for doing this.

AI systems (these should interact with the system data routines in a weakly coupled way, as in they should rely upon specific interfaces to the System Data containers but should NEVER EVER access public data in those containers.)

System Data Update routines. (These are actually a part the Data containers but they also can rely on the event manager to know when these things should take place.)

Main game flow algorithm (figures out when to call the different modules of the game. You should make this so that it can give specific time slices to certain components dynamically based on performance of the system. This may not be that large if you game architecture is highly multi-threaded.)

Networking (This is coupled to the data storage system and the event management system. These are usually operating system specific. I personally use standard UNIX style sockets. You can find out all about this kind of stuff on the net. MAKE sure that you don''t strongly bind your networking into the rest of the system. Use wrappers with inline functions if you have to.)

Event management (I use SDL which provides event functionality but this also ties in to how you handle events with you windowing system. If you are using MVC this is what the controller is for. If you are using DVA this functionality is part of the view. In any case, when certain events happen you controller is responsible for notifying the system data of the change [model or document] so that it can notify the views to update their data. This system also includes a method for allowing data storage modules to communicate with each other in a VERY de-coupled manner. I''ll tell you more about it in the future if you choose.)

Threading and Semaphores [data protection] (Yike! read up on this. This part is operating system specific usually, but if you are smart and use something like SDL, they''ll wrap the operating system specific mechanism for you so that you can use a standard interface on any OS, a-la weak coupling by using wrappers.)

Handling input data (Mouse, keyboard, joystick, etc. Make sure that you make this beautifully decoupled. I use MVC so my controller is where input data is relayed too. To decouple, at a wrapper level handle all input data as the same type, then you can attach input devices as you choose to those interfaces. This means that you''ll have a data input class that''ll handles ship movement. This class will be between the order to move the ship and the input devices to make the interpretation. In this way you could attach a keyboard, mouse or joystick to this class and they''d all use the same interface. Hence you save yourself a TON of coding by doing it right in the first place.)

GREAT methods for approaching these concepts can be found in any book on DESIGN PATTERNS. I recommend the gang of four''s books though. Ohh and one final thing. Learning to program games has NOTHING to do with playing games. Fundamentally programming games is no different than programming operatings systems is no different than programming accounting software (I know, I have done and do all three, currently being an operating system programmer.) My advice, spend less time playing games and more time learning how to program ANYTHING in general. Spend more time thinking about how you would design the SOFTWARE architecture of the game and less time playing them. Playing games is the game concept designer''s job.

Also, don''t just learn OpenGL or DirectX, learn how graphics API''s are created and how they work from a design perspective. Any good book on Graphics should teach you this. Don''t just learn link lists and binary trees. Learn about all kinds of data structures.

I also disagree with the first anon poster when he says "Only learn those things you absolutely need to know. As you need to know more stuff, learn it then, not before that." You''ll never know if you should use a certain data structure or certain graphics API if you don''t know about it before hand. If you don''t know about depth first graph traversals versus breadth first before hand you are going to waste so much time finding out that it may have been the way you should have done your traversal in the first place.

The first solution is not always the best solution. Learn as much as you can. It will help you avoid pitfalls.

savagerx, as you can see from my above rant so little of programming has to do with language or API [application programming interface] chosen. All a specific language or API will do is make your (the coder''s) job simpler in certain situations. Ex. It is easier to do proper OO implementation in C++ than in C.

Cheerz and happy coding all,

RandomTask

www.echoes.dhs.org/mp/
(The development website for my game. All content no crappy glitter.)

Share this post


Link to post
Share on other sites
RandomTask: Very loooong but regardless of what anyone has to say I agree with you completely and whole-heartedly. If ever there was a piece of information on the internet that would help you as a budding programmer; I would make it that post. I know seasoned developers that don''t get the principles in that post. Sad...

Again, well done.

YAP-YFIO

-deadlinegrunt

Share this post


Link to post
Share on other sites
Randomtask: That was a long but much appreciated post. Thanks heaps. I dont really understand many of the concepts you wrote about, but at least now I know that these concepts exist, which gives me places to start. I think I have to go. I have a lot to learn.

shanemf

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How can I create a topic?
Can anyone teach me?

Share this post


Link to post
Share on other sites
quote:
Original post by HuaHsin
Execuse me ~!
What is STL and GDI?

KOK@HOE


STL = S tandard T emplate L ibrary
GDI = G raphics D evice I nterface

There is a button on the main page in each of the forums you visit. On this page is a button NEW POST. In the future please try to locate this button, especially if your question doesn't relate to the current thread you are viewing. The reason being you could have a potential question that others would like to know but will never find because it's buried at the bottom of a thread with a completely different topic, resulting in redundant posts...

Also you may find this or this handy as well.


YAP-YFIO

-deadlinegrunt

Edited by - deadlinegrunt on September 27, 2001 10:46:15 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hi,

I want to try out game programming too.

I know how to program in Delphi and Java but I am by no means an expert at either of these. Still, I understand OO because of Java.

C++ is a must for game programming, right? So what is the best book and compiler for C++ for someone at my level? Yes, I have checked the "beginners" section. What book has good step by step tutorials so that I can learn on my own?

Is C++ a big step up from the languages that I am already familiar with?

thanks

Alex

Share this post


Link to post
Share on other sites
Hi Shanemf,
I''m just starting my first year of a Games Computing Degree. From what I can tell so far, we''ll be looking at the history of games, the social implications of games, the games industry, and keeping up to date with the latest developments. These are thing you won''t be covering on your course, but you can study them in your own time. Sites like this one and gamasutra.com are excellent too.
As for programming, we''re starting off with Pascal to introduce us to some concepts, then moving on to C++ - which seems to be "the" language to learn. The ordinary Computer Science students will be concentrating on Java, which surprised me a bit, because I thought C++ was one of the most useful languages to learn.
Maths wise, we''ve been told it''s not as important as we may think, and we''ll be taking lectures in 3D modelling and associated maths lectures to aid us.

Mr_Wobble

System Error!
Cucumber fault. Cabbage page stack overflow.
Please insert banana, and re-boot Universe!

Share this post


Link to post
Share on other sites
Thank you for your advice Randomtask
but in a programmer''s point of view, what is the main difference between DIRECTX and OPENGL in terms of syntax and others... I''m not starting a "war" sorry, and I understand that each of them have their own strengths.

Plus is this equation correct?:
LEARN =[((C++ && OOP) + (DX || OPENGL) + GAMEDESIGN)? TRUE:FALSE]



The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant

Share this post


Link to post
Share on other sites

  • Advertisement