Jump to content

[MaNGOS University] Want to learn?


shlainn

Recommended Posts

I would love that, shlainn! I'm not sure how easy it will be due to my internet access being limited to using my phone. These Android phones are amazingly versatile, but fall way short of my PC when it comes to ease of use.

Just taking part in these forums is a task that takes twice as long, using this on-screen keyboard. >:(

Still, I'm willing to try if you have the time and patience. I'm not going to let the limitations of my phone get in the way, but someone may have to commit my code for me, if I get that far.

Right now, my dev environment is Windows XP SP3 with VC++ 2008 and MinGW-64 as the two compilers I chose to learn. I'm not entirely sure I have it all properly configured, especially external libs and SDKs, but everything seems to work fine for basic coding and compiling. I still haven't learned my way around CMake. Sure you're up to teaching a lost soul? :P

Might be a good idea for these forums to have a Classroom section for those who want to teach and learn development for the core, database, and scripting.

Link to comment
Share on other sites

off-topic: WiFi-tether?

on-topic: I have no idea if I am up to teaching lost souls :P But I sure can try. A classroom section in a forum of a project dedicated to learning sounds not wrong - are you reading this, theluda???

Now, for the actual thing:

I guess for now we can either do it in this thread, which would be slightly off-topic; in community café, which right now sounds like the best solution; or over on mangosclient.org where I can set up a classroom board, but we don't have the audience and expertise this board provides.

How would you like to play it? (this is not mutually exclusive)

  • We can do it "Ask me a question"-style, where you ask questions on concepts or specific coding or design problems and I (and maybe others) try to answer as best we can.
  • We can do it "Let's fix that bug"-style, where we/someone find something wrong and we describe how one would go about investigating and maybe fixing that bug
  • We can do the "Explain that feature"-thing, which would basically be working on a wiki-style explanation together
  • Or anything else/a mixture of all/or whatever...

One thing I would like to avoid is giving basic C++/SQL/CMake tutorials. There are excellent websites just a google away

Input?

Link to comment
Share on other sites

off-topic: WiFi-tether?

on-topic: I have no idea if I am up to teaching lost souls :P But I sure can try. A classroom section in a forum of a project dedicated to learning sounds not wrong - are you reading this, theluda???

Now, for the actual thing:

I guess for now we can either do it in this thread, which would be slightly off-topic; in community café, which right now sounds like the best solution; or over on mangosclient.org where I can set up a classroom board, but we don't have the audience and expertise this board provides.

How would you like to play it? (this is not mutually exclusive)

  • We can do it "Ask me a question"-style, where you ask questions on concepts or specific coding or design problems and I (and maybe others) try to answer as best we can.
  • We can do it "Let's fix that bug"-style, where we/someone find something wrong and we describe how one would go about investigating and maybe fixing that bug
  • We can do the "Explain that feature"-thing, which would basically be working on a wiki-style explanation together
  • Or anything else/a mixture of all/or whatever...

One thing I would like to avoid is giving basic C++/SQL/CMake tutorials. There are excellent websites just a google away

Input?

I'll have a go!

You're right, Excellent Tutorials for coding C++ already roam the Web. What would be good though is some pointers on how to do the basics - for example, I have access to a number of Linux systems that could be used to code and everything needed to make them laugh C++ is on board but.... How would one "UberN00b" like me pull down the code from GitHub, navigate with some GUI (which includes setting up said GUI with the appropriate dependencies), experiment, compile my own mistakes waiting to happen and if in some odd sleight of hand I create something that works, push it back to GitHub?

I can write a null driver for Linux and even load it into memory and run it but I'm in no shape to pull/push code between me and GitHub on something as relatively complex by comparison as MaNGOS is.

:D

Link to comment
Share on other sites

Woohoo!! A customer!!

Okay, you asked several things, and I will try to answer them separately.

1) Linux for coding. Basic setup. GUI/IDE.

As you know there is no such thing as "The Linux" - all I say here refers to Ubuntu and her sisters (as I personally prefer Kubuntu). Unlike Windows systems, there is also no "The IDE". You have options. Basically these fall into two classes: Text Editors with syntax highlighting VS. real IDEs. There are various very verbose sites out there discussing the merits of both ways, but in the end it is a matter of personal taste (or religious belief). I will just give some examples to get your google started.

Text Editors with Syntax Highlighting

Hardcore coders will point you to vi or emacs. These are console based editors with a wealth of plugins and extensions which are immensely powerful, but have a learning curve of their own. I have not much experience with them, though.

My personal preference is KATE - this is the standard KDE text editor (you can install it on ubuntu/other linux distros as well). It has nice syntax highlighting for many languages, collapsible blocks of code, a powerful search/replace function, automatic indentation and a host of other features I find useful.

And I am sure there are more.

Common to all of these is that there is no "compile&run" button. You have to switch to console to compile, run and debug (and commit) your software. (Actually there probably are plugins to do this if you look around.)

IDEs

Two big players come to mind here: Eclipse and CodeBlocks. Both have big communities which can help with problems setting up and using the GUI. I have not used any of both recently, but they should be reasonably easy to set up. Please note that at least CodeBlocks (but probably also Eclipse) use their own project file format which is not provided/supported by MaNGOS (and PseuWoW for that matter) so you have to either import VC++ project files or build your own project files (which is quite a challenge for a project the size of MaNGOS) to fully use the advanced capabilities of the GUIs.

My development environment

Okay, half a page of text later I still did not give you any concrete hints on what buttons to press - so let me give a quick tour of what my dev box looks like. As I mentioned before I use Kate as my editor of choice, and do the rest on the command line. Some details follow

Kate has a "find in files" function, but I prefer to run "grep -Rn SearchTerm *" on the command line. -R is recursive search, -n outputs line numbers. So if I see a function call in code which I want to look at but don't know in which file it is, that is my tool of choice. Also for a quick look at a file I use "less". You can set it up for syntax highlighting, too. Saves a lot of clutter in the editor.

I use several command line windows/tabs in parallel. At least one for searching and code tree navigation. One for compiling. One for running the program. This speeds up repetitive tasks like recompiling stuff because it boils down to pressing UP and ENTER on the appropriate console.

Kate offers an option to split the view port. Nice for reading two (or more) files at once if your screen is up to it.

Git

There are many very good tutorials on git in general out there. Git is very nice once you get to know it. So instead of giving a complete tutorial, I will again try to point out some things I found helpful. Again, this is all command line.

git status will show you which files you have changed, which of the changes you committed, and a host of other information as a nice overview. Use it to prepare your commits. If there are files changed but not added, chances are you forgot something. A useful option is -uno which ignores untracked files - just be careful not to forget any files you just created.

git log lists every single commit ever made on the branch you are in, and git show gives you detailed information on that commit. git show --color will make the diff much more readable IMHO.

git diff is obscenely powerful. It can compare files, commits, branches, everything. Read the help a couple of times when you think there is something it cannot do. It probably can.

git help is where you go when you get stuck.

Final words

I know this is a wall of text. I hope it helps getting you started or at least gets a discussion going. Let me know if I should elaborate on anything...

:D shlainn

Link to comment
Share on other sites

I guess I'll stick with my books! You guys are already wading toward the deep end. I have an older PC I plan to dust off and set it up as a Linux box, but I settled on Debian since it's the grandfather of all the other distros and lacks proprietary customizations like Redhat and Ubuntu use.

For now, I use Notepad++ for coding. It's the best, lightweight editor I've ever used for Windows, but it's packed with useful features and has syntax for everything from Ada to Yacc. Lots of useful plugins to choose, as well. I also have MinGW paired with Code::Blocks and Wx Widgets. You should have little trouble using CMake with that IDE.

A simple text editor and command-line compiler is really all you need, especially when you're a beginner. IDEs tend to have their own steep learning curve and insulate a student from aspects of programming that are fundamental to proper coding.

