Why HL2 is made in c++?

Originally posted by Kincaid
Yes, yes it is. The shit of a bull. And it's bullshit that's been there on the ground for a while. So it has some insects taking up roost. Real disease-infested. Thus is the proprietary nature of MS.

Looks like Kincaid hates microsoft so much. :D
 
Don't get me wrong, a little sh*t here and there a few f*cking good comments are fine, I don't want to ban those words from the board as I use them too, but I don't try desperatly to put them into every sentence multiple times.

I don't like Microsoft too, but I want to play my games, so I have to have Windows XP. If every game would run on Linux Microsoft could kiss my ass.
 
Well haha... more critics in here...

ok let me explain some more..

1) c# is slower than c++.. yikes, come on you guys had far better machine than i have, can't your processor + memory + graphics card support it.. remember half life 2 is gear towards powerful machines...

2) why not java? Do you know there is a battle game, not sure the name, but it is a war planes flying here and there (3d plane simulator). They use java AOT .. i think so.. but i definitely know it is java and it is smooth!

3) Well i don't hate microsoft. I like them a lot. I am using windows xp and it works fine for my development. I had nothing to say here.

4) well some may say, i hate .net bcs each client machine need to have ..net framework that size around < 40 MB. Ok let see games nowadays like Metal Gear Solid 2 Substance on PC - 7.2 GBytes... 40 MBytes is nothing. Just like you install Directx9 runtime.

5) Well yeah i admit, as long the game is nice, why c# or c++? i don't care as long i can play it and happy with my money spent. Well, if game developers code with c#, you can faster game produced... hehe! C# is definitely easier than c++ 1000 times... i know that.

6) C# is used in games.. why not? You must know something, example the game engine i am using now, tv3d. The performance is not as good as delphi as because it uses com interop to call the engine. Hehe!

7) Why c++? Many will say it is more to cross platform? Opengl and Directx. Well again, let us talk about windows, linux and apple mac.

Linux - mono framework
Windows - .net framework (no windows 95 support - it sux.. who wants to play here)
Apple Mac - rotor framework..

So why can't c# uses here? Well, need to mod a bit of code... even you code in c++, you need to modify something.. just like moving directx codes into opengl.. (code in oop approach) 3d rendering is 1 section, and phyiscs is 1 section (example ok)

So again, please shoot me if you want to.

I am here for comments. Hehe!
 
I am pretty sure that Valve know what they are doing, and if they decided to use C++ then they will have very good reasons for that.
 
You write games and applications in C/C++ because you want execution speed. Execution speed does not go hand in hand with either .net, Java or Visual Basic.

And Delphi is just Pascal with oop. And because Pascal was never desinged for oop it just sucks.
 
Execution speed.. hmm.. can you tell more on that?

Well i don't know whether valve had a good reason why they choose c++?

I just feel that the game developers nowadays are influenced by everyone.. bcs of valve or some big companies code c++, i will code c++ too...

This happen to my country.. hehe! so kind of mad of it!
remember, .net are meant to save up the trouble of c++..

Well, sorry valve.. i am not here to cause trouble.. but i want to know what the community thinks?
 
I'd have programmed Half-Life 2 in Turing.
 
Half Life 2 has been in the developement phase for the last 5 years. .Net only came out 2 years ago. I doubt anyone at Valve was too enthusiastic about dropping everything to learn the .Net programming environment and C# langauge at the time. Sounds like something 3DRealms would do.
 
Execution speed.. hmm.. can you tell more on that?

Well i don't know whether valve had a good reason why they choose c++?

I just feel that the game developers nowadays are influenced by everyone.. bcs of valve or some big companies code c++, i will code c++ too...

This happen to my country.. hehe! so kind of mad of it!
remember, .net are meant to save up the trouble of c++..

Well, sorry valve.. i am not here to cause trouble.. but i want to know what the community thinks?

Execution speed is how fast the program runs. And it doesn't matter if any game is geared towards powerful machines, you want to squeeze out as much efficiency as possible NO MATTER WHAT. C++ almost perfectly reaches that point of HUGE amounts of power in the use of pointers and classes (and inheritance) and also fairly fast at the same time. And it isn't fast enough for ya? Plug some Assembly into your C++ code.

