Scripting and AI
This week in class we watch a GDC video that was very interesting. The topic was on as the title of this blog describes: AI with scripts. Scripts are code just done in a different way. They can be domain specific or simply a language needed to get your job done. When scripting you should always implement a robust system compared to a brittle system.
Taking scripting and implementing it as architecture is great and saves months of development time. I would know this as for the game I am currently working on it took a bit to set everything up but now because it’s done, things are being developed at a much faster rate. When listening to the speaker there was one thing that I think is important that he said. At sputnik their strategy is to have script at the pillar/ main support of the whole engine. Because the engine uses the component object model the components can be implemented in both script (ie lua) and in c++. Script is the glue of the whole engine.
Scripts can be divided into 3 parts: component scripts, system scripts, data scripts. Component scripts are the middle ground between one action and the output you’re trying to get. Component scripts tend to be grouped together in a ‘soup’ where as the project is being developed some things may be moved from script to code and vice versa. System scripts are organized boids in groups that can be accessed easily by the system. Finally there are data scripts. These scripts need to save the states of the scripts, drive the system and finally define a structure for both.
The greatest advantage of scripting is the fact that it integrates both programmers and designers in the development process. Scripting is much easier to understand and do therefore it can include designers and allow them to implement the game as intended. At sputnik they have the engineers create the initial framework and complete final implementation whereas the designer does the initial implementation and the final buy-off processes. But of course the big difference between code and script is that code is the technology you plan to keep for a long time and scripts make the game unique and awesome.
So now you might as what is DSL? First of all it stands for Domain-specific Language and are designed to work and solve specific issues/problems that are occurring. DSL’s can look different from one project to the next; it is all dependant on the programmer and the needs that need to be fulfilled. DSL’s should be used for AI because code is clean, bugs are minimized and you can maximize productivity.
DSL’s are good because it separates the game from c++ code and is accessible to designer and less likely to cause severe bugs. DSL’s can be implemented in an easy way and does not need to be complex. I never thought of it but as a student in previous years we created our own DSL’s in a way it was easy for us to understand and allowed everyone on the team to work productively. DSL’s remove all the complicated stuff and strip code syntax to a simple format.
To conclude scripting and using DSL’s are very good and important to use. They expand the team and allow simple AI functionality to but done outside of c++ code. As a long as syntax is clean and understandable it’s a win-win for everyone!

















