Categories
Games Geek / Technical

LAN PAR-TAY!

I am writing this post from DeLan, the largest and longest LAN party open for students only (although I distinctly remember being at some more intimate parties that lasted two days). It started on Saturday at 3PM and goes until 9AM Sunday. There were a number of firsts for me.

One, this is the first time I have ever paid to be at a LAN party. It was $5 to get in, and another $5 for tournament play. It’s not too much, but it’s still different.

Two, I never played Counter-Strike before. We played in a double-elimination Counter-Strike Source tournament, and my team had one other person who had never played. We played fairly respectably, all things considered, and we were eliminated in the third round. In the first round, I saved the team. We were playing as terrorists, and I decided to take a completely different route compared to my teammates. Well, something happened, and I was the only one left alive. I had to go back, get the bomb, then find an area to prime and set it. Apparently the counter-terrorists thought I was going to go where the rest of my team was heading, so it took them longer to find me. One killed me, but the bomb was set, and my team held our breath as we waited to see if they could disarm it. My heart was actually racing, and then BOOM! We won! High fives, lots of “w00t!”, and general cheers went around to the rag-tag team, Psycho Squad. Yeah, I wasn’t too happy with the name…

Unfortunately, the second and third rounds didn’t go so well for us.

Three, it is the first time I get to try out my new laptop at a LAN party. I bought a Dell Precision M90, which is a desktop replacement more than a laptop. I named her EsmereldaGB. So far I had installed games on it, but I haven’t played any of them yet. There were machines specifically provided for the tournament, so I haven’t had a chance to play on this new machine yet. I will, however, be playing Total Annihilation, which is a game I haven’t played in earnest in a year or two. There are apparently some fans here, too.

Four, I had Bawls for the first time. It’s not bad, but it isn’t as good as Red Bull.

I’m hungry, and my food just arrived.

Oh, and by the way, I finished the basic gameplay of Pong before I left. Today is a good day.

Categories
Games Geek / Technical

PSP Security Vulnerability?

These days I am generally trying to catch up with all of the weekly reviews I haven’t been doing, but I received a bit of news in my inbox that caught my eye: Game Console Vulnerability Identified.

Apparently it isn’t completely new news as the PSP has had security vulnerabilities before, but wow! How long will it be before someone finds something similar on the XBox?

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
Game Development Geek / Technical Personal Development

Finding Ready-Made Code

This past weekend I was trying to work on some code that makes use of math. Specifically, I was working on acceleration and velocity, but I didn’t necessarily need a heavy-duty physics engine. I just wanted some low-level C++ code for vector math.

I shouldn’t have to write it myself, right? It’s been done before, by myself and others, and I’m sure some publicly available code would be better tested and more functional than anything I would write. It should be easier to find some code online than to pull out the math books and write my own. There is no need to reinvent the wheel.

It spent about an hour and a half researching a Vector class. It was difficult to find because a number of hits were for imitators or enhancements of std::vector. When I finally found a good implementation, it was part of a small library, but it was fairly trivial to separate it out. I had to make some changes to adapt it to Doxygen, but it definitely beats creating a complete class definition from scratch over the course of a few days.

It was difficult to find code that was generic enough and well-written. Some were too specific or too unwieldy. I found one library that was a “tiny matrix and vector” library, only to discover that the vector was a small footprint version of std::vector. It was one of those WTF moments. I found one class that would have been fine except that the author didn’t bother to present his name or the date that it was created. How can I keep the author’s name in the source code if he/she didn’t bother put it in there in the first place?

I finally found some useful code through Koders, a source code search engine. I also learned about a few other code search engines that I may use in the future:

Planet Source Code
Krugle

What do you do when you need some basic code that you know should be available as a library? Do you just take the time to write your own, or do you look for code online? Do you outsource it to someone, using a service like Rent A Coder?

Categories
Games Geek / Technical Marketing/Business

A Loaf of Bread, a Game of Pong, and You?

I already wrote about Nolan Bushnell’s new venture of a restaurant chain that will feature video games, food, and alcohol that will somehow appeal to women.

turbo from the #gamedevelopers channel pointed me to the restuarant’s website. It actually does sound promising. You can play games with people at your table, other tables, or even the entire restaurant. You can order food from the touch screen display, which is actually something I’ve been telling my friends we should be able to do for years. You can even go to wine-tasting school by having wines brought to you and scoring them on the screen.

There is even a blog, and one of the recently made posts outlines the kind of games that you will see at uWink:
Nolan Bushnell’s Rules for Social Games