The reason why they're using C++ is because it is the fastest, most powerful, and also one of the easiest languages on the market. C++ is used so widely for one damn good reason, and that is it.
 
oh okay... is it bcs c++ can talk to hardware...

hmm.. i had no idea whether c++ or c# can do that.. haha!

well, but c++ is the fastest, most powerful and hardest to learn.. LOL!

Thanks for the comments. Sounds reasonable.
 
If by talk to hardware, you mean use DirectX, yes. Both C# and C++ can use Direct, and the DX9 SDK even comes with libraries for C#, C++, and Visual Basic .NET.

Oh, and C++ is easy as hell to learn if a) you're excited about it and b) you think about what applications a certain feature of C++ can have (i.e. pointers). I never found it hard to learn AT ALL.
 
And just to back the point about execution speed up, any .net language is inherently slower because it doesn't compile down to machine code, it gets compiled down to MSIL and that's compiled on the fly into machine code at runtime, which slows the whole thing down.

For apps that aren't so performance hungry as games .net kicks ass, but games need every drop of juice they can squeeze out of the CPU.

And yes, .net is very MS specific, but in theory, it's possible to port the whole .net framework, then every .Net app can work on Linux, quite possibly without any recompilation. I'm sure there's got to be someone working on it somewhere...
 
Originally posted by chuawenching

1)remember half life 2 is gear towards powerful machines...

Actually its vise versa. Valve knowing that alot of people in the comunity still running on a low end machines, took it into consideration and as they said, the minimum is gonna be 700Mhz, 128mb of ram, 32mb of video, sound card and DX 9. The game that is geared towards the power machines is Doom3. I doubt alot of people are gonna be able to run it normaly without making some upgrades to memory, cpu and even graphics.


2) why not java? Do you know there is a battle game, not sure the name, but it is a war planes flying here and there (3d plane simulator). They use java AOT .. i think so.. but i definitely know it is java and it is smooth!

Yeah ok, Java. But most of the games you gonna see are made for internet. Besides, (no offence Valve) but they would be really stupid to code Half Life 2 in Java. Jeeees


5)Well, if game developers code with c#, you can faster game produced... hehe! C# is definitely easier than c++ 1000 times... i know that.

Nah, no matter how hard you gonna try, C# is simply not the way for game development. I mean, you gonna see few games made in C#, but its just not the language to use, at least for now.
Ohhh, and if you know one language, C++ for instance or C#, then the difference is not big, so youll be able to use the same coding techniques as well. And C++ aint hard at all man, just gotta understand it and most of all write as many programs as u can. Even if they are just small programs.
Cheers ;)
 
Originally posted by Zynaps
You write games and applications in C/C++ because you want execution speed. Execution speed does not go hand in hand with either .net, Java or Visual Basic.

And Delphi is just Pascal with oop. And because Pascal was never desinged for oop it just sucks.

C was neer designed for OOP, does that mean C++ is crap?
 
garbage collection means slower interpretation/compiling/executing... basically c# has more overhead and c++ is pretty low level when it comes to high level languages
 
Hmm.. well c++ is not hard... well i had been looking the codes for years.. maybe i am stupid.. haha!

well yeah .net is slow bcs it depends on a virtual machine same to java...

Grid, where you learn c++.. sounds good recommendation.. learn c++ so i can code games for better.. i hate normall c++ books, they give me business example.. or small kids example.. boring!

Haha! way to go!

I just wonder again, in windows, you normally dont need anything and you can run c++ app right. If not mistaken, c++ is somehow build into windows and windows understand it. But in all future windows OS, the .net framework is part of it.. so why worry?

Thanks for the comments.
 
You say c++ can do something which c# cannot do..

well i seen c++ can do mouse gesture recognition and i did mouse gesture recognition... so is that counted as low level..

well i do believe i can do anything on c# as long c++ can do...

Hmm.. garbage collection is slow.. no idea.. but if you do not know how to handle memory in c++.. i think it will be hell slower than GC.. haha!
well i can't create an engine.. i am half way learning...
 
java are not meant for only internet games (applets).. maybe this is last time..

java can be used in mobile games.. well more off topic.. okok c# vs c++..

