Starting with Ogre

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Starting with Ogre

Post by WhiskeyJim »

Firstly, hello all! :)

I've been stumbling on these forums for couple of days and I really like the size and spirit of this community. Anyways, I'm that "I-want-to-do-an-MMO" type of person who really knows nothing. But now I've started to realize I'll never finish one if I don't learn how to program.


Languages I tried:
  • * C++
    * C#
    * Java
    * Python
Those are the languages I tried without any real success. I studied the basics of C++ by myself couple of years ago, but I got frustrated with it because I'm not a "super human", unlike many of you guys and girls. I can't remember anything about C++. I'm not too good with mathematics and I could say my overall logic's pretty bad.


Engines I tried:
  • * Irrlicht
    * Truevision3D
    * Ogre through Mogre
I liked Mogre, but I'm a bit scared of using .NET languages since evil people on the GameDev.net forums said it's not the standard in the industry. Also I'm a bit confused with all the DLLs and wrapped libraries (e.g. I couldn't get CEGUI to work). I'd use .NET-language for writing tools though, since I like the design system provided by the Visual Studio.


I can:
  • * Play games
    * Use Photoshop
    * Use Maya
    * Write bad english and stupid posts
I can't:
  • * Program
    * Get chicks
    * Write english and meaningful posts
I'm a student in a vocational school. Basically I study "IT and Business". We've studied database design with MySQL-databases, some Java, networking and UNIX / Linux-systems. I've used computers for well over 10 years now - mainly for IRC, gaming and modeling / digital painting / image editing. I'd really like to learn to design games and learn how to program them. I've had an idea of starting my own company in the software business someday. Personally I think that C++ and Ogre is the way to go.


The main questions:
  • * What is the "minimum" knowledge of C++ before I can start using Ogre?
    * Where can I find this "minimum" knowledge?
    * What should I do when I have this "minimum" knowledge?
    * Will I get chicks when I'm an Ogre Guru?
I can't take any courses mainly because of school and job. I can lend some books, but I've found them too heavy and too boring. What should I do? Thanks for taking the time to read this, hope this post helps you to help me and maybe some other people who are having similar problems.
Last edited by WhiskeyJim on Mon May 07, 2007 2:17 pm, edited 1 time in total.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

I was in your same position about a year or two ago. I just jumped into Ogre with my minimal C++ knowledge and flailed about for a few weeks. I finally got a grip on what does what, naming conventions, how to use the community resources (I <3 the Wiki) and just practiced my C++.

C++ can be tough to learn, but that's mostly when dealing with classes and pointers. Everything else is just patience and practice. I say classes are tough because they have a few "gotchas" if you're not used to them (like forward declarations to avoid circular problems trying to write a class that has information regarding a class that you write that has something about the first class) and pointers are pretty much everybody's nightmare when starting.

There are a lot of little math tricks like when working with arrays, such as instead of using 2 dimensional arrays, you'd use one, like this:

Code: Select all

int* iArray = new int[5*5]; // 5x5 array
for(int j=0;j<5;j++){
   for(int i=0;i<5;i++){
       int iValue = iArray[i + j*5]; // Gives you the [i,j] element
   }
}

delete[] iArray; // You used "new[]" now use delete[] - the [] works for arrays
iArray = 0; // Zero it out
I liked http://www.cplusplus.com/doc/tutorial/ for C++ - it's quick and dirty, but it's reliable and informative.


A lot of the little things you'll get used to just by playing with your code. Start small - make a few tiny applications that just mess with pointers and class creation. Read some posts on GameDev about performance improvements and you'll find *TONS* of speed tricks (like the one above).

As for game development - go find diagrams about the rendering pipeline and brush up on your vector math. As long as you can visualize addition, subtraction, scalar multiplication (scaling) and how cross/dot products work, you should be in good shape.

Lastly - peel apart source code. Tear open Ogre's source, the addons, anything posted in the Wiki and get a feel for it. It's a lot of free resources to work with, so use em :D
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

Thanks a bunch HexiDave, I found your post very encouraging and that tutorial you linked is really understandable. Too bad I don't have a compiler here at work. :) I'm open for any other resources and tutorials you people show me.

Long live Ogre and the Ogre community!
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Believe it or not, but I had no C++ experience prior to Ogre. I knew C style syntax from PHP, and learned the concept of OO programming from there. Of course I treated classes as storage of functions, and had no idea what business logic was.

