Live data from Hacker News

Jedi Knight 2 And 3 Source Code Released

rockpapershotgun.com

11–20 of 31 posts

Re: Jedi Knight 2 And 3 Source Code Released

#11
post #9
post #5

Earlier quoted context omitted.

If you are going to write functions like this [1], gotos are not your worst problem. :) [1]: http://sourceforge.net/p/jediacademy/code/ci/4bebb8ec23200ee...

What exactly is wrong about that? The nesting is too deep imho, but apart from that it looks ok. This looks more like a design problem, because there are lots of special cases, but the code style is ok.

Look at the size of that thing

That function is almost 1500 lines long, full of complex nested if conditions and commented out blocks. I understand how code (especially game character control code) grows to become like that, and I've probably been guilty of some similar horrors myself, but the most I can do with such code style is excuse it.

Re: Jedi Knight 2 And 3 Source Code Released

#13
post #5
post #2

Searching 1897 files for "goto " ... 603 matches across 121 files cocks gun, blows brains out (Yes I know the evil goto supposedly has its time and place, blah blah blah)

If you are going to write functions like this [1], gotos are not your worst problem. :) [1]: http://sourceforge.net/p/jediacademy/code/ci/4bebb8ec23200ee...

I'm equally repulsed by huge, highly nested functions. However, I'd have to say that the game play provided by this function was one of my favorite parts of Jedi Outcast.

Re: Jedi Knight 2 And 3 Source Code Released

#15
post #5

Earlier quoted context omitted.

If you are going to write functions like this [1], gotos are not your worst problem. :) [1]: http://sourceforge.net/p/jediacademy/code/ci/4bebb8ec23200ee...

I was also surprised to see these huge functions with multiple nested layers. Is it common for game development? Or it was just a quick hack on top of Quake engine?

Yes, it's very common in player / vehicle controller code.

People start with a clean model of how the player should move, using minimal physics, then add layer upon layer of special case code for various environmental / state / networking edge-cases.

Re: Jedi Knight 2 And 3 Source Code Released

#16
post #9
post #5

Earlier quoted context omitted.

If you are going to write functions like this [1], gotos are not your worst problem. :) [1]: http://sourceforge.net/p/jediacademy/code/ci/4bebb8ec23200ee...

What exactly is wrong about that? The nesting is too deep imho, but apart from that it looks ok. This looks more like a design problem, because there are lots of special cases, but the code style is ok.

I think you agree with the parent poster. By "code style" I assume they meant what you're calling "design problem".

Re: Jedi Knight 2 And 3 Source Code Released

#17
post #4

Preferring sourceforge over github seems like an unusual choice, I didn't realise anyone still used it. It's a git repo too, I wonder why they did that?

Well, I don't think they'll accept any pull request, I think hosting these files on sourceforge won't make any difference.

Re: Jedi Knight 2 And 3 Source Code Released

#18
post #14
post #12

How would someone go about compiling this? (More looking for resource/tutorial, running Ubuntu).

Judging from the `.dsw` file at the base of the code directory, it looks like you need to build it in MS Visual Studio.

There is also the matter of missing assets.

Re: Jedi Knight 2 And 3 Source Code Released

#20

Earlier quoted context omitted.

I was also surprised to see these huge functions with multiple nested layers. Is it common for game development? Or it was just a quick hack on top of Quake engine?

Yes, it's very common in player / vehicle controller code. People start with a clean model of how the player should move, using minimal physics, then add layer upon layer of special case code for various environmental / state / networking edge-cases.

It's usually what makes the game actually feel good to play.

I've heard looking at the first person movement code for Valve's games will make you wish for your own death, but stripping out the weird stuff which looks ideologically wrong just makes the game play worse.

Post reply on HN