C++
Post Reply
Quote
Re: C++
Posted by Le Chief on Wed Jul 4th at 9:53am 2007


I bought this book today about c++ . I know for a fact that source and the gold source engines use c++ so I thought this might be useful. And I've always wanted to know how to do this sorta stuff so that I can add real cool stuff into a certain half-life 1 mod. Its real hard but I'm getting there, I created the famous program 'hello world' than I stopped and had a rest, and now I'm on snarkpit.

I was just wondering if anybody does or has attempted c++ coding?







Quote
Re: C++
Posted by reaper47 on Wed Jul 4th at 10:16am 2007


I did. I once programmed an AI for Revesi, my favourite board game. I'm still proud of that. <img src=" SRC="images/smiles/icon_rolleyes.gif"> But then it got too long-winded and I didn't do anymore else.





Quote
Re: C++
Posted by Crono on Wed Jul 4th at 10:42am 2007


Attempted and conquered. I'm almost done with my Computer Science degree as well. I've been using Java more than anything else lately though.

If you don't know ANY programming language ... C++ is NOT what you want to start with. Especially if all you have is a book (which is most likely not even written well, since 98% or so of C++ books, specifically, are actually incorrect in many aspects of the language).

I would suggest starting with something more simple that has similar or identical syntax ... like PHP. Using something like Java would allow you to learn how to use objects and things like that without worrying about memory management. (The most common errors stem from poor memory management).

Also be aware that when regarding C++, there's a different between "C++" and "Visual C++", the latter being Microsoft's significantly altered version of the language, which I do not suggest using to start out with. It will do nothing but make you an even worse programmer.

As far as programming goes, in general, you really should learn the semantics of programming before jumping into (like, how languages generally work and what data structures are and how they're important. Otherwise there's no way in hell you'll be able to pick up someone else's code and read it), arguably, the most difficult language around.

And if you think you're just going to learn this and jump over to work on some half-life mod code ... well ... good luck, you'll need it.



Blame it on Microsoft, God does.



Quote
Re: C++
Posted by Cash Car Star on Wed Jul 4th at 11:08am 2007


I make a terrible C++ coder. I took Comp Sci in college and I'd understand the algorithms, but I just can't sit down and code. I lose sense of what I'm doing, forget all my commands and make stupid mistakes that constitute big errors. Also, I find it boring.

That said, I find I'm pretty decent with highly constrictive object-oriented coding. Hypercard, Visual Basic, Standard HL Entities... I once made Tic-Tac-Toe as a CS map. You'd play the game by shooting at a grid and then it would kill the loser. Granted, it was STUPID and a completely backass way to play Tic-Tac-Toe (aka Naughts and Crosses you silly limeys) so after a small prime number of games between myself and my roommate I nuked it. It was excellent entity practice though.

Basically, I like trying to break constraints. C++ doesn't really have that many. Halflife has a ton, but they're breakable.




Quote
Re: C++
Posted by Le Chief on Wed Jul 4th at 12:29pm 2007


Ok cool, thanks guys for the replies. The book I've got is called 'Teach yourself c++ in 24 hours' basically its a book of 24, one hour lessons and by the end, you know basic c++ . It also comes with a cd that contains a neat little compiler.

I think I'll find that I do much better on the art side of games than on the Engineering side. However hopefully this will help me out in the long run. If other human beings can do it, than there's no reason why I can't. 3D Studio max is another program they I have and have gotta learn.

Although Crono, it is extremely daunting with all the terminology that both you and the book uses, like : Classes, Loops, switches and library's, its very scary stuff. Maybe I should start of with Java First. Also, thanks for clearing up the visual c++ thing, I was wondering what that was all about.

I wish there was like this pill that I could take to instantly have all information about all aspects of game design implanted in my head.

By the way, the book is 503 pages long.







Quote
Re: C++
Posted by ReNo on Wed Jul 4th at 1:35pm 2007


