phantomwhale
July 12th, 2010, 19:05
Hi,
I wanted to start a thread on something I've not seen much of, perhaps as few people have written them in anger, but I was wondering what good practices there are for writing an extension to a ruleset.
To keep this less hypothetical, I have written some unofficial patches to the Savage Worlds ruleset. For these, in order to overwrite a LUA script, I had to not only copy the entire script into a new LUA file, modifying the part I wanted to modify, but also take the "windowclass" chunk of XML and copy it into the main extension XML file too.
This all felt a little overkill, not to mention I was often copying hundreds of lines of XML and LUA script, when all I wanted to do was change one LUA method. My concern came especially with regard to future updates of the underlying ruleset, which now seem very likely to break my extension, requiring me to manually locate the XML / LUA changes between the two ruleset versions and fold them into the hundreds of lines I had copy and pasted verbatum.
This concern compounds when you look at extending Savage Worlds for something like Deadlands, which would require Fate Chips and new card dealing functionality which would affect large chunks of the code. I could see this extension needed to copy and paste a large unnecessary chunk of the underlying ruleset just to add in the much smaller changes required for new functionality. This would seem very brittle indeed with any ruleset updates, one of which may potentially be in the pipeline for this year.
I am aware that some rulesets, such as Foen's BRP ruleset, have been designed with extension in mind. So perhaps the answer here is simply "you are doing the best practice with the ruleset you are extending at present". But it would be nice to have that confirmed ! Similarly, tips (or links to other threads I might have missed) from other people have gathered from extending ANY other ruleset would be of much interest.
Thanks,
Ben
I wanted to start a thread on something I've not seen much of, perhaps as few people have written them in anger, but I was wondering what good practices there are for writing an extension to a ruleset.
To keep this less hypothetical, I have written some unofficial patches to the Savage Worlds ruleset. For these, in order to overwrite a LUA script, I had to not only copy the entire script into a new LUA file, modifying the part I wanted to modify, but also take the "windowclass" chunk of XML and copy it into the main extension XML file too.
This all felt a little overkill, not to mention I was often copying hundreds of lines of XML and LUA script, when all I wanted to do was change one LUA method. My concern came especially with regard to future updates of the underlying ruleset, which now seem very likely to break my extension, requiring me to manually locate the XML / LUA changes between the two ruleset versions and fold them into the hundreds of lines I had copy and pasted verbatum.
This concern compounds when you look at extending Savage Worlds for something like Deadlands, which would require Fate Chips and new card dealing functionality which would affect large chunks of the code. I could see this extension needed to copy and paste a large unnecessary chunk of the underlying ruleset just to add in the much smaller changes required for new functionality. This would seem very brittle indeed with any ruleset updates, one of which may potentially be in the pipeline for this year.
I am aware that some rulesets, such as Foen's BRP ruleset, have been designed with extension in mind. So perhaps the answer here is simply "you are doing the best practice with the ruleset you are extending at present". But it would be nice to have that confirmed ! Similarly, tips (or links to other threads I might have missed) from other people have gathered from extending ANY other ruleset would be of much interest.
Thanks,
Ben