Jump to content
XCOMUFO & Xenocide

Squirrel As A New Scripting Language For Ufo2000


Serge

Recommended Posts

Well, there is a scripting language called squirrel. Its home page is here: http://www.squirrel-lang.org/ When described in a few words, this language is a lua twin with C-like syntax :) Squirrel C-like syntax is more familiar to most programmers and is much closer to C++, which we are using for the game engine programming. Lua has its own pascalish syntax, which needs some time to master, while people already familiar with C++ or java can start writing programs in squirrel at once.

 

Of course we are not going to drop lua support, at least no radical moves will be taken in the near future. But we can try using squirrel for some not yet implemented parts of the game, for example for AI scripting. And having support for both lua and squirrel is much more lightweight than a single python for example :)

 

What do you think? Especially interesting is the feedback from non-programmers who are making (going to make) mods for the game, what do you feel can be easier to use? Comments from Xenocide developers are also welcome (as you are also going to use scripting in your project).

Edited by Serge
Link to comment
Share on other sites

If it means AI, I'm all for it. :D

 

I wonder though... an AI will need to be made to adapt to terrains. That's the hardest bit. Now, assuming existing maps are being used, no hassle. We have maproutes for those and waypoints. Easy stuff. When it comes to custom maps without maproutes and waypoints is when it gets hairy. :wink1:

Link to comment
Share on other sites

If it means AI, I'm all for it. :D

Not quite so :) It means the choice: lua or squirrel for AI.

 

Just because we don't have any code for AI right now, lua and squirrel suit equally well for this and require almost the same developers resources. Squirrel itself will not magically add AI to the game, :)

Link to comment
Share on other sites

As long as people who don't know C++ but got a little used to lua don't have to change, and there are no other obvious disadvantages, I think I can speak for everybody by saying do whatever you like best.

 

 

And Exo: One can make maproutes and waypoints for custom maps as well.

Link to comment
Share on other sites

As long as people who don't know C++ but got a little used to lua don't have to change, and there are no other obvious disadvantages, I think I can speak for everybody by saying do whatever you like best.

Actually the question was if it would simplify add-ons making. There is no point in adding extra unneeded functionality. If more people know C++, it would help somewhat, if lots of people know lua already, that's fine to keep using lua exclusively.

 

Did you have any lua experience before starting to make new maps for ufo2000?

Link to comment
Share on other sites

The question is what is there to modify about AI?

Scripting is needed not to modify AI, but to implement it. We can bind some interface functions which are used to execute orders to do some actions to the scripting language and use them to control the units of the opponent. Scripting is good to make some barrier between the engine and some overmind controlling alien squad, so there will be no ways to cheat :) Also scripting languages are safer to program with and can't unexpectedly crash the engine. Also some tasks are believed to be solved easier with the scripting languages. I can confirm that text files parsing can be done much more efficiently in lua than in c/c++ (language translation files are currenly loaded entirely by lua code), some people claim that lua is also good for making AI, but we will check if it is true only after we try :)

 

In addition, scripting can be useful if we need to have race dependent behaviour (some aliens are dumb, some are fearless, etc.). Also cryssalids may have different tactics from the other aliens, so their AI can be implemented differently. Flexibility which is provided by scripting can be really useful here.

 

But I think AI is offtopic in this thread, better discuss it here: http://www.xcomufo.com/forums/index.php?showtopic=7697

Link to comment
Share on other sites

×
×
  • Create New...