1155

Many of the answers here are really, really good. But the OpenGL and Direct3D (D3D) issue should probably be addressed. And that requires... a history lesson. And before we begin, I know far more about OpenGL than I do about Direct3D. I've never written a line of D3D code in my life, and I've written tutorials on OpenGL. So what I'm about to say isn't a ...


80

Technical reasons: Most of the best 3D game engines are written in C/C++. This is a big deal, since most game developers don't want to compromise on their 3D engine, but nor do they want to write one from scratch. Java has jMonkeyEngine which is open source and actually really good but it still can't yet compete with the Unreal Engine. For some very rare ...


78

It’s called a duck, from a legend that allegedly comes from Interplay’s Battle Chess: This started as a piece of Interplay corporate lore. It was well known that producers (a game industry position, roughly equivalent to PMs) had to make a change to everything that was done. The assumption was that subconsciously they felt that if they didn’t, they weren’...


65

You write a program to solve a problem. That problem is accompanied by a specific set of requirements for solving it. If those requirements are met, the problem is solved and the objective is achieved. That's it. Now, the reason that best practices are observed is because some requirements have to do with maintainability, testability, performance ...


47

I've been wrestling with a problem in a Java project about circular references. Java's garbage collector doesn't rely on reference counting techniques. Circular references do not cause any kind of problem in Java. Time spent eliminating perfectly natural circular references in Java is time wasted. I coded this up [...] but the problem is that it's full ...


44

Give each Room coordinates (start would be (0,0)) and store each generated Room in a dictionary/hashmap by coordinates. It's trivial to determine the adjacent coordinates for each Room, which you can use to check if a Room already exists. You could insert null values to represent locations where it is already determined that no Room exists. (or if that's ...


39

From The Digital Antiquarian's article on "The Hobbit": Megler [1] recruited a partner to work with her on the game, Philip Mitchell [2], a fellow senior with whom she had already worked on a number of group projects and whom she knew to be both easy to get on with and a skilled programmer. Milgrom [3] himself added a third member to the team specifically ...


28

Java is extremely suitable for writing cross-platform games. Main advantages: Portability - In general, you can write a Java game and expect it to run unchanged on most platforms. It's probably the most portable option of any language - C/C++ is the other highly portable option but needs to be recompiled for each platform and in many cases libraries have ...


26

Okay, theres a lot of misinformation in this thread. I know the game business extremely well, having been in it for 25 years. I also know Java in games extremely well having been Sun's Java Game technical evangelist and lecturing Java performance programming expert. In terms of computational speed, Java beats C++ in many scientific computing benchmarks ...


22

Granted, circular dependencies are a questionable practice from a design point of view, but they are not prohibited, and from a purely technical point of view they are not even necessarily problematic, as you seem to regard them to be: they are perfectly legal in most scenarios, they are inevitable in some situations, and on some rare occasions they can even ...


20

It's actually quite an easy choice. Right now, you have zero users, and scalability is not a problem. Ideally, you want to reach the point where you have millions of users, and scalability becomes a problem. Right now, you don't have a scalability problem; you have a number-of-users problem. If you work on the scalability problem, you will not fix the ...


19

I think the modern-day equivalent of BASIC is Javascript. Give him a simple HTML page that has an embedded script that creates a canvas and draws a shape on it, point him at some tutorials and see what happens. Quick turnaround (save your changes and refresh the page) and decent debugging support.


19

2072-rated chess player here. I made this website in pure JavaScript over a weekend. It's not a chess engine (I designed it to create entertaining opening positions as sort of a perverse Chess960 engine), but it's a starting point. The source code is here. There are a lot of complications involved in making a functional board. These include: First, ...


18

There's a wise old quote: "Do not follow in the footsteps of the wise men of old. Seek what they sought." There are reasons for all of the rules of 'proper' coding. Knowing why those rules exist is more important than knowing what those rules are. There is a rule that you shouldn't put a test that could be repeatedly recalculated in a for loop like ...


