Search Trillek...

 

Planet Minecraft : Texture Packs, Skins, Projects, Servers & Blogs!

Latest Gaming News
Friday
Apr132012

Article - An Introduction to the DCPU-16

There have been a number of misconceptions and misunderstandings of what the “computer” which will be used in the game 0x10^c will consist of, how it works, and how it will be likely used by players.  There is also a certain bit of misconception by “non-techies” who think they understand computers but get their impressions of how computers really work from Hollywood movies or perhaps fear mongering that happens in popular news media articles and television reports.  In this article I’m going to try to dispel some of those myths and try to explain a little bit about this computer within a computer that will apparently be a part of the game that will be 0x10^c.

 

I’m not going to explain the game 0x10^c in detail other than it will be a “first person” point of view interactive video game where you will be playing the role of being a crew member on board a space ship set a great many years in the future, yet the technology which will be available for players to use will be roughly comparable to what was found in the 1980’s although with the premise that mankind continued to significantly work to move out into space rather than shut down the various space programs around the world after the Apollo moon landings.  If you want to see the kind of spaceship you will likely be using, it will look something like this spaceship design made by a bunch of NASA engineers which is called the NAUTLUS-X (yes, that is a “real” spaceship that may be built in the near future):

 

 

Inside of this spaceship, there will be all kind of different devices you can use that will help you fly that spaceship.  This will include laser guns, engines, radios, and all other sorts of things that you will find useful or that can be used either within the spaceship or control panels that you can use for devices found on the outside.  Among all of these devices is going to be one or more “boxes” you can play with that will be a fully functional computer called the DCPU-16.  This computer will be something you would recognize and includes a keyboard, video monitor, external connections, a power cable, and even a switch to turn it off.

 

Markus “Notch” Persson, the creator of Minecraft and now the game that will be 0x10^c, has already put some considerable effort into how that computer is going to work and has even done quite a bit of software development for this “computer within a computer”.  An example of what he has been doing can be found with this computer monitor screen from a sample screen shot of the 0x10^c game itself:

 

 

A computer program which will simulate the behavior of another computer is called an emulator.  Computer emulators have been around almost as long as there have been computers at all, where it is a common task for any group of would-be computer manufacturers to write this kind of software to simulate the behavior of the computer, primarily to allow computer programmers the chance to write software for a computer that hasn’t even been built yet so the software will be ready when the computer is finally being produced in a manufacturing plant.

 

Historical computers for comparison:

 

In the case of the 0x10^c computer game, this emulator is going to simulate the behavior of this “computer within the game”, and from the perspective of the avatar or “character” within the game, it simply will be a computer like the machine you are likely using right now to read this article.  Because the technology of the spaceship and everything in it will be something that was typically found in the 1980’s, this computer will be considerably more primitive compared to the computers of the early 21st Century that you see today.  An example of a “real-world” computer that might be comparable is the Apple II computer from about the same time period:

 

It is important to note that it won’t be an Apple II computer though, as that is merely something used as a reference to the kinds of abilities you should expect.  There were other computers of the era that had similar capabilities, including the Commodore 64, the Sinclair ZX-80, Coleco Adam, TRS-80, Atari 800, and several other computers which were manufactured by several different companies.  It was a sort of “golden era” where many different and sometimes crazy ideas were invented that broke all conventional wisdom.  Some companies were successful and others weren’t but a great many ideas about how computers could be used were explored.

 

Since this is about computers being used in spaceships, I would be in remiss if I didn’t at least show another couple computers used in this era.  One is the Apollo Guidance Computer, which was the computer system used in the Apollo command capsule and lunar landing which sent the NASA astronauts to the Moon and really did run those spaceships:

 

 

Perhaps a better spaceship computer to compare here would be the IBM AP-101, which is the computer which has been used in a number of aircraft such as the B-52 and F-15 military aircraft, but was also the primary guidance and operational computer used in the space shuttle called the IBM AP-101:

 

 

I use these examples to show what kinds of computers are needed to fly a spaceship.  They need to be tough little boxes that can handle everything that would happen in a spaceship, and as evidenced by their use in military aircraft the AP-101 was even designed for use in a combat situation like what might be found in 0x10^c with player vs. player combat.  Neither of these spaceship computers would be considered “state of the art” in terms of their processing power or their ability to do high end video games, but they got the job done and were very reliable for doing things like running a spaceship.  In the case of these two computers, they really were used to fly spaceships.

 

The DCPU-16 itself:

 

