Thread: GUI & Internet, very basic level

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    7

    GUI & Internet, very basic level

    Hello everybody!
    Programmer-wannabe here.

    All I know is fundamental C programming, I'm just a beginner.
    Lately I've came up with this idea: a very basic software allowing a set number of users to play a classic dice-rolling rpg.

    Basically all that it should be able to do is:
    - allow the Dungeon Master to show pictures on screen (and maybe move around some of them, like let's say in combat situations, updating the results real-time for other players)
    - allow the players to virtually throw dices
    - simple chatting functions.

    I perfectly know that my current knowledge is abslutely insufficient for such a thing. So I was wondering if somebody could point me out some resources, or at least directions, that would serve me as a good starting point in learning the skills I need.

    In particular, I am intresting in learning the basics of:
    - graphic user interfaces and implementation of code into them
    - network (internet) programming concepts

    Best would be to find some tutorials about how to make small applications around those subjects, but every suggestion is highly appreciated ^^ !

    (Since the software is kinda like a game, I posted this here. Hope it is fine...)

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    The GUI you speak of could be implemented with a simple 2D interface such as SDL or HGE, along with the rendering of your pictures on the seperate displays.

    Do not quote the following information.

    For the networking aspect you will have to use Sockets ( WinSock as an example ), with your
    software have client/server functionality. You will need to have client/server built into one program if you intend on allowing anyone to host games as a DM.

    You would need to distribute whatever pictures you intended to use with your software, and assign each asset a unique ID in which to send over the network.
    i.e.
    Dragon.png Unique ID = 0x001F
    You would then send 0x001F to each of your connected clients or players, and the Dragon.png would be shown during the update phase.

    Of course more information would be needed such as render location, delays, scaling, or whatever you needed or decided to use.

    Sockets are difficult to learn, but if you have a extra pc to test your client/server side by side it makes it much easier.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    In particular, I am intresting in learning the basics of:
    - graphic user interfaces and implementation of code into them
    - network (internet) programming concepts
    Which could comprise well over 20 to 30 thousand lines of code to do this correctly. I suggest you go read some books since there is no way any of us can address those issues in one thread or even a hundred threads.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    @original poster: There are APIs out there people have written to simplify using GUI's. CEGUI is one example for Graphical implementation, or wxWidgets for a general application look.

    There are also networking APIs, but I have never used any of them, but a quick search of google should come up with some results.

    Although, VirtualAce is right, even using an API to implement a big portion of the code, it will still be a difficult project.

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    7
    Thanks for the infos, I've gathered some material covering what you mentioned. All I have to do is absorb it, and seems like it's going to take quite a while.

    Thx =)

  6. #6
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    If I were you I would start with one or the other. Make a GUI where you can move images around and input text (and capture the text input) and show text and roll a dice without any network connectivity at all. Also make a console based mini-version where maybe instead of showing images you allow the dungeon-master send text to clients and maybe the dungeon-master rolls the dice and tells the player what he got or something along those lines.

    When you have both of these separately working it should be considerably easier to stich together rather than attacking both things at once.

  7. #7
    Registered User
    Join Date
    Jan 2011
    Posts
    7
    Yeah that's what I'm planning to do, far more realistic than the whole project all at once =)

  8. #8
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Since you intend to do this online, you might consider using a web interface. They are faster to construct, your user's don't have to install anything, and you don't have to worry about portability. It would require http negotiation tho -- or you could use a regular ol' webserver. CGI is very easy to understand and can be done in C/C++.
    Last edited by MK27; 04-05-2011 at 08:20 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

  9. #9
    Registered User
    Join Date
    Jan 2011
    Posts
    7
    I always thought cgi meant "Computer Graphics I-something". Ah, ignorance...
    Wikipedia page bookmarked, thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help beggining GUI prgramming in c/c++
    By draigan89 in forum C Programming
    Replies: 2
    Last Post: 04-16-2010, 09:34 AM
  2. New to c++ some specific questions, gui, db, xml
    By bpr in forum C++ Programming
    Replies: 4
    Last Post: 01-12-2010, 12:48 PM
  3. 2 internet connections
    By Erakis in forum Windows Programming
    Replies: 0
    Last Post: 07-01-2009, 07:14 AM
  4. GUI Programming :: C++ Exclusive
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2002, 03:22 PM
  5. C++: Reference Book, GUI, Networking & Beyond
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2001, 08:03 PM