PDA

View Full Version : "Programming to the metal"


kevJ420
05-03-07, 09:54 AM
What exactly is programming to the metal? I've heard it used but I don't know what it means.

What I do know is that:


1. Sega let developers program to the metal

2. sony didn't

3. the ps1 used c++ (I could be wrong about this, I don't know much about programming.)

4. the saturn used assembler.

I assume it wasn't necessary on the PS1. But then sony placed restrictions on 3rd parties, while sega didn't.

Would an example of programming to the metal be when Dave Perry did Terminator for the Genesis?

[he found a way to double the genesis' graphics throughput when working on Terminator in 91 and not even Sega knew it could be done. He didn't use the development manual, he went straight on to exploring the Genesis hardware.)

|MaguS|
05-03-07, 09:55 AM
Lay off the crack.

russ_3d
05-03-07, 09:57 AM
is it like 'putting the pedal to the metal'?

thats a driving thing, pushing the accelerator pedal to the floor to make you go fastest..

never heard that before, i must say

Medion
05-03-07, 10:03 AM
What I do know is that:


Stop there, because you don't actually know anything. "Programming to the metal" is an old term no longer applicable to even consoles. Back then when consoles were more simplistic (NES, Genesis, and even SNES), developers had to write their own low level operating system. When making a game for a PC, you programmed for MacOS, DOS, or Windows.

Nowadays, systems have more fleshed out dev tools and a choice of operating environments. They're too complicated for developers to program to the metal anymore. Developers could never program to the metal on a PC, due to the infinite number of configurations.

It's still done today, to an extent. Operating systems are, in affect, programmed to the metal. But that's about it. You're wrong about the Saturn and PS1. Devs could program to the metal on both systems if they wanted, but both were too complicated for almost any dev to do that.

In summary, programming to the metal is writing something that the hardware understands directly, bypassing any operating system(s) in the hardware.

kevJ420
05-03-07, 10:12 AM
Stop there, because you don't actually know anything. "Programming to the metal" is an old term no longer applicable to even consoles. Back then when consoles were more simplistic (NES, Genesis, and even SNES), developers had to write their own low level operating system. When making a game for a PC, you programmed for MacOS, DOS, or Windows.

Nowadays, systems have more fleshed out dev tools and a choice of operating environments. They're too complicated for developers to program to the metal anymore. Developers could never program to the metal on a PC, due to the infinite number of configurations.

It's still done today, to an extent. Operating systems are, in affect, programmed to the metal. But that's about it. You're wrong about the Saturn and PS1. Devs could program to the metal on both systems if they wanted, but both were too complicated for almost any dev to do that.

In summary, programming to the metal is writing something that the hardware understands directly, bypassing any operating system(s) in the hardware.

I read in next gen that Sega allowed it and sony didn't.

I guess you know more than Next Generation. It's certainly possible.

I didn't come up with any of the other things though.

ENU291
05-03-07, 10:18 AM
Hey Kevpla1 what the hell is your obsession with Sega and it's consoles?? Sega has been out of the console business for YEARS!!! GET OVER IT ALREADY! I am so sick and tired of reading all these garbage threads about how much you love Sega. If you love them so much then get a Saturn on Ebay, put a dress on it and live happily ever after... :rolleyes:

Amuro
05-03-07, 10:24 AM
I guess progam to the metal means program at the very low level like using assembly lanuage, machine lanauge..., etc.

superklye
05-03-07, 10:34 AM
I thought it meant programming with some heavy music in the background.

kevJ420
05-03-07, 10:49 AM
Hey Kevpla1 what the hell is your obsession with Sega and it's consoles?? Sega has been out of the console business for YEARS!!! GET OVER IT ALREADY! I am so sick and tired of reading all these garbage threads about how much you love Sega. If you love them so much then get a Saturn on Ebay, put a dress on it and live happily ever after... :rolleyes:

I've had my current (4th) saturn for years.

H3avyM3tal
05-03-07, 01:17 PM
I thought it meant programming with some heavy music in the background.

That would be awesome. Devs should definetly start working this way :cool:

sytaylor
05-03-07, 01:37 PM
That would be awesome. Devs should definetly start working this way :cool:

Any Dev who doesn't either sucks, or works for EA.

Tr1cK
05-03-07, 02:31 PM
I thought it meant programming with some heavy music in the background.

Reminds me of when J.P. was laid back in his office in Grandma's Boy listening to deafening techno while programming for "the future of gaming as we know it." lol

H3avyM3tal
05-03-07, 02:44 PM
Any Dev who doesn't either sucks, or works for EA.

LOL, or both.

Lyme
05-03-07, 04:57 PM
The brief version.
Most development computer systems and development enviroments have been built up to abstract the crude complexities of a system through the use of APIs (Application Programmer Interfaces). The creation and the use of such apis provides the ability for developers to say 'put a circle of this colour and size, here on the screen', by doing something as simple as func_circle(x,y,z,color,radius);

However getting this high level in modern day architectures is much like peeling a onion, there are layers upon layers of abstraction. In a generic sense you have the programmers code -> the operating system function that lets a api link to it's library (where the code for the underlying function lives) -> the library.
Depending on the system that you are using, once you have reached the lowest level of software programmability, you are usualy programming one dialect or another of assembly language. Assembly language in itself does not have any high level constructs, but rather uses things such as: add, subtract, multiply, compare, jump, mov, etc.. The use of these low level constructs requires that you, the programmer, know exactly what will happen when you move the hexidecimal version of a number into a particular memory address. (note: fixed memory addresses are commonly used by hardware [not the cpu] as a register space, just like mapping video memory as a extention to main memory).
When a programmer programs down at the lowest level, it is called 'programming to the metal'. The benifit of this, is that you can optimize the code to do exactly what you want and nothing else = fast. The drawback is that a) it requires intimate knowledge of that piece of hardware b) it is extremely time consuming, compared to programming at a high level.

