Does Rebellion support script like X3?

For example I want a ship to automatically use certain ability according to my custom logic, I want to remain a certain number of scouts and once a scout is destoried the ship factory can build one more.

I searched the forum but didn't find an answer. I find this thread in 2007 saying Iron Engine has an embedded Lua Scripting Engine. But I don't see anyone provide scripts.

Does Rebellion support script or will Sins of a Solar Empire support it in near feature?

7,368 views 8 replies
Reply #1 Top


For example I want a ship to automatically use certain ability according to my custom logic, I want to remain a certain number of scouts and once a scout is destoried the ship factory can build one more.

I searched the forum but didn't find an answer. I find this thread in 2007 saying Iron Engine has an embedded Lua Scripting Engine. But I don't see anyone provide scripts.

Does Rebellion support script or will Sins of a Solar Empire support it in near feature?

End of quote

Not really. It has its own logic system used for abilities and buffs but its not a programming language. Still if you check out some other mods you'll find people have still used it to do things like hero units that you would think could only be done with scripting.

Reply #2 Top

I don't see any Lua exposed in this game. Might have been a change of plans with that, e.g. the engine might support Lua, meaning it can be configured with Lua, but Lua wasn't used for Sins.

The entity files don't allow for Turing-complete computations within. You can call some of the predefined tests (i.e. defined in the C/C++ code) for conditionals, but you can't put arbitrary conditionals in the entity files and there's basically no looping within those either, except again for limited flavors like periodic actions. 

I have some experience modding games that support Lua (DoW2 in particular), but there's a substantial difference in the number of units one typically has there vs. Sins. Implementing (or altering) even one ability that's used by a swarm of frigates, e.g. LRF cluster missiles via scripting like Lua could easily cause performance problems in a game like Sins.

 

Reply #3 Top

There was at one point talk of giving us access to scripting/'triggers' in the maps, but that obviously fell through

 

Shame, having map trigger based scripts would have meant we could make campaigns or unique scenarios

Reply #4 Top

Quoting RespawnedTitanL10, reply 2

I don't see any Lua exposed in this game. Might have been a change of plans with that, e.g. the engine might support Lua, meaning it can be configured with Lua, but Lua wasn't used for Sins.

The entity files don't allow for Turing-complete computations within. You can call some of the predefined tests (i.e. defined in the C/C++ code) for conditionals, but you can't put arbitrary conditionals in the entity files and there's basically no looping within those either, except again for limited flavors like periodic actions. 

I have some experience modding games that support Lua (DoW2 in particular), but there's a substantial difference in the number of units one typically has there vs. Sins. Implementing (or altering) even one ability that's used by a swarm of frigates, e.g. LRF cluster missiles via scripting like Lua could easily cause performance problems in a game like Sins.

 
End of RespawnedTitanL10's quote

This is incorrect unless you're talking about an individual entity file. Buff chains are very much Turing complete.  While you can't do things in the traditional way, you can do anything you want if you're willing to be insane about it.  You just have to build a virtual computer from scratch.

You've always been able to make logic gates (back in Vanilla, it was just stupidly complex, requiring IIRC seven buffs just to simulate a single transistor, let alone an actual gate).  Back when they added actually allowed proper conditionals, things simplified a ton.  At the bottom of this post is a picture of how to make logic gates with them.  I've integrated logic gates into mods several times and even made a four bit adder once.  

I've actually considered on several occasions writing a program that would offer a GUI for the creation of gratuitously complex buff chains.  I won't for Sins I because it's too close to the end of its life cycle, but if Sins II uses the same buff system and doesn't allow scripting, I'd do it without question.  Writing that adder was an absolute nightmare.  It filled up two full sheets of notebook paper just to diagram the whole thing out before I started work on it.  Such a program would have let me do it in about five minutes.  It'd be about like this only with the ability to save the project and to export it as buff files.

 

EDIT: wow... that picture brings back memories...  What makes me happiest about when I made that picture and the adder was that I made them before I'd ever taken a system architecture class, so I literally re-invented the computer from scratch without reference or help.

Reply #5 Top

On the other hand, if you have large numbers of ships going through hundreds of entity files to do computations, your cpu's are gonna start bleeding rectally.  It's not engine efficient to do such things on a large scale.  The hottest processor out wouldn't be able to get Sins to run well if you gave a basic frigate a 50 file buff chain.  Anyone considering the insane should take system load into consideration first, then waste time writing it.

Reply #6 Top

Quoting psychoak, reply 5

On the other hand, if you have large numbers of ships going through hundreds of entity files to do computations, your cpu's are gonna start bleeding rectally.  It's not engine efficient to do such things on a large scale.  The hottest processor out wouldn't be able to get Sins to run well if you gave a basic frigate a 50 file buff chain.  Anyone considering the insane should take system load into consideration first, then waste time writing it.
End of psychoak's quote
I will confess that the tick rate of my "computer" was roughly one hertz.

Reply #7 Top

@Volt:

IIRC, even if you can do arbitrary sized adders, those are only primitive recursive functions, so still not Turing complete.

And adders are not enough to even cover all primitive recursive functions. For example, can you write a chain of entities that computes "proper subtraction", i.e., a ∸ b defined as "If a ≥ b then a-b else 0"? For instance, in the system selected, subtract the (total) number of friendly frigates from the number of enemy frigates, and if this result is greater than zero then do something observable with it, for example spawn a number of "equalizer" friendly LFs, i.e. make the number of friendly and enemy frigates equal in that system by increasing (via spawning) the number of friendly frigates precisely by the number needed to match the enemy's number of frigates.

 

Reply #8 Top

That operation is entirely doable.

 

And you can make whatever the heck you want. You just have to make it from scratch. Saying buff chains are not Turing complete is like saying transistor clusters can't be.