Suzuchibi Development Continues

Well, I haven’t stopped working on it of course, its just that with my hand sore from work, I don’t always feel like doing more computer stuff when I get home.

The only weapons shown in the menu are the ones you’ve unlocked
Hurray for diablo style click-to-attack combat!
She also doesn’t auto-attack objects that don’t have health.

Since the last update, I’ve implemented the following:

  • Save/load data on death, respawn, and enter level
  • enhanced triggers that can fire a number of events and effects
  • game pause stops combat
  • save triggers/checkpoints
  • a save data system that stores your variables
  • level transition trigger
  • mouseover text in game world
  • boss state system (partially complete)
  • click-to-attack system, like diablo
  • enemy wandering
On the todo list for code:
  • reincarnate player to hub at 0 lives
  • save and load ALL game variables (ughh)
  • level system
  • inventory system
  • dialogue system
  • cinematic system

todo list for design and art:

  • design everything
  • do all the art
  • nothing major

One Hundred Baddies and some menus

Well, last night I got enemies animating (mostly) and tried a test case to see how my scripting is doing. I wanted to check to see how many baddies I can throw at a time, and the answer appears to be 100. Kinda.

They can’t even all gang up on me right now.
It gets kinda hectic in the editor

 The “kinda”is due to the fact that 50 runs kinda framey in the editor, and 100 definitely does, but both run great in the build. Fortunately, only 20 or so seem to fit on the screen at a time, so it shouldn’t be a big deal. I was trying to see if I needed an enemy manager to keep track of which enemies to activate based on the player position, but at 100 guys, it almost doesn’t look like I’d need to. What I may do is build that into the enemy ai script early on so that it just doesn’t execute most of it if the player is too far away.

BEHOLD! GUILayout!

I’ve learned a lot over the past few days about GUILayout. It’s really, really awesome. Very much like CSS. I’m also very fond of the Border feature, which allows you to cut an image up and stretch the middle portions and not the edges or corners. REALLY HANDY. Thanks unity! Right now the menu has 3 tabs: inventory, settings, and game. The inventory actually controls what the player has equipped, and the settings menu adjusts the size and display of health bars. I’ll be adding in a save/load feature once I research writing to XML a little later. I may end up only having one save game I guess, if that turns out to be too complicated.

Red Oni test enemy and Attachments

Hurray for Paint Tool Sai!

He is SO going to get ragdoll’d

So this is our first enemy. He’s just an oni. He’ll have a tetsubo when I make one. Maybe the lower rank ones will just have clubs.

So the enemy guy was intended to help me get the enemy ai and weapon attachment stuff working, but doing so had the added benefit of teaching me all about classes and enumerations. HURRAY!!!! Now I feel smart. I now have an attachment class that allows me to set up an object to attach to any bone of the model after the model is spawned in. This is so that I can make a small number of bad guys and attach unskinned objects to them to change their equipment.
From there I applied the attachment class (which contains the bone name in a string, the game object to be attached, and a position and rotation offset) to the player, and linked the player’s list of weapons (as attachments and as weapon effects) to the Menu so you can actually swap weapons from your inventory! I feel so cool.
Also, special thanks to the Walker Boys Studio for their really nice videos on Enums and Classes. Dirt simple is what I needed.

Suzu Mechanics

Here’s another vid of some things in Suzu working. Demonstration of mechanics, such as targeting, movement, holding movement, firing weapons, and crossfading animations based on velocity and input.
Behold, the most massive rig for the least massive heroine

Suzu’s rig is pretty intricate, and will continue to evolve as animation needs arise, but right now its around 60 objects, with only half of them actually skinned bones. The rest are controller objects for animating and so on. There are controllers for the hands, feet, tail, head, and the major joints. She’s also got bones for her ears, and several bones for her sword and other weapons. The weapons themselves will get attached in game. Should be pretty easy to animate. Next up is skinning.

I don’t anticipate that the enemies should be as much trouble to rig and skin, since they need so much less customization. Unfortunately, they’re all going to be different, so I can’t really share animations.

Hopefully we’ll also benefit from Syl’s talents on this deal too, though we’re unsure as to what yet.

Off to skin!

Suzuchibi movement yatta!

ARG.
Alright. It looks so easy, but its not. Not for me anyway. So what I’m doing is setting up a player controller that you move with your mind your mouse.

Step 1: Getting a controller to follow an object:
I used the basic FPS controller as a starting point. Rather than constructing the movement direction vector from the mouse axes, I simply told it to use the position of a game object. Conditional’d that so that it doesn’t fire unless there’s a target. I had to pussyfoot around turning the controller, since I want the camera to be static for the most part, and turning the camera with camera-space controls makes the game control weird.

Step 2: Raycast screenspace to collider:
In the old version I figured out how to shoot a ray from mouse position in screen space to collisions on world space. I also figured out how to use a Layermask to check what the ray hit. Now the system looks to see if you hit something in the Enemy layer first, then checks to see if you hit anything in the Walkable layer if you didn’t. Then, if we have a target that isn’t an enemy, we move our waypoint to the position of the raycast hit in world space. If we hit an enemy, we just make him the target. If we didn’t already have a waypoint target, we make a new one at the hit point.

Step 3: Give the target to the graphics object:
Since the player controller (the deal that actually takes input) never rotates, and only moves to specific points without turning, we need something to rotate the character art. So I made a game object that holds the art and directional stuff (such as attack areas etc), parented it to the controller, and turned that. I setup the controller to broadcast the target to all children so that I can get the target on any given weapon or animation or anything. Then I smoothly interpolate the rotation of the graphics object  towards the player’s target.

Most of this is in Fixed Update, so it runs pretty smooth now, with no jitteryness or anything. Pretty sweet. I can now setup my level art so that there are parts that are Walkable and parts that aren’t and the player can’t walk off the map. Whee!!

Edit:
Ok, some other fixes to help with targeting:

When raycasting, we do it in two steps, first to check if its an enemy (so that we can target a mobile game object) and then we check to see if we hit some walkable ground. Now, I added in a check to see if we already have a target that ISN’T an enemy and if we do, we destroy that one. This is because it appeared possible to click off the enemy and back on rapidly and leave a bunch of instantiated targets lying around. I also added in a kill timer on the spanwed targets so that they go away if it takes too long to get there. We are ready for melee combat, baby.

Suzuchibi Desuyo!

Ohayo gozaimasu! Suzumaru desu!

A long time ago, I was working on a prototype for a diablo clone. I got busy at work and kinda gave up on it for a while. I wasn’t super impressed with the character. I’ve since upgraded to Unity 3 and I’m in the process of trying to port over some old assets from that to build a cute chibi samurai game based of that framework.

Here’s some screens from the old project in Unity 2.6.1.

I’m looking into setting up a nifty rig for suzu-chan, one of those separate top and bottom types so she can run AND swing her sword. I also plan to have arrows, kunai, shuriken, and other weapons in there, because samurai weapons are freaking cool.

Look forward to it!