toxikneedle
05-03-07, 07:25 PM
my brain hurts

Greg
05-03-07, 10:41 PM
3. the ps1 used c++ (I could be wrong about this, I don't know much about programming.)

4. the saturn used assembler.

People have already explained what 'programming to the metal' means, but is it actually desirable?

I worked for an unnamed company on an unnamed game back in this era (PS1, Saturn) and here's an example of roughly what happened since we were making the game for both platforms.

1) PS1 - Major code done in 6months with 1 person, written entirely in C.
2) Saturn - Major code done in 12months with 2 people, 1 person spent 9months coding mostly in Assembly.

In the end, both games looked similar, but the PS1 still had superior graphics and was still faster than the Saturn. The fact was, the PS1 was 2-4x faster than the Saturn and it took loads of programming effort as well as reduced art assets to make it playable on the Saturn.

The end user (game player) doesn't care if the game was written in Assembly or in Java, they just care about gameplay and pretty graphics. The developer however, wants to make a game in the shortest time and lowest budget so they can actualy make a profit and make more games in the future.

I suggested the PS1 was much more powerful than the Saturn, however, the theoretical performance is not what matters, it is the real, immediately accessible performance that counts. The fact is, most developers do not have time to heavily optimize game code. It is not that they cant or wont, but that they are severely time pressured. This is the case with current Xbox and PS3 platforms.

A side note for the Dreamcast fans... The Dreamcast had more accessible performance than the PS2 and was a joy to program. Pity it was a market failure. The final generation of PS2 games finally surpassed what the early generation of Dreamcast games could achieve.

All my opinion.

|MaguS|
05-03-07, 11:08 PM
Final Fantasy X alone was far better graphics then anything released on the Dreamcast. Hell show me a single game on the Dreamcast that can come close to MGS2.

As for PSX vs Saturn, The Saturn had very poor 3D capabilities, it originally wasn't even designed to handle 3D untill Sony unveiled the PSX with is why 3D games on both platforms always looked better on the PSX.

With the Dreamcast Sega fixed all the issues but the system had two faults, very poor software support (too many arcadish games) and no protection. Piracy was so easy and everywhere with the Dreamcast that many developers didn't even bother to release titles on the system since profit was low for the system. The hardware sold well in the beginning but poor advertisement (what happened? Saturn had great, DC had ****) didn't help keep it going once the PS2 was announced.

Subtestube
05-04-07, 02:28 AM
The benifit of this, is that you can optimize the code to do exactly what you want and nothing else = fast. The drawback is that a) it requires intimate knowledge of that piece of hardware b) it is extremely time consuming, compared to programming at a high level.

