Space Wars Update: Radar, random enemy spawning, sounds

I can check some boxes off this weekend, but a major sidetrack meant not as many changes as I would have liked…

Here is the link to the latest Space Wars…

I spent most of the weekend trying to figure out why adding more then 5 enemies slowed the frame rate to 20 FPS. Turns out I had cameras attached to all the enemy prefabs which I guess eats up lots of resources. So, keep your cameras to a minimum and don’t just attach them to random things. Early on I was using it so watch from the enemy perspective to see what they do, but I can always just add one when I need it.

Removing the cameras fixed everything, but not before I attempted to rewrite the movement scripts without using the physics engine because I thought that was what was slowing things down–I’ve heard too many physics bodies interacting could be a problem. Nope. So now the game can run at least 30 enemies. It’s a little messy because the AI can’t navigate around things really.

Screen Shot 2013-11-24 at 10.24.46 PM

I’ve added a pretty good radar system that tells you where enemies are. The system beeps when a new enemy comes into range. It shows red dots for enemies that are above you (using world coords) and orange if they are below. Yellow if they are about your level. It sort of helps to know someone is right on top of you before they hit you with projectiles.

I made it so enemies respawn in random amounts in random ranges around the world. If they get stuck you might have to hunt for them. Destroy them all and new ones respawn and the game keeps score. AI also picks points to head to before coming straight at the enemy thus sort of coming from all sides–seems to work ok but the AI is really just a place holder for real AI.

Right clicking yields a work-in-progress missile, right now its just as powerful as the guns and it seems less accurate. Longer range though so you can miss more from farther away.

Oh and I added some sounds. Guns make noise, the explosions make some noise, missiles make a noise, radar beeps – tho not loud enough really. Also I added some music for fun.

Update to Space Wars

No huge changes yet. Still not exactly a game. I haven’t gotten around to modeling cool looking ships so I added some horrible cube ones that are about the size. I also changed the AI and made the whole level a little more pretty. The thing was slowing to a crawl a few hours ago, but I think I fixed the bug. Or did I?  Here is a link to Space Wars in Unity 3D.

Again – WASD QE for moving, Mouse look to turn and aim. Left Click to shoot.

Next I am planning on adding a way for the enemies to patrol rather than attack outright and then be able to select targets like each other and fight. Oh and guided missiles.

Change Log 11/16/13:

– AI rotation / movement code – more gradual turning
– shoots when aligned
– duplicated enemy so there are two
– made 15 meter long place-holder ship meshes
– added some giant planets, asteroids to the play area
– drew my own nebula art and added to the skybox background-makes everything look awesome! credits to this artist Alec Schmidt for showing me how – Link to drawing Nebulas tutorial
– turned on some anti-aliasing
– turned off  lights for the bullets – although that wasn’t actually slowing things down.
– actually now I don’t remember what was…
– fixed multi-explosion bug
– made bullets smaller
– fixed some of the spinning when hit- still happens but not as bad
– added crosshairs for aiming and made mouse disappear – still has a habit of ending up clicking my desktop sometimes though

To do:
– sound
– radar map
– ai ai ai – patrol, chase, flank, strafe, gaurd, etc
– weapons systems – more weapons, switching, different damage / effects
– damage system
– game message system
– HUD – radar, armor visual, ammo, fuel, etc
– friendly ai
– good ship models
– communication with other ships

– planets, space stations, entire universe, jump gates probably
– buying, selling, upgrading
– walking around in stuff
– FPS action? ground wars? alien lifeforms? black holes? mining? crafting? jk

SpaceWars 3D demo

Not nearly anywhere near complete…its basically a tech demo of me figuring out how to use Unity. You can win by destroying the one bad guy. He has about 50 hit points. If you lose it will just say it at the top corner and keep letting you play.

Controls are W/S Thrust Forward and Back. A/D to strafe sideways. Q/E to roll. Mouse Look to turn. Mouse 1 to shoot lasers.

Be sure to click the center of the game screen when you start so the web app knows to use the mouse.

And yes, the bad guy is two cube put together but he does chase you and shoot lasers which is more important than looking cool. Also he’s probably gonna blast you in the first few seconds, beware. Eventually he goes on fire. If you go on fire you are in trouble. Also the planet/death stars on the playing field explode.

Here is a link to Space Wars 3D.

Space Wars Original

The first game I made in recent history was Space Wars — a 2D HTML5 game using DOM and Javascript.

Screen Shot 2013-11-07 at 6.20.30 PM

Controls are arrows to rotate and thrust forward. D – Shoot, E – Lock or Shoot Missile 1/2 Switch weapons if you get a special. Pauses.

Screen Shot 2013-11-07 at 6.15.16 PM


I did not use Canvas. It is basically CSS being animated on the screen. Pretty cool what you can do with it.

There are a bunch of levels but its sort of unfinished. The boss graphic was never updated from previous versions so he looks weird.



Island in Unity 3D

Hi there! I am messing around with Unity 3D since a compiled game on the desktop might be about a billion times faster. I am getting worried that my programming abilities in WebGL have hit a snag with the need to write custom shaders to make all the ships draw and move without crippling the frame rate. And so I am looking at Unity.

I will start posting some of the tutorials and things I have been working with since its not super easy to hunt down everything needed to make a good space game apparently. I’ve also been working with Blender on 3D models of ships. Screenshots coming.

Screen Shot 2013-11-04 at 10.13.49 PM

Here is a screen shot of the Island I made. Its real simple, nothing special – I just used Unity’s terrain features and played around. There is a path you can take to get pretty close to the top of the crag. Also it seems you can just run up the face… not sure why that is possible. Still learning!! Click here to play around with it in the Unity Web player.