Modding Discussion ComputerBound

Discussion in 'Starbound Modding' started by Defiance3, Aug 3, 2016.

  1. Defiance3

    Defiance3 Phantasmal Quasar

    So, Starbound has finally hit 1.0! Pretty cool if you ask me. Except, it's missing something.
    I remembered seeing this a while back, and when I think about it, it's odd to think that it's already 1.0, and we don't have usable computers!

    So, being the passionate programmer I am, I took it upon myself to create a programmable computers mod for Starbound, and what other language am I to let them be programmed in other than Lua? =P

    Of course, other major computer programming mods, such as ComputerCraft and OpenComputers have had a big influence on how I've decided to go about this, simply because they're awesome mods.

    I've decided that I've wanted this mod to be more for intermediate programmers, rather than beginners, so it'll be a bit more of a realistic* mod than not.

    So, after a few days of development (and staying up for quite a bit), I've achieved this:

    Okay, this may not look like much, but I'll get into the specifics now.
    So far, there are multiple tiers of monitors, all sporting different resolutions at different aspect ratios.
    With each monitor, you can control the individual pixels, as well as set a color in RGB format.
    The monitor you see above (not the object you see to the left, but the screen with the text itself) has a resolution of 160x90. The largest monitor has a resolution of 240x135, and of course, each resolution is scaled so you don't have to strain your eyes looking at tiny pixels on a screen.

    Upon the first release of the mod, there will most likely not be anything else but the monitor that's functional, and you'll be able to use the computer from there. As time goes on, I plan to have it so you can build your own computers, and put in different hardware such as GPUs and CPUs, which you'd be able to upgrade and such.

    I have to work on making a storage API so computers can actually read and write data, as well as make their coroutines persistent so you can exit the monitor without it shutting down completely. Once that's done, I'll simply work on the BIOS, add a few APIs, and be on my way for it's first alpha release.

    I figured I'd show you all so I can receive some input, such as what you'd guys like to see with this mod, or what you'd not want to see implemented. A release will probably be put out within a week, assuming I'm not too busy. Hope you guys look forward to this.
  2. Defiance3

    Defiance3 Phantasmal Quasar

    So, a lot more progress has been made. No screenies this time, as it's mostly more boilerplate code.

    I've added a new API, and in doing so, I realized I also accidentally implemented custom peripheral support.
    So, if you're an eager modder who's just as excited for this as I am, and want to make a peripheral for it super early, then here's how:

    You have to have an object that has at least one input/output node.
    It also has to have two functions, both of which take no arguments.
    peripheralType(), which returns a string.
    peripheralDriver(), which returns a table of all available methods the peripheral can do.

    As the computers are event based, I plan to have support for peripherals to queue events in the near future.
    I'm just not quite sure how I want to go about it.

    This may change in the future before the first release, so just keep that in mind.
    Just know that if you do plan to add new peripherals, I'll save you time by saying that you probably shouldn't make code for a mouse, keyboard, scanner, printer, hand scanner, or hologram projector.

    Other than that, I decided that computers will be built on the first release, but I'm just not sure if I should have them be crafted at first, or if they should be manually spawned in.

    All in all, things are going pretty well so far. I'll probably end up putting the code on Github once there's enough of it, along with full documentation of all APIs.
  3. Defiance3

    Defiance3 Phantasmal Quasar

    Alright, just gonna give a quick update on the current progress.
    Firstly, you can see that I've gone with a font change! Feels a bit more like a terminal to me now. Though, I'm considering whether or not I should reuse the old font or just have a smaller one in general for the monitors with a smaller resolution to make things easier. Besides that, computers are now persistent, and you have to put parts in, such as a CPU and RAM, for it to work. A computer object can be seen sitting to the left of the monitor.

    So, what do I have left to do before the first release? Well, I have to finish up the BIOS, create a shell-like program, toss in a couple of little starter programs, and perhaps make the objects and items from this mod actually obtainable in survival, rather than have to spawn them in. Shouldn't be too long until I put out the first release. Wish me luck!
  4. YoloJoe

    YoloJoe Space Hobo

    This looks amazing! Well done!
    Inf_Wolf14 likes this.
  5. Defiance3

    Defiance3 Phantasmal Quasar

    Thanks! I have a lot more planned for this mod, so this is only the beginning.
  6. Defiance3

    Defiance3 Phantasmal Quasar

    So, after making some performance improvements, I decided I'd go ahead and prepare a Github repository for when the mod is released. For now, it doesn't contain much except some wiki elements, but if you like, go ahead and take a look anyway.

    It can be found here.
  7. Darkspinesupersonic8

    Darkspinesupersonic8 Pangalactic Porcupine

    Woow... I'm not really a programmer per say (I did take a computer programming class once..) But this still looks rather interesting, great job! <;3
    Inf_Wolf14 likes this.
  8. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    This thread. Everything. Very yes.

    You can't even understand how happy I am to see something like this. How I missed this thread for a week is beyond me, but I support this until the end of time.

    I'll be honest, instead of going the normal routes, I learned everything I know about Lua from ComputerCraft. Seeing this brings back some great memories. :D
    Darkspinesupersonic8 likes this.
  9. Slash0mega

    Slash0mega Subatomic Cosmonaut

    i have been wanting this, but it is sounding more like open computers than computercraft, which i love for its simplicity to set up :(
    hopfully it works on multiplayer and is not pure clientside.
  10. donpapillon

    donpapillon Scruffy Nerf-Herder

    Hey, if you need any help making pixel assets let me know. As an mere mortal artist eager to know more about programming, I'd love working on something like this, and in the process get to know more about programming by leaching off of ya =D

  11. Defiance3

    Defiance3 Phantasmal Quasar


    Yeah, that's where I started too, and thank you for the support! It's motivational to see people comment on and like my work. :)

    That's actually a main concern of mine. Well, both of those topics. I too like the simplicity of ComputerCraft, but I think it really works because of the simplicity of Minecraft, so it just fits in.
    With Starbound, however, I didn't think simple computers would really fit in a futuristic environment, so I decided to make it a bit more realisitic than not. I hope that I don't make it needlessly complicated.
    My main goal with programming these computers is to let the programmer decide how challenging it will be to program for the computer. By that, I mean I'd like it so that once you're done with making a computer, it will be really easy to make a quick and useful program. But, if they like, they can get more in depth with the computers and change various aspects of it (such as GPU color channels) in order to really take full advantage of it.

    As far as multiplayer goes, I haven't tested it yet, but it is definitely something I'll be making sure works and does so properly. It would get lonely on singleplayer if you're just programming by yourself. :p

    That's a pretty generous offer, and I would really like to see more of your stuff. Do you think you can draw a computer case that is 16x16? I know that's a super small size, but something tells me you'll pull it off anyway. If you do, I would love to have your art for my mod. And of course, I would teach you a bit about programming as you'd like. :p
    Last edited: Aug 13, 2016
    Inf_Wolf14 likes this.
  12. donpapillon

    donpapillon Scruffy Nerf-Herder

    I didn't knew what kind of technology level you were aiming for, so I made three 16x16 computer cases, ranging from old/low end to modern/high end.
    Might be useful to visualize progression.

    bk3k, Mirau, Defiance3 and 1 other person like this.
  13. Defiance3

    Defiance3 Phantasmal Quasar

    Wow, those look really good! I would be very grateful to have you on board for making art for the mod. I'll begin to PM details and such to you.
    Mirau and donpapillon like this.
  14. MelOzone

    MelOzone Pangalactic Porcupine

    Heyap! Are you going to draw for Defiance3 only or can I also humbly ask for a pic or two?
  15. Defiance3

    Defiance3 Phantasmal Quasar

    Well, I doubt I'll need more than one artist for this mod. :p
  16. MelOzone

    MelOzone Pangalactic Porcupine

    I've meant if he can draw for me too, not draw myself.
    I can draw when required but my skills are mediocre.
  17. Defiance3

    Defiance3 Phantasmal Quasar

    Oh, sorry. Read over your post too fast now that I look back at it.
  18. Defiance3

    Defiance3 Phantasmal Quasar

    Progress is currently being made towards the default OS, programs, and APIs which will run on these computers.
    Right now, I happen to be working on the edit program. Can't get far without it. :p


    I'd like to look into having a larger screen size as to see more text, but my implementation is limited by Starbound at the moment. I have to limit the FPS to 20 for the in-game screen to prevent a major performance hit, and even using the screen you see above (240x135) will begin to really lag if I'm drawing at the 20 FPS the monitor is limited to. The game doesn't seem like it was made with more dynamic drawing in mind. In fact, it's faster to create an image which use R and G values as X and Y values, respectively, and use the ?replace directive to replace each pixel on said image to display the screen (which is what I'm doing), rather than draw the pixels themselves using the console API (which is a lot slower), so I'm rather limited in options.

    Anyway, I'll try my best to deliver a great coding experience without too much of a hit on performance.
    MelOzone and donpapillon like this.
  19. UniQMG

    UniQMG Void-Bound Voyager

    This is really cool looking! How did you implement the interpreter? Just writing a lua interpreter in lua?
  20. Defiance3

    Defiance3 Phantasmal Quasar

    Thanks! It's a lot different from what it could've been (see the first post :p)

    At first, I was gonna do that, but it would be horribly slow. Later I found out that there's an option in your starbound.config called "safeScripts" which, when set to false, gives one access to load(), collectgarbage(), the debug library, and so on. Though, I'm not quite sure why load, or even collectgarbage are disabled by default. Lua scripts can be just as malicious without them, and nothing malicious is allowed on the forums anyway. But hey, not my call.

Share This Page