.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Cyborg Factory > United Bot
United Bot The ultimate beast is being given birth right here! Half-Life 2

Reply
 
Thread Tools
Re: Quake II Full Build all setup for .NET
Old
  (#11)
FrostyCoolSlug
Member
 
FrostyCoolSlug's Avatar
 
Status: Offline
Posts: 318
Join Date: Mar 2004
Default Re: Quake II Full Build all setup for .NET - 12-05-2004

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 ?

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.

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


=====
Craig "FrostyCoolSlug" McLure
Network Administrator of the ChatSpike IRC Network
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#12)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Quake II Full Build all setup for .NET - 12-05-2004

Quote:
Originally Posted by FrostyCoolSlug
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
Now that... I can fully object to...
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
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#13)
TruB
One Eyed Freak
 
TruB's Avatar
 
Status: Offline
Posts: 1,164
Join Date: Dec 2003
Location: local mall
Default Re: Quake II Full Build all setup for .NET - 12-05-2004

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.
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#14)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Quake II Full Build all setup for .NET - 12-05-2004

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


   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#15)
Whistler
Whistler
 
Whistler's Avatar
 
Status: Offline
Posts: 1,478
Join Date: Feb 2004
Location: Beijing, P. R. China
Default Re: Quake II Full Build all setup for .NET - 16-05-2004

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.

Last edited by Whistler; 16-05-2004 at 05:11..
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#16)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Quake II Full Build all setup for .NET - 16-05-2004

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


   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#17)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 4643'60N 043'0W 0.187A
Default Re: Quake II Full Build all setup for .NET - 16-05-2004

Quote:
Originally Posted by Whistler
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)
I feel less lonely, suddently



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#18)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: Quake II Full Build all setup for .NET - 19-05-2004

I suspect that the HL engine is in C, not C++. I think only the mod code is in C++.
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#19)
FrostyCoolSlug
Member
 
FrostyCoolSlug's Avatar
 
Status: Offline
Posts: 318
Join Date: Mar 2004
Default Re: Quake II Full Build all setup for .NET - 19-05-2004

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..


=====
Craig "FrostyCoolSlug" McLure
Network Administrator of the ChatSpike IRC Network
   
Reply With Quote
Re: Quake II Full Build all setup for .NET
Old
  (#20)
Bill
Guest
 
Status:
Posts: n/a
Default Re: Quake II Full Build all setup for .NET - 19-05-2004

Quote:
Originally Posted by Pierre-Marie Baty
I feel less lonely, suddently
At a C++ contest at Mercy College in Westchester, NY...me and my team wrote C. 9_9 Don't feel lonely...we're out there.
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com