Friday, August 27, 2010

Droids - Shooting

This droid is shooting some kind of lethal glitter attack
I've made small progress with the Droids game. Something to note while playing around was that the CharacterController didn't do much for collisions beyond its movement checks. I added a capsule collider to it that matched the CharacterController's internal collider. This allowed my shots to detect their collision with the droids.

When destroying network shared game objects with Network.Destroy(), be sure to check the networkView's isMine property, otherwise you'll destroy it twice, and Unity doesn't like that.

I haven't updated the web player yet, but the code is still on my Github page. I'll likely update the web player when I get networking working well with it, but for now it crashes due to security problems inside the web player.

Sunday, August 22, 2010

Droids! + Dead Reckoning

I developed a strange addiction to Castlevania: Harmony of Despair recently. During the last IGDA game jam, kindly hosted at UAT, I sought to explore what kept me so drawn to a game a game that felt fairly basic.

I spent a good deal of time trying to make a platformer that would exist within a Dyson sphere. Unfortunately, Unity's CharacterController class, while awesome for a great many things, doesn't work well if your concept of up is a variable thing. I could write my own CharacterController, but I know it's a lot of work. Just seeing what I could do with the existing controller ate most of my time while at the game jam, leaving me with just a single untextured robot made up of cubes and cylinders warped into a mockery of a mechanical being. It could jump, yes, but there were bugs.
Why Droids? I'm not very great with modeling/animating/rigging. Robots need little to no rigging at all, if designed right. I can also have robots do things that normally just don't make sense for carbon based life-forms, and it won't break immersion. In other words, I can focus easily on making the game fun.

I've had a little time to work on it, and I've produced some satisfactory but less than amazing results. My game is now networked, borrowing heavily from my progress on Spell Blade. An interesting thing I discovered in all of this was how easy it was to implement dead reckoning using Unity's network serialization event. The game plays quite smoothly over the network.

This code does a read or write depending on who is controlling the droid (different players control different droids). The outbound is pretty simple. I serialize all of the relevant stateful data (location, orientation, desired movement over x/y, etc). Inbound is just about as simple, but the other half of this is that the remote player's input comes from the network. Since I knew at time of sending that the player was trying to move full-speed to the left, I'll give that same input to the robot until I get another update, where the location, orientation, and desired directions all get forced to new values. Maybe the player rapidly changed directions or something, in which case I might see some jerkiness depending on lag. What I definitely will see is the game moving the droid smoothly when the player is moving relatively smoothly, which I expect will be happening a lot. This isn't perfect, but it sure beats watching the player snap positions as he moves across the screen.

Each droid is controlled by a player over the network,
using a simple platformer scheme
Where do I go next? My plan is to demo this to my gaming group and ask "What would you like to see?". I've seen games evolve into some really wonderful things when designed this way. I believe I'm at a pretty good point here to do that.

Try the game here. I haven't been able to host any Unity games yet via the web player, but I test joining as a client with the web player all of the time. I'm using port 6112 if you're having connection issues.

You can also check out the code here.

Friday, August 13, 2010

Space Escape 2 Progress - Milky Way

Even while working on the first Space Escape I spent a good amount of time just looking for a way to make a Milk Way skybox, featuring, you know, stars. I did get an ok skybox with some rather ordinary looking stars.

I was able to find some fairly high res images of the Earth's night sky as a panorama. How to make a skybox out of that? The stuff I found mostly involved tossing the panorama on some sort of sphere or dome and then rendering that six times (one for each side of the skybox) to an image. This seems pretty hacky to me. Perhaps I just don't know how to wield Blender enough. I don't have Maya/Max, or a full version of Photoshop, so my options are pretty limited.

Instead of doing a skybox, I instead made a sphere with its material set to Particles/Alpha Blended. The sphere is set at 0, 0, 0 under the main camera, so it follows your view around everywhere. I had to turn off the collider so I wouldn't get problems with flares (which come fromt he sun). Everything in the game has a large or far scale, so I made the sphere very large. Unfortunately I can make it really large in the game world (where I can adjust the far clip plane of the camera), but it can make navigating in the editor a little clunky.

If an artist helped me out I'd certainly welcome it, but at the moment I can move forward, and that's what counts.
Having the Milky Way streaking across the view really adds to the look of the game.

Friday, August 6, 2010

Space Escape 2

While you're safe in the middle, there's a faint green ring around you
I have discarded Space Escape. The game and related posts will remain up as historical evidence that I have indeed worked on games before. I aim at a total reboot. The concepts I liked have been packed into a suitcase and we're now off to another location entirely. I present the beginnings of Space Escape 2. Perhaps I am fickle. The exhibits are laid bare for your judgement, but I believe the net result will be a more succulent fruit than the first iteration.

I initially really liked the idea of flying your ship through a virtual corridor, plotted by your ship's systems. This seems difficult to do when you can arbitrarily fly anywhere. That feature will be removed, and in its place you'll find you can move about in a radius freely, while I take you on a powerful trip.

As you start to leave the virtual lane, it brightens up and becomes yellow. Wouldn't it be great if we had this for cars?
I liked the idea of the boosting away. The act of acceleration seeming to tear at your very senses. This was difficult to accomplish, and positioning your ship just right to perform the maneuver was far too much delay and not enough gratification. My plans are to keep the boost, but make it more or less automatic, and guaranteed.

You'll also notice how close to the Earth the ship is. It should feel pretty big. It is pretty big. It houses billions of people with lots of room to spare. Compared to our sun it's actually pretty small, but I can still pull that off. I believe the baffling scale of the cosmos will be even more apparent now.

Ah! Too far!

Ok, so it's not enforced yet.