Our game uses a custom node editor to set up our task driven chapters. Our developers used to create these by hand, adding one task at a time (and there can be up to 50!) and setting the values on each. Values include icon, costs, story files etc. Understandably this takes a while. But since they create this from a google sheet with most of the settings defined, I figured we could automate this.

Each task that is created needs to have a few settings set like the name and description of the task by selecting localization terms, an icon, the cost for the task and various other settings. We have all these settings a google sheet, so the script works by feeding it a text file with all the settings. This can be a straight copy and paste from the google sheet, the line strings are read and separated based on white space. This is not the greatest solution (reading directly from an online google sheet would have been better but this was quicker to set up. Then again, if any column or row is offset that could also give issues) It has worked for multiple chapters without incidents, but I can imagine we update this at some point.

The icons used by the tasks can of course only be set if they exist. Some icons are generic and reused multiple times, others are unique. Tricky thing was that this taskflow file was often set up some time before art so if the script was run before the unique images were created they would have to be added later by hand. I created a script in Photoshop to quickly set up temporary image files under the correct name so that the code could pick them up. This Photoshop script would also take a text file with the filenames (as copied from the same google sheet as the other settings) This then creates a new file with a grid as set by the user of x amount of icons. If the icon is found it is linked in, if it is not found a temp image is linked in a layerset under the correct name. If those layersets are then exported all icons are present and can be updated at a later time avoiding having to go back into the tasks system and adding in the correct icons later.
All dependency connections between the task still have to be created, but this script gets the designer there around 90% of the way. And create a production ready *.psd file for the artist to work with along the way 😀
No comments:
Post a Comment