Categories
Game Development General Personal Development

Thousander Club Update: October 16th

For this week’s Thousander Club update:

Game Hours: 204.75 / 1000
Game Ideas: 435 / 1000

Target: 798

I managed to add a few more ideas to my list, but I spent the week either working long hours at my day job or catching up on other responsibilities. I did not get too much time to work on game development. I am fine with this fact, but I need to do a better job of scheduling these down times. As it is, it has been about a month since I first started working on Pong, and I don’t want to have another month go by before I am ready to release it as truly finished.

Categories
Games General Linux Game Development

Non-Profit for Linux-based Games

I learned that linuX-gamers.org has formed a non-profit organization in Germany, which is where it is located. I’ve found linuX-gamers to be a great source of news about games on the Gnu/Linux platform.

Major parts of our work will involve the support of communication, free exchange of knowledge and the linuX-gamers.net community through the linuX-gamers.net portal. We will care about developement and free distribution of open source software. Furthermore our work will cover organization of and participation in public events to make information available to a broad spectrum of people and to strengthen educational and scientific work on linux gaming related topics.

I don’t know the details of such work, but if it helps to improve the state of game development on Gnu/Linux and increases the number of games we can play, I welcome it. Good luck, everyone at linuX-gamers!

Categories
Game Development Geek / Technical General

Google Code Search

A few months ago, I posted about searching for code. I just learned that Google made an announcement last week about Google Code Search.

I tried it out, but I didn’t find too much more than other code search engines. I was expecting something more, especially in the advanced search section. You can search by license, for instance, but how hard would it be to list compatible licenses, too? For instance, if I look up code under the GPL, wouldn’t it be rather simple to also list similarly licensed code?

I tried looking for a piece of code that I tried to find a few weeks ago. I just wanted to use a Point class to represent a two-dimensional position in space. I figured it would be trivial to write myself, but it would probably be even simpler and less error-prone to find someone else’s well-tested implementation. I actually found that Google’s code search wasn’t returning results as well as other search engines. It was finding all sorts of code that happened to have the word “point” in it.

On the other hand, the engine does support regex, which is really nice. I don’t know how many times I have wanted to search for something with:

 #include\ "sd[a-z]*.h" 

Typing the above actually shows you the source to SDL_image.h, specifically as part of the framework source for the Weird Worlds demo, interestingly enough. Small world, eh?

And of course, being the vain Internet user I am, I decided to do a search for my name. The search engine actually returned results that included the source to a number of my projects! I guess Google does a really good job of crawling websites.

Categories
Game Development General Personal Development

Thousander Club Update: October 9th

For this week’s Thousander Club update:

Game Hours: 203.75 / 1000
Game Ideas: 432 / 1000

Target: 777

I hit 200 hours as of Wednesday morning, which puts me at over 20% of the way towards 1,000 hours!

In the article But Can You Make Pong?, it listed a set of components and features to make a Pong clone. I don’t have a win condition, so the game goes on forever or until you hit ESC or Q to exit the game. I don’t do any fancy work with the graphics or sound. I only used keyboard input, and it is hardcoded to the up and down arrow keys as well as the A and Z keys (although I did provide a configuration file that should be easy to edit to make it work for other keys). The physics are also simple, which means that the ball simply reflects as it hits an object. If it hits a paddle, it reverses the x-component of its direction vector. If it hits a wall, it reverses the y-component. It makes for some interesting bugs if the ball hits the top or bottom of a paddle, though. The scores are prominently at the top, and since the game simply starts and doesn’t end, there is not much of a UI to speak of. There is no computer AI, so you must play both paddles.

Still, even without all of these cool features, Pong is finished. I can add some of these features, or I can move on to a second project. There is the temptation to polish up a Pong clone, to “do it right”, but I think I can always take what I learned, apply it to a second project, and come up with newer features there. I’ll likely write more about this next project this week, but it might just be Asteroids or Space Invaders.

As suggested last week, I am also going to see if I can get this Pong clone submitted as a good example project for people learning how to work with the Kyra Sprite Engine. I will spend some time this week cleaning up the code just for this purpose.

Categories
Game Development General Personal Development

Thousander Club Update: October 2nd

For this week’s Thousander Club update:

