Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Script Complexity Restrictions and Load Balancing

Discussion in 'Programming Questions and Suggestions' started by terribleperson, Jan 5, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. terribleperson Trainee Engineer

    Messages:
    30
    I don't really understand the current restrictions on script complexity. I understand the necessity for a limit on complexity, both from a stability/performance perspective and a gameplay balance perspective. That said, there's a better way to do it.

    First, designate a fixed amount of processor time (as a percentage) that scripts can use on a server/in a game. This could also be an option accessible to the server admin. Secondly, that processor time is split across all the programmable blocks in the game. None can use more than is available. Secondly, if you feel the need to restrict the capability of individual programmable blocks, you can cap the stack and heap of each individual script.

    With these changes, it would be possible to develop complex scripts without overloading a server or allowing one programmable block too much capability.
     
  2. AutoMcD Senior Engineer

    Messages:
    2,369
    I love the idea and the fun things we can do with this block, but I really wish it was actually a script language instead of full blown C#.

    Like, I feel like for the limited things we can actually do, we should be able to do these programs in BASIC. This would make them more widely usable by much more of the player base.
     
  3. elch Apprentice Engineer

    Messages:
    241
    You're joking right? :D

    Just in case you're not I'll elaborate:
    Well it doesn't really matter in which language you write it, essentially all languages are the same. If you know one you can easily learn another.
    And why C# ? I guess it's because of convenience and speed.
     
  4. AutoMcD Senior Engineer

    Messages:
    2,369
    C is more complex than it has to be and leaves the door open for exploits that the devs may not have intended.
    You have a lot of additional syntax which does not help anything, options for pointers and things which are just way overkill.
    Should a game player have to be concerned about if a variable he's making is floating point or not?
    I feel lucky we don't have a list of libraries to include at the top of it.

    What we are making are simple programs that flow in a linear fashion, perfect for a dumbed-down script language. I shouldn't have to be tiptoe about with lots of semicolon and brackets. We have a limited set of parts and functions to work with, and I have not seen a single script yet that couldn't have been done in BASIC.
     
  5. pipakin Apprentice Engineer

    Messages:
    182
    The game is written in C#, which has a built in compiler. This allows the developers to focus on other features. It also means we're not learning yet another useless limited game scripting language.

    The reason you haven't seen something that couldn't be done in BASIC is, that just like C#, BASIC is a general purpose language, and therefore can create nearly any program depending on library support, not language features.
     
  6. AutoMcD Senior Engineer

    Messages:
    2,369
    oh, I know WHY.
    I just don't care if it's easy for Keen or not. I want it easy for ME.

    I don't want to tab out to do this out of game with a browser full of forum example tabs, wikis, API function list, etc.
    This should be like, punching a formula into excel. Something I can do in-game as an afterthought while I'm already 3 beers into the ship build.
     
  7. elch Apprentice Engineer

    Messages:
    241
    I'm not sure if it will be like excel at some point and I hope not:D

    Maybe devs will add some sort of code generator in the future where everything is "easy" so some people who don't want to write/learn/learn_C# can use some sort of GUI to create programs through graphical representations.

    But you should know these things are most of the time limited and hard to use, well at least for me.
    However, I can understand that someone would like it more then typing code.
     
  8. AutoMcD Senior Engineer

    Messages:
    2,369
    it just comes down to how well it's done, obviously a gui would be a roadblock if done half-assed.. what they gave us works fine for the people familiar with programming. i just don't consider it very user friendly in the scope of being a game player.

    Like, setting up a sensor to turn on drills when you get near a rock, that is consistent with the menus and pretty easy to figure out. Takes longer to dial in the sensor range than to do the actual setup. The timer is a little trickier to get the hang of, probably could do with some more text. But you catch my drift. That still feels like playing a game, not tabbing out to do actual modding/development.

    Now we have scripts which successfully use beacons to show GPS coordinates, save data in part names, etc. Very clever things are happening which I don't think could be done purely graphically.. but that doesn't mean the in-game compiler couldn't provide a lot of stepping-stone type help and take care of the minor syntax details.


    also I don't disagree with the OP's point. we can't let one of these run away with all of the server's processing time.. I think maybe TIME should be the constraint? like can only run 5 or 10 lines of code per second or something like that. Make people wait out more on timers if trying to be a complicated smartass, not punishing the people with a 10 line stone dump utility script.
     
  9. terribleperson Trainee Engineer

    Messages:
    30
    That's the essential idea of how restricting scripts by CPU time works; they can only use so much of the server's processing power per second (or whatever granularity the devs desire). For example; if you have scripts allowed 10% CPU usage, and you have 10 scripts, they can only execute for a hundredth of a second per second. Computers being computers, however, you can get a LOT done in a hundredth of a second.
     
Thread Status:
This last post in this thread was made more than 31 days old.