18

Every Valve product is developed using their own in-house game engine called Source. The Source Engine is written in C++. The source engine contains both an OpenGL and a DirectX renderer which helps it in being cross platform, but the key is SDL. The open source Simple Direct Media Library is used by a team inside Valve which is tasked almost exclusively ...


17

There is no clear-cut answer, and class design for games is a very broad topic. I can hint you at two very common pitfalls though: It is tempting to use inheritance to model polymorphism on your game entities, so that you have a BaseEntity, a PlayerCharacter, etc., and give them a dozen or so methods to model how they move, draw, decide what to do, and ...


16

The Component-Entity-System architecture for game engines works for games because of the nature of game software, and its unique characteristics and quality requirements. For example, entities provide a uniform means of addressing and working with things in the game, which may be drastically different in their purpose and use, but need to be rendered, ...


16

I come from the ancient era of "we had to code all by ourselves" and that is what I still do. So, I do not know these new "next-generation" 3D engines/environments where you just apply a bit of code here and there and it miraculously turn into a game. (no, its not really like that, just the way I see them) That is why I am offering my opinionated answer for ...


15

In most cases, what you're describing sounds like a graph. Given some of your requirements (the growing aspect) I'd probably choose an adjacency list as the implementation (the other common option would be an adjacency matrix). I'm not sure what language you're using, but a good tutorial/explanation with implementation details for a graph implemented with ...


14

The problem with "chess program" as a concept is that there are many pieces which can absorb a lot of time, and not necessarily interest you at the moment. You can spend years just working on graphics, or an alpha-beta search, or a visualization to help develop for the search engine, or... well, there are lots of pieces. I recommend finding an open source ...


14

Except OpenGL, I never used those libraries, but I'm going to try to guess, by reading wikipedia pages, like you did. You seem right about Mesa. Here is the additional info we have : "The X window system is a computer software system and network protocol that provides a basis GUIs for networked computers. It creates a hardware abstraction layer." "GLX ...


14

Since Tic-Tac-Toe is a solved game, I would recommend simply playing a perfect game every time. The following algorithm will allow you (or the AI) to always deny your opponent victory: Win: If you have two in a row, you can place a third to get three in a row. Block: If the opponent has two in a row, you must play the third to block the opponent. Fork: ...


14

Sure you can - I learnt a lot about Java when I started by writing a simple game. Just be sure to start with something simple so that you can focus on the basics and don't get discouraged - which is a risk if you take on an ambitious project too soon.. You will probably find it easier to write a simple 2D game (using a library like Slick2D) rather than ...


13

I'd personally go for many small libraries. Discourages developers from creating dependencies between otherwise unrelated packages. Smaller more manageable libraries that are much more focused. Easier to break up and have separate teams manage each library. Once you have a new requirement that's sufficiently complex, its better to add a new module rather ...


13

People have experimented with different mechanics of implementing a design pattern in the past with differing results. For example, the definition of a singleton is that there is only one instance of a class for your entire application. There is nothing in that definition that requires you to implement it with a static accessor, even though that's how the ...


12

Not a programming language explicitly for gaming, but very cool graphical effects can be done using rather little code with processing. Plus, it's free and relatively easy to learn. IMHO an ideal language to learn the basics of programming, especially since the tutorials teach many of the basic concepts like variables, arrays, math operations etc.


12

Looks like no one has thrown out Python+Pygame. Depending on your cousins age/maturity it certainly opens the possibility of a lot of cool stuff. That's certainly basic enough to get started, but with its huge standard libary, you can't really get bored with Python.


12

There are many different kinds of computer games and, correspondingly, many different appropriate sizes and structures of development teams. Some examples: A simple game can be developed by a single idealistic amateur or hopeful indie game developer who does everything, perhaps outsourcing graphics and sound. Many mobile games are of this type. I believe ...


Only top voted, non community-wiki answers of a minimum length are eligible