• Register
Post news Report RSS Start coding your spaceship!

Program your spaceship for space colonisation: flightcontrols, docking, games, trading, ...

Posted by on

Space Colonisation with Programmable Spacecraft

Colonise procedurally generated environments with your trusty Multi-Purpose Spacecraft (MPS), allowing integrated modding by controlling thrusters, lights and other devices via applications running on the 3001SQ central computer.

Start programming your spacecraft using AngelScript and nandOS, an operating system interface inspired by POSIX/Linux.

In the following 2 months we will be pushing the current technology demo to a full Multiplayer Test featuring docking with automated asteroid stations.

Code example

A little 3001SQ application controlling the cockpit lights to get you started - copy & paste into the Launcher Code Tab and start hacking!

#include "unistd.h"
#include "fcntl.h"

int main(uint argc, vector<var> &in argv)
{
    // We are starting to interact with the light: open the file descriptor
    int fdLight = open("/dev/light0", O_WRONLY);

    log("Turn off the light!");
    vector<var> controlOff = { Control_Device_Power, Device_PowerMode_Off };
    write(fdLight, controlOff);

    log("Waiting for 5s");
    sleep(5);

    log("Fiat lux!");
    vector<var> controlOn = { Control_Device_Power, Device_PowerMode_On };
    write(fdLight, controlOn);

    // We finished interacting with the light device: close the file descriptor
    close(fdLight);

    return 0;
}

Documentation

Post comment Comments
mirukiii
mirukiii - - 2 comments

foda

Reply Good karma Bad karma+1 vote
Cr2
Cr2 - - 1 comments

ayy lamepoios

Reply Good karma Bad karma+2 votes
poncianux
poncianux - - 10 comments

seems interesting

Reply Good karma Bad karma+4 votes
Tleno
Tleno - - 1,048 comments

Oh hey guys, think I remember you from Twitter! Well this looks cool, must say.

Reply Good karma Bad karma+2 votes
SocDesMondesVirtuels Author
SocDesMondesVirtuels - - 3 comments

Thanks! Now that we have user-apps it was obvious to come to IndieDB/ModDB as well since coding/modding will be a core part of 3001SQ :) More docs/programmable devices and asteroid colonisation mechanics coming in the following weeks!

Reply Good karma+1 vote
zohrra
zohrra - - 7 comments

nani?

Reply Good karma Bad karma+1 vote
MrGoatsy
MrGoatsy - - 5 comments

Looks cool.

You should make it so that you can program the computer from within the game itself, that way you don't have to keep alt tabbing outside of the game and the player should feel more immersed.

Reply Good karma Bad karma+3 votes
SocDesMondesVirtuels Author
SocDesMondesVirtuels - - 3 comments

When we implemented the shell utilities, there is no reason why not!
Still longer programs may be more comfortable to work on with external tools.

Reply Good karma+1 vote
MrGoatsy
MrGoatsy - - 5 comments

That is understandable of course.

Thanks.

Reply Good karma Bad karma+1 vote
Tajin
Tajin - - 98 comments

Looks both interesting and promising.

I just find it a bit irritating that all systems shut down whenever you reboot the computer.
I think the subsystems should just retain their current state until the get new commands.

Or maybe there should be 2 types of rebooting. One that resets all systems and one that only reboots the computer without affecting anything else.

Reply Good karma Bad karma+2 votes
SocDesMondesVirtuels Author
SocDesMondesVirtuels - - 3 comments

The workflow there will definitely be improved. Thanks for the feedback!

Reply Good karma+1 vote
Vertelame
Vertelame - - 435 comments

Okay now i see this as a good way to showing kids how to code OuO

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: