Results 1 to 19 of 19

Thread: Learning C++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Learning C++

    i want to learn to mod games, specificaly dragon age , and need to learn c++. i was wondering what the best way to go about this is. i dont know how much i need to know but looking at a few tutorials for modding the game i just get lost in the script

  2. #2
    Lord Feloric's Ambassador's Avatar Biarchus
    Join Date
    Nov 2008
    Location
    I live on a distant planet, a planet ruled by the Great Lord Feloric.
    Posts
    698

    Default Re: learning c++

    When I first arrived at Earth one of my first tasks, after some initial investigation, was to send computers back to my home planet. I gave access to some of my Lord's top engineers and scientists to knowledge I learned and online tutorials. Together we learned the basics of how computers worked but when it came to more complicated processes, such as coding and writing programs, we too became lost in viewing online tutorials. So my Lord decided a better approach would be to learn from computer experts. I obtained textbooks and my Lord sent agents into some top universities. Now my Lord's plans for conquering Earth are well under way, it would not be possible without computers. This story brings me to my conclusion. If you want to learn a high level object-oriented computer language get off of the online tutorials and turn instead to textbooks or classrooms teaching basic programming techniques. Although, it appears you are only interested in modding. In that case my Lord and the Order Of The Wolf would recommend this book, or any equivalent programming book.

    My Lord wishes you luck. By assisting in modding you are essentially giving to the gaming community.
    All Hail Lord Feloric

  3. #3
    AqD's Avatar 。◕‿◕。
    Join Date
    Dec 2007
    Location
    🏡🐰🐿️🐴🌳
    Posts
    10,897

    Default Re: learning c++

    hmmm are you sure it's c++? c++ is usually used in the core part of game engines - it's very unlikly that modders could modify that part... unless you want to join open-sourced games

  4. #4

    Default Re: learning c++

    Well C++ is an excellent place to start to understand scripting in general from what I understand. Though its a hard one too. Visual basic and HTML have always been easier.
    But yeah in general game code cannot be modified with C++, from what ive heard others say, theres a language called LUA that is the most commonly used in modding video games.
    Anyway , any language should be of moderate usefulness.
    "If you can't get rid of the skeleton in your closet, you'd best teach it to dance." - George Bernard Shaw (1856-1950)

  5. #5
    C-Rob's Avatar Primicerius
    Join Date
    Jul 2008
    Location
    somewhereinorneartheUS
    Posts
    3,492

    Default Re: learning c++

    I'm actually taking a java class at uni.

    Once you know a major language it's easier to transfer knowledge and understand others.

    Textbooks work awesomely though. Dont' get C++ for dummies though. That book's worthless!

  6. #6
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: learning c++

    Quote Originally Posted by wupwup View Post
    i want to learn to mod games, specificaly dragon age , and need to learn c++. i was wondering what the best way to go about this is. i dont know how much i need to know but looking at a few tutorials for modding the game i just get lost in the script
    If you've never done any modding before, I don't think you should start with programming, unless you know plenty about computers aside from modding.

    I don't know anything about Dragon Age, but are you sure that you use C++ to mod it? If so the engine must link to a dll that you can modify?
    I've only ever known of one game that does that which is the American Conquest engine.

    I started out learning C++ to mod the American Conquest engine and here are my thoughts. I don't recommend C++ as your first language unless you are very motivated and also very flexible. If you are a person who develops concrete habits and aren't able to easily adapt to better ways of doing things, starting with C++ and no programming knowledge can cause some grief. C++ gives you a lot of control which lets you do very bad things and develop a bad programming style if you don't know any better. This was the case for me at first. This isn't to say the whole endeavor was bad, I accomplished my goals there, my code is still in use today, and I was able to change my bad habits rather easily later on.

    If your bigger goal is just to become a good programmer:
    Spoiler Alert, click show to read: 
    I personally recommend starting with C#. It is my subjective opinion that it guides you into better programming style and habits without being dangerous like C++.

    Starting out with C++ is a lot more painful. Perhaps I am wrong and it's better to get beat up by C++ and then try C# to be able to fully appreciate it, as that's what happened to me, but I don't think so.



    If you are certain that modders use C++ to mod dragon age, link me to somewhere where that is mentioned and I might be able to help some more.

    For people learning C++, read as much as you can here on cplusplus.com. It's a very clear and concise reference for C++.
    Last edited by Garnier; March 21, 2010 at 01:45 PM.


    Retired moderator of TWC
    | Under the patronage of Atterdag

  7. #7

    Default Re: Learning C++

    On this occasion my wayward ambassador does in fact know my wishes and I do wish you well as does all the Kingdom of the wolfs.

    Now all I need to do is find myself a ambassador.

  8. #8

    Default Re: Learning C++

    well im going by this guide to start with. http://dragonagemodding.wordpress.co...layer-an-item/

    think i did everything right except the coding at the end. prety sure it is c++. thanks for the sugestions though.

  9. #9
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Learning C++

    So it is. If you don't know how to do something, just start browsing the articles and tutorials on www.cplusplus.com. Usually googling a generic C++ problem will get this website near the top anyway.

    My opinion: Reading a book when you're starting out is only good if you've got tons of time and patience. Personally I learn things first by diving straight in and then googling when I need information. Reading books is fun and helpful later on after I've developed a strong interest.


    Retired moderator of TWC
    | Under the patronage of Atterdag

  10. #10
    Dewy's Avatar Something Witty
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    4,697

    Default Re: Learning C++

    Quote Originally Posted by roy34543 View Post
    Well C++ is an excellent place to start to understand scripting in general from what I understand. Though its a hard one too. Visual basic and HTML have always been easier.
    But yeah in general game code cannot be modified with C++, from what ive heard others say, theres a language called LUA that is the most commonly used in modding video games.
    Anyway , any language should be of moderate usefulness.
    you can edit games with C++

    Quote Originally Posted by Garnier View Post
    So it is. If you don't know how to do something, just start browsing the articles and tutorials on www.cplusplus.com. Usually googling a generic C++ problem will get this website near the top anyway.

    My opinion: Reading a book when you're starting out is only good if you've got tons of time and patience. Personally I learn things first by diving straight in and then googling when I need information. Reading books is fun and helpful later on after I've developed a strong interest.
    Really, thats odd. Taking a class or some books is the only good way to start programming; generally stay away from online tutorials because you don't know if you can trust them. Good books would be anything by the publisher O'Reilly (they used to be near perfect 10-15 years ago), there is ofc other good books by other publishers but look at books by O'Reilly first.

    There is alot of comments in that tutorial. A comment is ignored by the compiler and is anything behind //. There is one other way to comment but its hardly used and isn't in that tutorial
    Last edited by Dewy; March 22, 2010 at 01:01 AM.
    Oh no the picture of my dog disappeared!

  11. #11
    Simetrical's Avatar Former Chief Technician
    Patrician

    Join Date
    Nov 2004
    Location
    θ = π/0.6293, φ = π/1.293, ρ = 6,360 km
    Posts
    20,154

    Default Re: Learning C++

    Quote Originally Posted by Garnier View Post
    I personally recommend starting with C#. It is my subjective opinion that it guides you into better programming style and habits without being dangerous like C++.

    Starting out with C++ is a lot more painful. Perhaps I am wrong and it's better to get beat up by C++ and then try C# to be able to fully appreciate it, as that's what happened to me, but I don't think so.
    Java is a more conventional starting choice than C#. They're fairly similar, but C# is Microsoft-only.

    As for whether to start with a low-level language or a high-level one, I'd suggest you start with C if you ever want to do serious programming. If you know C, you gain a real understanding of how computer programs work, and it's easy to understand how higher-level or more featureful languages work (including C++). If you start with Java or something, it will be a lot easier, but you'll probably avoid learning C after that, which would be a loss. Not only does C let you understand computers a lot better, it's also the fastest language around, so it's a must to know C (or at least C++) if you need to optimize seriously.
    Quote Originally Posted by Dewy View Post
    you can edit games with C++
    It depends on the game. Different games expose different languages. Some expose a C or C++ variant, but most use a higher-level language like Python, Lua, or some made-up thing.
    Quote Originally Posted by Dewy View Post
    Good books would be anything by the publisher O'Reilly (they used to be near perfect 10-15 years ago), there is ofc other good books by other publishers but look at books by O'Reilly first.
    Seconded. O'Reilly is consistently excellent.
    Quote Originally Posted by Dewy View Post
    There is alot of comments in that tutorial. A comment is ignored by the compiler and is anything behind //. There is one other way to comment but its hardly used and isn't in that tutorial
    Comments like /* this */ are widely used. It depends on coding style. That's the only way to comment in traditional C, and in some other languages like CSS.
    MediaWiki developer, TWC Chief Technician
    NetHack player (nao info)


    Risen from Prey

  12. #12
    Dewy's Avatar Something Witty
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    4,697

    Default Re: Learning C++

    Quote Originally Posted by Simetrical View Post
    Java is a more conventional starting choice than C#. They're fairly similar, but C# is Microsoft-only.
    Actually C# can be used on Linux, just there is basically no point without .NET

    Quote Originally Posted by Simetrical View Post
    As for whether to start with a low-level language or a high-level one, I'd suggest you start with C if you ever want to do serious programming. If you know C, you gain a real understanding of how computer programs work, and it's easy to understand how higher-level or more featureful languages work (including C++). If you start with Java or something, it will be a lot easier, but you'll probably avoid learning C after that, which would be a loss. Not only does C let you understand computers a lot better, it's also the fastest language around, so it's a must to know C (or at least C++) if you need to optimize seriously.
    Yeah I avoid learning C, even though I have thought about taking classes to learn ASM. I thought I said this before about ASM being faster than C but again so knows ASM these days?

    Quote Originally Posted by Simetrical View Post
    It depends on the game. Different games expose different languages. Some expose a C or C++ variant, but most use a higher-level language like Python, Lua, or some made-up thing.
    Every game can be edited with C++, most not legally such as cheats.
    Oh no the picture of my dog disappeared!

  13. #13

    Default Re: Learning C++

    I taught myself C# last Autumn using O'Reilly's C# 3.0 in a Nutshell. For C++, I can highly recommend Prata's C++ Primer Plus.

    I found that the most helpful way to learn C# was by starting with someone else's code and then trying to expand it. I used the ETW mod tools code to play around with.

  14. #14
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Learning C++

    It is an interesting subject, which language is best to start with. It's not a straightforward question and it's not the same as "which language is best." Besides that everyone has strong opinions on it!

    Colleges don't want to start out with C/C++ because they'd lose a lot of CS majors due to frustration, I would think. So learning C/C++ on your own is indeed necessary if you want to do a lot of programming jobs.

    Taking a class or some books is the only good way to start programming; generally stay away from online tutorials because you don't know if you can trust them.
    You're going to need online tutorials if you're teaching yourself programming, unless you really want to dig everything out of books. I didn't have the patience for that. Personally I find it's easier to learn a language by trying to do something with it and googling when stuck, than reading until I think I understand it before doing it. It probably depends on the person, but that's how I learn. This is another matter of preference.


    Java is a more conventional starting choice than C#. They're fairly similar, but C# is Microsoft-only.
    In spoiler to not derail the thread:
    Spoiler Alert, click show to read: 
    I'm open to correction, these are just my current beliefs..
    Java as a language is easier to fully know, but it's much more complicated to write a lot of things in due some rules like "everything is a class". I am curious, have you done much in C#? It's very different from Java, the main similarity is automatic memory management and much of the basic syntax.

    I'd say Java has three pros, but the most important one for me is a big con.

    • Severe language restrictions so there are fewer keywords and less unique language constructs. This makes it easier to know all the features, but harder to do a lot of the programming.
    • "Portability" Not much to say here, C# is for Windows (and Linux with mono), Java isn't tied to anything.
    • Javadoc is something I quite like, C#'s documentation isn't as easy to extract from the code.


    I mostly do windows programming, and I use php/html/js for web stuff. It's a simple statistic that currently the vast majority of end users are on windows. If that changes I'll switch to Java if need be.

    In the end I think you're right. Java is better to start out with since there's fewer unique things to learn, and it's good to be able to solve any problem without relying on special language constructs. But then once you understand programming, C# is much nicer for when you want to make elegant software for people to actually use, and make it sooner and easier. Assuming you're on windows.


    Retired moderator of TWC
    | Under the patronage of Atterdag

  15. #15
    Dewy's Avatar Something Witty
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    4,697

    Default Re: Learning C++

    Thats the problem with learning programming, to get good at it you need to practise; you can't just go to school and think you can program well it takes years after that to get advanced at it. Also I agree C# is a great language just started learning it (well months ago I did, but its easier to pick up because of my background in C++) because its easier to make indie games with it than C++; which in Australia I kinda need to go off on my own, not much free lance work.
    Oh no the picture of my dog disappeared!

  16. #16
    Simetrical's Avatar Former Chief Technician
    Patrician

    Join Date
    Nov 2004
    Location
    θ = π/0.6293, φ = π/1.293, ρ = 6,360 km
    Posts
    20,154

    Default Re: Learning C++

    Quote Originally Posted by Dewy View Post
    Actually C# can be used on Linux, just there is basically no point without .NET
    Quote Originally Posted by erasmus777 View Post
    You can run .NET on Linux with Mono, iiuc.
    By "Microsoft-only" I mean that it's a Microsoft technology that's made and developed by Microsoft, with the reference implementation being a closed-source piece of software developed by Microsoft, designed to integrate tightly with Microsoft technologies, and possibly encumbered by Microsoft patents.

    It's true that it technically does work on other platforms in some capacity, yes. There is a C# standard. "Microsoft-only" was too strong. Mono is open-source and will run on just about anything, including Linux, Mac, and even Windows. It supports not just C#, but also parts of .NET. However, almost no one uses C# on non-Windows platforms because of how Microsoft-dominated it is.
    Quote Originally Posted by Dewy View Post
    Yeah I avoid learning C, even though I have thought about taking classes to learn ASM. I thought I said this before about ASM being faster than C but again so knows ASM these days?
    I know basic x86 assembly. It is definitely faster than C (assuming you write in C first and assembly-optimize later, which is the only sane thing to do), and also definitely far more tedious than C. Computer game programmers usually use assembly optimization to speed up critical pieces of their games, and it's necessary for operating system authors.

    I found assembly very interesting to learn: it gives you an even better understanding of your computer's architecture than C. C abstractions like "functions" and "the stack" disappear and you can see the real implementation. You don't want to write anything in it if you can avoid it, but it's interesting to know anyway.
    Quote Originally Posted by Dewy View Post
    Every game can be edited with C++, most not legally such as cheats.
    No, if you're editing binaries you need to use assembly. You can't reliably decompile a program into C++ that will compile back to the same binary as the original. Assembly is basically the language you get the game in, it's what you compile to (or very close: there's nearly a one-to-one correspondence). People who author things like no-CD cracks have to use assembly.
    Quote Originally Posted by Garnier View Post
    Colleges don't want to start out with C/C++ because they'd lose a lot of CS majors due to frustration, I would think.
    My college had C++ as a required first-year course for CS majors. I took it as an elective. The professor mostly taught C, though, not really C++.
    Quote Originally Posted by Garnier View Post
    I didn't have the patience for that. Personally I find it's easier to learn a language by trying to do something with it and googling when stuck, than reading until I think I understand it before doing it.
    Completely agreed. I suspect the same is true for most decent programmers. Take some working code and fiddle to get it to do what you want. If you can't figure that out, you probably aren't cut out to be a good programmer. Not everyone is, and that's a fact.
    Quote Originally Posted by Garnier View Post
    In spoiler to not derail the thread:
    We can split it if it gets derailed.
    Quote Originally Posted by Garnier View Post
    Java as a language is easier to fully know, but it's much more complicated to write a lot of things in due some rules like "everything is a class". I am curious, have you done much in C#? It's very different from Java, the main similarity is automatic memory management and much of the basic syntax.
    I've never written anything in either. I program in PHP mostly, Python when I can, sometimes C or C++. Also some JavaScript for web stuff. Most people seem to agree that C# is a better language than Java, but I'm not going to touch it, personally. I'll stick to languages that don't have an open-source implementation developed as an afterthought.
    MediaWiki developer, TWC Chief Technician
    NetHack player (nao info)


    Risen from Prey

  17. #17
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Learning C++

    However, almost no one uses C# on non-Windows platforms because of how Microsoft-dominated it is.
    The end user market is also Microsoft-dominated, which gives C# plenty of room. Now obviously it can't work for every area of programming, but where it can work, I think it works very well.

    Quote Originally Posted by Simetrical View Post
    My college had C++ as a required first-year course for CS majors. I took it as an elective. The professor mostly taught C, though, not really C++.
    The downside of that would be that it does in fact take more knowledge and more work to accomplish the same thing in C++ as it does in Java. They also get to focus more on design and object-oriented stuff than on the often messy details of C programming. Whether this is good or not I don't know.

    Quote Originally Posted by Simetrical View Post
    I've never written anything in either. I program in PHP mostly, Python when I can, sometimes C or C++. Also some JavaScript for web stuff. Most people seem to agree that C# is a better language than Java, but I'm not going to touch it, personally. I'll stick to languages that don't have an open-source implementation developed as an afterthought.
    Fair enough. Python is a beautiful language. I haven't done a lot of PHP so I don't know as much about it, but I ought to.


    Retired moderator of TWC
    | Under the patronage of Atterdag

  18. #18
    Simetrical's Avatar Former Chief Technician
    Patrician

    Join Date
    Nov 2004
    Location
    θ = π/0.6293, φ = π/1.293, ρ = 6,360 km
    Posts
    20,154

    Default Re: Learning C++

    Quote Originally Posted by Garnier View Post
    The end user market is also Microsoft-dominated, which gives C# plenty of room.
    Sure. I never said it was a bad language to learn. As a Linux user, though, I'm not interested.
    Quote Originally Posted by Garnier View Post
    The downside of that would be that it does in fact take more knowledge and more work to accomplish the same thing in C++ as it does in Java. They also get to focus more on design and object-oriented stuff than on the often messy details of C programming.
    Oh, sure. C or C++ is more work, but you learn more. I don't suggest you use either for actual programming jobs you have to do, unless you need the performance.
    Quote Originally Posted by Garnier View Post
    Fair enough. Python is a beautiful language. I haven't done a lot of PHP so I don't know as much about it, but I ought to.
    PHP is awful. But it's the de facto standard for web development, so it's unfortunately useful to know.
    MediaWiki developer, TWC Chief Technician
    NetHack player (nao info)


    Risen from Prey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •