Monday, February 18, 2013

Ten Steps Back

After working this weekend to try and come up with new config files to test, I've discovered that my Unity project is actually horribly broken and that any perceived progress this past week was actually a coincidence. I'm now planning on going back to the original walking person code and starting over with my code integration, hopefully with some help this time (I realize now it was stupid of me to stubbornly try to learn it on my own).

I'm getting really frustrated with Unity. My struggles with it have completely halted any progress on my actual project - the development of dynamic storytelling for games. I feel as though I'm no farther now than I was at the start of the semester - more than a month ago.

I have a little over a week now until the Alpha Reviews are due. I'm still deadset on having my code work in Unity by that deadline, which is a problem due to the fact that I'm starting over and clearly still don't understand the first thing about how Unity works. I've sent an e-mail to Aline asking if she has a few hours this week to try and help me with the code integration. I have a lot of ideas on how to integrate everything, but I don't understand the mechanics of how Unity works. Hopefully, with Aline's help I can get this done by next week. If not, I'm really not sure what the next step is. I don't want to waste any more time on the visualization of something I've had working for months now.

Thursday, February 14, 2013

Finally Some Progress

I really do think the Unity port is coming along, if still a bit slowly. At every turn I pretty much need to figure out "well, what's the Unity version of this?"

Since last week I had a talk with Aline, who seemed to think that the project would be much more impressive if I do manage to pull it off in Unity (which I agree with). She very graciously offered any help I might need (which I've yet to take her up on, with my oddly full schedule) and pointed me towards other people who might be able to help me (again, scheduling has been a nightmare this past week). Next week I might actually (finally) get the chance to sit down and get some one on one help, which is good because the Alphas are due the week after and I really want to get at least the simulation up and running in Unity.

I've been able to get the start script almost fully operational, loading various figures into my scene as well as creating new actions and emotions. I've got an idea of how to link the actions/emotions with the characters... Essentially, I need to rewrite my character script and attach it to my "actors" (the walking figures), which I've already done. I've hit a small snag in that once the characters are created I have trouble getting them to do anything. For example, I can create 5 characters and give them attributes based on my scene txt file, and I have a walking script attached to them that is controlled (again, in theory) by the designated "actions," but they don't actually walk unless they were created before initialization. Which is to say, I can attach scripts that control the figures to them, but I haven't yet figured out how to control my figures or access/activate their scripts once they've been created. I assume I'll be able to figure it out through my usual method - beat my head against the problem and Google it until I strike gold - but if I'm still stuck on this issue by Monday I'll likely be coming in to the SIG Lab to ask someone for assistance. Still optimistic about achieving my alpha goal! Will post photo results once I can actually get these guys to do something (instead of just theoretically being primed and initialized to actually do something).

That's it for now!

Thursday, February 7, 2013

Many Garys

I named my AdaptMan Gary. I'm not sure why.

Anyway, finally something to show. I was able to fix Unity and get a good enough understanding of it that I can now create multiple versions of Gary, though not in any way that's linked to the initial scenefile. I think I know how to handle that, though. It does require major restructuring, but it's more copy-pasting than rewriting from scratch and that's a good thing.

I think step one in Unity version of Storyteller will be "generate characters, get them to walk around". Step two will be "get them to stop and recognize each other" and step three will be "get the complete story thing working."

In the image below, the walking "Gary" was created before runtime. The other three Garys were created at runtime as a test, and in the next test (which will be performed tomorrow, because this has been a long day and I am tired), I will attempt to get them to generate in random (within reason) locations with names and numbers based on the scene file. Might be a bit too much to try and get done in one day given my luck with Unity lately, but I feel like this (no matter how trivial) represents a major breakthrough in my understanding of this program and hopefully will give way to better, faster breakthroughs in the future.


Unity Struggles

I've just been reading a lot about Unity lately. I know what Prefabs are now, and how I'll need them if I want to do dynamic anything in Unity. I know about how there's no main script I can use to control how the game is run, and I know that it's absolutely unlike any coding environment I've ever worked with before. I said earlier that I found Unity intimidating. Now that I'm starting to understand it, I find it terrifying.

Through my research, I've had the revelation that the way my code is structured is fundamentally not going to cooperate with Unity. Unity is object based in a very different way from the one I'm used to... Which is to say, while I have multiple objects all used and updated in the main loop of my main program file, Unity has no such main loop. I need to have each character keep track of themselves and update themselves on each step of the game loop in the game object's Update class, which basically means I have to tear down my code and rebuild it in Unity this time. Additionally, I've been having a bizarre amount of trouble trying to get the scene initialization to work, in addition to some other bizarre bugs. Trying to get Unity to work is really stressing me out, and I feel like it's been distracting me from what the focus of my project was supposed to be - dynamically generating stories for games. I've e-mailed Aline to see how bad the consequences would be for not using Unity, and choosing a more simple approach to a graphical display (maybe something in 2D). I'm not expecting much, though, as I was told implementing my code in Unity would be an important element since I first proposed the project.

I'm currently drafting what I think will work as a scene intializer (if I can get ever get my code to compile). In theory, it should read the scene file and add a number of characters to the scene, but that's it - I haven't been able to figure out porting emotions or actions just yet. That said, I'd be happy to get just this up and running for now. Unfortunately, as I said, my code still will not compile in Unity so I can't tell if I'm going about this the right way (it's not a code error as far as I can tell - Unity says it's missing some important files for compiling my file and I can't seem to find the error online. Weird, as this wasn't happening to me before).

I'll keep trying to get Unity to work until I hear back from Aline. At the very least, I'd like to sit down with her or someone who knows Unity better to help me sort through all this mess, because the learning curve has been much steeper than it was with C#. In writing this, I have actually thought of some ideas on how to proceed without rewriting absolutely everything (don't it always seem to go?), so I will continue to attempt to port my code into Unity, even though I've made virtually no progress in almost a month. I'm going to go ahead and try to get what I have to compile first, though. That seems like a good first start.

EDIT: Code compiles now! Thank you, internet!