Sunday, March 3, 2013

Whew!

Where to begin?

Following a meeting with Aline where she helped me through most of my biggest problems, all the pieces started falling into place one by one. First I got scene loading working, so that various characters loaded into the scene from the config file. Then I got actions and emotions back up and running, and defined the character object script so that it's more or less the same as the character class from the text based version of my code.

Once I got characters into the scene and walking around, I created a line of text above their heads and attached a script so that they follow the characters and always point towards the camera. I rigged up a script so that the number keys 1-9 correspond to characters 1-9 (technically characters 0-8), and 0 resets the camera so that it isn't attached to anyone. Eventually I will have the opportunity to "cut" using the camera from interesting scene to interesting scene.

Next I got character interactions back online, so that characters could interact with each other based on the config file (I still need to tweak the config file so that there are more interesting directions that conversations can go - right now positive gets more positive and negative gets more negative, without anything like "accidental insult" or the conversation getting dull or conversation ending actions that occur without extreme emotional settings). I made it so that characters find other characters that aren't interacting and walk to each other. Then I re-implemented actions, so that characters could have their interactions and then break away from each other. This made the characters end their interactions, but because they were nearest to the people they just interacted with, they would just start another interaction with those people. So I added a variable to keep track of past partners, so that partners wouldn't repeat (since you would never have a conversation with someone, end it out of boredom or frustration, and immediately start a new one with the same person). I made it so the text above characters' heads displays the action that they are implementing (the action lines from the text based version proved helpful here). I noticed two problems here - there was bunching occurring, where characters would walk to each other and eventually wind up in a cluster in the middle. The other issue was that there was no random wandering - characters just walked to the closest characters to them, interacted, then found the next closest and walked there. I tried to fix both these problems by having characters wander to random points on the screen and only "notice" each other - walk up to each other - if two unoccupied characters get within a certain radius of each other. When that happens, they lock on to one another and walk up to each other as before.

Some immediate next steps: there is still a bit of bunching going on, mostly I think because character interactions are instantaneous. Characters meet with each other and then bounce off. The actions need to have a time interval that they take. Right now, the interaction loop cycles through and implements different actions so that each character performs dozens in under a second, and then they go their separate ways. I need to try to condense this (each consecutive action gets folded into the previous one, each uninteresting action gets suppressed) so that we actually see the actions going on onscreen. After that, I need make it so that actions have corresponding animations (their config files currently have a spot for animation names, but I need to actually implement the code that takes those names and plays the animation). This will be relatively straightforward... Aline already taught me how to do that.

I anticipate things moving a lot faster from here on in. Now that I've got a solid understanding of how Unity works (and more importantly, a solid framework to build off of), it should be a matter of implementing feature by feature (for instance, I still need to reimplement death in the Unity file).

After this there are many ways I can go. My primary target is still turning this into a playable game, though Aline and Norm gave me a number of other targets I can try to meet along the way. One of these is having characters remember past interactions that they can "recall" upon request. In a game I could then ask someone "what did you just do?" and they'll recount their story to me in a complex way that factors in how long ago the action was performed and what its importance value was.

I'll post screenshots soon of what the project looks like right now.

No comments:

Post a Comment