Howdy sparklineers of the whole world!
Today I’ll share my thoughts about some aspects of the current development paradigm I’m using.
One could call it “code fast to see if it’s as cool as in your head though don’t forget to code it right so you can build on top of it” !
In order to test and get feedback about ideas, and/or give a better idea to potential team members, it was mandatory for me to have the most important features in without compromising on coding time and coding quality. And that’s where my modularity habit is really cool, like having shooting starships when no ship customisation system is even thought about (I won’t open a debate about he pre-existence of code before it is written).
One clear example of this is my mission/scripting system, consisting of a XML file:
<Mission> <MissionCode>P_MissionTest_01</MissionCode> <MissionTitle>First mission test</MissionTitle> <MissionType>PrimaryChoice</MissionType> <Prerequisite> <SystemName>Primeval</SystemName> </Prerequisite> <MissionText>You receive an incoming transmission from the planer Babylon: - This is planet Babylon's Military Headquarters, we are under attack by a group of Omega fighters! If you can assist our forces you will be rewarded, otherwise it is strongly recommended to leave the system until further notice. You may well help the local defense militia, but attacking an Omegan scout squad may endanger any mission in their quadrant! </MissionText> <MissionChoices> <Choice> <Label>Assist</Label> <Code>P_MissionTest_02</Code> <File></File> </Choice> <Choice> <Label>Deny</Label> <Code></Code> <File></File> </Choice> </MissionChoices> <MissionActions> <SummonShip> <Type>Condor R6C - Militia Version</Type> <Faction>Omega</Faction> <Number>3</Number> </SummonShip> </MissionActions> </Mission>
And on the code side a MissionManager.cs which checks the conditions (prerequisites) for every mission the player has “subscribed to” (for performance and justice the mission manager is called every 3 seconds instead of every frame :p).
As you may or may not have noticed, my actual mission scripting format is quite simple but also limited… It doesn’t include condition-triggered alternatives (there’s only a “if”, but no “else”), it can’t be triggered again or linked to other conditions.
- I want to create a space pursuit mission across several star-systems owned by a single faction, I’d have to check the system’s allegiance and then summon enemy ships. But if the next hyper-jump doesn’t get me out of this faction’s space I’d have to re-trigger the mission to summon enemy ships again.
- That could easily be done by having a check-fail action, or by allowing condition alternatives, but as it wasn’t needed right now (it’s more of a “proof of concept” to show potential team members that I know my code and am serious about it).
- So instead of blocking the iteration process for one or two weeks to get a full scripting system for every possible mission you could imagine, I only took one afternoon to get it working with simple scenarios.
My point is, If you don’t need it to be fully flexible then do it simple. So that the day you’ll have to make it flexible you won’t have to redesign the whole thing!