XType Engine progress report! :)

A place for people with an interest in developing new shmups.
Post Reply
User avatar
sniperwolf
Posts: 39
Joined: Wed Aug 10, 2005 10:44 pm
Location: Oregon

XType Engine progress report! :)

Post by sniperwolf »

Okay, been a while since I posted...

First of all, thank you ALL for your help when I posted what questions I had. Timer weirdness is pretty much fixed, which frees me up to do other stuff... and I've been working almost day and night on this thing since my last post here.

I've decided how I want to handle weapons. I ditched the bulletML idea for something tailored more for my own app, instead of having to design around another's idea. Here's how it works:

All enemies, and the player, have their own "ammo controller". The Ammo Controller maintains information regarding the current types of weapons the enemy or player has, or more appropriately, the ammo controller maintains a linked list of ammo objects. It also contains functions to manipulate the ammo objects, most notably render, move, and destroy functions.

Ammo objects contain data regarding the ammo type, ammo spray pattern [currently I have implemented straight and sine-wave pattern firing patterns], which mesh to use to render the ammo object, and how to move and render the object.

It sounds complicated, but it's really quite simple. For my player ship, for instance, I simply make a new ammocontroller, and when I want to fire a bullet, I call the ship's fire() function. In the fire() function, I make a new ammo object, assign it some parameters [for instance, sine wave firing type, standard bullet mesh, etc] and store it into the ship's ammo controller. In my render() function, I tell the ammocontroller to do it's render() function, and it cycles through the ammo objects currently stored in it, moving and rendering them. It ends up being about 5-6 lines of code, I think. :)

Also, I've moved the engine almost completely over to state-based operation. It's made everything go soooo smoothly. Part of that was implementing a title screen [right now a static bitmap image, going to change that soon, though it's not a huge priority, won't be a hard fix] and a pause function, which went fine. I merely added two game states - Paused, and TitleScreen. When the Paused state is enabled, all I do is suspend rendering [basically, if the state == Paused, I run a separate render loop which does no game logic calculation] and display a static bitmap image till the user presses the pause key again.

I've also started my custom sprite class. I wanted one so I could draw objects to the screen that didn't need to be 3D - things like the background image behind the user interface, and things I simply haven't thought of yet. :) It's coming along fine, just need to write some more constructors and functions for it and iron out some minor details. I can easily draw tiled images now [for the UI, I tile a 32x32 bitmap for the background], so I'm pretty happy with it. :)

Also did some model optimization - When I was laying down tons of bullets on the screen, I couldn't figure out why my framerate fell down horribly badly - turns out, I designed my bullets with around 140 polygons each. :P

I'm trying to get a binary of some sort to release, just to demo the progress so far, and I hope to have one I'm comfortable with letting out next week or so. I want to get the collision system in place [at least the bullet collision] before I do, I consider that the next "big" milestone to do.

Anyhow, until there's a stable enough release, here's a screenshot showing the demonstration player model loaded, and firing using an ammo controller instructed to fire two streams of bullets, one uses a sine wave and the other using the same sine wave inverted [the x value after the sin() function * -1]. It also shows a quickie starfield system I made, it's just two meshes composed of tiny cubes, arranged in 3D space for the sake of scrolling effect, colored white, which swap positions according to the player's location [one mesh is where the player is currently, one in front of it, and once the player is in the middle of the second mesh the first one bunny-hops to the front of the line, and so on], giving the illusion of an infinitely long starfield with depth.

Image
How do I wrote code?
Post Reply