Game Hours: 197.25 / 1000
Game Ideas: 432 / 1000

Target: 756

On Saturday, I managed to get the basic game of Pong finished. It has two players, a ball, and two walls. The ball will bounce off of the walls and paddles, and it resets to the middle again if it goes out on either side. Now all I have to do is add scoring and sound, and I think anything else would be polish and shine.

Of course, then I have the choice of either polishing what will end up being just another Pong clone or moving onto another project. I don’t want to switch to another project prematurely. I’ve already jumped from one project to another multiple times. There are still a number of things I could implement to really “finish” the game. I could create a simple menu, a pause feature, mouse input, ball spin, and a credits screen. I haven’t made use of fonts or text in a graphical game, so it would actually be a good opportunity to learn what it takes.

On the other hand, the end result will still be Pong. How long will it take to polish it up? Could I better spend that time by adding a second game under my belt? If I go this route, I’m leaning towards working on the original version of Oracle’s Eye again. It’s a relatively original game, and finishing it will result in a game that I can say is mine.

If I had a third hand, I might say that I should try to make another classic game, such as Asteroids or Space Invaders. While I will still end up with a clone in either case, the advantage of picking a clone is that I already know what the game should look and feel like. OE doesn’t have a very specific set of features, and I don’t even know if it will turn out to be fun. Working on the clones might give me better insight into what it takes to make a game as well as what I can do to make my own games more fun.

After I add scoring and sound effects to my Pong clone, I will make my decision. For now, I just want to outline what I’ll be pondering, hoping that you’ll provide at least as much quality advice and feedback as you did last week.

Categories
General

Friday Already?

It’s interesting that when you don’t like going to a job or to school, the weekend can take forever to get here, but when you want to try to do something or otherwise like what you are doing, Friday was yesterday and today.

Just like that, a week has gone by, and I don’t remember what I have accomplished. I should do a better job of keeping track of my accomplishments by date.

Categories
Game Development Geek / Technical General Linux Game Development

Physics, Collision Detection, and Porting Code

As I develop Oracle’s Eye Prime using component-based methods, I have found myself thinking about how to implement features in a general way. For example, if I am trying to make Pong, I shouldn’t hardcode the Ball and Paddle and Walls. Instead, I should have a more general way to detect collisions. After all, even if I have a Ball entity bouncing off of a wall entity in Pong, I might want to do Space Invaders next and have bullet entities that destroy alien entities.

There are two aspects to collision detection with which I am grappling. The first problem is determining how to detect collisions between different, arbitrarily defined objects, which generally are represented by sprites on the screen, while still knowing where it collided. In Pong, I would like to know if the Ball hit the front or the sides of the Paddle since it would bounce differently. The second problem is figuring out what to do when a collision happens. If the Ball hits a Paddle, it should bounce off depending on the side it hit. If the Ball hits the goal, or goes out on one side, it should result in the score increasing for one of the players.

Metanet Software’s N Tutorials section helped me to figure out the solution to the first problem. While the code examples use ActionScript, the interactive example animations demonstrate the concepts and make them easy to grasp.

However, in the forums, there was a mention of Erin Catto’s GDC presentation on sequential impulses. Sequential impulses for “fast and easy” physics? It technically takes care of both problems? Count me in!

My first task: port the code.

It was originally written in Visual C++, but I am using an entirely different operating system and compiler. I obviously had to remove the #include for “windows.h”. The application used GLUT so I didn’t need to worry about WinMain or anything specific to VC++. On Windows, filenames are case-insensitive, so including <GL/glut.h> is the same as including <gl/glut.h> is the same as including <gL/Glut.H>. On Gnu/Linux, filenames are case-sensitive, so I had to determine which name was needed.

The next problem I encountered was a bit trickier. The code makes use of the class Arbiter, which basically regulates the collisions between different bodies. The World class has makes use of std::set to hold and sort through the Arbiters. The problem?


for (ArbIter arb = arbiters.begin(); arb != arbiters.end(); ++arb)
{
(*arb).PreStep(inv_dt);
}

g++ won’t compile the above code. It complains that it is modifying a const Arbiter, even though ArbIter is not a const iterator. VC++ will compile it just fine, obviously. Which one is correct?

