Thief 2 source code leaked
Page 1 of 2 Goto page 1, 2  Next
inz




Posts: 11914

PostPosted: Sun, 12th Dec 2010 12:25    Post subject: Thief 2 source code leaked
http://www.ttlg.com/forums/showthread.php?t=134091

Nice bit of news for Garrett fans - of course it all needs to be sorted out (and probably patched up too a bit, depending on how incomplete it turns out to be) but given time, this should help the community get rid of some hardcoded limitations and shortcomings that currently exist in the Dark engine. A little polish with some new graphical effects certainly wouldn't hurt, either. Wink
Back to top
Epsilon
Dr. Strangelove



Posts: 9240
Location: War Room
PostPosted: Sun, 12th Dec 2010 12:31    Post subject:
lol this code is a mess, still it's interesting to look at.
It's mostly C and some asm AND C++ really what a mess.
Goodluck to those who only know C#.
Back to top
inz




Posts: 11914

PostPosted: Sun, 12th Dec 2010 12:38    Post subject:
Epsilon wrote:
lol this code is a mess


Aww, say it isn't so. Crying or Very sad

At the very least I hope they can sort out the polygon cap on the NPC's, those weren't anything special to look at 10 years ago, let alone now.
Back to top
Yuri




Posts: 11000

PostPosted: Sun, 12th Dec 2010 16:27    Post subject:
OMG... this proves it! C++ knowledge is infinitely more useful than C# in game programming! Well don't know about other stuff but what is the general consensus?



1 and 2 are still amazing.
Back to top
madmax17




Posts: 18709
Location: Croatia
PostPosted: Sun, 12th Dec 2010 17:13    Post subject:
Interesting, there sure are a lot of files, mostly in C, couldn't find any concrete gameplay stuff like if water_arrow==flame lights_out Very Happy

Probably doesn't work that way.
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 17:47    Post subject:
yuri999 wrote:
OMG... this proves it! C++ knowledge is infinitely more useful than C# in game programming! Well don't know about other stuff but what is the general consensus?


C++ is a must for a game engine, and all performance intensive tasks. By comparing C++ and C# by some generic tasks, the speed difference isn't that great, but when you get to really optimizing your code, C++ will be MUCH faster.

