Programmable Computer Block (fleet command, mechs, etc)

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    Advanced Bobby AI. We all want it. How can we do it, though?

    After talking over things in chat for a little while, I thought of something that'd make possible logic control systems, advanced fleet control, and the like.

    A programmable computer block, utilizing a scripting language of schema's choice. Press R while looking at the block and unlike the Bobby AI, instead of a series of toggles and options, you get an IDE.

    Of course, we'd need a way to set different inputs and outputs to different numbers, and we can't do it based on color like Redpower in Minecraft did due to the scale and complexity of our ships.

    Input signals could include things such as nearest block of X type, ship location, rotation, mass, and box dimensions, surface normal and position of whatever's in direct LOS of a designated targeting block, etc. More inputs and outputs could be added over time as new features get added to the game.



    Under this system, we could create a fleet control system, including the ability to redock ships inside complex carriers with a pathfind system (based on the Find Nearest Block X input and movement commands). Future uses would probably include using the computer to manage moving parts such as arms by setting key based inputs for otherwise excessively complex movements (ie: give us computers and rotating parts and we'll give you walking mechs)
     
    Joined
    Jul 20, 2013
    Messages
    603
    Reaction score
    203
    • Legacy Citizen 2
    • Community Content - Bronze 2
    • Purchased!
    I'd like this as well. Just, I'd also want the ability to load scripts from file instead of having to use an in game editor. Just by virtue of the fact that it will probably be unwieldy to write scripts in game, and for those of us who fullscreen and have less or no experience with scripting might need to quickly look to documentation for something.
     
    • Like
    Reactions: Winterhome

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    I'd like this as well. Just, I'd also want the ability to load scripts from file instead of having to use an in game editor. Just by virtue of the fact that it will probably be unwieldy to write scripts in game, and for those of us who fullscreen and have less or no experience with scripting might need to quickly look to documentation for something.
    An extra segment under Community Content, perhaps.
     
    Joined
    Jul 20, 2013
    Messages
    603
    Reaction score
    203
    • Legacy Citizen 2
    • Community Content - Bronze 2
    • Purchased!
    An extra segment under Community Content, perhaps.
    Absolutely. I'd like if there was a way to bundle scripts into ship files as well so we can pre load them for ship-specific functions. Or, even better if scripts can be in game like blueprint meta-items, as a data disk or something. That would just make the game feel more immersive.
     
    • Like
    Reactions: Winterhome
    Joined
    Aug 23, 2014
    Messages
    427
    Reaction score
    137
    • Purchased!
    I was thinking there could be a minilogic build block. You enter the build mode of a small block and you can place logic as normal inside a defined area (4x4, 7x7, etc. whatever the devs decide) and when your done, whatever is inside that build area is packed into one single block. You could add an input/output code block to define which inputs are taken in what part of the circuit. Simply, you'd add a number to an activation block and it would take input only from other activation blocks with the same number, but would interact with every other block normally. blocks inside the computer block would then only take input from an external input if they are numbered and recieve a signal from the same numbered block on the outside. It sounds complex, but it's really not. it wouldn't even require a new block, just a modification of the current activation module.
     

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    I was thinking there could be a minilogic build block. You enter the build mode of a small block and you can place logic as normal inside a defined area (4x4, 7x7, etc. whatever the devs decide) and when your done, whatever is inside that build area is packed into one single block. You could add an input/output code block to define which inputs are taken in what part of the circuit. Simply, you'd add a number to an activation block and it would take input only from other activation blocks with the same number, but would interact with every other block normally. blocks inside the computer block would then only take input from an external input if they are numbered and recieve a signal from the same numbered block on the outside. It sounds complex, but it's really not. it wouldn't even require a new block, just a modification of the current activation module.

    That would require massive amounts of chunk updates to run well, and it wouldn't be capable of functioning as an AI system unless we simulated an entire computer inside of it.
     

    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
    Imo, it should work just like the computercraft MC mod. a LUA based programmable computer, that can download files off the internet like in CC (for those who cant program) and interface with logic the same way CC does with Redstone, just better.

    Place an activator on the back? you can read the status of that activator. Place an and/or gate on the back? you can read how many inputs are active of how many there are.

    CC is so good for minecraft with the extra features it has with mods. Imagine that power in SM.

    It could detect how far a ship is away, and automatically tell the pilot where the closest open dock is when they approach. Think of all the things logic can do, but with an OS controlling it, with custom UI's and more.

    If we ever get power cables, you could have controllable junctions forming a power grid that adapt if a system isnt getting power

    This is something I have been thinking about for a long time :)
     
    • Like
    Reactions: Winterhome
    Joined
    Jun 24, 2013
    Messages
    270
    Reaction score
    43
    ...LUA based...
    I knew someone would bring LUA into this. :p I can't say I agree, but I'll just put this out there. Java has a JavaScript interpreter already (Currently Rhino, Nashorn in Java 8). [JavaScript would also allow pretty simple websites to test your code and/or show off your script.]

    Even if the block could accept one input and had one output, it would allow a lot of really cool things by itself. A single logic output could feed a series of blocks via a shift register of logic blocks. The script would just have to output a stream of bit values.

    Of course, if the script had access to valuable ship data, this could make automated systems possible by analyzing the shield values and activating protective measures (launching drones, closing blast shields [for RP], or activating "red alert" status...)

    I don't know if I'd want to see it capable of altering ship values, because that would deprecate a lot of the Logic constructs. I think allowing it to read ship stats and output a logic signal could be enough to make a huge difference.
     
    Last edited:
    • Like
    Reactions: Winterhome

    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
    I knew someone would bring LUA into this. :p I can't say I agree, but I'll just put this out there. Java has a JavaScript interpreter built in (Currently Rhino, Nashorn in Java 8).

    Even if the block could accept one input and had one output, it would allow a lot of really cool things by itself. A single logic output could feed a series of blocks via a shift register of logic blocks. The script would just have to output a stream of bit values.

    Of course, if the script had access to valuable ship data, this could make automated systems possible by analyzing the shield values and activating protective measures (launching drones, closing blast shields [for RP], or activating "red alert" status...)

    I don't know if I'd want to see it capable of altering ship values, because that would deprecate a lot of the Logic constructs. I think allowing it to read ship stats and output a logic signal could be enough to make a huge difference.
    The reason I say LUA is because alot of people know it from CC, and it is incredibly basic, you can make so many syntax errors in there and it will still work, well, in CC atleast.
     
    Joined
    Jun 7, 2013
    Messages
    403
    Reaction score
    67
    • Purchased!
    I generally would prefer somewhat more programmable blocks instead of having to build whole logic labirynths where one block often makes for one command. I also would prefer a bit more customizable GUI that could allow adding icons and stat indicators. In fact, I hoped for things like consoles with several different buttons instead of one big activation block since quite some time and wouldn't mind that instead of efficient-and-comfortable-by-default core.

    However, there would be certain - potentially sizeable - issues, depending on how robust such programming would be, how many commands would be allowed and how one could mix them together. Simplistic programming where one would put together little blocks of commands affecting/requiring each other could work - adding actual, even simple programming language would be a potential disaster increasing average server load by several magnitudes and giving more capable (or actually, quite inept) folks a way to actually mess up things, badly.
     

    lupoCani

    First Citizen
    Joined
    Jun 23, 2013
    Messages
    504
    Reaction score
    127
    • Purchased!
    • Legacy Citizen 10
    adding actual, even simple programming language would be a potential disaster increasing average server load by several magnitudes and giving more capable (or actually, quite inept) folks a way to actually mess up things, badly.
    Could we please put an end to this lag scare that surrounds programmable systems?

    Firstly, where did "several orders of magnitude" come from? The average program will be to check if there are any enemies nearby and aim a turret in that direction. At the same time, Starmade is calculating the geometric shapes of several thousand vectors in three dimensions and expressing these as a series of hexadecimal colors, dozens of times every second. I woulds argue no remotely well-written program will come close to the load that starmade produces just by running.

    As for the programs that aren't remotwly well-written, the game has no need to accommodate those. Limiting the amount of processing power dedicated to user-made programs can, and has, been done with numerous other games.
     
    Joined
    Jun 7, 2013
    Messages
    403
    Reaction score
    67
    • Purchased!
    The "several orders fo magnitude", if I recall correctly (and I confess I may be not recalling correctly), comes from the problems Notch mentioned back when he was making his own space game with programmable computers and it was one of the reasons why there were to be certain limits in the size of the programs - as supposedly there was quite some risk that without such a bunch of players could easily mess things up.

    More important is, however, the thing you touch upon yourself and which I've mentioned before, LupoCani:

    I woulds argue no remotely well-written program will come close to the load that starmade produces just by running
    Absolutely agreed - but I am pretty sure that should 'serious' programming language be introduced, plenty of bad, memory leaking, recursive and 'set fire to computer now' programs would be made, possibly intentionally at times. I also take into consideration fact that StarMade already, on its own is somewhat demanding and while average, even home-based but quality server can probably handle loads of several instances of such a program, I wouldn't be surprised if longer game - which often already lags when there's a bigger group of players interacting - would get horrible bogged down if every one of those players would also start running complicated scripts.

    Making a bad program isn't tough. Hell, I didn't program over a decade (and what I've made before then was rather simple) but give me a few days and I'll probably be able to relearn enough to make an application easily more demanding than StarMade. Making such is rarely a program - it's making a big application actually optimized that's a challenge.

    Taking into consideration that with all this optimization, minimizing bandwidth use and so on the game can put some stress on average computer in single player mode, I hope you can understand now why I mention possibility of how much worse it may be if on top of that on average server there'll be lines of code sent back and forth.

    Of course, the problem can be limited, as you've mentioned yourself when it comes to bad programs. I do believe it would be silly to sync with the server code of a program when you can simply send effect of it, as in 'however bad and long my program is, its goal is to make this cannon shoot once'. There can be also limits imposed on how lengthy the program can be, what hardware (in-game and IRL) it is allowed to interact with and so on.

    Still, for the sake of finding solutions to such problems allowing the feature to work well, first the potential problems have to be mentioned - which is what I did. Hope this lengthy explanation makes it a bit more clear.