[Offtopic]: My phone service provider charges extra and requires signing up for a separate, limited data plan for tethering. Using apps intended to hide your tether would cause my service to be cut off entirely. They use some sort of fancy traffic profiling and query the phone to detect such useage. At least I do have unlimited data with my existing plan. It just means I do lots of transfers between phone and PC. :rolleyes:

Link to comment
Share on other sites

I guess I'll stick with my books! You guys are already wading toward the deep end. I have an older PC I plan to dust off and set it up as a Linux box, but I settled on Debian since it's the grandfather of all the other distros and lacks proprietary customizations like Redhat and Ubuntu use.

For now, I use Notepad++ for coding. It's the best, lightweight editor I've ever used for Windows, but it's packed with useful features and has syntax for everything from Ada to Yacc. Lots of useful plugins to choose, as well. I also have MinGW paired with Code::Blocks and Wx Widgets. You should have little trouble using CMake with that IDE.

A simple text editor and command-line compiler is really all you need, especially when you're a beginner. IDEs tend to have their own steep learning curve and insulate a student from aspects of programming that are fundamental to proper coding.

Awesome! I don't do much coding on my windows system because ever time I try it hurgles a face full of errors at me... Linux is so far doing Great for my coding experience, When I do attempt Windows coding, I have indeed used CodeBlocks on MinGW! :D

[Offtopic]: My phone service provider charges extra and requires signing up for a separate, limited data plan for tethering. Using apps intended to hide your tether would cause my service to be cut off entirely. They use some sort of fancy traffic profiling and query the phone to detect such useage. At least I do have unlimited data with my existing plan. It just means I do lots of transfers between phone and PC. :rolleyes:

Bugger! I guess so far in Australia we've avoided the "So much for internet" plus "So much extra to actually use it" and then "So much extra again if you want to use Email" plus "So much more if you want to use your computer attached to it like a dongle"... It's like going to a car dealership and buying a car and then after you've signed up and paid for it, asking you to pay an ongoing subscription to drive it, then extra if you want to put more fuel in it when it runs out, extra again to leave the city limits, etc. It's Bizzare what they rape you guys for...

xD

Link to comment
Share on other sites

Sublime Text 2 also shines under Windows, and runs on Mac and Linux, too :) Oh, and not to forget, in case you want to enjoy readable error messages, there is a CLANG version for MinGW available, too. Build instructions here.

Wait, is it possible to build mangos under windows using MinGW since I would love to get proper gcc like warnings there :)

I tried it a few days ago but kinda failed

Link to comment
Share on other sites

I guess I'll stick with my books! You guys are already wading toward the deep end. I have an older PC I plan to dust off and set it up as a Linux box, but I settled on Debian since it's the grandfather of all the other distros and lacks proprietary customizations like Redhat and Ubuntu use.

Wrong! Wrongity-wrong-wrong-wrongwrongwrong!!! (Not the sticking with books - the reasoning!!!) Learning is a process of taking your knowledge from A to B - like a journey. If everyones journey started in the same place it would be a conveyor belt, and not what we like to call traveling. If you want to join our collective journey of learning at any point you are cordially invited. Even if to you that point seems silly.

By the way I really recommend Ubuntu over Debian BECAUSE it has proprietary customizations that make the experience tremendously better.

And I came up with another approach to the classroom theme:

  • We can do the "What does this function/object do?" thing going through code line by line and learning how to read it
Link to comment
Share on other sites

I guess I'll stick with my books! You guys are already wading toward the deep end. I have an older PC I plan to dust off and set it up as a Linux box, but I settled on Debian since it's the grandfather of all the other distros and lacks proprietary customizations like Redhat and Ubuntu use.

Wrong! Wrongity-wrong-wrong-wrongwrongwrong!!! (Not the sticking with books - the reasoning!!!) Learning is a process of taking your knowledge from A to B - like a journey. If everyones journey started in the same place it would be a conveyor belt, and not what we like to call traveling. If you want to join our collective journey of learning at any point you are cordially invited. Even if to you that point seems silly.