It gives you complete control over memory, so you can align stuff to different boundaries, which is important if you want the data to be optimally placed in CPU cache. It allows you to use SSE, which makes it possible to process 4 pieces of data at once (theoretically giving you 4x speed boost) for problems that can be parallelized in such manner. Those two are probably the most important low-level differences, although there are many more. (Its probably possible do most of that in C# too, by using some hackity way, which defeats the purpose, and makes it more difficult than just making it in C++)

Gameplay and rest is usually C# or some other scripting language because its much easier to work with and maintain.

If you're doing a small game however, where you have resources to spare, C# or some other higher level language will do, and will make things easier.
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Sun, 12th Dec 2010 17:50    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:38; edited 1 time in total
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 17:56    Post subject:
garus wrote:
What BearishSun said. If you plan to make a big, optimized game by yourself, then good luck Razz


Don't get me started on that Very Happy A couple of years ago me and my friends set out to create a fully fledged MMO. Me being the only programmer. Now that was a blast lol.

One year, and 30 000 lines of code later:

Suffice to say, we got nowhere. Barely got the basic stuff implemented. I'm still pretty proud if it though.
Back to top
Overlord123




Posts: 2335

PostPosted: Sun, 12th Dec 2010 18:38    Post subject:
yuri999 wrote:
OMG... this proves it! C++ knowledge is infinitely more useful than C# in game programming! Well don't know about other stuff but what is the general consensus?

http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/
http://www.csharp-architect.com/images/benchmarksJan2009Final.gif
http://www.codeproject.com/KB/cs/CSharpVsCPP.aspx
Note: These are not based on .NET 4, which is more optimized than previous versions.
Back to top
peter980




Posts: 1977

PostPosted: Sun, 12th Dec 2010 19:01    Post subject:
BearishSun wrote:
It gives you complete control over memory, so you can align stuff to different boundaries, which is important if you want the data to be optimally placed in CPU cache. It allows you to use SSE, which makes it possible to process 4 pieces of data at once (theoretically giving you 4x speed boost) for problems that can be parallelized in such manner. Those two are probably the most important low-level differences, although there are many more. (Its probably possible do most of that in C# too, by using some hackity way, which defeats the purpose, and makes it more difficult than just making it in C++)


Those parts that where done in asm, where probably also done so for performance reasons. I still remember a talk with Civ3 developer who explained that while whole game was done in C, most of the pathfinding routines were done in assembler, since they were most CPU intensive tasks in the game.
Back to top
LeoNatan
Banned



Posts: 73193
Location: Ramat Gan, Israel 🇮🇱
PostPosted: Sun, 12th Dec 2010 19:07    Post subject:
BearishSun wrote:
yuri999 wrote:
OMG... this proves it! C++ knowledge is infinitely more useful than C# in game programming! Well don't know about other stuff but what is the general consensus?


C++ is a must for a game engine, and all performance intensive tasks. By comparing C++ and C# by some generic tasks, the speed difference isn't that great, but when you get to really optimizing your code, C++ will be MUCH faster.

It gives you complete control over memory, so you can align stuff to different boundaries, which is important if you want the data to be optimally placed in CPU cache. It allows you to use SSE, which makes it possible to process 4 pieces of data at once (theoretically giving you 4x speed boost) for problems that can be parallelized in such manner. Those two are probably the most important low-level differences, although there are many more. (Its probably possible do most of that in C# too, by using some hackity way, which defeats the purpose, and makes it more difficult than just making it in C++)

Gameplay and rest is usually C# or some other scripting language because its much easier to work with and maintain.

If you're doing a small game however, where you have resources to spare, C# or some other higher level language will do, and will make things easier.

The smartest thing to do is indeed to combine C++ (w/ ASM optimizations - this is the real performance puller) and C# to get the best of both worlds.

But a word on .NET performance; what you say is not true anymore. With ahead of time compilation, most of what makes CIL slower is removed. While true that in some fields .NET is still a little slower (mainly from full object oriented overhead), claiming that C++ is so much more is a gross exaggeration. As you say, almost everything can be accomplished with C# that can be with C++, and I disagree that these are considered hacks; C# is a powerful language (and CIL of course, but not all .NET languages), and it's for a reason.
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Sun, 12th Dec 2010 19:09    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:38; edited 1 time in total
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 19:14    Post subject:
@iNatan

I said that. They are close in performance unless you go into really optimizing the code, and thats where the real differences appear.

You cant use SSE with C#, at least not in a way I know of. That means its at least 4 times slower. (For problems that can benefit from SSE, and those are plenty in games)

You also can't align stuff to cache lines, and with memory latency being a huge bottleneck with todays CPUs, this has great importance on performance. (Although you might be able to do this with unsafe code in C#, i'm not sure)

And what you say about asm is true, it can help with optimizations, but compilers today are so good, that you really really need to know what you are doing, unless you run the risk of ruining the performance instead of improving it. Using asm block essentially tells the compiler: "dont optimize this code". Compiler optimizes the code globally, and that's really hard(impossible) for a programmer to do, which is why local asm blocks can cause issues.
Back to top
mehee




Posts: 331

PostPosted: Sun, 12th Dec 2010 19:17    Post subject:
calling c# a programming language is a pretty far shot
Back to top
LeoNatan
Banned



Posts: 73193
Location: Ramat Gan, Israel 🇮🇱
PostPosted: Sun, 12th Dec 2010 19:23    Post subject:
@BearishSun There is talk that Microsoft will finally introduce SIMD support sometime soon, but this talk has been for a while. Laughing

ASM routines are usually used for very specific tasks, not project-wide coding, so if you know to write these routines, you probably know what you are doing. Wink
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 19:31    Post subject:
I think the final conclusion should be: learn both C++ and C#. They're great languages.

@garus thanks Wink
Back to top
Paintface




Posts: 6877

PostPosted: Sun, 12th Dec 2010 19:36    Post subject:
nice , were these leaked on purpose or stolen ... ? i remember all the drama with the HL2 source being leaked Smile

That said what are the big games that had their source out in the open , legit or not?
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 19:41    Post subject:
I know of Freespace, Saga of Ryzon and Prey.
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Sun, 12th Dec 2010 19:46    Post subject:
Bearish can you give us a little outline on how you created the game?

(Development environment, used external libraries(?) and so on)


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 20:32    Post subject:
We used Unity 3D which is really easy to get into. It had all the rendering, audio and and basic network stuff. I extended it with AI editor, resource streaming and management, level of detail and multiplayer capabilities(although the low level support was already there).

Other than that it was mostly simple stuff, gameplay scripting and such.
Back to top
ixigia
[Moderator] Consigliere



Posts: 65035
Location: Italy
PostPosted: Sun, 12th Dec 2010 20:39    Post subject:
@BearishSun
Awesome, I'm not into programming, but I recognize that you have a lot of talent. Keep working on it!
Back to top
consolitis
VIP Member



Posts: 27318

PostPosted: Sun, 12th Dec 2010 20:44    Post subject:
BearishSun wrote:
Prey


Source? This is the first time I read this!


TWIN PEAKS is "something of a miracle."
"...like nothing else on television."
"a phenomenon."
"A tangled tale of sex, violence, power, junk food..."
"Like Nothing On Earth"

~ WHAT THEY'RE TRYING TO SAY CAN ONLY BE SEEN ~

http://www.youtube.com/watch?v=CHTUOgYNRzY
Back to top
BearishSun




Posts: 4484

PostPosted: Sun, 12th Dec 2010 20:45    Post subject:
consolitis wrote:
BearishSun wrote:
Prey


Source? This is the first time I read this!


http://www.3drealms.com/news/2006/10/prey_sdk_released.html

From what I can tell it contains all the game source code. I haven't tried compiling it myself though.

Thanks ixigia. We stopped working on it almost a year ago sadly... Most of the team got "real" jobs and didn't have enough time.
Back to top
SilverBlue




Posts: 1747

PostPosted: Mon, 13th Dec 2010 03:11    Post subject:
Paintface wrote:
nice , were these leaked on purpose or stolen ... ? i remember all the drama with the HL2 source being leaked Smile

That said what are the big games that had their source out in the open , legit or not?


Dont know if I would call it a big game, but Jagged Aliance 2' source code was also released.
Back to top
Epsilon
Dr. Strangelove



Posts: 9240
Location: War Room
PostPosted: Mon, 13th Dec 2010 04:20    Post subject:
SilverBlue wrote:
Paintface wrote:
nice , were these leaked on purpose or stolen ... ? i remember all the drama with the HL2 source being leaked Smile

That said what are the big games that had their source out in the open , legit or not?


Dont know if I would call it a big game, but Jagged Aliance 2' source code was also released.

I'd certainly call it so.
Back to top
Spazmotic
VIP Member



Posts: 3107

PostPosted: Mon, 13th Dec 2010 04:25    Post subject:
I've been toying with that Unreal Source for a while now..Man it's a mess, no wonder it takes a full development team to make anything out of it.
Back to top
HunterHare




Posts: 742

PostPosted: Mon, 13th Dec 2010 05:11    Post subject:
a lot of talents on these forums, you guys should group up and become a mod team, teams like they had around the times of games like half life1, bf1942, and UT2K4. I dunno if games are as easily moddable today but if they are then make a badass total conversion mod, leave out some features or make some annoying bugs and start asking for donations to fix stuff and make it better... something like that Smile and if all goes well valve will hire you for their next game to


Phenom II X4 965 @ 3.8 // 4GB DDR3 // GTX 285
Back to top
dodger2020




Posts: 3537

PostPosted: Mon, 13th Dec 2010 07:09    Post subject:
Paintface wrote:
nice , were these leaked on purpose or stolen ... ? i remember all the drama with the HL2 source being leaked Smile

That said what are the big games that had their source out in the open , legit or not?


Falcon 4.0 was leaked quite a few years ago

I think a couple of years ago someone leaked the source code for the Eve Online client. Can't remember if it was just a partial or what though.

There are a lot of smaller indie games that had their code released legit though. Gish, Darwinia, and Multiwinia to name three

And I think Return to Castle Wolfenstein and also Wolfenstein: Enemy Territory recently were released under the GPL.
Back to top
Areius




Posts: 14809

PostPosted: Mon, 13th Dec 2010 10:35    Post subject:
Epsilon wrote:
lol this code is a mess, still it's interesting to look at.
It's mostly C and some asm AND C++ really what a mess.
Goodluck to those who only know C#.
I disagree, if you understand how C# works (internal) instead of copying everything from the internet it's not a big deal to move to C++. I started with Delphi, C# and then I switched to C and later C++, no problems at all really.
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Mon, 13th Dec 2010 12:31    Post subject:
If you only know C#, you won't know how it works internally Smile

A pure C# programmer will most definitely get tons of memory leaks at first in C. C++ is a different story, as a lot of the basic stuff you'd do as a beginner is relatively leak-safe.

Then again, I might not be the best one to ask. Starting with Basic, continuing on to PHP+JS. Simple start right? And then before learning anything else I went to ASM thanks to uni - once you do that, everything seems simple :>
Back to top
Page 1 of 2 All times are GMT + 1 Hour
NFOHump.com Forum Index - PC Games Arena Goto page 1, 2  Next
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group