Saturday, May 02, 2009

Using V8 for scripting in my game

I'm going to try and find time this weekend to throw google's "V8" Javascript engine into my game.

http://code.google.com/p/v8/

Basically, its a javascript implementation intended for embedding within applications (and its used by google in a lot of thier apps).

I figure using jscript as a language has some advantages for end users who want to play with modding the game. Alongside the benefits of having google funding the development of the script engine. Thier implementation seems easy enough and allows for some of my requirements (allows me to create/load scripts on the fly etc).

Reading up on thier license has got me thinking as well. Theyre using a BSD style license which is one I much prefer. I've been using OGRE along with a few other open source libs and honestly the LGPL and anything GPL based really irks me. I simply dislike DLL's and being platform dependant they annoy me because I then have to figure out how to stay within a LGPL license (which allows commercial usage with dynamic linking) on other platforms. After visiting the LGPL license website where its trying to push you towards GPL usage instead, I *really* dislike this idea that all software must be free. It seems like thier version of freedom means nobody earns a living.

Anyway, its enough to make me think again about my decision to use Ogre. Not that Ogre is bad and I know that theyve relaxed the licensing on Ogre to allow static linking too. But every library thats associated with Ogre ends up getting infected with the LGPL usage which means a dozen more DLL's to track and update.

I also plan on using webkit to run my UI, after considering lots of options I think ultimately it will be the most flexible. Using a typical web-browser based frontend means that I can literally prototype the UI using regular browser style tools. I could even use flash and flex to do it at a push.

Anyway, enough worrying, time to code!

Sunday, April 26, 2009

Brain update and moving site

Well, just sat in on an interesting discussion with Andy Shatz from pocketwatchgames.com over at aigamedev.com for a couple of hours. Fun interview and threw up some really nice details of Andy's games. Interestingly I'm doing something similar in terms of my games being AI based, but I think mine is definitely focussed in a different direction in that I'm really thinking of my game as a toy rather than a particular challenge oriented game.

I've been imagining this pure sandbox style gameplay where you can setup your own worlds and simply let them run, or you can introduce different characters and brains in order to test "what if" kind of scenarios.

Anyway, I made some good progress today. Particularly just after Andy's talk I finally realized why my agents werent doing anything I wanted. After spending a few hours throwing more debug views into the fairly lame current UI, I finally figured that even though I was reading different values from my agents blackboard, thats no good unless those values are initialized to something!

Each agent in the game is a big bag of different AI stuff, but in the main there is a behaviour tree and a blackboard and the BT acts on the data in the BB in order to process its logic and select actions. Its complicated a little by the emotional appraisal/arousal processes, but at the bare level its pretty simple. Only I forgot to initialize the blackboard!! :) specifically, I forgot to add the various initialized values for the agent to know wether he had already found somewhere to live and somewhere to work. So basically the agent never got into the daily rythm (the particular agent I'm working on now is called "worker" and does exactly that, he works a job, goes home, fulfills his basic needs for sleep and thats about it. Any spare time he gets he fulfills his need for entertainment as easily as he can, so usually that would involve sitting in front of a TV, but could involve almost any form of entertainment he actually likes.

Worker is an interesting starting point for splicing brains, because he is basically all of us. He is a drone. You hardly get any personality until you add in some other forms of behaviour. This is done by splicing other brains into the worker brain.

In other news, after a lot of mulling around, I think I'm just going to go with liquidweb for a while and see how things pan out. Which should mean a switchover from this blog up on blogger.com to a new spangly wordpress based blog on my own hosting. Although I might just leave this where it is and concentrate on the britishindie.com site exclusively for the project, havent decided there yet.

Wordpress seems like it'll be my platform for almost all content. I'm going to get a vbulletin license too so I can setup a forum, although they take a horrific amount of time to police for a one man band like me. I suppose I could code up some weirdo validation scheme at least so I dont get botspam (kinda like the old spectrum lenslok or something).

Look for BritishIndie coming soon!

.Z.