When I started using Ogre, I had a very brief idea on how pointers worked, and I had to keep copying examples of code and modify them to effectually program, I lived out of the Example Application framework. But look at me I'm an Ogre Expert!

All it takes is time and patience, and a whooping great project to get you motivated. :D
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

Hey, betajaen! I really admire your work (BetaGUI for example) and I'm feeling all comfy because you answered to my post. :) If I remember right, you have done some programming in the golden ages of Amiga? Thanks again, I found your post encouraging and motivating.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Thankyou!. I've used Amiga's longer than I've worked with PC's and Mac's. I used "AMOS" which is a derivative of the BASIC language. For our non-Amiga users. It's almost an entire 2D game engine, but part as the language and incredibly easy to use. Many Many games were made for it. Even BetaGUI borrowed my experience from AMOS, I wrote an entire windowing system, and programming language in it once. I still have the source!

Of course, AMOS in all it's power only taught me the very basics of programming "variables, loops, conditions and functions" and the most important.

I believe learning to program, isn't learning the syntax or the traits of the compiler, but to gain to understand logic and the feel of it all. Like how one can learn to drive in one car, but still continue to drive in another make and model in another country where your on the opposite of the road and the road signs are in another language!
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Post by lonewolff »

I was actually inspired to learn programming because I saw Ogre!!

I had never used C++ before. I still have a long way to go though. :lol:

I often found myself leaving then coming back. Months off at a time. Now I am back again! (Who knows for how long? :lol: Hopefully permenant this time).

I have just recently got the grasp of classes, which was a huge win for me. Its like any other thing, you read but don't fully understand and then one day a light bulb lights up in your head. I find that most of it is a case of "what is the point of ....?" and "why would you use ....?", but eventually you find there is good reason for it.

I hope you go ahead with it all. It will be a very frustrating but rewarding path. You will find everyone in the Ogre3d forums eager to help. Sometimes even brutally honest :lol: . But, well meant.

Good Luck and hope to see you around. 8)
User avatar
Devil N
Greenskin
Posts: 123
Joined: Sun Jun 26, 2005 4:32 pm
Location: Groningen, The Netherlands
Contact:

Post by Devil N »

Well, I certainly do appreciate the honesty you exhibited in your post. Many welcomes, first of all.

I can understand some of your feelings and frustrations. Most IT related studies nowadays don't apply at all to the art of game development. For some reason, schools generally seem to think that there are only tailor-made software applications written at a high level of abstraction. They forget that there are plenty of other types of software that require a completely different approach. Game development is in the most separate category - it's more like the movie industry than anything else.

Classes about C programming are rare at most schools and C++ is practically non-existent. I was already self-tutored in C before I started my CS study, and I learned to use pointers properly during a short stint at the university. After that, I was lucky to land an internship where I got to program C++ for half a year (I already had some C++ experience by that time), because there I really got to hone my C++ skills. Right now, I feel there's not much left in the language that could surprise me. I still don't consider myself to be a 'super human' though.

When it comes to Ogre, I learned about its existence about two years ago, right about the same time I took my first steps in C++. I meddled around with it a bit back then, but I wasn't comfortable enough with C++ yet to really make something out of it. Since then, I've held off on Ogre, trying instead to write my own engine (and with a certain degree of success, but a lack of focus and interest made me quit halfway through). Now, after the release of Eihort, I've picked up on Ogre again and as time allows, I'm trying to learn its intricacies and to think of an interesting project that I could work on during the next couple of months.

Now, to answer some of your questions:

* What is the "minimum" knowledge of C++ before I can start using Ogre?

That's hard to say really.
I'd say you should at least know something about pointers and references and the importance of constness. Secondly, Ogre makes extensive use of the classes in the Standard Template Library (STL), so you need to know a thing or two about these as well. There are some design patterns that Ogre uses, such as the Singleton and Factory patterns, that you will want to be familiar with as well.

Now, you say you're comfortable with .NET, so I assume you know the basic principles of object oriented programming, such as encapsulation and polymorphism.

Besides all that, C++ has a lot of nasty pitfalls that you need to be aware of, but these are things you mostly have to learn in practice. Just make sure you dig into the theory before putting some technique into practice, that way you can avoid a lot of mistakes before you make them.

* Where can I find this "minimum" knowledge?

I personally learned a lot from the Thinking in C++ books. It's a massive piece of text, but just about everything is in there - from the most basic Hello World programs to the biggest complexities of the languages. Most of C++'s pitfalls are explained as well.