By the way I really recommend Ubuntu over Debian BECAUSE it has proprietary customizations that make the experience tremendously better.

I agree with shlainn, have a bash at whatever suits your fancy, Ubuntu have (arguably) done wonders for Linux usability, I'm running one of my systems on 11.10 and I have another on Fedora17. My 1Ru blade server I have in my telco's rack is running Fedora 16, it's doing all my web, email, vpn's, MaNGOS serving, etc. :)

And I came up with another approach to the classroom theme:

  • We can do the "What does this function/object do?" thing going through code line by line and learning how to read it

Yay! I'm IN! I like the idea of practical learning a Mangos function and perhaps lighting up a routine using it? I wonder is it possible to write simple plugins that maybe interface into Mangos and do some ancilliary function like externalising bot AI or something? mebbe battleground or arena bots??

I'm guessing I'm biting off more than I can chew, Just a thought....

Link to comment
Share on other sites

Woohoo!! A customer!!

Okay, you asked several things, and I will try to answer them separately.

1) Linux for coding. Basic setup. GUI/IDE.

As you know there is no such thing as "The Linux" - all I say here refers to Ubuntu and her sisters (as I personally prefer Kubuntu). Unlike Windows systems, there is also no "The IDE". You have options. Basically these fall into two classes: Text Editors with syntax highlighting VS. real IDEs. There are various very verbose sites out there discussing the merits of both ways, but in the end it is a matter of personal taste (or religious belief). I will just give some examples to get your google started.

Text Editors with Syntax Highlighting

Hardcore coders will point you to vi or emacs. These are console based editors with a wealth of plugins and extensions which are immensely powerful, but have a learning curve of their own. I have not much experience with them, though.

My personal preference is KATE - this is the standard KDE text editor (you can install it on ubuntu/other linux distros as well). It has nice syntax highlighting for many languages, collapsible blocks of code, a powerful search/replace function, automatic indentation and a host of other features I find useful.

And I am sure there are more.

Common to all of these is that there is no "compile&run" button. You have to switch to console to compile, run and debug (and commit) your software. (Actually there probably are plugins to do this if you look around.)

IDEs

Two big players come to mind here: Eclipse and CodeBlocks. Both have big communities which can help with problems setting up and using the GUI. I have not used any of both recently, but they should be reasonably easy to set up. Please note that at least CodeBlocks (but probably also Eclipse) use their own project file format which is not provided/supported by MaNGOS (and PseuWoW for that matter) so you have to either import VC++ project files or build your own project files (which is quite a challenge for a project the size of MaNGOS) to fully use the advanced capabilities of the GUIs.

My development environment

Okay, half a page of text later I still did not give you any concrete hints on what buttons to press - so let me give a quick tour of what my dev box looks like. As I mentioned before I use Kate as my editor of choice, and do the rest on the command line. Some details follow

Kate has a "find in files" function, but I prefer to run "grep -Rn SearchTerm *" on the command line. -R is recursive search, -n outputs line numbers. So if I see a function call in code which I want to look at but don't know in which file it is, that is my tool of choice. Also for a quick look at a file I use "less". You can set it up for syntax highlighting, too. Saves a lot of clutter in the editor.

I use several command line windows/tabs in parallel. At least one for searching and code tree navigation. One for compiling. One for running the program. This speeds up repetitive tasks like recompiling stuff because it boils down to pressing UP and ENTER on the appropriate console.

Kate offers an option to split the view port. Nice for reading two (or more) files at once if your screen is up to it.

Git

There are many very good tutorials on git in general out there. Git is very nice once you get to know it. So instead of giving a complete tutorial, I will again try to point out some things I found helpful. Again, this is all command line.

git status will show you which files you have changed, which of the changes you committed, and a host of other information as a nice overview. Use it to prepare your commits. If there are files changed but not added, chances are you forgot something. A useful option is -uno which ignores untracked files - just be careful not to forget any files you just created.

git log lists every single commit ever made on the branch you are in, and git show gives you detailed information on that commit. git show --color will make the diff much more readable IMHO.