I'm a competent programmer, but nothing special. C/C++ are my primary languages, although I can also use Java. I'm inclined to agree with Crono that you'd probably be better off learning with something like Java (or PHP, although I've no experience with that so I'll take his word for it) as it does handle a lot of the more complex parts of programming for you, but I learnt Java after learning C/C++, so it certainly can work out doing it that way around. Then again, I did learn in uni, so it's not exactly comparable to teaching yourself from a book!

Best of luck Aaron, it's gonna take a lot of determination and practice to get good at programming so stick with it.






Quote
Re: C++
Posted by BlisTer on Wed Jul 4th at 1:59pm 2007


I followed 2 classes of Java in uni. I understood it quite well back then, with the hardest program i wrote something that used backtracking.

I forgot most of it, untill i started fiddling with LUA scripting for HL2 last month. It proves the object-oriented approach really sticks <img src=" SRC="images/smiles/icon_wink.gif">





Quote
Re: C++
Posted by G.Ballblue on Wed Jul 4th at 6:25pm 2007


The best bit of help I can suggest would be to, like what Crono said, start with something a bit easier. Visual Basic .Net is what I learned/am learning first. It's not any where near the realm of C++, in terms of complexity and power, and it shows you that even writing a smiple data base program can be a real mind f**k at times.


Breaking the laws of mapping since 2003 and doing a damn fine job at it



Quote
Re: C++
Posted by Crono on Wed Jul 4th at 8:21pm 2007


? quote:
I'm a competent programmer, but nothing special. C/C++ are my primary languages, although I can also use Java. I'm inclined to agree with Crono that you'd probably be better off learning with something like Java (or PHP, although I've no experience with that so I'll take his word for it) as it does handle a lot of the more complex parts of programming for you, but I learnt Java after learning C/C++, so it certainly can work out doing it that way around. Then again, I did learn in uni, so it's not exactly comparable to teaching yourself from a book!

Best of luck Aaron, it's gonna take a lot of determination and practice to get good at programming so stick with it.


Exactly. I learned at a university as well, and C++ was my first language, but I had like one of the best C++ Computer Science instructors in the entire NW USA.

PHP is pretty neat in that it has the exact same language syntax as C/C++/Java, and there's really no ... hard stuff ... that's the best way I can explain it. The only real advantage you'd have by learning something like Java is documentation. There's so much it's crazy, it's actually more difficult to wade through the documentation on the language then to actually learn the language. However, there are books available online that are free (Like Eckles' book Thinking in Java, however, I don't know how good, or bad, his C++ books are).

If you're serious about learning this stuff, that's cool, but, it's hard and there's a lot more to "programming" than just knowing how a language works. CCS mentioned it. Algorithms. Especially when it comes to run time intensive things like games.

I guess the only good news I have is that, you're still in high school and young so you have plenty of time. Just try to avoid learning all of this stuff the wrong way (which is very easy to do with something like C++).

Anyway, PHP has loops, classes (I know I was surprised too), arrays, functions, all that junk. You can even get some plugins for IDE suites, like Eclipse, to use PHP and actually run it without a server. It might even work without the need for HTML.

Go look around for it. (php.net beginner tutorials maybe?)



Blame it on Microsoft, God does.



Quote
Re: C++
Posted by Gorbachev on Wed Jul 4th at 8:27pm 2007


? quote:
I make a terrible C++ coder. I took Comp Sci in college and I'd
understand the algorithms, but I just can't sit down and code. I
lose sense of what I'm doing, forget all my commands and make stupid
mistakes that constitute big errors. Also, I find it
boring.


I'm the same way, I suck at sitting down and coding, but I can read/understand and solve bugs in coding that's already done quite well.




Quote
Re: C++
Posted by Stadric on Wed Jul 4th at 10:40pm 2007


You may enjoy reading this as extra credit.
Edited for Crono

I can code a little Java, but it's been a while, and I didn't do anything overly complex. I did make a text-based game, though, but I thought it was too easy (the programming, not the game itself, that was actually kind of hard).



Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying



