Tweaking [Alpha] Modular Computers

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
I've recently finally decided to port my in-JVM VM programming language to Terasology and make use of it.
The language has syntax very similar to JavaScript, but is a bit stricter (requires semi-colons at the end of statements, all variables have to be declared). This is due to the fact that the program is "compiled" into Java objects that interpret it when program is run, and I didn't want to bother with some technicalities of a less-strict language.

The implementation of the Alpha of the module is already finished and it features couple of exiting things:
  • syntax checking while typing with error message and location,
  • syntax highlighting while typing (stops at first encountered error),
  • automatically generated documentation available in clickable format (hyperlinks between documents), along with history "Back", "Forward",
  • each computer has a predefined amount of "virtual" CPU cycles, memory and stack size, if a program exceeds the memory or stack size, it exits with appropriate message, on each tick, each computer in the game can run operations up to the specified amount of "virtual" CPU cycles, each operation performed by the computer consumes configured amout of CPU cycles,
  • instead of wait-and-check that is often used (i.e. wait 1 second, check if inventory is not empty, repeat), computers support conditions - these allow to define a condition upon which the computer should be awakened from sleep to continue the program (i.e. inventory state changed, signal state changed, etc),
  • computer's available functionality is configurable by the player, each computer (per type) has a defined number of module slots available, each slot enables specific set of operations to perform, i.e. manipulating inventory, movement, block destruction, internal storage, etc.
  • full modability - new modules can be developed and added by other mod developers, computer modules are extremely easy to implement and bind into the scripting engine,
  • full extensibility - new pre-defined objects can be added by other mods, also existing objects can have methods added,
Features to be added at some point:
  • players with specified permission will be able to, using a special console, query "virtual" CPU cycles user per player each tick, and to limit specific player's CPU cycles available across all of their computers to prevent lag if that player is abusing the module,
  • players with specified permission will be able to set maximum number of CPU cycles available for all computers on the server per tick, each computer then will be scaled down, so that the total of all CPU cycles/tick does not exceed the limit set,
I'm accepting any reasonable feature requests, but most importantly I'd like people to test this module, so feel free to take it from Jenkins, or wait for next Terasology drop, that should include this new module.

If you are willing also to make some graphics for me, I need 4 item images for the 4 modules available in the game - "Mobility", "Inventory Manipulator", "Internal Storage" and "World interaction (block destruction)". Also an extra image is required for the "Computer Terminal" item.

And finally a couple of images and videos, most of them are outdated, but why not.
Images:
Videos:
  • Introduction to module (lesson), make sure to enable captions -
  • Example of sorting program -
  • Example small mining program -
  • Auto generated documentation -
Feel free to comment, throw ideas, etc.
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Video showcasing a new method of World Interaction module - placeBlock. Small program that builds a house of the specified dimensions:
 

manu3d

Active Member
Contributor
Architecture
Just wanted to say: very cool stuff.

Cervator mentioned this module and its screens might be part of the solution toward security cameras. In this context it might be best, albeit not strictly necessary, to separate the "monitors" module from the "computers" module. Or perhaps to have a way to disable the computer portion so that data can be piped directly to a screen. Eventually the rendering code will be able to handle multiple cameras and will "publish" texture buffers to get at least color data from. Ideally however I will aim to create and modify entire rendering pipelines at runtime, so that if you wanted to you could get that color data and then pass it through a few filters nodes before it's displayed on the screen, i.e. to turn the rendering to monochromatic and add some noise for a more "old-style CCTV" look.

Finally, for an eye-candy: you could place a light source behind the screen and light up the surroundings with the color of the screen. =)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
You're in luck! The monitors module is already separate :D Although I don't know the exact details vs. what you have in mind for the future, too 3d wizard'ish

Cool idea to make monitors light up their surroundings with whatever color is dominant! That'd be sweet
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Well, it's not in a separate module yet, but it is in a separate package within the module and once we find a use for it somewhere else, we can separate it. I just don't want to keep creating multiple small modules just to feel good about myself. :)

It's org.terasology.computer.display and org.terasology.computer.monitor, the "display" one can be probably moved to org.terasology.display.
 

metouto

Active Member
Contributor
Art
Marcin .... Cervator was telling me in chat that you might be needing a computer :omg: so I have put this together ....

ComputerBack.png ComputerBack.png

ComputerBottom.png ComputerBottom.png

ComputerFront.png ComputerFront.png

ComputerLeftSide.png ComputerLeftSide.png

ComputerRightSide.png ComputerRightSide.png

ComputerTop.png ComputerTop.png

..... if you would like to use it / think it needs to be changed somewhat / like it the way it is / or / just like to use your own work and not others .... feel free to use or use not .... just thought I would offer what I could :coffee:

 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps

metouto

Active Member
Contributor
Art
Ok more futuristic ..... I got it ...... will try again ..... :oops:
 
Last edited:

metouto

Active Member
Contributor
Art
Last edited:

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
At the moment computers don't really have "sides", though obviously top and bottom might make sense.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Haha excellent yes! That was about exactly what I had in mind. The sharp contrast between the background colors definitely is eye catching, maybe a wee bit too much :D

I would suggest changing the background fill to a light gray of some sort (could be a darker one like the bottom, should probably match). Then as far as I'm concerned they're perfect :)

@Marcin Sciesinski the different faces are just for decoration, at least for now, is it even meant that the player can only interact with the "front" ? I would figure hitting it from any orientation would bring up the controls
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Great! Thanks :D

@Marcin Sciesinski do you want to replace the coal block, or bedrock, or whatever the placeholder block is with this set? I can do it / talk @metouto through how to do it if you'd rather stay focused on code
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
@Cervator I removed the block from the module at the moment, these will however come in handy, once somebody will build a "modpack" with this mod.
 
Top