Review:Real-Time Strategy Game Programming 82
Real-Time Strategy Game Programming | |
author | Mickey Kawick |
pages | |
publisher | Wordware Publishing |
rating | 6 |
reviewer | SEGV |
ISBN | 1-55622-644-6 |
summary | Marred by lack of focus and inferior editing, this book is only for the serious RTS programmer who is willing to overlook its weaknesses. |
Highly Anticipated
I found out about this book early this year. It was scheduled to be published in February by some small publisher I had never heard of. It was the only substantial source I could find on real-time strategy game programming, and it wasn't yet available. After a month or two of delay, it was released I ordered it directly from the publisher.
I couldn't wait for this book. It was aimed at intermediate to advanced programmers, so I had high expectations. I wanted something that would help me significantly in my own efforts to produce an RTS game for Linux. Even though the book was written using DirectX, it promised to cover game objects, landscape, pathing, and other such topics.
Initial Reactions
I was hopeful when the book arrived, after scanning through it. It had promising diagrams and meaty chapters on the topics I was interested in (Chapters 15-19, which actually comprise almost half the book). However, there was more DirectX coverage than I had bargained for.
The more I read, the more disappointed I became. I read the entire book, some parts several times, and indeed have used it while programming. It became clear to me that this book did not have the quality of an O'Reilly or Addison-Wesley product. What follows is an extensive deconstruction.
Topics
As evident from the table of contents, the book covers a lot of material. That lack of focus in itself is a flaw. I found the discussion of game ideas interesting, but I wanted a book devoted to the construction of RTS games, not their design. For the most part, Chapter 8 is composed of screenshots and descriptions of popular games in the genre, such as Age of Empires and Starcraft. You would think anyone purchasing this book would have played most of those games!
I found the discussions of the development cycle, coding style, and so forth in Chapter 3 excellent. But frankly, I have many great books on those topics and didn't need more. I think the same could probably be said for any intermediate to advanced reader. In the same vein, I didn't need information on data structures and utility libraries. Yet Chapter 6 is thrust upon me, composed of two pages of text and fifteen pages of source code from the CDROM (some of which the author admits to having never used).
Chapter 7 teaches the reader how to use the Visual C++ integrated development environment. It has screenshots of most wizard dialogs, and even gratuitous shots of the author's colour preferences and the Windows calculator. Is this intermediate to advanced fare?
While unrelated material receives valuable coverage, other important topics I was anxious to read about are shirked. There is no real coverage of multiplayer aspects or networking concerns. In addition, many topics are not covered deeply. For example, fog of war is described, yet the author presents no implementation details.
DirectX Coverage
I was hoping the DirectX material would be limited to some introductory chapters and API usage. As long as the algorithms were discussed, I could always port the code to another API myself.
Chapters 9, 10, 11, and 20 are fully DirectX specific. Chapters 12 through 14 cover additional graphics topics. That would be great, except I didn't need a graphics book. I'm not sure why the author feels a presentation of Bresenham's algorithm is in order (p222). Chapter 17, while not about DirectX, is highly Windows specific.
I can't say whether the DirectX code the author presents is quality or not, but if you are a DirectX programmer perhaps the book might appeal to you more.
Source Code
The author states in a note: "For this book, there was a lot of rewrite in order to make things more consistent and readable. I do not code this consistently or perfectly in real life."
I find that statement somewhat ironic, as I have many problems with the source code in the book. First of all, it is put forth as C++, yet makes heavy use of the preprocessor while avoiding the Standard Library. The author uses assignments in constructors where initializations are preferred. He also writes a standalone memory allocator instead of overloading operators new and delete (p579). That is not the C++ way.
The source code has absolute paths in its include directives (p106). The author employs leading underscores in his header guards (p121), and is not afraid to copy header declarations in order to decrease compile time (p159,241).
The author seems to miss the point of object-oriented programming, using inheritance to save typing (p307). The author derives from WORLDCOORDINATE such diverse classes as SINGLE_TILE and WORLDOBJECT (p426,529,531). Clearly the relationship should be containment, thereby expressing "has-a" as opposed to "is-a."
The author makes further coding errors, such as half-page-long virtual inline functions (p557-558) (see Effective C++ for details), recursive deletion of linked lists (p58) (which risks overflowing the stack), and incorrect copy constructor signatures (p631) (preventing copying of const objects).
The most intriguing error I see is premature optimization. For example (p389), the author "optimizes" a structure to 13 bytes, while noting that floating point members might increase its size. Yet padding would dictate that the structure occupy 16 bytes anyways, and indeed, that proves to be the case using the egcs-1.1.1 compiler.
One note the author writes (p363-364) is just plain wrong, apparently confusing the const and static keywords. The author also employs an incorrect syntax for bit fields (p388-389).
The author presents too much utility code. For example, not only does the author present seven and a half pages of container implementation, he repeats it later "for reference" (p336-343,629-637). Another seven pages of container implementation are, in the author's words, "nearly identical" (p678-685). Finally, if the reader needs yet another string class, one is presented (p293-300).
Editing
I'm not sure if the book was rushed or just poorly edited. Some paragraphs are just hard to understand, bordering on incomprehensible. But more often I find the author rambles, often repeating a paragraph, only slightly rephrased (p31,32,306).
The author writes in a confident tone, almost cocky. He is not afraid to tell the reader when his code is really good, although to be fair he also occasionally admits its shortcomings. Also, he seems to have an opinion on everything. I just think a little restraint would give his words more weight.
The gratuitous source listings should not have made it to publishing. I especially don't appreciate the author merely dumping unexplained untested code into the manuscript (p346-352).
I think strong editing could have helped those problems, and also imposed greater focus on the material. There seems to be a real confusion as to reader's skill level, which is supposedly intermediate to advanced. The author talks of the complexity of a doubly linked list as if the reader had never seen one before (p637).
Pedagogical Issues
The most glaring omission in this book is a sample game implementation. I would have been thrilled to have seen a tiny RTS game, even if it were implemented using DirectX on Windows. Instead, we are presented with libraries, code fragments, and demo apps.
The book could benefit from standard textbook fare: checklists, summaries, exercises, and the like. I find the index to be lacking. And although the author recommends Booch diagrams (forerunners of UML class diagrams) for understanding architecture, he only uses them twice, prefering instead to overwhelm the reader with source code.
Value
Is this book worth it? First, it's quite expensive. Although it is 700 pages long, much of that is padding. Really Chapters 15-19 are the meat of the book, and some of that information is available from other sources (eg, Game Developer articles and various web sites).
I've been extremely critical of this book, mostly because there are enough poor computer programming books without adding to their ranks, and enough excellent ones to serve as examples. Yet not all is marred. The book still has some excellent parts and good discussion. They are just overshadowed by its faults.
Unfortunately, this is the only book on real-time strategy game programming available. So, if you're really serious about programming such a beast, you'll probably want this book despite its shortcomings.
If you'd like to pick this book up, head over to Amazon.
TABLE OF CONTENTS
- Welcome
- Gameplay
- Getting Started on Your Game
- Documents
- Development
- Standard Macros and Data Types
- Background
- Great Ideas
- Working With DirectDraw
- How to Draw as Easy as 1, 2, 3
- How to do Your ABC's
- The Drawing Manager
- Loading Graphics
- The Black Space and the Wild Void of Life
- Animation
- The Landscape
- The Interface
- Objects and Creatures in the World
- Pathing
- DirectSound
Re:Game Programming API's (Score:1)
I start a week of vacation this week, I may just have to help them out with that.
Good, complete review (Score:1)
Thank you.
Re:Good, complete review (Score:1)
Re:The entire idea seems pointless to me. (Score:3)
Why would anyone want/need a book like this? Well first off, to save research time. If I had a reasonable book with at least abstract concepts of different pathfinding algorithms, details on their pros/cons, networking issues detailing pros/cons of how often to transmit a unit's current position, etc, I'd be a happy camper.
I played with a DirectX wrapper in Delphi once. I put together a terribly simple engine. You could click on a unit, move it around, but that was about it before I got busy doing other things. Sure Delphi isn't the mecca for gaming programming, but it taught me about the hassles with finding these sort of topics. After hours of perusing web pages, newsgroups, trying to remember/find notes from college classes that lightly touched these areas, I found the need for such a book is strong. It would be most prefferable if someone with a good bit of experience making a full game authored it as well.
Something like the reviewer mentions, a sort of college textbook on RTS game programming would be perfect. Present the material in a straightforward way, talking to intermediate/advanced programmers, delve into the beauty of a good algorithm and less into how-to-use-Visual-C++-for-dummies (redundant?) and it will sell 100 times what this book will ever sell.
Re:horrible API? (Score:1)
I can comment as far as DirectX 5, where (while I saw no problem with just DirectDraw) Direct3D was still horrid.
(Btw, DirectX does exist in linux, through WINE... but I consider Crystal Space a far, far better high-level 3D API).
I know that. (Score:1)
Pardon my grammar, btw. English is not exactly structured the way I had it be if I had designed the language... ahh, well.
Re:To make an RTS game... (Score:1)
It also won't hurt in getting some industry experience. Like trying to get a job at a game company. Get to know other developers, make lots of friends and contacts. At some point your home project might become a published deal.
Re:Not interested in design? Shouldn't you be? (Score:1)
I am already fairly skilled at program design in general (patterns, architecture, etc.), and am in fact currently designing some systems at work in addition to my game at home.
Design is incredibly important. But this book claims to be about "programming" which I believe is generally considered to mean lower-level implementation as opposed to "design", "analysis", etc.
Re:Good, complete review (Score:1)
Re:It said DIRECT X! (Score:1)
I have no problem with a game programming book being exclusively focused on DirectX, even if I don't use it personally. As I pointed out, I could always port such platform-dependent usage to a comparable API, such as OpenGL, if I wished. Or, I could just use the concepts expressed.
However, a game programming book must be about game programming first.
This book promised "RTS Game Programming *using* DirextX" but delivered several chapters just on DirectX.
As a comparison, consider "Concurrent Programming in Java" which I previously reviewed. It is a book on concurrent programming which just happens to use Java as its implementation example language. It is *not* a book on Java programming.
That is what I was expecting. Perhaps I was misled by the term "using" in the book's title.
I think my point is valid.
Re:To make an RTS game... (Score:1)
McConnell is clear in Code Complete about such bullshit gonzo attitude.
Maybe that's how the "primitives" do software development but I already quit one major software company because of that sort of perpetual "Red Queen" environment.
The "gurus" know better, it's not like this stuff hasn't been written about since Brooks wrote The Mythical Man-Month.
FROM THE REVIEWER (Score:1)
The need for a good RTS game programming resource is clear. I have a web site devoted to that goal at http://www.cgocable.net/~mlepage/rts/
I am *not* a professional game developer, though I *am* a professional developer. I am learning some of these game programming techniques from first principles, so in some ways I am far behind current technology (eg Age of Empires) but in others I am ahead (eg sound application of design patterns).
Since my free time is divided between reading books, working on my game, and documenting on my web site, among non-computer-related pursuits, the work is slow. But check it out if you're interested in RTS game programming.
Re:Books not so bad (Score:1)
Your interpretation is correct. By all means provide your own memory management if necessary. Meyers and Stroustrup each provide a wealth of material on how to do it properly. And that way is to customize the new/delete operators. That's what they are there for.
And you are correct, not everyone has to agree with my review.
Re:Premature optimization vs novice programmers? (Score:1)
The author can note that such code may not be fast enough for a production game, but explain the concepts used to rectify that, and leave the performance tuning as an exercise. I have enough books on efficient design and tuning code already.
I don't need pages devoted to an assembly implementation or a "really clever implementation."
I think if you follow the advice (mostly from Stroustrup and Meyers) at http://www.ses.com/~clarke/cpptips/perf_eff_opt then you can't go wrong.
A similar pedagogical issue is all this "roll your own" container madness. I'd rather the book used the STL throughout, *even* if it were not suitable for a production version of the game (which I haven't had demonstrated to me yet). Then the author wouldn't have to introduce and explain his own containers and their usage: he could refer the "intermediate to advanced" reader to a good STL book. At least the STL is Standard.
Re:Please, slashdot, no more Windows-only articles (Score:1)
I reviewed the book. I am a Linux programmer. I am making a Linux RTS game at home. I program on Linux at work.
I don't understand.
Re:RTS for linux = ALE Clone (Score:1)
Re:Please, slashdot, no more Windows-only articles (Score:1)
Not terribly useful for anything other than 3D. (Score:1)
If you need input, it doesn't help.
If you need 2D or iso-3D (for things like Civ:CTP), it's inefficient and really gets in the way.
No, OpenGL's only useful in the context of true 3D software.
I don't get where he gets the "excessive pirating" (Score:1)
Try SDL or ClanLib... (Score:2)
URLs:
SDL - http://www.devolution.com/ ~slouken/projects/SDL/index.html [devolution.com]
ClanLib - http://www.clanlib.org/ [clanlib.org]
Keep in mind that these aren't your only options, there are others in varying levels of usefulness but these are the current front-runners that appear to be sticking out of the crowd (Cross-ELF/JUGL is one of the other libraries, allowing a unique ability- one main binary set for DOS, Windows, and X11 with a batch file to execute the loader engine for each platform. The main drawback to it is that it's poorly documented and fairly primitive.)
Re:It said DIRECT X! (Score:2)
Documentation is good- sadly, you're going to really need it.
Usability, or rather, ease of use and low overhead is paramount for a good game. DirectX fails in this regard, making the task of writing a game unpleasant at best, untenable at it's worst.
Game programming books in general (Score:2)
There are good books on networking technology (Tannenbaum), project structuring (Design Patterns, many others), 3D graphics (ask Rosenthal for recommendations here
Game programming under linux:
- use X, it's not that bad
- use Glide or GLX (or Mesa if you don't care about speed so much) for 3D.
Unsurprised (Score:1)
Incidentally, I only know one coder here that buys games programming books, and I doubt he actually reads them.
Re:Game programming books in general (Score:1)
Re:Game Programming API's (Score:1)
So, it certainly is possible to use OpenGL to it's full power in a RTS game, and, I think at least, preferrable. I find 3d games are generally nicer than 2d games (not to say that there are no great 2d games out there, I love the civ series, even though I have not tried CTP yet, I am sure I will love it)
Re:Game Programming API's (Score:1)
Re:It said DIRECT X! (Score:1)
You don't need DirectX to program RTS games (Score:1)
Point here is that DirectX for RTS is irrelevant. In fact most RTS use only fraction of it to just initialize screen and gain direct assess to video memory. There is NO need in it at all. My old DOS based code could be easily ported to it. I think the author uses DX as a buzz-word only. Besides, in my experience no generalized drivers are fast enough (unless hardware accelerated as 3D are)
Dune32 shots/source [investigatio.com]
Although in my view book is worthless (for me) I wish I had it back in 1994, when I had to do all these things on my own!
However, as a humble person who was interviewed there [investigatio.com] and talked to some guys, I would caution those wannabes who think to make big $$$ in the Games industry. Those wonderful games such as DungeonKeeper, MagicCarpet et al, are not making much money! Problem is that it takes lots of time and enegry to produce a game, while sales are not high (piracy)! Cash-cows for such companies are sports-games, boring to program, but people buy them. So, if you think to make your life as a games progammer -- think twice. I personally changed my mind and going for an MBA. Although games programming (w/o books, when YOU do design things) is a good teacher.
Projects I have been into are outdated now, some of the source was lots (stable one
AtW,
http://www.investigatio.com [investigatio.com]
Re:Game programming books in general (Score:1)
While focusing mainly on graphics, I found Michael Abrash's Graphics Programming Blackbook, (probably butchered his name and the book title sigh) an excellent resource for game design.
Also, not sure how many people have played Dark Reign, but I'm very impressed with the game engine that Auran (http://www.auran.com/), and just how do I make that a hotlink?, designed for the game. They are currently working on their next engine for the Harn world.
I don't know if they would be willing to offer any support, but it's worth asking.
Another site/game you might look up is Omega Tank, this is a RTS game designed as a thesis project and looks to be a fairly good basic implementation of an RTS game. It still needs to be tweaked, but with a couple of freindly questions to the author I believe it might be possible to get a peek at his source code.
On the gaming side, I'd suggest checking out Insomniax (http://www.insomniax.net/) There are a lot of good players there and some excellent resources as to what makes a good design.
My site RTSG (http://www.rtsg.com/), Real-time Strategy Gaming, though sorely neglected also has a number of articles produced by the staff that might give help to game design.
Anyway if you need assistance or advise drop me a line and I would be happy to give you pointers, but at the time have little time to actually show you implementation.
Lando
Re:It said DIRECT X! (Score:1)
Sorry but I cannot agree. The main reason of course is because I am a hard-core gamer. I don't play FPS much, prefering RTS games. The only reason I still have a Windows box around is to play games. So saying that games will die out under Linux is an alien thought to me.
Your statement about copying program under Linux also need to be brought to light... Are you saying that just because the Linux community has the ability to copy games, that most of them will? Working as a computer professional, yes scary isn't it, I prefer spending money on games that are well developed, while it may be argued that sometimes games have perchance fallen to my grasp, any game that is well developed and worth playing I buy.
Another point is that Linux is getting a great deal of press recently, we already have the basic apps that people need to use Linux full time, but we need games to provide entertainment to those out there that don't like playing with code.
And what are you talking about Linux not matching DirectX??? It seems to me, going on rumor here, that Microsoft eventually threw in the towel and let game programers have direct access to the hardware because Microsoft could not write adequate drivers...
It's my belief that open source is a lot more flexible and robust than closed source software all we really need is to get the hooks into the vender's drivers so that we can write the code to use the hardware, that's happening... I seem to recall TNT2 code being released within the last day or so.
Hopefully, that explains why I feel you are wrong about the future of gaming under Linux.
Lando
Re:Enlighten me (what's wrong w/ the following) (Score:1)
External identifiers that begin with an undersocre are reserved for use by the library [variables, functions, etc]. as are all other identifiers that begin with an underscore and an upper-case letter or another underscore [#define'd macros].
More clearly:
extern char * _some_buffer;
and
#define _A_something
#define __other_macro
are all 'reserved'
whereas
extern char * myvar;
and
#define _x_Macro
would all be fair game for you to use in your program.
So if I used 'header gaurds' of
#ifndef _header_graphic_h_
That's really just fine, but if I
#ifndef __header
or
#ifndef _Header
I may risk clashing with the C library, and I was warned.
The idea that the complier could refuse the complie the code is silly of course
--Shaun
I'm no expert... (Score:1)
Re:Game programming books in general (Score:1)
Please don't give me a "Game programming" book that introduces me to C and Windows and how to use a joystick. Give me a book that talks about game design -- what makes a game fun? What data structures and algorithms do games typically use? Why would you choose 2D over 3D or vice versa? What kinds of games are better as single-player? How do you write decent game AI?
Re: 80-hour weeks (Score:1)
Welcome to game programming, where the motto is "Work harder, not smarter."
Re:Books not so bad (Score:1)
E.g.: was there a good reason for him to write his own memory allocator? If so, then *perhaps* the standard C++ approach is flawed. If not then his code is flawed. But this is subject to analysis, and saying it's against the "rules" don't answer. A working program is a test of the rules.
OTOH, I'm not particularly interested in devoting myself to another proprietary library. Those things change or get dropped. I'm still recovering from the cyrogenic suspension of FoxPro.
OpenGL? (Score:2)
OpenGL has an ancillary and auxillary set of libraries and APIs to deal with windows, menus, overlays, mouse, keyboard, controllers, etc.
It's the GLUT libraries, GL Utility Toolkit. I guess do a search for Mark Kilgard, or GLUT, or go to OpenGL.org.
They also have resources for game design, I think.
GL itself will only get you 2d and 3d output, you need other stuff for networking, sound, and UI. GLUT does the UI nicely, if not optimally. It's an introduction, at least, and it's very simple to use =) We had to crash course it and learn it and write a game in a week for our first Graphics homework assignment.
-AS
Re:Not terribly useful for anything other than 3D. (Score:2)
GLUT handles mouse, keyboard, trackball, stereoscopic glasses, menus, gloves, etc.
GL Utility Toolkit, not GL itself.
GL itself does fine for 2d, since 2d is really a subset of 3d.
GL itself is a low level API; iso-3d mode has to be done yourself, just as true 3d mode, or fisheye 3d modes...
IIRC, however, there are camera and perspective models that allow iso-3d transforms and manipulation, as well as true 3d perspective and transforms...
-AS
Re: 80-hour weeks (Score:1)
Yourdon has a lot to say about projects with impossible schedules, impossible
deadlines, no budget, conflicting goals, and constant overtime.
Constant 80-hour weeks aren't a sign of dedication; they're a sign of project managers who aren't doing their job.
Re:Source Code comments... (Score:1)
Now if you mean relying on MFC (ARRGHH!!!) I can't help but agree with you. I try never to use that waste of disk space MS claims is a great OO class library! Even if I need to do Win32 stuff, I try to role my own class wappers because it reduces the overhead and I can use proper C++ constructs and style. But this has nothing to do with the development environment. Most of what the review speaks of seems to me to be a C convert to C++ still using the old bad habits (for C++ not C) of preprocessor directives everywhere and confusing a class with a struct. I suspect this same crap code could be written in Borland C++ Builder, Watcom C++ or whatever.
This has more to do with a bad coder than a bad coding tool.
Not interested in design? Shouldn't you be? (Score:1)
Ok, I may be taking this out of context, or misinterpreting your point. But, isn't one of the most important aspects of writing a computer game, the written design? I've read several articles (Post Mortem) in Game Developer Mag. These articles are written by a game dev. after the release of their game, discussing problems and successes. More often than not, the authors have found that the lack of a thorough and concrete design had negatively impacted the development of their product. Sure it isn't something that seems fun when you love to code, but at some point you need to come to realize that you just can't sit down and "hack" things out.
I, like you, do like to see implementation as part of my learning process. Infact, this is more lacking than books written on design. I was actually thinking about picking this book up when I saw it. I think I'll stay away from it, or just read it in my local library (aka Barnes & Noble
Sixpack
Re:Not interested in design? Shouldn't you be? (Score:1)
Design is incredibly important. But this book claims to be about "programming" which I believe is generally considered to mean lower-level implementation as opposed to "design", "analysis", etc.
>>
Ok, now I understand where you're coming from and see your point. "Don't judge a book by its cover" takes on new meaning with programming books, I guess.
Re:To make an RTS game... (Score:1)
One of the biggest problems is that from a marketing standpoint, game players want the visual stimuli. They want full motion videos integrated into their video games. If the game doesn't come on at least 4 CD's, how good could it possibly be?
Games need to more and more resemble real life. It needs to be fully 3D, with extremely realistic graphics, and of course it has to be fast, but if I need to upgrade to a platform that won't be available until next year to get what I want, so be it.
The biggest issue with money is that someone who's programming a game and expects to get paid for it will see the money issue as an obstacle. You can program a game for free. Just sit down at your computer and start typeing. Just don't try to program Quake II on your first try or you'll be so overwhelmed that you'll get discouraged and quit.
Start with something simple, even if its been done before. Program minesweeper and tetris. They won't make you any money, but you'll learn those valuable design skills.
Then, once you've done that, aim for something simple, yet unique, even if it copies off an old trend. Try minesweeper 3D for instance, something that will require some creative layouts and will give you some practice with more advanced graphics programming.
Once you feel ready to take a shot at AI, don't try to program the AI in starcraft. Program a checkers game. The rules are simple. When you want a more advanced challege, try chess. You might wonder how programming chess will help you when you want the computer to know when to move a marine from one corner of the map to the other. At least when you try to figure that out, you won't be struggling with the fundamentals.
And don't forget the most important thing. Game programming isn't all about the graphics and the AI. Its about captivating your audience. It doesn't matter how elaborate your game design is, if the player gets bored with it after 10 minutes, then the game was a failure.
Perhaps I have gotten off on a rant.
-Restil
Re:The entire idea seems pointless to me. (Score:1)
I suppose a 700 page tome is considered more impressive.
Enlighten me (what's wrong w/ the following) (Score:1)
Re:Enlighten me (what's wrong w/ the following) (Score:1)
I appreciate it.
Re:I don't get where he gets the "excessive pirati (Score:1)
Re:Game Programming API's (Score:1)
Dont know much about web site help, but the best
book ever written for learning C IMAO is
K&R C for yourself.
It teaches basic C and has a chapter on the
unix side of it.
To learn linux programming is fairly tough when
you have to teach yourself and i would recommend
reading a non-platform specific C tutorial first.
Wish you luck in your coding.
Have fun.
PenguinII
Game Programming API's (Score:2)
and basically have had major problems is what to do
input and output with.
Originally i used svgalib but after many people telling
me its dead, I searched around and switched to GGI
GGI is not too bad for graphics, but GII, ggis input
library is basically undocumented and unworkable.
Now im at the stage im at now- I need a good API to
program my game in, requiring full screen with mouse
I have tryed DGA but have not been able to find one scrap of info on it. Direct X 6 may suck etc etc... but at least they have a reasonable API for people new to game programming. BTW im not trying to bag out linux- it rules, just pointing out a major weakness.
Re:To make an RTS game... (Score:1)
The fact of the matter is, you can't learn something as general as coding a complete game from start to finish from a book. There's just too much information to be read.
In addition, games have historically pushed the technical envelope, code wise. It's not realistic to expect a book to give you inspiration for your next title. Quake was a huge hit, because the technology was so far ahead of everything else on the market at the time. There's no way the implementation could of come from a book.
Books are a good way to get started. But don't expect to be the next ID if you can't come up with the radical designs on your own.
Bughammer
Re:horrible API? (Score:1)
Re:Books not so bad (Score:1)
Some of the things the reviewer objected to (page long inline functions, premature optimizations that didn't achieve anything, etc.) really did sound remarkably stupid. What's the point of optimizing a structure from 16 to 13 bytes (to save 3 bytes!!! whoopee!!!), only to have the compiler pad it to 16 anyway? You've broken the "rules" (or, more accurately, the standard guidelines) and achieved absolutely nothing. You're code is more complicated and harder to follow, but you've gained nothing in efficiency. To quote Donald Knuth, "Premature optimization is the root of all evil." Coding like this is what gives C++ a bad name. Yes, it might (through some stroke of luck) still work, but what's the point? Why not code properly, make it work even better, and make the code more maintainable?
I really, really liked this review. It was critical, and critics are supposed to be critical. Of course, some people my disagree with the reviewer, and that's valid too.
Re:Game Programming API's (Score:2)
I had a similar problem when working on a fairly large-scale game for a software engineering class. I turned up, in my monumental search for the Perfect API, something called SDL, the Simple DirectMedia Layer. I can't attest to its flexibility or ease of use, since I didn't end up using it, but it boasts "portable low level access to a video framebuffer, audio output, mouse, and keyboard." It is LGPL'ed and impressively platform independent. But what I, or even its website [devolution.com], have to say is probably not so gleaming; Probably a more solid endorsement is the fact that Civ:CTP was written using it.
Hope this helps,
Dan