Programming Language for Game Design

I'm trying to be a game designer. As in, dabble in a bit of everything, and have the skills to make a game myself, which shall be the end product.
 
...When using C/C++ it matters to know how the registers are used...

Woah woah woah, wait up. C/C++ allow for direct register control, as in the cpu registers like AH, BX...? I'm taking my third semester of java and one semester of assemly, and I just spent more than 2 hours writing a program for the 8086 that inputs 2 numbers, gets the sum, and outputs it. Fricken thing took an extra 45 minutes because the jump on carry at the end couldn't make it all the way back up to the start.

I know a very little bit of C++ and it seemed to be in the same ballpark as Java. Does it really get that low level? Often?
 
There are two answers to your question.

The first answer is "no". On paper, the C++ standard doesn't say anything about which registers are used for what, and when.

The second answer is "yes". In practice, you can get further with debugging if you know what each register is (or should be) doing at a certain point in your code. If you're writing code that mixes languages, like writing assembler to access the CPUID instruction to figure out what processor is running; or writing code to interface to another language to get something done in a different/better way, then knowing what is supposed to be in each register is helpful.

Perhaps the most common example of this in my work is looking at return codes. Sometimes, people don't check them. Say they call Foo(), and it returns an integer, using 0 for success and -1 for failure. But someone has coded this:

Code:
    Bar();	// do something
    Foo();	// do something else, didn't check return code
    Baz();	// do some more stuff

As I'm stepping through the code and I want to see if Foo() was successful, I can't. There's no code to store it in a local integer and I can't see the return code. But if I know how the compiler works on my machine, I can check out what the function returned. On Windows, for example, I expect the return code to be in the EAX register. So after returning from Foo(), I can check out EAX. If it has 0x00000000, then I know Foo() was successful. If it has 0xFFFFFFFF, then I know it failed.

By the way, why did it take 45 minutes for you to fix your out-of-range jump problem? The pattern is very simple; branch around an unconditional long jump to the desired symbol. If you were going to do this:

Code:
   jc FarAway

just do this, instead:

Code:
   jnc NearByNotFarAway
   jmp FarAway
NearByNotFarAway:

and you're fixed.
 
Thanks alot for the answer. Was scared for a bit there but I believe I like that answer.

As far as my program, that's what I ended up doing, but I was only off by a couple bytes, so I spent 30 minutes rewriting a couple things to save those few bytes, and then realized that the assignment required the user to press enter after input, which added those bytes back in. At that point I just went with what you did.
 
Alright, so I'm on lesson 12 or so of that tutorial, it seems to be very good. It's getting heavier, which I like, but I think I'll like coding, however see it can get tedious. As for the modeling...yeah...that is going to take some work. I also have a friend that would do the game art if/when I start my game.
 
Alright, so I'm on lesson 12 or so of that tutorial, it seems to be very good. It's getting heavier, which I like, but I think I'll like coding, however see it can get tedious. As for the modeling...yeah...that is going to take some work. I also have a friend that would do the game art if/when I start my game.

If you want... I own a starting game company, and we are very interested in acquiring new talent. If you don't mind signing an NDA and such you could join our efforts :)
 
Cool.

I've been looking into the UDK Epic released...seems very interesting- a great learning tool. I've got another friend who will be looking into it as well...I'd love to start experimenting with this...he suggested making Gears 4 Dead. haha.
 
Back
Top