Wednesday, January 22, 2014

Week 3 and an Ambitious Undertaking: I Bite Off More Than I Can Chew

Week 3 was going to be a hot development week. I was working with some new tools, rewriting all my scripts, and effectively rebuilding the game 100% from the ground up. I wanted to get 300sq.m. covered in city, I wanted animated enemies, I wanted Raycast weapons, I wanted Health scripts that can be accessed by trigger events without needing to reference the health script on each enemy directly, I wanted to get a general aesthetic for the game set in place, and I wanted to start modeling and texturing around that aesthetic.

I rebuilt the scripts, got 200sq.m of city covered, animated a new android (to replace the robot), created 2 new weapons, and started flushing out a general theme (which I told 3 people about in gross detail, more on that later); and then everything went wrong. I'm not talking hard to handle, I'm talking output-crushing difficulty spikes in development. It all started with a Quaternion Angle calculation, one that took the better part of an entire day to write and instantiate; all over the angled trajectory of the spray pattern of bullets off of mesh surfaces.

I was told, that the easiest way to accomplish an on- hit animated particle effect was to simply create a particle effect, and then when a raycast hits have the particle effect rotate to "look" back at the camera and then instantiate. But this looked sloppy. Bullets spray wouldn't ricochet back 180 degrees and fly towards you, not unless you were going to be looking straight at the wall. Not acceptable. That was my first mistake. As an indie developer who does EVERYTHING other than the modeling of the enemies (I even rig them and animate them myself once I get them from Julius), I needed to see when it was good enough for now; mark it down in my to-do list and then go from there. I, of course, didn't. 5 hours later it was working great. Bullet collision spray works in an almost natural way; mirroring the angle of the raycast's trajectory and then calculating that mirror to fit the mesh plane and rotation of the hit-point. That also put me 5-hours behind.

Now, I had finish the android's animation and figured it wouldn't be difficult to simply swap the enemy model from the old game model robot with the new one. Yeah. Right. Unity, without the Pro version, doesn't support IK in Mechanim. What good is an animation program, that can't animate? Not very good. No problem, I had already made the animations in Blender and could easily just import them into Unity; in fact, it should have done so already because the FBX file contained them already. Yup, but for some stupid reason Unity can't find the head bone of the rig, even though it had found the parent neck bone, and the head bone was the next bone on the spine in the hierarchy. It took me a little while to figure that out, but now my animations were working in Unity on my android. Except my AI script is set to move the character, and I had created the animations with movement. Even the one I didn't Mechanim was still adding a movement to it. This meant I was doubling up on the movement, so I just removed the forward movement from the AI script.

So now the android can walk around, follow my waypoints and so forth. It clips through objects because it doesn't have a collider attached. Attaching a collider caused the animation to get stuck on literally everything (the ground, 0.25m size increases...) wont work. So I change the collider to a capsule collider and everything seems to work fine, until it runs into something that allows the collider to push the android up; then he never comes back down. Fine, I'll attach a rigidbody to the android and he should be good. He'll walk over stuff, and then fall back down. And fall down he did. Almost immediately, and then sat there spinning in circles. Alright, box collider then. Hitbox is messed up now from being a square. Adjust it. He starts getting stuck on everything. Yup. Fine then, no rigidbody and a sphere collider with downwards force being put on it. Feet clip through the ground, can't go up slopes. Just choose to remove it all for now. So none of that works right. I can make the android walk around on flat ground, but any slope kills it. So now I have to decide if I want to flatten the slopes of the city to make it work right. It's on the back-burner.

I start researching themes for the game overall; and decide on a period based science fiction theme, starting with the 1970's, then releasing some later full conversion content levels that would be the 80's, then the 90's; and possibly the 60's. I start working on some textures, and weapon ideas that would fit the theme. Ray Guns, Laser Beams, Destabilizers, Mini Nukes, Rocket Launchers, that sort of thing. Start sketching out some general aesthetic idea's of a 1970's futuristic city; not that there is a specific idea, using more of a compilation of idea's. I reanimate the android to look like a guy in a suit, giving the mesh a "jiggle" overtop of the rig so it doesn't move in a natural way. I create some billboard-like effects, which make rockets look like they have a hand-animated 1970's CG fire-trail (it looks two-dimensional from every angle, and auto rotates to "face" the camera) cool stuff. I send the file to a good friend of mine, who talks with me for about 2 hours about the vision of the game and getting a feel for how I envision it to be once it's a finished product (months from now). I get some great feedback from him, and took as many notes as I could.

Then I get into a meeting with Julius and pitch it to him; total shut-down. It doesn't fit the aesthetic of what he was creating with the enemies. Scrapped. So now we go into discussion of what the game should look like; there is no real general consensus other than a city that has giant monsters and other enemies rampaging it. I get told Doom 2 type city textures, and more hell-gates and stuff. Alright. I start going back through Doom 2 to get a feel for the description. I see it, and I love it. First thematic pack can be based on what we already have the assets mostly created around; I have zero problem with that. But now, everything needs a full redesign. I designed the city around the idea of having a retro-futuristic look, now I get to go back to square 1.

So now I'm 2 days from when I wanted to drop a new Alpha (I try and get one done a week) and I have, essentially, no city again, no animated enemies, no weapons (just scripts), and a whole lot of work to do redo. To "finish" the first level, I still need:

1. Enemies that are animated, that follow a waypoint script, with variable attack scripts worked in (wander->chase->attack->chase->wander) with hit-detection, and health.
2. An attack for the enemies to do, be it a raycast laser or a projectile.
3. Buildings that are textured properly.
4. Particle effects to mask the building "being destroyed" falling through the ground.
5. Raycast that also has an add force/velocity script attached.
6. Explosions that also have an add force/velocity script attached.
7. To redo my explosion radius script so it never produces negative damage.
8. A flushed out way to create the enemies on the playing field (hellgate, dropship, tractor beam...)
9. All of my UI elements re-added and updated for new gameplay mechanics.
10. Environment assets (trees, vegetation...)
11. Lighting completed
12. Sound
13. A level script telling the game when you're "won".
14. Player data to be saved from one "level" to the next.
15. Weapon and player upgrades.
16. A weapon model.

It's just going to be a long road. I went into this week with a high-output thought process, but at this point I'm just crippled. I'm trying to get focused and start work again, but other than the scripts, I'm essentially having to scrap everything that got done this week; right down to the animations on the android. It's just being written as a total loss in my book. I didn't realize the scale of this weeks undertakings, but next time I'll make sure to dial it back a lot; better to get everything done really early and have to think of things to accomplish, then to force output. It's just too much stress for one person.

No comments:

Post a Comment