git diff is obscenely powerful. It can compare files, commits, branches, everything. Read the help a couple of times when you think there is something it cannot do. It probably can.

git help is where you go when you get stuck.

Final words

I know this is a wall of text. I hope it helps getting you started or at least gets a discussion going. Let me know if I should elaborate on anything...

:D shlainn

If you are running a GUI on linux you can install CMake and Code::Blocks. CMake can generate codeblocks project files! :)

http://www.cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator

To note: it worked fine for me as i tested :)

Link to comment
Share on other sites

Wait, is it possible to build mangos under windows using MinGW since I would love to get proper gcc like warnings there :)

I tried it a few days ago but kinda failed

Actually you can build under MinGW with QT-Creator 2.5. It's a long road though. Took me three days to configure the damn stuff. I had to build all libraries under MinGW, too. Not funny, but doable.

Link to comment
Share on other sites

You can indeed use CMake, or even just Make, with MinGW and/or Code Blocks! It may require some tinkering, because I'm not sure how they handle linking and headers versus GNU GCC or Visual C++. However, CMake does support generating build files for several different compilers and IDEs. I would prefer using MinGW over Visual Studio, just because I think that's the better choice for cross-platform development by minimizing the exposure to proprietary Microsoft implementations of C++.

As for me sticking to my books:

I'm not trying to back out of anything, shlainn. It's just that I think my C++ skills are being overestimated. While the rest of you have already jumped into libs, APIs, and functions, I'm still wallowing in the shallow end of the pool, printing out "Hello, world!" while clinging to my inflatable duck float to keep the big boys from swamping me as you splash and dive into the deep end. LOL.

As it has been said, there are many online sources to learn as a beginner, with the intent of classes conducted here at MaNGOS U. to focus more on working with the core code and topics for those that already know at least the basics of C++. I just regret not having come far enough in my lessons to take part using more than educated guesses and intuition.

I may learn slowly, with so many other demands on my time, but I do soak up like a sponge the things I read in my spare moments. It's tough to devote proper time to such technical matters when you have a wife with medical needs, plus a home to keep... and I don't move as quickly as I used to, either. I say this not to garner sympathy, but so all of you, my friends, may better understand why I'm falling behind the rest of the class.

I do think having new threads or sub-forums for learning C++, SQL, and EventAI scripting would be a good feature. It just might encourage others to take part, ensuring the future by creating new developers. We could even call the new classroom section MaNGOS University. :D

"Teach a man to fish...", as the saying goes.

Link to comment
Share on other sites

Then how about starting with "How do I get MinGW with CMake and QT-Creator to build mangos" as a starting point? This is quite a bit of work, but it would at least allow every level of coding skill to start from zero.

I am very willing to provide assistance for that.

Link to comment
Share on other sites

Is QT absolutely necessary? I thought that was just a GUI library, like wxWidgets, which wasn't really needed for building a console application.

It looks as if this thread has been hijacked beyond hope of recovering the initial intent. Perhaps you should re-title this topic and start a new one for PseuWoW, shlainn. lol

Link to comment
Share on other sites

  • 1 month later...

I'm all for the examining / tracking / fixing the bug route.

- Thats got to be a Win-Win solution, we learn some valuable techniques and Mangos gets a bug fixed

just please don't make it a *nix only thingy, I do all my dev on windows and run mangos on a windows box.

I currently have the following setup:

I have a VM running Windows Server running Mangos, plus I also have Visual Studio all the dev stuff on there too.

- This gives me the flexability to Remote Desktop to it from any PC and update/tinker with Mangos.

Just about have a step by step guide written on how to set this up, you will see it here soon.

Link to comment
Share on other sites

Don't worry, Antz. MaNGOS, in all versions, has and will continue to support development and operation on both Linux and Windows platforms.

In fact, we welcome having more Windows devs for 32-bit and 64-bit environments. MaNGOS has usually had more Linux devs and it helps with cross-platform compatibility to have input from Win coders.

Welcome back! I hope we will see a great deal of your talents. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use