I also need to clear something up here:  The term DCPU-16 is being used for two things simultaneously.  It refers to the computer itself that is found in 0x10^c, but also to something called the microprocessor chip which is found inside this computer, also called a central processor unit (CPU).  For the most part players won’t even really have to worry about this except for those who are digging down into the guts of how this computer even works.

 

One thing that is remarkable about the 0x10^c computer game is that for a video game this is one of the most elaborately emulated computers ever used, especially for a game that will have many other elements where this computer is ultimately going to be just one of several different items in a much larger game.  “Notch” Persson could have put in computers in a number of different ways, all of which have been done in the past with computer games ranging from a robot that talks back to you or merely simulated the computer terminals with custom programming he wrote to make it feel like you were using that computer in the game.  Many computer games have had “computers in the game” like 0x10^c, but not on the level being done here.

 

What makes the DCPU-16 so unique is that it will be completely programmable by the players themselves.  What you will get when you start the game 0x10^c is just a raw computer with none of the computer software that will be needed to get it to work.  Simulated within that computer will be the DCPU-16 processor core, which is what has been getting a whole lot of attention by would-be players of this video game and in general fans of “Notch” Persson.  As a sort of teaser of things to come, Notch has released a little bit of information about how this computer works including three rather remarkable documents which have been the basis for which the entire fan community has built up a whole library of computer software.

 

Of these documents, perhaps the most significant is the DCPU-16 instruction set architecture (ISA) document.  If you want to see this document for yourself, it can be found here:

 

http://0x10c.com/doc/dcpu-16.txt

 

What this document actually does is to define the behavior of the DCPU-16 at a level where electrical engineers meet with computer software developers.  A document like this can be used to either create actual computers (more on that in future columns), or be used by software developers to create computer programs of various kinds.  For the most part a typical player of 0x10^c will not even need to worry about this document other than to know that it exists.  Notch Persson used this document himself to create the emulator that I showed earlier, and it is used to create some very specialized kinds of computer programs called assemblers.

 

To perhaps simplify this way more than it needs to be, all computers operate using something called machine language.  While it isn’t exactly true for what really happens, from the perspective of somebody actually using a computer this is the raw numbers used inside of a computer which gives instructions that a computer can “understand” and are converted into electrical signals which allows a computer to perform different things like operate a computer video screen, operates a computer printer, and in the case of the spaceships in 0x10^c it will be the computers that you will be using to send messages to other spaceship, plot a course to other planets, and be able to fire the laser cannons which you will be using to protect your ship or to attack another player.

 

These raw numbers that computers use are obviously hard to understand, and how the exact numbers are determined come from how an electrical engineer would need to take those numbers and turn them into circuits and wires that form the physical computer.  There are predictable ways to make those numbers, which is where the ISA document explains how to make those numbers that the computer will be using.  It is at this level that the DCPU-16 in the 0x10^c computer game allows player interaction.  When these numbers are created, it is said that they are “assembled” and organized to create the computer instructions.

 

To make these numbers much more understandable for programmers, something calledassembly language was created as a way to symbolize these raw machine instructions.  Each command or instruction in assembly language corresponds to either one number or to just a few numbers in a very predictable way that is explained in the ISA document.  Because converting these assembly instruction to numbers is a very tedious task, computer programs calledassemblers are usually written to turn these assembly instructions into raw machine code.  There are also computer programs called disassemblers, which take the raw machine code and turn it back into assembly language.

 

As a side note, Steve Wozniak, one of the co-founders of Apple computer and the designer of the Apple I and Apple II computers, actually wrote the original operating system and BASIC interpreter for those computers (it was the “Integer BASIC” interpreter for those interested in the details and seeing the actual software) by doing what was called “hand assembly”, where he performed the task of an assembler by generating the raw machine code with nothing more than a piece of paper and a few pencils and erasers.  He did this in part because he couldn’t afford to pay for the computer equipment which had the assemblers for the CPU he was designing, and cheap computers like we know of today simply didn’t exist at the time.  If you are an experienced computer programmer, I’d recommend that you at least try to perform hand assembly just to see how hard of a task that can be, much less write an entire operating system in that fashion.

In the case of the DCPU-16, a great many fans of the 0x10^c game have already written assemblers that you can use, so hand assembly isn’t really needed other than as an academic exercise to see how it can be done.

 

Two other documents that have been influencing the development of the software in the DCPU-16 computer were also written by Markus “Notch” Persson:

 

