Thursday, May 1, 2014

Generic Event handler, can even handle dialog trees and more...

I became confused with too much content and how I ended up managing this in an easier way.

Until recently I used Excel every day to write and keep track of the events in Junkcraft Armada, but after a few dozens I found that it was really difficult to keep track of the content and sync up it all together, adding new conditions was always a pain and had to edit so many XML nodes when I had to add something new, so I spent a lot more time on XML fixing in excel than actually creating content, so I decided that it is time now to change that and take a step to the next level. I searched for many months before for tools to simplify the work but I couldn't really find anything that could be incorporated into another game and still be open enough to handle all my requirements, and I am pretty much sure most developers face this same issue. So my solution is a very generic XML content creator that can hold many things but processed as needed with any variable needed.

Just to show up a little bit of what I am talking about, here is a screenshot of an event managed in excel, I had quite many variables and many are not even needed for all events, having to copy paste around 80 lines in excel per event made it very difficult to find and edit an event.

Not very nice... after 10 events in excel I had 800 lines! and it became unmanageable to keep adding variables and states with so many hundreds of lines!, so I ended up writing this little tool and it made my life super easy after.

In 4 days I got this working, only the exporter is still pending for XNA and the content manager in-game, but I think a day at most will suffice to finish this, but the most important part is that is so generic that it can be used for any other game that I have in mind, it can manage states and dialog trees in many ways and since all the variables can be linked with the local variables in game it means I don't have to re-invent the wheel to handle all this conditions, and if I ever found that I need super complicated condition, I can simply abstract all of that into the game itself and set a flag to true or false at the end for this event handler to handle, so it simplifies all the work in excel and state management in one small tool.

There will be consequences to many of the decisions the player makes and this little tool allows me now to do that job without having to keep track of everything in hundreds of cells in excel.

For example,  I can use a random number generator for the possible outcomes after the player selects what he/she wants to do in (1) below.

And then reuse the random variable for the different outcomes like in (2) below.

and having a visual representation of complex dialog trees helps speed up the content building while having access to many different variables exposed to the editor allows me to show/hide possible outcomes in-game instead of having to include all the variables in so many cells in excel, since I was using XML as a base in a spreadsheet I had to have the same structure for all the events so if I had to add one more variable in the past it meant that I had to add it to all the other events and it made my life so hard... but now is a different story.

If there is enough interest in this little tool I may release it as open source.

No comments:

Post a Comment