* What should I do when I have this "minimum" knowledge?

Practice! Start on small projects and hone your skills. Don't be afraid to make mistakes. Never be completely satisfied with your work, there's always room for improvement. Learn from what you do and try to do things differently the next time.

Most importantly, don't get too ambitious too soon. A lot of my own projects have failed because I was aiming for the moon and got stuck halfway through. You said you're an "I-want-to-do-an-MMO" person, then I say you shouldn't be thinking about that yet. Aside from the fact that maintaining a home-built MMO would be a practical impossibility, it takes many people, many years and an ungodly amount of resources to create anything that remotely resembles a proper MMO game.
Start small, get motivated and learn.

* Will I get chicks when I'm an Ogre Guru?

Not likely. In fact, Ogre will probably diminish your chances, unless you can become the next Peter Molyneux or something.

By the way, I don't agree on the "I can't write english and meaningful posts" thing. Your English is exemplary and if everyone wrote posts like you do, this board would be a whole lot more pleasant.
Last edited by Devil N on Mon May 07, 2007 1:31 pm, edited 1 time in total.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Post by lonewolff »

Can you download "Thinking in C++" as a pdf or equivalent?
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

I can't hear "Amiga" mentioned without jumping in! :)
Amos was damn cool. I used to do most of my gfx coding and experimental stuff in Amos, then port the algorithms to either C, E or assembly (E being my favorite).
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Well perhaps this will bring back some nostalgia. That's the AMOS source code to that windowing system/programming language I was talking about. :D
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

Betajaen: I think I know what you mean. :) Thanks again!

lonewolff: Hey, thanks for the answer! Actually I also had those back-n-gone times couple of years ago, when I tried to learn C++ and when I was trying out some of the engines. I think I'm trying to settle down with Ogre for now. :)

Devil N: Thanks for such a great post. I'm happy that you could understand my problem. :) Yes, it's true that we don't have any game programming / game designing classes and it's pretty frustrating. Thanks for sharing your learning resources and pointing me to the right direction!

syedhs: Thanks for the link! :)
User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi »

Same here like lonewolff and betajaen; I actually learned C++ to use Ogre, coming from a pink-easy-like Delphi world. Took about a year for me to get a firm grasp on C++. I just never expected to do miracles over night, or learn it fast, and it came naturally by practice and a little reading :) You should do faster though, as I'm a bit of a lunatic :)
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

Well if you'd like you can check out my work-in-progress "How to make a game with zero knowledge" guide :D
It's entirely c# and MOgre because seriously, unless you desperately want to work for someone else in a games company, I wouldn't bother with c++. I teach C# and MOgre to about 40 complete newbies and they pick it up, because it does away with loads of c++ wackyness and compiles instantly. And honestly at the level you will be using it, it's barely slower. Only actual 3d engines etc need the low level speed of c++. The main disadvantage is alot of good code isn't avaliable in c# but it's not really a problem most of the time (as MOgre shows)
http://www.ogre3d.org/wiki/index.php/Th ... ing_a_game

:EDIT: I updated it to Ogre 1.4 now
ps it's certainly not finished :)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

I started using Ogre two days after my first encounter with C++. I had never written a single line of C++ code nor read any before that. I had, although, been using Game Maker for 2D games, until I realised I should go 3D. I tried doing 3D with Game Maker's 2D engine, but it was too slow. I like the Object (game entity) organisation system of Game Maker. I decided that I should learn C++. After 2 days, I was too impatient, and just jumped into Ogre. I learnt all the C++ I know while working with Ogre. I tried to reproduce the Game Maker Object system using C++ classes. I wrote a small Game Object organisation system, and currently am working on the game mentioned in my signature. :)

C++ is a nice language. Don't leave it if you're confused at first. Everything will be alright 2 to 3 weeks later. Don't give up. Giving up is the only way to failure, since there is no enemy here. :)
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

betajaen wrote:Well perhaps this will bring back some nostalgia. That's the AMOS source code to that windowing system/programming language I was talking about. :D
you've done it now, you've forced me to post (repost?) a vid of my 1996 vintage AMOS game
http://users.on.net/~edan/games/Disorie ... il.com.wmv

Coolest game ever and ever, my flatmate sucked at it though ;)
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

raicuandi: Hey! Thanks for your answer and for giving me more inspiration. I'm a bit wacky aswell. :)

