Way to make LUA computers in game without laggs

    Joined
    Sep 4, 2013
    Messages
    723
    Reaction score
    200
    • Purchased!
    • Legacy Citizen 5
    Let's give speed cap to computers. Something like 3 operations per game tick or something like that. Or make some kind of operations slower than another.

    Currently we have logic blocks and I didn't noticed any problems caused by them
     

    therimmer96

    The Cake Network Staff Senior button unpusher
    Joined
    Jun 21, 2013
    Messages
    3,603
    Reaction score
    1,053
    • Legacy Citizen 10
    • Top Forum Contributor
    Computercraft does it well. It runs each computer one at a time. If the program is poorly written and doesnt stop doing stuff after some seconds, the mod crashes the computer. Most programs that exceed that time are waiting for something to happen, and so you can have a line that pauses the program, letting others run, and will then restart when the event gets fired.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    The OP will also encourage scripters to optimize their operations.

    The difference between a program performing a function in 2 seconds or 10 seconds can be a matter of life and death.
     
    Joined
    Sep 4, 2013
    Messages
    723
    Reaction score
    200
    • Purchased!
    • Legacy Citizen 5
    Just imagine all these cool struff that can be done with computer blocks... Possibilities are endless and it can give You far more uses than even logics blocks and 2x more if it will be combined with logic blocks :D
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    Stoppit stoppit stoppit! you're making me want to play tekkit and I'm in the middle of two Starmade build projects! But yeah, there's a lot to be learned from that ComputerCraft mod. Schema seems to be pretty good with Java so I bet he can make something better.
    Let's give speed cap to computers. Something like 3 operations per game tick or something like that. Or make some kind of operations slower than another.

    Currently we have logic blocks and I didn't noticed any problems caused by them
    In addition to limiting individual computers, it might be a good idea to limit all computers to a certain total percentage of the server's available CPU power. People will start whinging when computers lag, but it's worse if the whole server lags and the game becomes unplayable.
     

    lupoCani

    First Citizen
    Joined
    Jun 23, 2013
    Messages
    504
    Reaction score
    127
    • Purchased!
    • Legacy Citizen 10
    For the record, the Lua project's introductory page specifically asks people not to spell it LUA, since it's a name, not an acronym.

    Furthermore, I'm not convinced computers would be a particularly substantial strain on the server. After all, the vast majority of user-made programs will be fairly simple operations for ship control purposes, whereas the game already runs a physics algorithm and a rendering engine several times a second.
     
    Joined
    Jan 24, 2015
    Messages
    57
    Reaction score
    46
    • Purchased!
    Couldn't Lua computers be run by clients?

    I dont think that they would be something that would be terribly vulnerable to exploitation (If I understand correctly its just a much more sophisticated method to control the same things logic would, as well as a potential way to customize AI behavior.) And even if there were, there are loads of anti-cheat systems specifically for client side handling of sensitive game mechanics nowadays (for instance PlanetSide 2, a first person shooter, has client side hit detection with no real issue with hacking).

    If we are concerned about people using Lua to lag/crash servers by having it generate a lot of logic type outputs or something (either maliciously or through incompetence) I imagine it would be fairly simple to implement limits to handle it.
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    It honestly would benefit Starmade if the Schine team talked to the ComputerCraft guy about the computers, chances are the ComputerCraft guy hasn't even heard of Starmade though. To Twitter my friends, we will spam him/her at the beaches! :P