Page 1 of 1

Survivor + Scripting

PostPosted: 12.08.2012, 01:34
by dcode
Hello everyone,

for the next update I am planning to replace the current hard coded Survivor AI with a scripted implementation using JavaScript and I am going to open source the survivor script to everyone interested. I am doing this because I am fully aware of the fact that the current Survivor is using a quite simple rule set that might not be satisfying enough for everyone. Even though I am aware of this fact, I think that there are other players better able to adjust and extend the AI on their own than I could do that - so I'll give it a try. Everyone with very basic programming skills (JavaScript at best) will be able to understand and extend the AI script.

Basically all it does is to export an ExternalInterface e.g. to send Creeps and providing some methods that are called by the server on specific events. So, for example when a new income round starts, a function is called that then may send creeps, send chat messages or similar. Finally all the logic behind this i.e. what creeps will be sent and with which exact delay can be scripted.

For now I am converting the old Survivor AI to the new script engine and I'll post it in this thread later on. Let me know what you think about it :)

Cheers
dc

Re: Survivor + Scripting

PostPosted: 12.08.2012, 03:33
by EricGleek
Survivor AI? I think is harder and really thought. :shock:

Re: Survivor + Scripting

PostPosted: 12.08.2012, 20:45
by dcode
I've uploaded the current survivor implementation to the first post. Additionally, if you plan to add some fancy new survivor game play to the AI, I appended the Interface.js that describes all available methods and constants. The Interface.js is not editable and provided by the server as the link between itself and the survivor AI script.

Interface.js
Server-side Interface.js
(5.91 KiB) Downloaded 108 times


As you might see it's possible to work with a lot of variables like path lengths, map details like number of starts etc., complete creep descriptors and so on. Let me know what you think :)

Re: Survivor + Scripting

PostPosted: 17.08.2012, 03:58
by EricGleek
Where do I put those script files, I'm so confused! :?