just wonder, why can't someone from valve give comments on this?
 
Funny most ppl critize they hate microsoft, uses windows xp at home..

i had a friend in college, he is a true hard core linux fan.. ask him all linux question and he can answer...

but when i went to his house, he does not have linux at all.. only windows xp.. the worst part he had an original windows xp professional box!

Hehe.. what is this? Funny person..
 
maybe one day C# will the language for games..but not now.
ppl used to say C++ is far too slow for game programming, but when CPU speed goes up, doesnt really matter anymore
 
Originally posted by Epsi
And just to back the point about execution speed up, any .net language is inherently slower because it doesn't compile down to machine code, it gets compiled down to MSIL and that's compiled on the fly into machine code at runtime, which slows the whole thing down.

For apps that aren't so performance hungry as games .net kicks ass, but games need every drop of juice they can squeeze out of the CPU.

And yes, .net is very MS specific, but in theory, it's possible to port the whole .net framework, then every .Net app can work on Linux, quite possibly without any recompilation. I'm sure there's got to be someone working on it somewhere...

I believe that .Net can be compiled down to an executable (Java can too for that matter) that wouldn't have the over head of a VM. But inherently, C++ allows the programmer to tweak their code on a much lower level than C#, allowing for a lot of efficiency tweaks. chuawenching's argument that HL2 is geared to high end machines isn't true, but even if it were, that still wouldn't be a reason to switch to .Net and C#. The overhead that you get with C# would not translate to a better gaming experience and that is what Valve has behind every decision that they make. It's one thing to up the graphical capability at the expense of speed, but there's no point in switching programming languages when the user will see absolutely no benefit.

That's my primary guess as to why Valve stuck with C++. Other reasons would include:

1 - C# is proprietary and there's always a fear associated with programming in a proprietary language rather than one that's controlled by an organization well represented in the programming community.

2 - C# wasn't out when Vlave started working on HL2. Switching languages at that point would have negated any speed you gain from the ease of coding in C# (see the next point).

3 - C# isn't that much faster to program in than C++. Especially when you're dealing with game programmers who have been using C++ for quite a while. I'm sure it's amazing to watch them code with a language they've been using for so long!

4 - Just reiterating my statement in the paragraph above. C++ allows programmers a much lower level access to what their code is doing. A good programmer is create many times more efficient code with C++ than C#, especially when dealing with as much processing power (from both the GPU and CPU) as a game would need.

Those are the 4 main reasons why I think that Valve's using C++. I'd love to see everyone's comments on this. This is a great thread, btw.
 
C++ is a much more widespread language and its fast. Most higher level languages like C# and Java are slightly slower. C# still packs a punch though, and its getting faster and faster, + it has DX support. Modern languages like C# have Java have 1 thing over C++ though, and thats the much more streamlined class system. C++ will eventually be replaced for this simple reason, C# allows you to create things much faster, even if theres a small performance difference. If that wasnt true we would still be programming in assembly cuz its so fast :p
 
Originally posted by sys202
Why not Java? Ah I know.. too slow. Damn, bloddy Sun.
Haha, Java is a piece of shit I hate so much. Even the name is crappy.
 
Originally posted by Kincaid
I think it's we're 'battle-hardened' from the past. Windows95 was utter shit. They released 3 different 'patched' versions and all were shit. Stable as nothing. User-friendly my left ass cheek. Etc.

Windows98 wasn't much better. More user-friendly for point and click functions but still not stable.

Still three revisions of that. Win98, Win98SE and WinME. All sucked for the most part.

WinXP has been the only thing that can touch on stability and reliability. You'll still find areas that are utterly full of shit in WinXP. But for the most part it's good.

That's why I say it's still the past creeping up.

You forgot Windows 2000 Pro :) Imho, still the most stable and reliable OS that Microsoft has ever produced.
 
Originally posted by Yatta
Haha, Java is a piece of shit I hate so much. Even the name is crappy.

Java is great when used for an application that uses it's strengths (multi-platform compatibility, a true OO programming experience, a very well documented set of pre-written classes for your code to access, etc). However, gaming does not really need any of those strengths at this time (multi-platform compatibility would be cool, but not at the extreme expense of speed that you'd see).
 
