Many games today have some creative aspect to them, whether it be an in-game editor or an active mod community. Typically, players of these games have the ability to share whatever they make with the game’s community, and within these communities there always arise certain people that manage to make a name for themselves as a respectable and awesome content creator. Dual Universe will be no exception. If you’re the kind of person that would love to be renowned for their awesome creations, but believe that you just couldn’t, then this article is directed more towards you.

In Dual Universe, there will be markets. You can create a ship and sell it, or a blueprint of it, on the market. Your name will be attached to that ship; so if you can create great constructs, you can not only get rich from selling your creations but also make yourself more valuable as a player to potential organizations.

This article is about the coding aspects of Dual Universe, and how they can be more easily conquered than one without experience might initially think. It is not intended to provide a guide on how to write code, and it will not do so (though there are some basic examples of code, which need not be understood regardless). It is more intended to perhaps inspire, and bring to attention the fact that building awesome creations in Dual Universe may not be as out of reach as one might initially think.

Languages of Dual Universe

Dual Universe will have several coding languages in it: CSS, HTML, and Lua.

CSS and HTML are languages most commonly used in the creation of websites. Within a website, HTML provides more of the function while CSS dictates how the function looks. For instance, when writing content (just standard text), you would use HTML to indicate which text is supposed to be the header. With CSS, you would dictate how all headers across the website look; so that any time you use HTML to indicate where a header is, it appears as it has been programmed with CSS (this is more clearly explained further on). In Dual Universe, these languages will be used to customize the look of element widgets, which are available on ships. Things like fuel tanks and engines have information available to display to the player while they are operating a construct, and these languages can be used to customize how they appear.


CSS and Lua will be discussed in this article, but HTML will not be, for two reasons. The first is that I personally have no experience working with HTML. Secondly it has not yet been revealed exactly how, or to what extent, HTML can be used within Dual Universe. Due to these factors, I cannot provide an adequate example on how HTML can be used in Dual Universe.


CSS, as stated before, is a language which is most commonly used to customize the style and layout of websites. While some programming languages may look like robot syntax salad with punctuation dressing, CSS (a markup language) is intuitive, >especially if you are simply trying to edit someone else’s code, or fill in a template. In Dual Universe, it will at some point be possible to change how widgets on constructs display information, through the use of CSS.

A sample of some widgets in their current pre-alpha state, shown in the corner of the screen while flying a construct.

A perfect example here for CSS is the official Dual Universe wiki. There are hidden pages on the wiki; one of them contains CSS code. This code dictates how content across the whole wiki is displayed, including all of the colors, size, font, style, location, etc. of all different aspects like text, lines, headers, charts, and links.

I recently was working towards changing several of the styles on the wiki, but had no prior CSS experience. However, with the code there already written and cleanly laid out, finding what I needed was trivial because the syntax is intuitive, and it only took time and trial and error working with what I had to make the changes that I needed to. The first thing I wanted to change about the wiki was to make it so that the text of a link would change color when the cursor was hovered over it.

When hovering the cursor over a link, the text turns orange.

The links on the sidebar of the website already did this, as can be seen in the above image, but normal links within the content did not. Since the code was laid out and organized, and the syntax of CSS is intuitive, I was able to find what I needed.

The “Tabs” section containing references to hovering, and the color orange.

