my gaming past, present and future
Friday September 3rd 2010

Interesting Sites

Insider

Archives

Developer’s Corner

icon_gauntlet_mayaThis is where I post about game development: programming, game design, level design, art, etc. If you have questions, please ask them.

A very important tutorial on pixel art that is too important to lose to the chaos of the internet:
So You Want to Be a Pixel Artist?


Text Console Library

Romero : November 23, 2007 4:10 pm : Developer's Corner

text maze console libraryWhen you first start coding in C/C++ your first programs are done in the console. The problem with the console nowadays is that the conio.h library no longer lets you do all the fun things it used to, like set the text color, set cursor position, clear the screen, etc. You can only print text out in a stream just like the olden days of the 70′s and teletype printers. Lame.

This is the problem that all beginning game coders run into and it really takes some of the fun out of learning when you can’t even sit down and try to write Pac-Man in text mode.

So I poked around and found a little snippet of code, added my own functions and now I have a nice little text console library you can use. Just add the console.h and console.cpp files into your empty Win32 console project and you can actually make text games. Without this kind of library you can’t really make any kind of fun text game other than an adventure.

I threw together a short sample program to demonstrate what you can do. It’s a simple maze that has a random exit (‘X’) in it; touch it and you win. The source is named main.cpp. The game? ULTRA-X OF THE FORBIDDEN REALM!

To add even cooler stuff to your console games you should download FMOD and link it into your project. Instructions on how to do this are on FMOD.ORG and are easy to follow. Imagine that – a text game with background music and sound effects.

Grab the code here (Windows only)

2 Comments »

Beginning C++, Part 2

Romero : April 30, 2007 6:50 pm : Developer's Corner

beginning c++ bookAfter further investigation and actual use, I would like to now recommend Michael Dawson’s book “Beginning C++ Game Programming”. I went to the book store, rifled through a ton of C++ programming books and after getting through my filter I settled on this book for my son Michael to start with.

Even though the title of the book sounds like you’ll be getting into a bunch of fun game stuff the reality is that all the focus for the first 8 or so chapters is just on learning C. C++ comes in during the next couple chapters and builds upon what you learned about C but doesn’t go too far – it keeps it simple.

Along the way you use the language to construct a few simple games that are all text-based which I believe is a great way to just focus on learning the language and some basics about game construction. So don’t be expecting to be drawing graphics and making sounds and using the mouse on a graphical screen – you need another book to do that and it should be AFTER you get through this one.

I got Michael a book on coding game graphics that he’s diving into now since he finished this book. I’m proud to say that he can program in C++ now after finishing this book and it’s not an overly long one either. It’s also very easy to understand with good explanations for the concepts.

Some things I would have liked to have seen in the book were explanations of switch() before its use, using struct{} and explanations of complex data structures, and explanations and use of printf. The book relies heavily on cout and cin which I’m not too fond of because of the syntax but they’re easy to understand when it comes to printing string objects. When Michael was going through the book I taught him printf and had him convert all the couts in the book to printfs – it showed him more about what goes on inside those string objects and was less typing when he needed to print %d, %s, etc. arguments.

One important note: the gaming college Full Sail uses this book as their introductory programming course book. Michael went into Full Sail right after finishing this book so he got to do it all over again. Much easier the second time!

Try it.

1 Comment »

Beginning Game Programming

Romero : May 30, 2006 4:06 pm : Developer's Corner

Just got an email about game programming books, a very popular question I get:

Hey John, I’ve mailed you before but I doubt you remember; with that said, I love your games! Always have, always will. I’ve done a bit of game programming with some beginner’s languages like GML and many versions of BASIC, but I’d really like to learn C. I have one question: I’ve pretty much learned all there is to make console applications, which is all I can find tutorials for. Where can I get some info on basic graphics programming? Just drawing/manipulating bitmaps or pixels, something like that.

Thanks!

-Jake

beginning game programmingHere’s what I would recommend with just a quick search on Amazon: Beginning Game Programming by Michael Morrison.

Now, I haven’t had to read a game programming book in about 22 years but this one seems pretty solid with good reviews. Sure, some of the reviews might be by the guy’s mom and friends but how else can you tell if it’s good unless you try it yourself?

I’m sure some of the readers here can recommend other great books – that’s what this section is for!

1 Comment »

Code Newbie

Romero : February 13, 2006 3:54 pm : Developer's Corner

code newbie logoContinuing on from my previous post, if you’re a beginning programmer there’s a great site out there for you: Code Newbie. You absolutely do not have to know how to program already when you go to this site and you can get great explanations of common programming problems in the forums. Check it out!

Leave a response »

Total Beginner Programmers

Romero : January 31, 2006 3:47 pm : Developer's Corner

Just today I got this cute email from a 13-year old:

Dear Mr. Romero,

I’m a thirteen-year-old boy who absolutely loves the games that you’ve made throughout the years, so much that I really want to start programming, however, I don’t know where to start.
BASIC seems too small a language to aid me in what I want to do, create the games graphical engine, but C# and C++ seem a little robust for a beginner. What do you think?
I really want to program, and I know that I do want to learn C# and C++, it’s just that I’m not sure if they’re the best languages for me to start in. I’d sort of like to learn BASIC, but I really can’t find any good tutorials online, do you have any that I could possibly use?
Anyways, I hope that you take time out of your busy schedule to reply, but I won’t be absolutely crushed if you don’t. Thanks.

Sincerely,
Zachary

This was an absolutely great, well-written email with an excellent question. My answer is pretty much the same every time: if you want to learn how to code, you should be learning C. You can learn C++ later but I still believe it’s best to go the C/C++ route rather than Visual Basic or some scripting language.

My personal favorite environment is the Visual Studio C++ Standard or Professional Edition. The Standard Edition is around $280 online and has everything you’ll need for quite a while if you’re a beginner.

visual c++ expressIf you’re on a budget, like, a no-money kind of budget, then you should download, for free, the Visual C++ Express Edition product by Microsoft. There’s even a nice book for complete beginners on Amazon.com that will help a lot.

This dev environment can get you through PC game development, handheld development (PocketPC anyone?) and with enough tweaking you can get it to work with external compilers for special hardware.

2 Comments »
« Page 1, 2»

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Reader Feedback

One Response to “Developer’s Corner”

  1. John, do you follow any journalism/gaming/web accounts on tumblr.com at all? There’s a lot of great blogs on it; if you haven’t, you should check them out!

Leave a Reply