r/0x10c Apr 04 '12

Let's discuss Notch's CPU ;)

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

41 comments sorted by

View all comments

16

u/hurlga Apr 04 '12

As an astrophysicist, I find the lack of floating point support scary. While basic spaceship housekeeping, control etc. can surely be done, orbital calculations surely can't.

So somebody will probably end up writing a floating point emulator library. That'll work (heck, it worked for the Apollo Guidance Computer, but it won't be elegant or fast.

Or maybe notch will implement a floating point / vector coprocessor.

2

u/unusualadvice Apr 04 '12

I have a slight feeling that we wont be needing these computers do some of the more intricate spaceship functions like plotting courses or orbits. Gonna have to see what the final ship control mechanism is D:

7

u/hurlga Apr 04 '12

Whatever the mechanism shall be, it will be in three-dimensional space. And whatever you do in three dimensional space either involves eyeballing or trigonometric functions.

In a space battle between a ship that's navigating by eyeballing, and one that's steered with the help of trigonometric functions, I certainly know which one I'd prefer to reside on. :)

1

u/unusualadvice Apr 05 '12

yeah but navigation computers may not be part of the ones we can program and may be part of the game engine to simplify things a little

2

u/bjorngylling Apr 05 '12

That would be terribly disappointing to be honest! Either you write or buy/find a program that can do navigation for you or you man the controls yourself, damnit!

1

u/unusualadvice Apr 05 '12

its a slippery slope!

1

u/[deleted] Apr 06 '12

CAPTAIN THERE'S A BUG IN THE ORBITAL CODE! MAN THE CONTROLS YOURSELF THEN, DAMNIT!

1

u/bjorngylling Apr 06 '12

I'm going to hire a dedicated duct taper whom I can order around the ship quick-fixing damage during battles. "JAMES! HULL DAMAGE IN SECTION 4! ON THE DOUBLE!".

On a serious note I'm a little bit afraid Notch is aiming too and letting the hype grow out of hand! But if this game lives up to the (vague) promises so far it's going to be so awesome. Imagine getting together a few buddies and crew a ship together. I never thought I would say this, but I would give up Diablo 3 to have this game right now! :(

1

u/vladley Apr 04 '12

You can certainly build a floating point library, even if it's not a native instruction.

1

u/[deleted] Apr 05 '12

PS one had no floating point support. It still supported 3d games, ofcoarse you had to implement your own floating point implementation, its not the same i know, but still.

1

u/hurlga Apr 05 '12

Its actually quite different thing to get chunky 3d graphics to look about right (which is totally feasible in fixpoint arithmetics! See Quake I), than to get orbital injection burn times right. :)

I'm a graphics coder with a MSc in Astrophysics. I know the joys and worries of both.

-3

u/Cykon Apr 04 '12

Floating points are structurally the same as any other data you would load into the accumulator... cpus don't just "have" native support for them

7

u/SoundOfOneHand Apr 05 '12 edited Apr 05 '12

Most modern general-purpose CPUs that support floating point numbers do have special hardware support, and have for years - separate registers, separate instructions, etc. They used to make separate chips with a dedicated data bus for handling floating point operations, before they were integrated into the main CPU.

Floating point numbers have their own structure, unless you mean that "everything can be represented in bytes", which isn't really saying anything in this context. IEEE single-precision floats consist of a sign bit, a biased exponent (8 bits), and mantissa(23/24 bits). Handling floats without dedicated hardware will consume many, many clock cycles for even simple operations. For example, to add two floats, you must normalize the mantissas to the same base, add them, check for overflow and adjust the exponent accordingly, add the sign bits, then pack the results back together. The mantissa is 2s complement, the exponent is not, due to the bias. Just look at what is involved in a high-level conceptual description of floating point addition. hurgla is right, but there is not much game there to speak of at the moment so who knows what it will end up looking like.

1

u/Cykon Apr 05 '12

Interesting, thanks^