Thread: Your experience from text to graphics.

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    18

    Your experience from text to graphics.

    I've spent much of my free time, for the last few weeks, learning as much as I can about c++. My first goal was to be to make a text-based rpg. I wasn't concerned, or even very interested, in the graphics. Instead, I was focused on creating a game that had in-depth systems such as crafting.

    Well now I think I have the basics down; I have the functioning framework for loot, file save/load, turn based combat, random encounters, story, crafting, etc....

    From here, I am confused as to where to progress. Maybe some of you game devs can look back to your beginner days and help me (and others) with some questions.

    Would it be wise to start with acsii "graphics", then move to real 2d, then move to 3d?

    How much of working with graphics does one do from scratch, and how much is standard copy/paste material? I picked up a "Programming with DirectX" book, and was surprised to find that just producing an empty windows window required nearly 60 lines of code. I was able to point out a function here, and a class there. But for the most part it seemed like technical jargon far beyond my understanding. Is there some middle point, or am I supposed to just jump in using code that I don't understand?

    Was C++ the wrong choice for a first language?
    I feel like I have accomplished a lot in the last few weeks, going from no understanding of coding, to being able to work with basic functions, classes, and pointers etc. But I feel like working with graphics through c++/windows must be infinitely difficult. I am a graphic designer, so maybe I expected to be able to start fleshing out the game sooner than what is realistic. Is there another language that can make a concept tangible in shorter timer?

    Thanks ahead of time.

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    I certainly don't think you've chosen the wrong language. I would suggest moving into 2D, being able to draw ASCII "Graphics" isn't going to teach you much.

    Have you considered helper libraries like SDL?

  3. #3
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    My first goal was to be to make a text-based rpg. I wasn't concerned, or even very interested, in the graphics.
    That's a great place to start with your games - I fear too many beginners are so concerned with graphics and are ultimately disappointed when they start programming in OpenGL and realize that drawing a cube takes upwards of 20 lines. Or even when they start their endeavors in ogre3d, and they don't know what the [bleep] is going on.

    Would it be wise to start with acsii "graphics"
    But if you're looking to integrate graphics into the picture (and I don't blame you, I find text-based games a little tedious to play myself), then ASCII graphics are definitely not the way to go (as zacs already said). The only real library for doing that anymore is ncurses (take a look at the man page) and it's not exactly the best-designed library in the world.

    If you're interested in a history lesson then go straight ahead and do the ASCII graphics. It's fun for a while. But eventually you're going to move on to actual picture-graphics - it's inevitable. SDL is a nice library but I personally think that allegro (especially the older version - ie, v.4.4) is a lot easier to learn.
    Last edited by bernt; 06-02-2010 at 07:33 AM.
    Consider this post signed

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Do 2D first since you can then start learning your target API (directX). 2D is quite simple (probably simpler than ascii, which is 2D but will require more low level stuff I think).

    Quote Originally Posted by Xanderbeard View Post
    Is there another language that can make a concept tangible in shorter timer?
    Probably (python seems to be increasing in popularity for this), but if you've already gotten into C++, why bother.

    I think anyway you slice it graphics programming is going to seem overly complex -- but I think that's true of most programming realms. Everything with a computer turns out to be more complicated that you would think, because they can't intuit anything and must have the most basic details explained, in detail. Details so basic you probably have not even considered their existence. Detail on top of detail, and they all interact and influence one another. That all adds up to complexity!

    There's a lot of math in graphics. You probably need basic trig for 2D, this rapidly gets more complex in 3D. Ever heard of the dot product? That stuff is not impossible to learn, but if you do not have a math background, it will probably seem very tedious and awkward to work with (does to me), at least for a while. Practice practice practice.
    Last edited by MK27; 06-02-2010 at 07:41 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    18
    Thanks for the replies, I am looking into the posted resources now.

    I played around with ascii using simple 2d arrays just to get a feel for how I would do a 2d 'tile-based' game. I worked out a simple collision detection system by making some tiles push the player back if they try to move there.

    I am unfamiliar with helper libraries. I've basically just been working with whatever my compiler came with.

    I don't really have any interest in 3d graphics or animation at this point. I'm almost entirely focused on gameplay mechanics. I would like to get some simple 2d graphics going though. As a graphic design, I am anxious to start designing a GUI.

    So SDL and allegro make windows programming with Direct X easier?
    Last edited by Xanderbeard; 06-02-2010 at 09:15 AM.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Just use Direct3D or OGL and forego the other libs. Once you learn Direct3D or OGL then feel free to use other libs to take care of the nitty gritty. If you deprive yourself of the nitty gritty now in the learning phase you will become too heavily dependent on 3rd party wrappers for Direct3D and OGL and won't know what is going on without them being present.

    Before using SDL or Allegro you should be able to create a window and render 2D or 3D or both to that window. If you can't do that then you shouldn't be using them.

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I would suggest learning 2D graphics first before jumping into 3D graphics with DirectX or OpenGL. 2D graphics are much simpler and you can still do things like display and rotate bitmaps, simulate gravity and collisions and that sort of thing . . . .

    I highly recommend the SDL. The learning curve isn't too bad and there are quite a few good tutorials about it, such as this one: Lazy Foo' Productions
    Apparently Allegro is pretty good as well, I don't really know it so I can't really comment.

    Here's an example of the sort of game that you should be able to create before too long if you're fairly proficient with C++: nort

    I personally went through a very long process of learning graphics. I started with standard C text-based games, then went on to using DOS text-mode graphics (basically the equivalent of ncurses). After a while I got tired of that and started using actual DOS graphics in the 256-colour 320x200 resolution DOS screen mode 13h. Eventually this became too restrictive as well so I started using the SDL. At some point I switched to C++, and I have a number of C++ projects using the SDL that are not too bad.

    Only then did I start learning OpenGL.

    I don't suggest going through a whole process like I did -- there's not too much value in it really (and anyone today suggesting you learn DOS graphics should really figure out which decade this is). The SDL is definitely a good place to start . . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    and anyone today suggesting you learn DOS graphics should really figure out which decade this is
    Agreed but some of the concepts gained during that time are invaluable in the current modern era of graphics. The concepts still apply when it comes to how to access textures, surfaces, etc. and as far as matrix transformations work since that is pure math and does not change regardless of the 'era' we are in.

    You can do 2D with OGL and D3D just fine and there are about a million tutorials and books out there that address how to do this.

  9. #9
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    You should _really_ consider using SFML rather than SDL imho. SDL is C, SFML on the other hand has a proper C++ interface with classes, templates, overloaded operators and exceptions, it does everything SDL does, and on top of that it has support for GLSL. Finally, the rendering speed has been proven to be many times faster than SDL.

    Oh and if you wish to follow Bubba's advice, you can simply use SFML for stuff like input, sound and setting up a rendering context, while using OpenGL for the graphics. (SDL does this aswell i should add, but again, it's alot more clumsy.)
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Detecting Edit Control Text
    By yoonkwun in forum Windows Programming
    Replies: 2
    Last Post: 07-12-2009, 08:48 AM
  2. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  3. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  4. How to use FTP?
    By maxorator in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2005, 03:17 PM
  5. Small HTML question
    By Thantos in forum Tech Board
    Replies: 4
    Last Post: 12-29-2003, 12:37 AM