Real life events have again made it difficult to contribute time to XAGE, but there has been some small progress in the last few weeks.
I remember now why I put off implementing the conversation system for so long - there are a lot of design ramfications of doing so. The basic structure is in place and its now possible to initiate and select various conversation options in a similar way to a LucasArts game.
The reason it is incomplete is a long one. I've found that the more time I've spent on XAGE, the more inclined I am to want to do things right, rather than use any cheap or ugly hacks. One such case is that the dialogue system requires new Action Types in order to initiate conversations, amend option visibility etc. Rather than plumb these in as before, I wanted to completely rewrite how the Actions are organised both internally and externally.
Internally: At the moment, actions are simply stored as a type and a string of associated content, which is delimited by the tilde character. This is simple to implement but is quite brittle. After discovering
Nick Gravelyn's post about serialization, I realised that it was actually possible to put Action types in their own class and still serialize them. This is a much cleaner and
correct OOP way of doing things.
Externally: The original Action editor relies mostly on combo boxes. Given that the number of action types was swelling to thirty and beyond, it was becoming obvious that this list would become daunting to any unfamiliar users. It's also quite a backwards thing to select the action type before the item it is being performed on. By selecting the item first, you automatically narrow down the number of possible actions you can perform. Its also more intuitive:
(old) Walk -> (Character, ToXY, Direction, Pause)
(new) Character -> Walk -> (ToXY, Direction, Pause)
Its not especially easy to illustrate using text alone, but the benefits should become obvious after a few minutes of use. The above also means I can wrap up each piece of information into a seperate class and re-use as necessary for each Action (e.g. Pause after action is used in various). Certain items are now selected via popup buttons rather than combo boxes, as this is more visual and easier to understand.
All of these changes require quite a large rewrite. One problem is that, previously, I've completely seperated the codebase of XAGE and the Editor itself, as they only shared a dozen or so classes. As the number of classes has grown massively due to the new Action structure, it has become obvious that I need to wrap all the shared classes into a Global project, and expand any functionality in XAGE or the Editor via partial classes.
None of these required changes are particularly exciting in any way, and will take some time to complete. The end result will be a cleaner, more flexible XAGE v0.4, which should be the first wholly public alpha.