Thread: Beginner needs help

  1. #1
    Registered User
    Join Date
    Sep 2007
    Omaha, NE

    Beginner needs help

    Howdy. I'm not a programmer by trade, in fact, I am extremely new to it, and am largely picking up programming as a hobby. However as a fairly new SysAdmin, I figure some C knowledge, and perhaps some Bash scripting would be valuable tools to pick up for my job as well.

    When I was in high school I took some programming classes (a long while back) and learned some basic concepts, but they taught Basic and Pascal, not to mention I took those classes near 15 years ago.

    I've been reading a C book, but I need to learn to apply the concepts, so I'm getting my hands dirty. I wanted to start small, but do something useful at the same time. I've been very interested in game programming, however doing a game from scratch seems a bit intimidating for my very first project. So I decided to take an open-source game and attempt to extend it.

    I decided to go with Slash'em, a rouge-like opensource game hosted on Sourceforge. It is based on Slash, which is based on Nethack, which is based on Hack, which is based on Rouge.

    I've been reading over the code base, and trying to learn in/understand it as best as I can. I've also been looking at existing patches that modify nethack and slash'em (there are far more nethack patches floating around). So, to start small, I decided to take a hunk of code written for nethack, and convert it to work with slash'em. The code is a pretty big patch (1 meg) but the two codebases are fairly similar.

    At the end of the day, I got all the code inserted, and started fixing the compile errors.

    It *mostly* compiles, in that all the actual *.c code compiles just fine save for a couple warnings that have me scratching my head.

    Now, the game data is stumping me a bit, except it may be bugs from me not properly doing the coding parts.

    After the code is compiled, the makefile then uses tools it just compiled to generate the levels, and tiles/graphics for monsters and objects.

    Both of these areas are expanded from the original Slash'em code. I used existing code from a patch, and not only have I verified a million times that it is inserted correctly, but I also keep comparing it against existing code for the same things (adding bitflags for the levels and such) and I can't find anything wrong.

    I've hit a wall, and after staring at the code for two days, I don't know what to do. The original author of the code I'm porting can't be reached (he wrote it years ago) and I'm at a loss.

    I hate effectively asking people to help me with what is my project, but would someone be so kind to look over the code, and help me unbork what I borked?

    I'll upload to my site (when I get home) a bzipped version of the patch, or I can email it to anyone if they are willing to take a look at it.

    And for what it is worth, I've attempted compiling it in Cygwin with gcc, and with MinGW with gcc (so gcc under a fake Unix, and under Windows). I generally work on this at work (where my job is continual downtime) as opposed to home, where I have no free time, though I plan on testing it at home under Linux as well.

    Thank you very much for your time and consideration.

  2. #2
    Fear the Reaper...
    Join Date
    Aug 2005
    Toronto, Ontario, Canada
    In all honesty, starting with a game as your first coding project is no less daunting then making one from scratch. You still have to understand the mountains of code that was previously written, and if you have little or no coding experience...that's just not going to happen.

    If you want to apply concepts, you're much better off sticking to console applications for a bit and progressively making your way up to graphical applications.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  3. Books, Beginner, MustHave
    By Zeusbwr in forum C++ Programming
    Replies: 9
    Last Post: 10-25-2004, 05:14 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM