Hello there! Welcome to Programming Shenanigans! This is a blog documenting the trials and tribulations of two novice programmers as we try to navigate the weird and wondrous world of game coding.

Pages

Saturday, May 22, 2010

Think fast! *Splash*

Graphics

The graphics handler on the player would run at a preset frequency. It does not care about how fast the game itself actually runs, it will run as fast as we set the frame rate. After a period of waiting, the graphics thread would send a request to the logic game world to give it a snapshot the current game world. The event handler of the logic thread would see this request, and would do a callback on the graphics thread using AddGameWorld() and AddPauseMenu() if required to pass the snapshot.

Another idea to implement is to make every state of the game its own game. When the “gameplay” game ends, a “Title” or “high score” game begins. A global variable inside the main loop of the game could be used to keep track of the current game that’s going on. The graphics thread would simply call the current game, and ask for a snapshot of what to output. The snapshot passes lists of items that need to be outputted, and the graphics thread simply cycles through the lists drawing every relevant object.

Yay, after 4 posts of blogging, the random global variable count is solidly at 1, as opposed to the bajillion in Tetris.

Now for another interesting idea I had. Instead of having a plain old background for the title game, we could have the map levels showing behind the title menu. But then that got me thinking, if we could have the level BG running anyway, why not just through the entire game in there, with an AI playing. I don’t remember if I talked about this or not, but I also had the idea of having mini bosses that spawn super randomly. And these guys would actually put up a fight, using smart movements and ninja like evasion of your shots. This would imply that your shots are evadable though, so this is where I plan to deviate from Raiden. The shooting in Raiden would require much more finesse and not just holding down the button. I want it to be like the AC130 from Modern warfare 2, if anybody’s played that.

So with this kind of system set up, another challenge arises, we have a lot of AI that needs to be written. At the very least, we need 4 classes of AI, Player-AI, Miniboss-Ai, Regular Scrub –Ai, and Boss Ai. If this is done right though, imagine how awesome it’d be. We could just sit back, and watch our AI fight each other. Crap, the Player-AI needs to be seriously intense, using collision detection projection and also objectives.

With all that talk about player-AI, we need to make a class that can accommodate it. When a user is created inside a player class, it will need to be handed an object distinguishing it as a player or an AI. If it’s an Ai, it will initialize an AI object and begin taking commands from that. If it’s a player, then it will begin reading player input.

Things to do for the future

-Design AI structure
-Figure out things like how enemies would spawn and fly in formation etc.

1 comment:

Followers