Author Topic: The many bright possibilities of Lua  (Read 2249 times)

0 Members and 1 Guest are viewing this topic.

Offline Garanis (OP)

  • Leading Rate
  • *
  • G
  • Posts: 6
The many bright possibilities of Lua
« on: October 04, 2010, 11:44:48 PM »
I've been playing the game for a few days now, and after the many trials, successes, and failures I've had, I'm left with an intense desire to have more direct control over the behavior of my ships.

I'd really like to be able to code my own conditional actions for my ships, possibly even some sort of state machine type setup.

I've always dreamed of being able to write missile targeting code in a game, or freight management code, but I've never found a game more ripe for it than this one.

Thus: I would suggest you implement a scripting interface into the 'special orders' section of the task group page. Lua has been integrated into VB6 before -- there are plenty of web resources on it --  and it would make a very good drop-in for exposing some internal ship control functions directly to the user. I'm not saying it would be easy -- It would take a good bit of research and coding, but it would be well worth it in the end, and would probably attract some new players as well.

It could even be as simple as evaluating the script(if any) for each task group once per interval(possibly user specified).

Once implemented, the possibilities are endless. I could have my scout fleets explore the universe without my constant nannying. I could have my logistics fleets move around mining fleets to boost production of key resources when shortages arise. I could automate training and patrol fleet rotations. I could automate fighter launch and targeting.

In short, I could write code to eliminate the micromanagement that at times makes this game tedious, and even better, I could share it with the other people on this forum.

Depending on how well the above works, you could implement lua in other parts of the game as well, and maybe even open the game up to modding someday.

Anyway, the above is just my $.02, take it as you wish.
 

Offline Beersatron

  • Gold Supporter
  • Rear Admiral
  • *****
  • Posts: 996
  • Thanked: 7 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
Re: The many bright possibilities of Lua
« Reply #1 on: October 05, 2010, 12:21:05 AM »
I hate you!  ;)

I decided to google Lua and then read the wiki page for it and then go side tracked into reading the actual type of language that it is which then lead me to reading about other languages that I have never heard about but seem to be the building blocks of more commonly known ones. (no punctuation!)

And then my head started to hurt and I remembered that I have to get to sleep and ready to churn out some more Coldfusion in the morning.

So, yeah, I hate you because now I may have to read some more about Lua  :P
 

Offline UnLimiTeD

  • Vice Admiral
  • **********
  • U
  • Posts: 1108
  • Thanked: 1 times
Re: The many bright possibilities of Lua
« Reply #2 on: October 05, 2010, 04:04:20 AM »
Lua is awesome, really easy to learn, had it in a crash course once, and within a day me and a fellow student were building a text RPG with character classes and all that stuff.
However, implementing a scripting language will probably be more work that just creating a new interface with 20 new conditions and reactions that you can chain together.
 

Offline Garanis (OP)

  • Leading Rate
  • *
  • G
  • Posts: 6
Re: The many bright possibilities of Lua
« Reply #3 on: October 05, 2010, 09:20:41 AM »
Lua is awesome, really easy to learn, had it in a crash course once, and within a day me and a fellow student were building a text RPG with character classes and all that stuff.
However, implementing a scripting language will probably be more work that just creating a new interface with 20 new conditions and reactions that you can chain together.

Yes, as you say, it would totally be easier to do that, but in the long run implementing Lua or something like it would open up a lot of possibilities under the hood. For instance, Instead of writing the AIs entirely in VB, some of it could be written in Lua, greatly speeding up the development process. Instead of compiling a new exe to test an AI tweak, you could just change a line in a text file, restart aurora, the lua would be compiled at runtime, and voila.

There are a host of other plusses.

So the think that I salivate for is more control over the ships, but I think the implementation of a real scripting language would make this game really sing.
 

Offline Garanis (OP)

  • Leading Rate
  • *
  • G
  • Posts: 6
Re: The many bright possibilities of Lua
« Reply #4 on: October 05, 2010, 11:02:24 AM »
I hate you!  ;)

I decided to google Lua and then read the wiki page for it and then go side tracked into reading the actual type of language that it is which then lead me to reading about other languages that I have never heard about but seem to be the building blocks of more commonly known ones. (no punctuation!)

And then my head started to hurt and I remembered that I have to get to sleep and ready to churn out some more Coldfusion in the morning.

So, yeah, I hate you because now I may have to read some more about Lua  :P

Sorry  ;D

Coldfusion  :'(
 

Offline UnLimiTeD

  • Vice Admiral
  • **********
  • U
  • Posts: 1108
  • Thanked: 1 times
Re: The many bright possibilities of Lua
« Reply #5 on: October 05, 2010, 01:53:18 PM »
That'll also lead to a slower game.
So instead of waiting a minute for a 5 day increment, you'll be waiting 2. Unless theres a way to compile all orders in the engine and save them for repeated use.
 

Offline Garanis (OP)

  • Leading Rate
  • *
  • G
  • Posts: 6
Re: The many bright possibilities of Lua
« Reply #6 on: October 05, 2010, 04:07:42 PM »
That'll also lead to a slower game.
So instead of waiting a minute for a 5 day increment, you'll be waiting 2. Unless theres a way to compile all orders in the engine and save them for repeated use.

It would add a very small overhead, sure, but the scripts, once written, would be compiled, and from there it's a very small performance overhead, as the compiled lua code is just calling methods that already exist in the game.

You could also make it so that the script could be set to execute a finite number of times per increment. I think it certainly wouldn't add a whole minute to a 5-day increment unless there was a serious misconfiguration or the script was just really complicated.

 

Offline lastverb

  • Warrant Officer, Class 2
  • ****
  • l
  • Posts: 52
Re: The many bright possibilities of Lua
« Reply #7 on: November 22, 2010, 05:24:29 PM »
That wouldn't be that hard to code in (however time consuming if u never done it). Scripts are compiled once, not every time that "order" would be taken, so if u dont do some stupid looping for every your ship it wouldnt take a lot of time (aurora makes a lot of math alredy, additional scripted easy orders would be close to 0 in compare to that). It wouldn't take any time if ur not using it. And as Steve started to work on Aurora II in C# i would recommend Angel Script for that. I'd really like to automate my empire some day :)