Will uWink develop all of its games in-house, or will they be outsourced to some enterprising indies? Is “social game” really a new genre, or is it just a marketing buzzword for making the LAN party experience more accessible to the masses? When will we see uWink in Chicago?

Categories
Game Development Geek / Technical

Debugging

Richard “superpig” Fine has written a piece called Introduction to Debugging. While it is clearly biased towards using Visual Studio’s debugger, it does provide a general checklist of things to do when killing those bugs:

  • Issue recognition
  • Intelligence gathering
  • Diagnosis
  • Prescription
  • Response
  • Verification
Categories
Games Geek / Technical

Video Game Detox Clinic Opens in Europe

This past Sunday I read an article in the newspaper about a video game addiction center opening in Amsterdam.

Smith & Jones Addiction Consultants have created Game Zone Center, an “outdoor gaming treatment camp”, to help people with a video game addiction.

I am not going to claim that there is no such thing. In fact, I think it makes sense that there are people who have a serious addiction problem with video games since there are addictions to a number of other things. I take issue with the following statement:

The participants will gain true self esteem by spending 2 weeks in a team of real people, achieving real goals and having real fun!

That statement bothers me because it sounds too much like the uninformed statements I’ve heard from people in high school and college. “Why don’t you put down the controller and get a life?” or “Why don’t you go out and hang out with real people?”

To a lot of those people, going out smoking and drinking with friends until you get sick is healthier social time than LAN parties. They were not exactly the kind of people I wanted to use as role models. Besides, not all games involve solitary confinement, especially not today. Even the single player games can get communities of players talking to each other. It may sound like I am stretching the truth to make a terrible point, but I’m serious. Playing video games does not require cutting yourself off from the real world.

I don’t really know how to talk about “real goals” since I do not know what they mean. Video games involve goal-setting, and accomplishment of those goals can provide a very satisfying feeling. It does not compare to life accomplishments, such as getting a new job or winning a championship soccer match, but it isn’t as if video games promote inferior goal-setting techniques. I would argue experienced video game players are the ones most likely to create great goals for themselves. They know that if they set out to acheive something, whether in a game or not, they can do it if they attempt it. They’re the ones getting the experience of trying, failing, and trying again.

Video games are real fun. I’m sure that the clinic will offer their own enjoyable activities, and I’ll be the first one to tell you that I think sports are a lot of fun. I just don’t see how playing a simulation of a sport or any other type of game disqualifies it as “real” fun. Tell a bunch of people playing Super Smash Bros Melee or Guitar Hero in the living room that the fun they are having isn’t real. Tell them that it doesn’t count unless they are actually playing guitar or having epic martial arts matches. I’m sure it will be a real eye-opener and they’ll change their ways.

I don’t know nearly enough about the subject to talk about the addiction problem. I’m sure it is a real problem, and those suffering with it will need the help that such a clinic can provide. That issue is not what I am talking about. I simply don’t appreciate the sentiment that video games are the enemy of normal, healthy, and socially acceptable people. Not to get too dramatic, but I’m waiting for someone to say,”Well, have you ever tried not being a video game player?”

Categories
Game Development Games Geek / Technical

Carnival of Gamers is Here!

I keep forgetting to post about it when it happens, but the Carnival of Gamers is here! This time it is hosted by Kim Pallister at …on pampers, programming & pitching manure. My post about Roger Ebert is featured this month, as well as a number of great posts by other participants.

Categories
Games Geek / Technical

Nethack Song

Greg Costikyan posted a link to the NetHack song. You can find the lyrics and an mp3 of NetHack.

And, of course, the game is teh awesomes.

Categories
Geek / Technical Linux Game Development Marketing/Business Politics/Government

Open Source Java

A friend pointed me to this article: Sun Promises to Open Source Java.

If Sun does make Java open source, it is good news for people who prefer to run Free operating systems. It’s one less technology that they have to do without. Existing open source solutions are always behind the one provided by Sun.

Now the choice for Free software developers is “Do I switch to Java or do I continue to use the language I have been using?”

It is interesting that Sun’s main concern is fragmentation of the codebase. When you give people the right to redistribute the source, it is bound to happen; however, the worst-case scenario nightmare that opponents of Free software think of is not typical. There aren’t exactly hundreds of forks of the Linux kernel, for example. Everyone basically works off of the main branch of development. If someone wants to take Linux in a different direction, they are free to do so. Of course, if everyone is sticking with Linus’ original project, then the fork won’t exactly be a problem in terms of “fragmentation”. And with Free software, forks are free to merge back into the original project anyway. Contrast the situation with software under the BSD license, which would allow someone to fork a project without giving anything back.