- Home /
0x10c - In-game computer CPU - Assembly?
How was Notch/ Markus able to put something like this in his recently 'Cancelled' game? - 0x10C (He used Unity)
Reference Images: http://img.wonderhowto.com/img/92/38/63469583884246/0/hector-martins-alternate-dcpu-16-proposal-would-allow-for-better-c-compiler.300x140.jpg
and
btw: i didn't read anything about he's using Unity for this and in a gameplay video you can see Java code, so i don't think it's made with Unity. He said that he wanted to completely start over, but haven't found any hint about Unity...
$$anonymous$$aybe you've seen something like this:
http://www.youtube.com/watch?v=d9$$anonymous$$P31B$$anonymous$$lwk
But that's not the game Notch made. This is just an emulator for the dcpu-16 made in Unity.
Answer by Bunny83 · Dec 02, 2013 at 08:19 PM
Well, that's simple, write an emulator / interpreter or search for one that works on pure .NET / Mono...
How he was able to implement one? Well, because he can :D
You provided almost no information in this "question". Most people (including myself) probably don't know the game you talk about. So what can you actually do in this "PC"?
edit
It seems he invented his own 16bit processor type. The instruction set can be found here:
http://dcpu.com/dcpu-16/
If you don't know how a CPU works you should better stop right now ;)
I do - but How would I go about in creating a similiar system - ingame monitor allows for ingame coding.
[Published his answer from mod queue and converted it to above comment]
Answer by billykater · Dec 02, 2013 at 09:07 PM
How to design your own system from scratch will most likely need a lot of CS studying. You have to understand what goes on at the basic assembly/instruction level to come up with something like that. The keywords you are looking for is CPU Instruction Set. Lookup the instruction sets of e.g. the 6502 or Z80 and read through them. If you now understand how a program like while(i < 5) i++; translates into those instructions you have all the understanding needed, otherwise you will need to read up on how a textfile gets translated into something a cpu can understand: The compiler.
Implementing these things is the easiest part and will most likely be a loop + switch for the most basic version. Going to JIT/AoT compiled from there is a whole other level and not needed except you are doing something really processing heavy.
Look at how emulators are doing there job to know more about this.
If you want to provide external users with a scripting capability just use a scripting language or let them import .NET dlls.
Your answer
Follow this Question
Related Questions
How to make a Multiplayer Game? 5 Answers
How can i put minigames Inside a 3D Third Person Game 2 Answers
sound registry 0 Answers
Why did Unity 4.5 break my game? 0 Answers
Change assets dir or load assets from other dir to default dir at runtime 0 Answers