Vectrex: Hey Vectrex! Thanks for your answer aswell. I tried Mogre and I think it's great - but after reading about the industry standards I quickly figured that I should use C++ if I want to program for my living. I want to also keep using the latest version of Ogre any given time, and I think it's only possible by using C++. Nice and freeminded tutorial, thanks for sharing.

nikki: Hey nikki! I've tested your game earlier and it's pretty innovating. :) It's great that you've ported some of your Game Maker knowledge to C++. Keep up the good work!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

I started programming in Turbo Pascal, after a very brief encounter with Basic, on the C64. :D
The language C was my next project, but I knew that I had to find something to program which could grab my attention and make me want to learn the language..

Enter graphics programming ... :wink:

I read Christopher Lamptons book Gardens Of Imagination over and over, trying to decipher what it meant.
This book taught you to write your own raycast engine, like Doom ..

I still remember how thrilled I was when I wrote my first program in modeX ! :)

It was not until I found Ogre that I finally found an engine suitable for honing my C++ skills..

I find it very hard to learn something dull ... So, yeah: doing graphics programming is an excellent way to learn C++.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
big_o
Goblin
Posts: 279
Joined: Sun Feb 19, 2006 1:08 am

Post by big_o »

I first encountered programming in a strange form of Basic called JustBasic, but I quickly realized that creating a big project with it was going to be a nightmare and moved on to c.

I worked with c for about a year, but I found it too difficult to keep everything organized and structured, and moved to c++. I learned everything I know about c++ from working with ogre as well.

The hardest part in moving from c to c++ for me was learning to think in an object oriented manner. It can be difficult at first, but once you figure it out it becomes second nature. I agree with Jacmoe and the others, learning a programming language is much easier when you have something to motivate you through the frustrating times, and there will probably be quite a few of those.

Nikki:
C++ is a nice language. Don't leave it if you're confused at first. Everything will be alright 2 to 3 weeks later. Don't give up. Giving up is the only way to failure, since there is no enemy here.
Good advice! I find it far too easy to become my own worst enemy though.

I wouldn't worry about c# being non-standard, any future employer or professor is probably going to be more impressed by a single finished project written in c# than a half-dozen unfinished ones in c++.
User avatar
weshowe
Silver Sponsor
Silver Sponsor
Posts: 98
Joined: Sat May 05, 2007 3:27 am
Location: Rockdale, TX, USA
Contact:

Post by weshowe »

Kojack wrote:I can't hear "Amiga" mentioned without jumping in! :)
Amos was damn cool. I used to do most of my gfx coding and experimental stuff in Amos, then port the algorithms to either C, E or assembly (E being my favorite).
Me either. I did a lot of assembly programming on the Amiga, and later learned C on it. I still program a lot of defensive things because of compiler quirks (especially pre-ANSI ones), such as using "&buff[0]" to make sure I get a pointer to the first character of buff[].
Of course, I am not surprised that lots of graphic enthusiasts once were fascinated by the Amiga. In it's day, it was the greatest. Too bad the company became altitude challenged.

<* Wes *>
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

jacmoe: Hey, and thanks for your post. I get easily frustrated with single-function, boring applications so that's why I wanted to give Ogre a shot. After couple of days of tinkering and stumbling it all makes a bit more sense. :) Thanks for the tips!

big_o: Hello! Nice tips, and I agree with the motivation part. I want to get comfortable with C++, so I'm trying to forget all the other languages so I won't try to blame the language if I can't get nothing done.

weshowe: Hello to Amiga people aswell.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Vectrex wrote:you've done it now, you've forced me to post (repost?) a vid of my 1996 vintage AMOS game
Wow-sa, and I actually remember playing something like that. That's using AMOS, with two screens I imagine? How graphics technology has passed and yet they can't switch between resolutions halfway down the screen like the Amiga could, and it did it in the 80's. Perhaps if Commodore didn't suck so bad, Ogre would of been written on the Amiga rather on the PC. ;)

You should rewrite it - In Ogre; a style 2.5D game with LAN or Internet for multiplayer and using NxOgre as the physics engine. :D
User avatar
WhiskeyJim
Gnoblar
Posts: 20
Joined: Sun May 06, 2007 8:00 am

Post by WhiskeyJim »

I feel myself a bit confused in the middle of these Amiga freaks. Fluffy and comfy though. :?
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

WhiskeyJim wrote:... these Amiga freaks.
We prefer the term "Amigans" ;)
Post Reply