http://pastebin.com/raw.php?i=qb7k8fNa (video example)

http://pastebin.com/raw.php?i=aJSkRMyC (keyboard example)

 

While to somebody who is not a computer geek would look at these documents and scratch their head as to what is implied here, these documents help to accomplish three rather important tasks at the same time:

 

  1. A memory map
  2. Input and Output architecture
  3. an example of assembly coding using the DCPU to perform these tasks

 

To explain a memory map, what that does is to define how each piece of memory inside of a computer is to be used.  Without going into details, some pieces of computer memory can be used for almost anything like holding the instructions for computer software or to keep track ofvariables used in that software.  On the other hand there are some memory locations which are also used by the computer that will allow software to send messages to other devices or do things like turn on lights or fire laser guns and more.

 

Notch Persson is using with the DCPU-16 something called memory mapped input and output.  What that means is that if you want to communicate with another device, you must put a number at a certain memory location in the computer or retrieve the information at that memory location.

 

Based exclusively on these two additional documents, there have been several fans who have created several DCPU-16 emulators of their own which have a video display screen and allow you to use your keyboard to be able to interact with that emulator.  Some of these are now sophisticated enough that you can even play computer games on them, including a very interesting version of Minecraft which can be played on the DCPU-16.  It is remarkable how much has been developed based on what I’ll admit is the most flimsy of information you could possibly have and still be able to get something done.

 

At this point it should also be noted that other kinds of computer software are also being developed.  This includes operating systems, which is the computer software being used to help computer programs interface with the input and output hardware of the computer, and even a few compilers.  A compiler is software that allows you to use other computer programming languages and turn them into either assembly instructions or even raw machine instruction.

 

Over the next few weeks and months, I intend to go over some of the blatant misconceptions about this “computer within the game” including explaining a bit about computer viruses and malware, as well as perhaps even do some reviews of some of the very interesting computer software that has been developed for this computer.  I am excited to see 0x10^c be developed, and the power of this “computer within the game” is something that I think will ultimately change computer video games in the future.  I’ll try to explain how I see that change happen with perhaps even a few games that are going to be following the lead of Notch Persson with some of these innovations.

By R Horning

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (3)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Trillek.net - 0x10c Community Blog - News, Images
  • Response
    Our SQL tutorial will teach you how to use SQL to access and manipulate data in:
  • Response
    Response: yPqRpMVM
    Trillek.net - 0x10c Community Blog - News, Images & Video - 0x10c community, blog, news, images & video - Article - An Introduction to the DCPU-16

Reader Comments (3)

What I know of emulators I know because of things like epsxe and pcsx2 and dolphin, that is there is a rule of thumb that a computer has to be roughly ten times more powerful than a system to reliably emulate it. So am I right in saying that the computer in 0x10^c will take negligible computer power to emulate? Could Notch have made it significantly more powerful without costing performance much?

April 13, 2012 | Unregistered Commenterclyspe

Apparently Markus "Notch" Persson actually wrote two emulators for this game. One was an emulator for a 6502 chip, but he ran into some problems with the performance of that emulation simply because of some design compromises made by the original designers at MOS Technologies. Those compromises and tweaks were useful for building such a chip in the real world, but it made software emulation much slower.

Notch has been playing around with emulators in one capacity or another for the last several months, and the real key was getting this particular design with the DCPU-16 to be emulated with very little overhead. As you've said, clyspe, the target CPU should be running at a rate significantly slower than the "host" system if you want it to be emulated accurately. In the case of the DCPU-16, Notch was able to have over 5,000 "computers" running simultaneously on his test server.

Now this is speculation, but I suspect that he is targeting the ability of each server to host about a thousand players at the same time, each with their own spaceships and several of these DCPU-16 computers. On average, he is expecting each player to have about three of these computers running at the same time within the game.

If you want to think about how much CPU processing power it takes to be emulating 3,000-5,000 CPU cores, I think you could make the case that the ability to have more powerful virtual computers is quite limited. Perhaps if Moore's law continues for a few more years at least and Mojang (Notch's company which is publishing this game) can purchase better computers in a few years, there might be some better computers which are made available in the game.

I probably should have mentioned this issue within the article as well as it is useful information.

April 13, 2012 | Unregistered CommenterR. Horning

Thanks for this wonderful article!

I look forward to more :)

April 17, 2012 | Unregistered CommenterWatson

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« Screenshot - Planet Earth? | Main | DCPU-16 Coding - Printing and Keyboard Input Tutorial »