So, I've gotten some 'off time' from big school projects and finally managed to get started on a game I've been wanting to work on for a while now.
Quadrant is that game, and I've been working on it for two weeks now. I'm not completely sure where I want to take the game, but in the long run I'd like to make some sort of 2d Economic spaceship playground, X3 Terran conflict is a big source of inspiration for this. but such grandness is still far faaaar off in the distance.
For now I'm working on getting spaceships to fly around... shoot stuff, and eventually die in fictional agonising space explosions! something I'm also keen on having in my game is to allow players to design their own ships, using 'modular' components. Preparing this and designing an editor for spacecraft is something I'm currently working on.
I'm using Unity 4.3 to work on this, the Box2d Physics implementation is missing a few... vital functions (like an easy way to get/set the centre of mass on a physics body). but I'm really digging the performance its giving me, I've tried using
Farseer for unity, which has some more fancy features but sadly just doesn't compete with unity's native 2d physics implementation when it comes to performance =(...
So enough talk, Lets see some stuff.
As I mentioned I want spaceship to be build out of modular components, These components are essentially sprites being stored in a texture atlas:
(these are the current parts I have.
(and here you can see these parts combined into a ship)
I also made a ship saver and loader. which takes a ship assembled in the unity editor and saves/loads it to an XML. the parts are saved by name... so when the texture atlas is changed in the future and the positioning of the various components changes the system can still find the correct part based on its name. not only does this keep my hands out of my hair when I want to add some new graphics it should also open up the door to some modability!
(A loaded ship with its xml)
(the green colours on the ship are actually team-colours, and will change depending on the three colours the user supplies)
while most of the components are only aesthetic and used to define the shape of the spacecraft, other components like the guns and engines do their respective job when input is provided, (IE... guns shoot and engines enact force onto the physics body they're attached to)
(here I'm breaking apart force vectors into separated force components,
the green aspect of the vector is 100% Angular Acceleration(perpendicular to the centre of mass (red),
and the blue aspect of the vector is 100% Linear Acceleration,
you can see the centre of mass is a little off centre, because the central rear engine has some Angular Acceleration)
so yeah... Engine placement matters when it comes to ship handling.
Feel free to have a bit of a test ride.
Link to Webplayer (edit: link no longer works.)
WSAD for steering, Space for shooting. There's not a whole lot to do, damage and user friendly handling is kinda still on the wishlist
(ps, if you're interested in a game developer students portfolio feel free to go to the root of that link
(mind you, its a bit of a work in progress))
Heres what I've got:
- Loading of art assets through texture atlas.
- Engines that give force depending on their positioning.
- shooters that spawn bullets.
- a projectile manager to handles bullet collision (its a raycast between old and new positions) and renders bullets as particles.
- a way to save designs to XML.
- a way to load designs from XML.
- automatic assignment of correct engines to correct inputs (that's what the breaking up of engine force vectors was for)
- every art asset has its own collision object that is saved to an xml.
Here's what I'm currently working on:
- I've imported the excellent
Clipper library made by Angus Johnson.
- I'm trying to preform a boolean union operation of all the little collision objects to merge them into a single object.
- I ran into problems with the clipper not working as intended when the new polygon has holes.
- reworking the way I store collision shapes to take holes into account...
- all of this is being done to make an ingame editor, so I don't have to design ships in the unity editor any more!
Let me know what you guys think. I don't know how often I'll be able to update this or how often I'll be able to work in my game in the future (dark clouds of educational responsibilities are on the horizon)