Quote
Re: C++
Posted by Crono on Wed Jul 4th at 11:05pm 2007


Introductory purposes? Boolean Algebra and Logic?

The entire point of learning a high level language as a beginner is so you don't need to focus on those things. (However, knowing the terminology of how memory works is recommended)

But actually knowing how gates work and arithmetic in various number bases is really not needed. Knowing those things wont actually make you a better programmer, though you may become more aware of memory use, but that can be leaned without knowing the ins and outs of how the hardware works. Okay, so, if you're making an AI agent for some game it would be nice if you know how to get your entire state space to be stored in cache since you're going to be working with an enormous branching factor and want to stay away from memory ... but that's hardly introductory.

Leaning these things from the start would probably make things much more difficult, since you wouldn't have any frame of reference. Generally, when you learn about how the hardware works you can relate it to what you know about your programming language. If it's C or C++ then that makes a pretty nice connection, since you're actually dealing with memory there.

To be honest, programming in Java is even easier if you have reference to a programmer memory control language like C++. It allows you to understand how to use Java more efficiently.

Anyway, I wouldn't, personally, suggest jumping into any hardware architecture stuff until you at least know one language and general programming ideas (for starters it's much easier to learn boolean operators at that level)



Blame it on Microsoft, God does.



Quote
Re: C++
Posted by Cash Car Star on Thu Jul 5th at 12:43am 2007


I miss the days when everyone's first language was BASIC.




Quote
Re: C++
Posted by Yak_Fighter on Thu Jul 5th at 1:26am 2007


I took two years of computer science and all I remember is

cout >> "Hello World";

I did make a kickass poker game in collaboration with a much better coder though, he did all the mechanics and I made the debugger and the AI, which had five different skill levels and would randomly select which to use in order to give the game some variety





Quote
Re: C++
Posted by Le Chief on Thu Jul 5th at 1:30am 2007


? quoting reno
Best of luck Aaron, it's gonna take a lot of determination and practice to get good at programming so stick with it.

Awww thanks man .

Thanks for all the advice people. And I must say, I am suprised how many people know somthing about coding. You guys really blew past my expectations.







Quote
Re: C++
Posted by wil5on on Thu Jul 5th at 1:46am 2007


2.5 years of learning (and teaching) java. Tried to learn C++ for a bit, I didnt have much trouble picking the language up (I did a course in ASM before it) but other projects took over. I'm taking a proper course in it (C/C++) soon so I'll get me a proper edjimacation in it.

I tried some HL mod coding long ago (probably my first introduction to C++) and did some cool stuff, but didnt know enough at the time to do anything really interesting.




&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: C++
Posted by Le Chief on Thu Jul 5th at 1:47am 2007


Good luck man





Quote
Re: C++
Posted by G.Ballblue on Thu Jul 5th at 2:33am 2007


The most impressive thing I've done with VB.Net was a space invaders game. My instructor actually got the best sample of the source code I had, since I turned it into him with a few improvements that I had made that morning.

I've actually got the thing on my hard drive; at some point, I should see what I could do with it. I always wanted to try and add some movement into the game, like the classicial space invaders games, such as Gorf.



Breaking the laws of mapping since 2003 and doing a damn fine job at it



Quote
Re: C++
Posted by Le Chief on Thu Jul 5th at 3:16am 2007


Man the possibilyties are endless when you know how to code, I swear.





Quote
Re: C++
Posted by mazemaster on Thu Jul 5th at 3:40am 2007


If you just want to be able to hack some things together, then just learning a single language like java or c++ or whatever will be fine. However, if you want to gain greater understanding and become a "good programmer", it is useful to learn several different types of languages. Even if you never use the crazy ones again, just knowing them will make you a better programmer in your language of choice.

Preferrably learn 1 from each of these 5 categories:
1) Object-oriented (C++, java, etc)
2) Functional (scheme, lisp, etc)
3) Declarative (prolog, etc)
4) Assembly (any will do)
5) Array/math based (Matlab, GNU Octave, etc)





Post Reply