It turns out that both are correct. At least, the standard library implementations are both correct. See, std::set’s keys must be ordered, and if a key can be modified, the ordering can’t be guaranteed. A set could be implemented so that std::set<T>::iterator is equivalent to const_iterator, which is how it is implemented for g++. If the key is only accessible through const methods, then there is no concern that the key can be changed in a way that would change the order. Other implementations can allow modification of a set’s keys so long as the parts relevant to ordering don’t change.

The problem is that the code as written wasn’t portable, and I didn’t like the idea of using const_cast or mutable to work around it.

Scott Meyers, author of “Effective C++” and “Effective STL”, provided the safe and portable solution.


ArbIter arb = arbiters.begin();
while (arb != arbiters.end())
{
// Erase key from set, modify it, then add it again.
Arbiter newArb((*arb).body1, (*arb).body2);
newArb.PreStep(inv_dt);
arbiters.erase(arb++);
arbiters.insert(newArb);
}

As the comment above states, you modify a copy of the key, erase the original, and then insert the copy. The above code should compile on any implementation, which means that it works with g++ on Gnu/Linux or VC++ on Windows.

Moments later, I was able to get the physics demos to run on Gnu/Linux.

The next step: integration with Oracle’s Eye Prime.

Categories
General Politics/Government

Copyright Extension Debate: Urban Legends

Jerry Brito’s Not an Urban Legend exposes the holes in the arguments for a need for extended copyright.

The arguments made to extend copyright vary slightly, but you’ll almost always hear that without the protections of copyright, people wouldn’t have the commercial incentive to create. It’s convenient for the people making such an argument to ignore the fact that Walt Disney pretty much built an empire by creating new works from works that were no longer protected. When Disney was creating works, the public domain wasn’t more than a generation old. Today’s Walt Disney must wait many, many more decades before he/she is allowed to do the same, and yet arguments are still made that extending copyright is a good thing.

Jerry Brito basically pointed out the flaws in one such argument, made by James DeLong of IPCentral. DeLong claimed that the idea that older creations are not forgotten by their creators and so are not deteriorating into nothing due to the inability of preservationists to copy them into a less fragile medium. He points to entire packs of older movies being sold on Amazon as proof that copyright holders are “diligent [in] panning their slag for gold.”

But I would point him to another series for sale on Amazon called Dover Thrift. It is a series of books, priced at about $2 each, the underlying works of which are all in the public domain. That is, they are being printed—and someone is making money—without copyright.

Therefore, what I argue for is not no copyright, but rather sensible copyright. I argue for taking into consideration the public domain, and not just the interests of creators, when setting copyright terms. What should be the balance is up for debate, but an informed debate requires that we face facts and not simply dismiss those facts as urban legends because they are inconvenient to our position.

Sensible copyright would be nice.

Categories
General

498 Spam Posts

Sometime between going to bed last night and waking up this morning, I got 497 spam posts on this blog. After scanning through them to verify that no valid posts are awaiting approval, I deleted them, to find #498 had appeared during that time. Posts don’t get published until I approve them, so readers don’t have to deal with junk, but what a hassle! It’s been this bad for the past couple of weeks. I’ll see about taking measures to protect against them.

How is it profitable? I understand people clicking on certain links, such as drugs and mortgages, but what benefit is it to link to the official website of a major theatrical release? Or Google’s gmail subdomains? As Seth Godin recently said, “It’s the enemy of anything open.”

Update: #499 was waiting for me as I was writing this post.

Another update: I just installed something. Hopefully it works well, and hopefully legitimate posters don’t get blocked. If so, my email address is available at the bottom of the page, so please feel free to let me know if your posts can’t make it through.

Categories
General

Final Score: 1-1

While soccer is usually played with 11 players on each side, the United States played Italy to a tie with 9 men to Italy’s 10.

It was an amazingly competitive game, and I couldn’t be more proud of my team. They overcame some great odds and earned their first point in a European-hosted World Cup. It wasn’t the 2-0 or 3-2 win that I had expected, but under the circumstances, I’ll take it.

Next up: Ghana, who beat the Czech Republic 2-0 earlier today. If the United States can win against Ghana, and if Italy beats the Czechs, the United States can move on to the 2nd round. Thursday’s games are going to be watched closely.