.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   United Bot (http://forums.bots-united.com/forumdisplay.php?f=46)
-   -   Quake II Full Build all setup for .NET (http://forums.bots-united.com/showthread.php?t=1463)

Austin 21-04-2004 12:24

Quake II Full Build all setup for .NET
 
Here is something interesting...
The Quake II full source ported to C++ all setup to build, out of the box on .NET

Isn't the CS source base basically Quake II ported to C++ with some new networking code?

http://msdn.microsoft.com/visualc/ho...e/default.aspx

The direct link to the folks who did the port:
http://www.vertigosoftware.com/Quake2.htm

Now, I would not particularly recommend .NET because I am in the process of moving totally to Linux, but this may be interesting for somebody to toy with.

stefanhendriks 21-04-2004 14:46

Re: Quake II Full Build all setup for .NET
 
this is interesting indeed. In fact, if we can 'port it back' into native C/C++ and make it compile and work with CS maps (probably not that hard to doo), we could eventually even try to update the engine. Well, we could try that :)

Wei Mingzhi 22-04-2004 13:40

Re: Quake II Full Build all setup for .NET
 
Quote:

Originally Posted by Austin
Isn't the CS source base basically Quake II ported to C++ with some new networking code?

Nope, the HL/CS source code is NOT based on Quake 2 ! It's based on the ancient Quake 1. If you look into these two versions of Quake, you'll find lotsa things in Quake1 is very similar to HL, but Quake2 is not.

Edited: I've just downloaded that source code, but I've found it NOT pure C++. Only a little code is C++, the major of the code is still the plain C.

Whistler

Pierre-Marie Baty 23-04-2004 00:38

Re: Quake II Full Build all setup for .NET
 
The Doom/QuakeI/QuakeII series of games have indeed been developed at times where C++ compilers were not really producing CPU efficient code. They've come some way since.

It won't prevent me to prefer good ole ANSI C, but still... :)

Austin 23-04-2004 01:00

Re: Quake II Full Build all setup for .NET
 
Quote:

Originally Posted by Pierre-Marie Baty
...
It won't prevent me to prefer good ole ANSI C, but still... :)

Our #1 coder not using C++... :(

To get a jump start into C++,
When you see class, REPLACE it with struct and rebuild!

Conceputally you can grasp C++ much much faster going through the tutorials first thinking of classes as a structs that can also have functions defined in them.

I think the only difference is all member functions and variables become global using struct instead of class.

Pierre-Marie Baty 23-04-2004 02:45

Re: Quake II Full Build all setup for .NET
 
I *know* how C++ works Mark, I've already written stuff in C++ and hacked proggies that were written in C++, but why do you guys all want to push me to switch over ?

I prefer C because it's more demanding. You need to put a lot of clarty and structuration into a C program to make it work efficiently. You must be able to tell for each variable where it applies, what's its purpose and what's its scope. You must have a complete understanding of the whole program in all cases. The C++ withdraws this responsibility from the programmer... and for this reason I prefer C.

Lazy 23-04-2004 04:05

Re: Quake II Full Build all setup for .NET
 
What would have actually impressed me would be if they ported the entire game to C#.
Managed C++ is good but it takes the fun out of developing a managed application.

Austin 23-04-2004 08:45

Re: Quake II Full Build all setup for .NET
 
Quote:

Originally Posted by Pierre-Marie Baty
I *know* how C++ works Mark, I've already written stuff in C++ and hacked proggies that were written in C++, but why do you guys all want to push me to switch over ?

PM, I have no idea of your understanding of C++.

My only intention, ok ok my TWO intentions ;-) were:

1) IF you have not spent much time with C++, then knowing that at first you can think of class as struct is an enormous benefit in getting over the initial jolt of the syntax and concepts of C++, of which most all C++ tutorials and books never mention… . So I didn't know but thought that IF you were just starting out with C++ I would throw this help your way, and also help anyone who may read this.

2) C++ Is much better IF it is properly used. Class global variables are way more organized then global or module global variables (static, global to a file). Functions associated with the data they operate on are way more organized then disparate global functions and data. The very first look I had at the pod source I thought all the wp stuff would be a perfect candidate for a class as well as a bot class.

If C++ is used improperly it can become nightmarish. A perfect example of this IMHO is the "standard" C++ practice everyone was pushing when the language came out, of having accessor functions to get/set all of the class variables!!!

So you tell me for a simple class with like 10 member variables I would go from managing ten variable names to 30 names (a get and set function name plus the original variable name! Not to mention writing the tiny functions themselves to get /set the actual variable) What A mess!
But well written C++ is much better to deal with, really it is. But still, even so it doesn't save any time in developing small to medium applications (if you consider the time to develop helper classes) . The calling object interface may become simpler, but the code underneath in the classes is just as complicated as it always was to write, with the exception of some help from well-designed helper-utility classes.

But C++ was a patched on upgrade to c (anyone remember the first c++ compilers that were preprocessors to turn the C++ into totally unreadable C that was then fed to your C compiler?) and many things were changed in C++ to "Fix" problems in C. And C++ isn't even "really" truly object oriented since Main() isn't an object!

The short answer, because well written C++ that takes advantages of the new features of the language is really much better to program in!

P.S.
Just having fun!

stefanhendriks 23-04-2004 09:44

Re: Quake II Full Build all setup for .NET
 
In fact, i use C++ in a minimum way. I use classes so i keep my code more organized. It also prevents me from messing up variables which i should never modify. Classes can restrict you to that. So when a variable gets changed, its my fault ;)

As an example, i have written a small RTS engine (yes i love RTS) in C only. It was ONE huge file (mind, this was the first in C ever i did, hence the first huge program i did in C) with tons of functions, global vars, etc. Eventually you end up with this naming convention:

int game_var_score_of_player;
int game_var_score_of_ai;

etc. Perhaps a bad example, but you get the idea. Now, i use something like:

class cGame
{
public:
tPlayers player[MAX_PLAYERS]; // x amount of players in the GAME
};

and in tPlayer:

struct tPlayer
{
int score;
int credits;
... etc
}

It keeps the code way more organized. I can send you this (compilable!) source... or a binary file to show you how it looks like and how it plays...

Wei Mingzhi 23-04-2004 11:51

Re: Quake II Full Build all setup for .NET
 
I only converted the bot_t struct in the original PODBot source code to a class because that will be handy in MSVC.

I thinks using too many classes (especially virtual functions) will reduce the performance.

Whistler


All times are GMT +2. The time now is 01:08.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.