Monday, December 3, 2012

Back Where We Were

So last week I presented my "Beta" (only not really, because the majority of my work will be done next semester). There's a lot that's happened since the last time, I suddenly realize. I think I forgot to do a blog the week of the beta, but we'll rectify that now.

I'm back where I was in terms of the code, which is to say I have a functioning text based simulation that generates randomized interactions for characters for a given number of turns. It's radically different in that the construction of the world is done entirely outside of the code in .txt files of a format I created myself (and outlined in past blog posts). Here's an example of a simple simulation world structure:

emotions
3
love
hate
boredom

actions
3
kill.txt
converse.txt
search.txt

characters
3
Bob
m
random

end


A world file contains names of emotions, names of text files containing actions, and then the number of characters. Characters can be explicitly defined using gender and name. If after a certain number of defined characters the person building the world would rather just randomize them, they can put in "random" to randomly generate characters until the number they requested has been reached.

Here's an example of a simple action file:

converse
1
talks to
1
boredom
30
.05
.05
partner
end

The action file has the name of the action, the "Action Importance Value" I discussed in an earlier post (important for storytelling), a text phrase for implementation of the action (to be replaced with a file linking to a specific animation to play in a fully implemented solution - since I won't be generating these animations, I'll probably just leave them with text expressions). Next it lists all emotions relevant to the action, first by name, then by what the ideal value is for implementation of this action (the closer to the ideal value the emotional state of the character, the more likely they will select that action), then how much that value should be increased by for the character and for the interaction partner. Finally, there is a list of specific commands (partner/solo,samesex/oppositesex,kill,suicide,stop) that can be used to specify when the action is used and what built in commands (like killing) does it cause when it is implemented.


Below is a "story" generated using just three or four actions and emotions. Whereas adding new emotions and actions in the previous implementation could take hours, now adding a new one of either takes a matter of minutes, and doesn't require the code to recompile. Ignore the "0,0" printed between every turn cycle... That was a test of something that will come up in a later post.




No comments:

Post a Comment