r/programming • u/willvarfar • Apr 10 '12
GitHub officially supports DCPU16
https://github.com/blog/1098-take-over-the-galaxy-with-github27
u/jrochkind Apr 10 '12
So this game is for people who think writing assembley is fun?
28
Apr 10 '12 edited Apr 10 '12
Here comes the obligatory statement that comes up when anyone talks about assembly language in a modern context:
Rollercoaster Tycoon was written by one guy in assembly (except for some Direct X wrappers).
There, someone said it. Now we can get on with our programming safe in the knowledge that malloc isn't going to return null and that the class keyword isn't voodoo.
13
u/SkaveRat Apr 10 '12
I knew it was done by sawyer alone but... pure assembler? wow. Now I have even more respect
1
Apr 11 '12
I used to think that when I found out. Put I consider the effort futile now that I've had to optimise code for ARM neon and other instruction sets; you have infinitely less portable code and, even if you're an optimisation god, in most cases the compiler is smarter than you are. Its also practically impossible to work in a team of more than 2 people because the time to understand everything is so much more complex.
Don't get me wrong, Chris Sawyer is a legend and I'll probably never accomplish something that I will just the choice of Assembler, even in the 90s, was kind of a crazy one.
Yeah, its an impressive effort but so is colour coding a million thumb tacks by hand. The reason we don't write much assembler any-more isn't because its hard (if anything there are less concepts to "get" than in C or C++) its because its a massively flawed way of working that probably won't yield any performance increase.
3
u/willvarfar Apr 11 '12
But the thing was, when I first got RCT on a magazine cover disk, it ran really super smoothly on my PC. The defining thing is how much on-screen animates whilst everything is going around smoothly.
It was unparalleled in its time.
0
Apr 11 '12
No doubt, it was well a tested, well designed and well written game (as well as fun). Good algorithms, good design and good practice are visible no matter the language used but I still don't think it should be be considered masterful that the entire thing was coded in Assembler, any more than C with specific machine optimisations where necessary.
It amazes me how well written old games were, and even bizarre design choices seem to pay off. I remember reading that Doom just loads up with a single call to malloc() which is basically "size of everything needed in the game" they then proceed to use their own memory allocation after this. Mental decision but it probably made crucial optimisations for the hardware.
0
Apr 11 '12
Doing a single allocation at startup means that you will never crash in the middle of a game because the OS suddenly decided you can't have any more RAM.
2
Apr 11 '12
I think the risk of malloc() returning null can be handled with much more effective design decisions than "allocate me all the ram".
2
Apr 11 '12
I think the risk of malloc() returning null can be handled with much more effective design decisions than "allocate me all the ram".
Not really. The system can refuse a memory allocation at any time for any reason, and there is really no way to recover when this happens. The best you can do is try to shutdown cleanly, and even this may be extremely difficult.
The only way to guarantee that you will always have memory when you need it is to determine in one way or another how much you will ever need, and allocate all of that and then handle it yourself.
System memory allocation is non-deterministic.
2
u/Tuna-Fish2 Apr 12 '12
The system can refuse a memory allocation at any time for any reason, and there is really no way to recover when this happens.
A lot of modern systems never actually fail on alloc. On Linux (and most other unices), calling malloc doesn't actually provision you any memory. If you run out of memory, it happens when you actually try to use it and access the page for the first time.
→ More replies (0)9
u/Buzzard Apr 11 '12
I believe Transport Tycoon was in assembly too (though I can't find a solid source).
On a side note, Ludvig Strigeus then disassembled the game and re-wrote it in C to create Open Transport Tycoon Deluxe.
3
3
u/badsectoracula Apr 11 '12
It better had to be. Running this thing on my 386 with animated everything at SVGA 640x480 (or whatever resolution it used) and a full GUI system with overlapped windows, several cameras, etc and huge scrolling things like the newspaper was incredible back then when there were games that couldn't done half of that on standard 320x200.
4
4
6
2
u/josefx Apr 10 '12
Never wrote "real" assembly, only mmixal - assembly is a language like any other that does its job. Just a bit more verbose and less type safe than c, but with direct access to all cpu functions and flaws.
6
u/smek2 Apr 10 '12
every spaceship in the game is controlled through a "CPU", implemented on the server through a Virtual Machine. Players program their spaceship in order to play the game.
It's Pascal Robots all over again. Which is a good thing.
8
u/YakumoFuji Apr 10 '12
I'll take sweet16 over dcpu16. Sweet16 designer at least knew what he was doing...
3
2
u/Nebu Apr 11 '12
The CPU spec is one thing, but when are we gonna find out how to interact with hardware? I'm assuming well be able to program these CPUs to control the space ships, for example.
2
u/bcain Apr 12 '12
From 0x10c standards committee (who knows how authoritative they are...?):
Here is what we know: The external storage device attached to the DCPU-16 will be one (or more) floppy disc drives each of which will contain 1.44 MiB of data storage (the 3-1/2" discs that originally came with the Macintosh computer and later on PCs and other computers later on). Sector sizes traditionally have been 512 bytes, or in DCPU-16 terms, 256 words (close enough for our needs). This is a total of 2,880 sectors on a given floppy disc. The physical addressing composed of reading in 18 sectors per track, 80 tracks per side and two sides of the disc. The data transfer rate (if this is simulated) was about 500 kilobits per second (or about 125 sectors per second and with the DCPU-16 about 800 machine cycles to load a sector as the limiting factor from the disc controller itself).
...hmm, ok they're citing the forum, so probably fairly authoritative.
1
u/thattreesguy Apr 12 '12
ya hte whole point of the CPU is so you can automate your ship. The cpu can control your ship hardware and it can also network with other ships.
Lots of the details on this haven't been released because notch is at an extremely early stage still so it probably hasn't been decided/specced
1
u/spotter Apr 10 '12
Not sure if they want a cut of his jib...
[insert Fry face here.]Or "cant spell GitHub without 'fad'."
(But it looks like everybody wins in either case.)
-16
u/MarkTraceur Apr 10 '12 edited Apr 10 '12
In other words, GitHub and Notch have teamed up to completely deny everyone any digital liberties they might otherwise have, and they're doing it through the black magic of marketing.
A) Make real programs, you can even use assembly; B) Use Gitorious to host your programs, so that you aren't denied digital freedom by your code host.
EDIT: Proggit once again strikes back against the evil menace of someone who wants them to be free! How dare I!
0
Apr 11 '12
[deleted]
-8
u/MarkTraceur Apr 11 '12
They're refusing you critical digital freedoms for software--to use for any purpose, to share copies, to study and modify, and to share modified copies. None of those freedoms are available to you when you use GitHub. When you use Gitorious, you have all four.
4
u/movzx Apr 11 '12
...all of those are available.
-3
u/MarkTraceur Apr 11 '12
Where do I get a copy of the source code, then? And where is the license that gives me those freedoms?
6
u/movzx Apr 11 '12
The source code you created? From your hard drive.
The source code others have created? What exactly is stopping me from doing
git clone https://github.com/joyent/node.git?The license? It's your code. You can do whatever you want with it.
The license for other people's code? It's their license, they can do whatever they want with it.
I really don't understand your issues. Literally one of the first things you see when you go to a GitHub project page is a download button to grab the entire project as a zip.
-9
u/MarkTraceur Apr 11 '12
The source code of GitHub, of course!
10
u/miniguy Apr 11 '12
and how does them not giving you the source code of something they made restrict your digital freedoms?
0
u/MarkTraceur Apr 11 '12
They made it, but I'm using it. I should be able to use it for any purpose, study it and modify it, and distribute copies.
1
u/miniguy Apr 11 '12
Garry Newman made Garry's Mod, but I'm using it. I should be able to use it for any purpose, study it and modify it, and distribute copies.
And yet remains the fact that while i think that this i should be allowed to do, the code remains closed and the likelihood of it ever seeing the light of day is slim to none.
Github have chosen to not publicize their code and it is absolutely their right to do so. While it may be true that their code is used freely by thousands upon thousands of people to host and manage millions of repositories, there is no law that says that Github must give their code openly to the ostracizing eyes of everyone. They are providing a service just like every other site, and it is well within their right to keep the code behind it to themselves.
→ More replies (0)
-6
u/bonch Apr 11 '12
Could we have another 20 submissions about this pointless videogame CPU that only spergs will ever use?
-8
12
u/willvarfar Apr 10 '12
An exceedingly shrewd move; a new generation of coders discover the joy of coding whilst seeing GitHub as the new world. Hats off to GitHub!