Oracle’s Eye Development: Un-Eventful

This week’s Oracle’s Eye development wasn’t too fruitful, but I did spend a bit more time trying to figure out what I needed in the first place. The lack of actual code doesn’t bother me so much now that I have some ideas of the problem domain.

The problem domain of the moment is the Event system. I don’t want to hardcode the movement of the Ball and the Player since I might want to tweak the way things are handled. I’ve had a general idea of how the Ball and Player should interact, but I haven’t explicitly defined it.

So while in the middle of a presentation last week, I started to write down some ideas. What is it that I am trying to accomplish?

Well, I want to finish the game. How do I do that? Well, I’ll basically need to allow the Player to end a Level by kicking the Ball into a Goal. That line basically sums up what would make this game into a game, regardless of the amount of fun possible. The idea is that if I can do that, I can then design as many levels as I want, but the basic game is complete.

Well, how do I get to that point from here? Currently I can move the Player, and the Ball can also be moved, but I don’t have a clean way of keeping the Ball stationary until the Player touches it. I also don’t have a way to tell the Ball when to stop moving when it hits a Wall or the Player.

What I need is an Event handler and some Events. I need some indepdendent system to handle things such as telling the Ball when to move and when to stop moving. I need something to decide that the Level has been completed or needs to be reloaded. How about the creation and destruction of objects during a game? Maybe there are four Balls, and when one gets into the Goal, it disappears.

Now, when the Player collides with another object, the GameWorld can create a CollisionEvent, or maybe it knows that the Player hit an object of type Ball and so creates a KickBallEvent.

I’ve read a few tutorials and the book Game Coding Complete, and so I should be able to come up with something workable fairly easily. Well, maybe not too easily. Still, once I get an Event system working, it should be much easier to make the Player kick the Ball, to get the Ball to enter the Goal, and to let the game know that the Level has ended.

Or at least that’s the theory.

4 comments to Oracle’s Eye Development: Un-Eventful

  • Impossible

    While complex designs are good when you need flexibility, I’d say it’s better to start with doing the simplest thing possible to acheive your goal. It will take you a lot less time to hardcode this logic and find out if your game works than it will to create a complicated architecture. If you later decide you need a more complex system its relatively easy to remove the hardcoded parts with more flexible code.

    I’m assuming your goal is to make a game, and if it is, I would do things that move toward the goal of having a playable game, not a nicely designed engine. Even if your goal is to design a nice game engine, chances are there are a lot of things you aren’t thinking about (having no actual game running on the engine.)

  • Yep, that’s true. In fact, if I really try, my code might be ugly, but I can probably get a Ball kicked around by the end of next week. I should probably just concentrate on that.

    I find that whenever I try to think ahead, that’s when I get stuck. Right now, the code and data are hardcoded, and I keep trying to separate them. I think if I just add some comments like, “THIS IS DONE ON PURPOSE” and “DO NOT TRY TO FIX AND JUST GET THINGS DONE!” it will probably stop me from trying to abstract everything. B-)

  • Ah, you’ve got Game Coding Complete. Excellent book. And I’m not just saying that because I know the author. If I were building a team and I’d hired some fresh, bright-eyed college graduate, that is the first book I would require him to read.

    I must say, budding game developers have a lot more resources to draw from than I did back when I got started 🙂

  • I was actually thinking about that point. Since I’m not blazing trails, none of this work should be hard. I mean, someone else already did it before me. I should be able to do it too. It isn’t to say that it isn’t challenging, but that it is definitely within my abilities or within an ability I can learn.

Twitter: gbgames