![]() |
Re: Quake II Full Build all setup for .NET
Quote:
I read that as 'C++ is for n00bs' :p When i started with C++ i had NO idea what the fark i was doing, and got lost straight away, (I tried learning C++ as a 'first' language) but i found that C was much easier to code, all those structs and stuff, and it helpped me along alot. So kids, if you wanna be good at C++, learn C first :p |
Re: Quake II Full Build all setup for .NET
Quote:
C++ was my first language.. I had no trouble learning and I thought it was pretty easy... The only confusing parts I thought were templates, vectors, and a bunch of other advanced things :D |
Re: Quake II Full Build all setup for .NET
i read c++ for a year.. i understood structures but had problems understanding many of the common funktions.. "for loops" is not included.. that one i understood well.. ;)
decied programing was something i shouldnt work with. |
Re: Quake II Full Build all setup for .NET
one cannot really compare them. you cannot really do OO stuff with C. Pierre was talking about clarity of code and structure in C ... well, I'd say that this is even more crucial in C++, in OO languages in general. all those books on class design havnt been written just to make money, that's just a hard topic. I'm not talking about stefan's method, just using C++ to limited the scope of some variables, mainly just putting the old C structures into classes, translating structs to classes. I did this in old JoeBOT, and well, you can somewhen save some time coding, since you can benefit of inheritance and such, but this isnt clearly the intention of C++.
For example the current JoeBOT XP, where you might have read the pdf documentation draft. There I can really take advantage of C++ capabilities. take for example the perception system. A squad has some sort of perception, as does the bot. so I can write a base class for perception and then used derived classes for the perception for both, different, still different tasks. The same for the goalfinder which can just be plugged into the bot as well as into the squad. This'd be quite difficult using C. Or the 'interesting entities' system the perception is based on ... Before actually coding I made scetches of those classes for about 2 month ... well, a lot of paper got wasted, but finally I think it's working pretty well and the code is relatively compact. in both languages you can write shit, no question. but I dunno if the advantages of C++ really are seen by pmb here e.g. @trub: for constructs, well, the belong to C and C is a subset of C++. the for loops are not really a oo oriented concept, therefore they might not be explained in the C++ bool ... C++ takes time. maybe just read a book about it to get to know about the capabilities of that language. somewhen you might remember and use that very feature. I read once upon a time about virtual base classes, the exmaples where fine, but well, in "real life" programming I never saw the reason to use them. After some years of coding I then saw a good possibility to use this feature in JoeBOT XP ... knowing and using are two different pairs of shoes :D |
Re: Quake II Full Build all setup for .NET
Looks like Id Software just prefer C to C++ - I have just downloaded the Quake3 and Return to Castle Wolfenstein SDK source code and those ones are still written in pure C. (all the files are with ".c" extension)
Also C code (or something like stefan's code, @$3.1415rin's old code or my modified POD code) usually runs faster than C++ code with a lot of classes/virtual functions. |
Re: Quake II Full Build all setup for .NET
the classes itself are not slowing down your program, since you often need a pointer to some structure as an argument for a function, and tout a coup, you have the same like in C++
the virtual functions take more time, that's clear. Used carefully this isnt a major performance loss, but it can be simplifying your code, allowing multible use of the same code ... and having code being used quite often is very cache friendly :) But like Killaruna once said : today we shouldnt bother about a couple of cycles spent extra for a virtual function. Good C++ is easy to maintain, and the main point of optimizing is optimizing the algorithms anyway. You cannot really improve the runtime of a bad algorithm by speeding up some parts, instead, it's hard work to slow down a good algorithm to the speed of a slow one, by using 'slow' stuff like virtual functions. PS: Guess why current CPU have some part which is called branch prediction ... the have sometimes to respond to the demands of the coders, too ;) |
Re: Quake II Full Build all setup for .NET
Quote:
|
Re: Quake II Full Build all setup for .NET
I suspect that the HL engine is in C, not C++. I think only the mod code is in C++.
|
Re: Quake II Full Build all setup for .NET
I have high reason to believe that the entire of Half-Life was coded in C++, although i dont have any proof, The SDK seems too 'evolved' to have any of the base source to be coded in C..
|
Re: Quake II Full Build all setup for .NET
Quote:
|
All times are GMT +2. The time now is 17:08. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.