It's also worth noting that very low level coding is not at all workflow friendly, and is only useful for very specific tasks. Good C/C++ compilers can approach assembly speeds in most cases. Only certain tasks for certain systems, for which the hardware is esoteric and difficult to automatically optimise, are really worth actually writing assembler for. The PS2 is a relatively modern system for which low level coding is still often worthwhile, as it's difficult to automatically make good use of specialised memory areas it provides, and the fact that it has 2 vector units, of which only 1 is usually used.

nemecb
05-04-07, 11:42 AM
Good C/C++ compilers can approach assembly speeds in most cases.
^This is the important point regarding this topic.^

Nobody codes this low-level anymore because compilers are in most cases better at optimizing code than individual programmers anyway. Unless it's a very specific thing you need to do, or you are so arrogant you think you can optimize better than an entire compiler team, you just don't do it. Not to mention the fact that writing a modern game in ASM would be next to impossible. It's hard enough to write bug-free code using all the tools to assist you.

kevJ420
05-04-07, 12:36 PM
Final Fantasy X alone was far better graphics then anything released on the Dreamcast. Hell show me a single game on the Dreamcast that can come close to MGS2.

As for PSX vs Saturn, The Saturn had very poor 3D capabilities, it originally wasn't even designed to handle 3D untill Sony unveiled the PSX with is why 3D games on both platforms always looked better on the PSX.

With the Dreamcast Sega fixed all the issues but the system had two faults, very poor software support (too many arcadish games) and no protection. Piracy was so easy and everywhere with the Dreamcast that many developers didn't even bother to release titles on the system since profit was low for the system. The hardware sold well in the beginning but poor advertisement (what happened? Saturn had great, DC had ****) didn't help keep it going once the PS2 was announced.

Well the dreamcast did have better textures, and possibly better audio, but possibly not.

The dreamcasts advertising was pretty damn retarded, with the it's thinking fag****.

The reason I read why was because sometime after late 1995 advertising and starting sometime in 1996 Sega switched to a different advertising agency.

I'm not sure which advertising agency they were with when they made the ad with the woman covered by screenshots.

However, a lot of Sega of America's management left in 96, b/c of conflicts with Sega of Japan. The people at SOA that left in 96 were the coolest people in the world. Tom Kalinske was largely responsible for Sega's marketing and he left in 96, so that was when the advertising went downhill.

I remember the Ione Skye and Ice Cube ads sega had (c 1995) and how attractive their hardware and software packaging was. They also usually didn't have stupid box art like a lot of Super NES and NES games did.

Lyme
05-04-07, 03:39 PM
[QUOTE=nemecbNobody codes this low-level anymore because compilers are in most cases better at optimizing code than individual programmers anyway. Unless it's a very specific thing you need to do, or you are so arrogant you think you can optimize better than an entire compiler team, you just don't do it. Not to mention the fact that writing a modern game in ASM would be next to impossible. It's hard enough to write bug-free code using all the tools to assist you.[/QUOTE]

IMO that is a little too much of a generalization. There still is a need to program to the metal, which you can do in c++ btw, for one major reason:
New hardware. The low level code that the APIs use, must be written. Without that written you cannot use the hardware.
However that being said, no software development company in their right mind (especially game developers) will write to the metal. It is a waste of time and resources.

Developers need to trust that the manufacturer of the platform has put a lot of time and effort into tweaking and optimizing the software for their hardware. In cases such as the 360, we know that Microsoft through direct work (things specificly done for the 360) and the use of indirect work (general os/compiler development) has put a amazing amount of cash into their product.

As such Programming to the metal is dead for anything other than driver development.

nemecb
05-04-07, 04:52 PM
IMO that is a little too much of a generalization. There still is a need to program to the metal, which you can do in c++ btw, for one major reason:
New hardware. The low level code that the APIs use, must be written. Without that written you cannot use the hardware.
Well, obviously hardware and compiler devs are going to have to work on a lower level, but they do it because they have to. Those things exist to provide an interface for higher level stuff. When I said nobody does it I meant people writing user applications (though I suppose a compiler could be considered one of those, but I did mention compiler writers as a specific exception;)) like a game developer. In any case it sounds like we agree, so I'll stop attempting to cover for the assumptions I made in my previous post.:D

ViN86
05-04-07, 05:59 PM
is KevJ420 kevpla1? im so confused... :confused:

nemecb
05-04-07, 07:57 PM
I'm pretty sure he is. Somewhere there's a thread about it.

Edit: Err, brain malfunction. I need to stop reading his threads apparently.