Under a section labeled “Tabs”, I found some code that said “hover”. I guessed that the TABS section was for the tabs on the side. Now the text saying “a:hover” really doesn’t make much sense. But, the code underneath that indicates that whatever “a:hover” means, it’s color is orange. The little bit of numbers and letters indicate is one of three common ways to indicate a color (the word “orange” would also have worked instead of “#F4B331”). Because the links in the tab turned orange when hovered over, and I found the text “hover” right next to some code indicating the color orange, I figured this must be where I should start.

The “Anchors” (Links?) section, containing the same syntax as before.

Further on in the code, down in the “Content” section, which I guessed contained the code for standard text on normal pages, I found an “anchors” section. Underneath that were several other different types of “a:something”, just as before there was “a:hover”. The syntax itself doesn’t make much sense, and it doesn’t need to, because the keyword from before is “hover”. Could it be that if I put “hover” behind some types of “a:”s in this area, I could make all links across the whole website orange when hovered over?

Trial and error. I copied and moved some text around, and after a few attempts (definitely not the first) I got everything working the way I wanted it to. I did the same sort of thing later to make visited links slightly darker (before, a link would be the same color before and after clicking on it). Because if you notice in the image above, there are link types that say “visited”, which I guessed meant a link that had been clicked on. Finally, I ended up with the code I had set out to make. I notated the colors using rgb; rgb stands for red, green, and blue, which can be combined for any color. The ‘a’ in ‘rgba’ dictates how transparent the text is. I could have also used “#F4B331” as before; notice that this is referred to as the “Hex” value in the Colors window.

Remember, I wrote almost none of this myself. I copied and pasted things, moved text around, and most importantly, I looked at other code and guessed how I could make the code do what I wanted. In Dual Universe, widgets will be small; it is highly likely the code will be simple with only a few functions. The size, colors, fonts, locations and style of information, etc. will all be editable, through the use of just a few lines of code. It will not take long for a player without experience to figure out, from a template, what each section of code does and how to change it to make it do what they want. They can become proficient at it in no time.


Lua is a very simple scripting language which is easy to grasp. Lua is a name, not an acronym (so not LUA), and is intended to be embedded within larger programs than itself. In Dual Universe, Lua scripts will be able to work with elements to receive information from them, and do commands based on particular circumstances. The concept of how this works is easy to understand once you get a grasp of it; it is explained in more detail a little later on in the article.

Before moving on, please acknowledge the following regarding Lua scripts in Dual Universe:

  •       A player running a Lua script must be online and near the script for it to run
  • Mining cannot be automated by Lua in any way
  • Weapons may or may not be scriptable with Lua; if they are, they’ll be inefficient

The best thing about Lua is that it is such a simple language. There are videos online to teach the language in just one hour. You can of course get quite a bit more in-depth with it, but for the general purposes of Dual Universe an hour tutorial is all one would need, at the most. On the other hand, a video on a programming language like C++ could practically spend an hour just talking about the different types of variables it has.

Each element in a construct has a set of things it can do. And engine is a thruster; when it is on it can be exerting anywhere from 0-100% of its maximum thrust. A switch can be flipped; it can be at least either on or off.

(Disclaimer: Some of the following assumes that there will be a sensor which can detect the position of a local player. Such a feature is not officially confirmed. I am using it because it is easy to make an example with it.)

A local sensor can detect distances in coordinates to a nearby player. It is set to detect its owner, and for this example the owner will be you. Just like the engine’s main feature is that it can exert thrust, the sensor’s main feature is that it can detect how far away you are from it. In this example, it does so in coordinates. So, if you are 10 meters in front of the sensor (in the Y direction), it detects your position as (0,10,0). If you then move 5 meters to the left (in the –X direction), and 7 meters into the ground (in the –Z direction), it then detects your position as (-5,10,-7).

Columns showing the different functions of elements. The current value of thruster power can either be set by the script, or the value itself can be used; however, the value a sensor is reading cannot be set by the script.

Before moving on, the concept of “DPUs” must be explained. In Dual Universe, a Distributed Processing Unit, or DPU for short, is essentially a computer. A DPU is what runs Lua scripts. Now, think of a DPU as a computer with several USB ports. The thruster and sensor mentioned before can be thought of as hardware with USB connectors that can be plugged into those USB ports, just like a mouse and keyboard can plug into a computer. There are only a few ports, and the computer can only work with things that are plugged into it.

Moving on, inside of the DPU, Lua scripts can be placed which use the features of the things plugged into it to execute actions. The sensor can detect how far away you are in (X,Y,Z) coordinates; the DPU can accept those numerical coordinates and do things with them. The DPU can also change the values of any thrusters plugged into it.

In a practical example, let’s say you build a hovercraft. You want that hovercraft to follow you on its own; it has lots of cargo containers on it and you’re mining by yourself. You put engines on the back, front, right, and left of the hovercraft. You also put a sensor on it. You plug all four engines and the sensor into the correct DPU on the ship, and then you write a Lua script for that DPU to have the ship follow you wherever you go.

The following image is an example of one way this code would work. Note that this is simple pseudocode, and is not actually how Lua is written; for the actual script, more specific syntax would be required (nothing too hard!).

The script is constantly checking the values that the sensor is reading. As you move around, the values change based on where you are. You set up a series of commands in the script to execute based on what the sensor is reading. If your value in one direction gets too great (let’s say if your X coordinate exceeds 20, so you are 20 meters ahead of the ship) then the script will run the part of the code that turns the back facing thruster on low until the sensor reads your X coordinate as 5, at which point the thruster will shut off. Since you are mining and will be going underground, then the script does nothing with the Z value. The script will be checking your location and never let you get farther out of range than -20 to 20 meters away.

This script is quite basic. The thing is, this is how so many scripts can and will work in Dual Universe. Each element—each engine, sensor, door, cockpit, button, light, etc.—has just a few things, a few features, which it is capable of working with. Each script is conceptually the same as this example; it uses the values or properties unique to each element to execute actions to other elements. You could have a script do something based on the state of a door; if the door is opened, the script turns on a light behind the door. If the door is closed, the script turns the light off. This is just the same concept as before, where if a condition is met, an action is executed.

Why should you have a desire to learn how to use these languages? Well for one, they’re useful. CSS will only make aesthetic changes, but you can customize your ship’s widgets for your organization to make them match the organization’s colors, making you more valuable to someone looking to hire you. Lua is useful without needing an example; so many things can be scripted. Not only will you increase your worth to potential organization leaders, but it is extremely useful information to know on the spot in case you want to test something out or make something work quickly. Learning to write Lua scripts is one of those things you’ll never realize how useful it is to know, until you actually know it. And let’s not forget where this article started; using Lua and CSS, you could add your own personalized touch to ships you create, and make a name for yourself on the market as a master shipwright. Learning how to use these languages will be incredibly useful, it will increase your worth as a player, open up lots of doors for you, and even improve your overall game experience.


Please note that both of these languages can get very in-depth. I am not saying that after watching a youtube video and then screwing around in Dual Universe, you’ll be qualified to go work at EA and improve their website. Learning the languages for Dual Universe will not be difficult as they pertain to Dual Universe. The game will not go in depth with requirements, which is why I say that just about anyone with the desire can become proficient in the needed skills. Just know that I am well aware, and you should be too, that the languages themselves as a whole can get much, much more complicated beyond their practical use in Dual Universe.