Originally posted by chuawenching
Grid, where you learn c++.. sounds good recommendation.. learn c++ so i can code games for better.. i hate normall c++ books, they give me business example.. or small kids example.. boring!

Well depends what you wonna learn. If its game programming i suggest you read books on DirectX (thats what I learn, but you can study OpenGL if you like it) and Win32 Programing (get a book or 2 at most, youll have a better understanding and will help you in the long run, you never know). Ohhh and before you go into all that DirectX stuff and Win32 API, you should have a good understanding of C++ and OOP. If not, you should start off at the ground ups - Win32 Console. It might sound boring, but hey everyone started there. Besides you can do some pretty cool stuff with it and even small games hehehe (ehh good ol days ;-)
And if you dont like books and all that stuff, then check out sites like
GameDev.net
FlipCode
GameTutorials
OpenGL
DirectX

Well that should be enough for now...
Cheers ;)
 
I'll comment on this, since I'm an MCSD.NET.

.NET is still a young technology, so I imagine Valve wanted to use something they already knew.

As many have said, the most likely reason for not using C# was the game started development before C# and the .NET framework were released.

Plus the third-party libraries they are using (Havoc) are in C and C++ also, so if they tried to use "managed code" (.net framework) with unmanaged libraries (C, C++) they would suffer a performance hit from converting the calls to the libraries (a process called thunking).

Companies will continue to use C and C++ for game development for a while until they have time to prototype a few games in C# to see if there are any advantages.

Plus, if you ran a .NET game you would have to ensure your computer had the .NET framework installed. The latest Windows XP clients have most of the .NET framework libraries, but older systems may not run the framework as well.

.NET does make it easier to build business and web applications that can integrate better with each other, but I'm not sure if making a game in .NET would be any easier than doing it with good code design and libraries in C++.

I plan to try out the .NET Framework with the DirectX 9 SDK later this year, but only to prototype business charting applications.

I think it will take a few years before the game development community fully embraces .NET. By then the framework hopefully will have stabilized and someone will have pushed out a successful .NET game by then.
 
Hey, since they're at it, why don't they just program Half-Life 2 in SmallTalk? Wheeeeee!
 
As a director of a software company and someone that has been programming for 22 years, I can tell you from experience there are several issues here.....

In no particular order:
1. What language best fits my application for speed requirements.
2. What language lets me develop in the shortest time.
3. How common is the language (which equates to how expensive are the programmers and how easy are they to replace should they get knocked down by a car)
4. What platforms am I going to support.
5. How easy is the coding estate to maintain (shared sources)
6. What resources do I already have (people and code).

These questions for Valve are very significant when looking at 5 years of development.

They need speed over development time which rules out RAD languages like Visual Basic and Delphi. They already have a lot of staff experienced in C and C++ and being fast multi platform languages with plenty of programmers who know them, it was pretty much a no brainer on choice. No gaming software company would pick a lanuage that may restict platform conversion......is there a C# compiler for the PS2?

At the end of it all though, people like me always ask one question first....how much is it going to cost.
 
Well no.. no c# for ps2.. haha!

Well, again someone can create.. why not? They can create for c++ like codewarrior why not on ps2...

hehe!

Why too many factors to consider? Maybe what youguys say might be true...

Thanks for the comments too.
 
Wasn't that game "Vampire: The Masquerade - Redemption" made in Java?
 
I've programmed extremely simple games in a programming language called MATLAB... sorry to sound patronising but i think the only people who use this are scientists and engineers who use it to solve impossible equations. Anyone ever heard of it...???

Compared to C++ this is like programming in treacle, with a blindfold on, your fingers tied together, and a hooker sucking your chopper. Then again it could probably be used to program physics quite effectively. Hmmm...

Anyway my point is.... (yes there is a point). Different languages are used for different things... and C++ just so happens to be the most effective for games IMO. And as everyone understands it in the industry and it's still effective there is no point in changing.

I'll post my version of MATLAB HL2 here when i finish. If we're still alive...
 
I'll post my version of MATLAB HL2 here when i finish
--> you kidding?

Wow is mathlab right?
 
"Why HL2 is made in c++?"

because if it was made in html it would suck :D
 
Back
Top