• The Entrepreneur Forum | Startups | Entrepreneurship | Starting a Business | Motivation | Success
  1. Join 40,000+ entrepreneurs
    who are kicking butt and
    winning their dream life.

    Unscripted™ Entrepreneurship:
    A Business That Pays More Than Money, It Pays Time.

    "Fastlane" is an entrepreneur discussion forum based on The Unscripted Entrepreneurial Framework (TUNEF) outlined in the two best-selling books by MJ DeMarco (The Millionaire Fastlane and UNSCRIPTED™). From multimillionaires to digital nomads, the forum features real entrepreneurs creating real businesses.

    Download (Unscripted) Download (Millionaire Fastlane)  Register
    Registering for the forum removes this block!

EXECUTION Learning C (Game Programming) Progress Thread

Discussion in 'Progress/Execution Threads' started by SputnicK, Jan 23, 2019.

  1. 404profound
    Offline

    404profound Gold Contributor I've Read UNSCRIPTED Speedway Pass

    Messages:
    862
    Likes Received:
    1,774
    Joined:
    Aug 27, 2017
    Gender:
    Male
    Location:
    Desert of Desertion
    Rep Bank:
    $3,659
    It sounds like you may have taken C fundamentals for granted. Following a tutorial is one thing, but you won't retain an understanding of why the code is doing what it's doing that way - especially if you don't have a firm understanding of the fundamentals. I fell into the same trap when I first got into javascript, and JS is far easier than C. Once I focused on mastering the fundamentals the rest came pretty easy.
     
    SputnicK likes this.
  2. SputnicK
    Offline

    SputnicK Contributor Read Millionaire Fastlane I've Read UNSCRIPTED

    Messages:
    16
    Likes Received:
    21
    Joined:
    Dec 23, 2017
    Gender:
    Male
    Location:
    Kansas
    Rep Bank:
    $116
    I definitely am missing some of the fundamentals, at least when it comes to memory management. IDK what to do besides follow some very basic tutorials or purchase a book. Any ideas? I was thinking that messing with code might be a good idea to get a better idea of the language, but perhaps that learning should be supplemented with simple tutorials so that I really understand it.
     
  3. 404profound
    Offline

    404profound Gold Contributor I've Read UNSCRIPTED Speedway Pass

    Messages:
    862
    Likes Received:
    1,774
    Joined:
    Aug 27, 2017
    Gender:
    Male
    Location:
    Desert of Desertion
    Rep Bank:
    $3,659
    I don't know anyone personally who works in C, but I have seen word floating around from C developers recommending these books:

    Prata’s C Primer Plus 6th Edition (or whatever the latest edition is when you read this)

    Kernighan & Ritchie’s The C Programming Language 2nd Edition (aka K&R2)

    I think what really helped me was using new concepts to build simple things. Once I was able to apply a concept to my own idea it became clear how it worked.. or StackOverflow made it so.
     
    SputnicK likes this.
  4. Rabby
    Online

    Rabby Silver Contributor Read Millionaire Fastlane I've Read UNSCRIPTED FASTLANE INSIDER Speedway Pass

    Messages:
    300
    Likes Received:
    543
    Joined:
    Aug 26, 2018
    Gender:
    Male
    Location:
    Florida
    Rep Bank:
    $3,526
    For a text-based adventure I would use something simple and friendly, like Ruby or Python or Lua. I know you want to learn C, but it's worth noting that you don't need memory management and low level control for a text game.

    What you may want to do, eventually, is write the things that need to be fast in C, and glue them together with one of the three above (or something quick and high level).

    PS: Whatever language or project you do, try to do a little every day. If 2-3 days go by and you have to go back to it, the load on your brain is heavier. Even if it's only 15-20 minutes on a really busy day, play with code and do something. Once you've been writing code for a few years, you can walk away for a few months and your hands will still know how to code without you, but right now you need to keep it fresh in mind.
     
    SputnicK likes this.
  5. SputnicK
    Offline

    SputnicK Contributor Read Millionaire Fastlane I've Read UNSCRIPTED

    Messages:
    16
    Likes Received:
    21
    Joined:
    Dec 23, 2017
    Gender:
    Male
    Location:
    Kansas
    Rep Bank:
    $116
    You are so right, being inconsistent is absolutely a problem for me. I go a few days at a time where I don't program and then have to make up for it on the back-end. I suppose I should make it a daily ritual, perhaps first thing in the morning. I know programming is the kind of activity that really requires dedicated time to focus and get into the rhythm and I tend to get very distracted.

    As for writing the game in the C language is absolutely an obstacle but it's one I'm willing to deal with in the short term. If I face more challenging obstacles I would think about using Java instead, which I am very familiar with compared to C.
     
    Rabby likes this.
  6. masterneme
    Offline

    masterneme Silver Contributor Read Millionaire Fastlane I've Read UNSCRIPTED Speedway Pass

    Messages:
    276
    Likes Received:
    639
    Joined:
    Apr 13, 2015
    Gender:
    Male
    Rep Bank:
    $4,057
    I suggest you switch to C++ and start applying the new knowledge building stuff ASAP.

    Take a look at this link:

    The Definitive C++ Book Guide and List

    If you're interested in videogames you'll have to learn even more stuff, like patterns and algorithms for game logic and the different ways game engines and other frameworks make use of the different C++ methods to build games, so it's another layer of stuff to learn.

    And this takes time (a lot).

    I thought about learning C too, "because it's cool", but at the end of the day finishing projects and prototypes is what will give you the learning experience you need and will teach you proper good coding practices.

    Finishing and releasing titles is what you need and what will give you the competitive edge in the business, much more than reading and learning different languages.

    Getting your hands dirty is what counts, solving the next problem at hand and then the next one.
     
    Rabby, lowtek and 404profound like this.
  7. lowtek
    Offline

    lowtek Platinum Contributor Read Millionaire Fastlane FASTLANE INSIDER Speedway Pass Summit Attendee

    Messages:
    1,292
    Likes Received:
    3,970
    Joined:
    Oct 3, 2015
    Gender:
    Male
    Location:
    Phoenix, AZ
    Rep Bank:
    $26,393
    I'm rooting for you.

    If you want a project not related to games, check out this one

    Learn C • Build Your Own Lisp
     
  8. lowtek
    Offline

    lowtek Platinum Contributor Read Millionaire Fastlane FASTLANE INSIDER Speedway Pass Summit Attendee

    Messages:
    1,292
    Likes Received:
    3,970
    Joined:
    Oct 3, 2015
    Gender:
    Male
    Location:
    Phoenix, AZ
    Rep Bank:
    $26,393
    I generally agree with you, and switching to C++ isn't a stupid suggestion. My only complaint there is that it's easy to get lost in the complexity of the language. Which C++ are we talking about here? The various iterations are so disjointed that it's easy for a novice to get confused.

    IMHO it's easier to learn the fundamentals of programming with a language that isn't so complex that even the people who wrote it don't comprehend it fully.
     
    masterneme likes this.
  9. masterneme
    Offline

    masterneme Silver Contributor Read Millionaire Fastlane I've Read UNSCRIPTED Speedway Pass

    Messages:
    276
    Likes Received:
    639
    Joined:
    Apr 13, 2015
    Gender:
    Male
    Rep Bank:
    $4,057
    Yeah that's definitely a problem.

    Maybe starting with something like raylib could be a good option before trying more advanced engines/frameworks.
     
  10. SputnicK
    Offline

    SputnicK Contributor Read Millionaire Fastlane I've Read UNSCRIPTED

    Messages:
    16
    Likes Received:
    21
    Joined:
    Dec 23, 2017
    Gender:
    Male
    Location:
    Kansas
    Rep Bank:
    $116
    Update week 2/6/19-2/13/19 (WK3):
    I took @404profound's advice this week and am now focusing more on "fundamentals" of C. I followed a 4.5 hour tutorial series covering the C language, some of which was review but it also covered a significant amount of material. It was a great beginner guide overall.

    I also finished the essential segments (up to segment 9) of the C text adventure series I started last week. This series is extremely complex for such a seemingly simple topic and some of the implementation was outside my grasp. I think it was good practice regardless and I enjoyed following it.

    Here is a link to my personal code from the C text adventure series I followed. It is a few hundred lines and demonstrates the basic proof of concept even though most of the locations and items are undefined. I used the online compiler OnlineGDB.

    Links:
    C Programming Tutorial | Learn C programming | C language
    How to program a text adventure in C
    Personal code from text adventure series

    Plan for next week 2/13/19-2/20/19:
    I want to focus this week on consistency more than anything. @Rabby made a very good point that programming requires daily practice, and this week (just like last week) I put it off until a couple days before my next update was due. I plan on spending at least 45 minutes every morning on programming next week so that it doesn't get put off and disregarded. In the long-term making this a habit will yield greater dividends than more intense but inconsistent methodology in the moment.

    In terms of results, I will continue to learn and strive to master fundamentals of C. I will follow some more tutorial series but also attempt to practice more of what I have learned. I don't like going three weeks without displaying tenable projects of my own, so next week expect something of that nature, even if it is only as simple game simulator (such as Tic-Tac-Toe.) I saw a thread the other day on this forum stressing the importance of "showing" instead of just "telling" and I'm afraid I doing too little of the former and too much of the latter. Hope I can improve in this regard.
     
    Last edited: Feb 14, 2019 at 6:35 PM
    404profound and Rabby like this.
  11. 404profound
    Offline

    404profound Gold Contributor I've Read UNSCRIPTED Speedway Pass

    Messages:
    862
    Likes Received:
    1,774
    Joined:
    Aug 27, 2017
    Gender:
    Male
    Location:
    Desert of Desertion
    Rep Bank:
    $3,659
    Great job with the progress!

    Now that you see the rigor involved to learn C, what are your thoughts? Do you see yourself going down this path, which requires patience and serious time investment, or is your priority making money in the short-term? This is a non-trivial question, because which one you commit to will likely determine if you should fully invest in C. You obviously realize how involved low-level programming is now, so I'm curious if you still have the same strategy.

    - Cheers
     
    SputnicK likes this.
  12. daru
    Offline

    daru Bronze Contributor Read Millionaire Fastlane I've Read UNSCRIPTED Speedway Pass

    Messages:
    165
    Likes Received:
    271
    Joined:
    Feb 11, 2017
    Gender:
    Male
    Location:
    Earth
    Rep Bank:
    $1,167
    Hey, couldn't access your code. Put it on Github or Bitbucket perhaps?
     
    SputnicK likes this.
  13. AfterWind
    Offline

    AfterWind Bronze Contributor Read Millionaire Fastlane I've Read UNSCRIPTED

    Messages:
    64
    Likes Received:
    122
    Joined:
    Jul 23, 2017
    Gender:
    Male
    Location:
    Romania
    Rep Bank:
    $618
    Here is a 3D game engine I created in C using OpenGL and standard stuff that is used for a game engine with the goal to learn as much as possible regarding game programming. I also have a lot of C tutorial videos that explain how to do certain operations while helping you understand the why behind it. Feel free to PM if you're interested (don't want to spam here) or have any specific question.

    It's a great idea to start with a basic text adventure game. Work on that, get it to a semi-finished product while also understanding C and continue challenging yourself. Step it up to a 2D game then a 3D game. Whether it's a 2D game or 3D game that you'll be working with you will have to understand the basics behind game engine if you want to focus and grow the community of a few games in the future.

    There is great money (and success) to be made in the game development industry but it takes a ton of patience and hard work, as most things here. (some examples of great games that required exemplary : Factorio or Path of Exile in which the amount of thought that was put into them is insane, not just in the game itself but the community too and it shows).
     
    SputnicK likes this.
  14. SputnicK
    Offline

    SputnicK Contributor Read Millionaire Fastlane I've Read UNSCRIPTED

    Messages:
    16
    Likes Received:
    21
    Joined:
    Dec 23, 2017
    Gender:
    Male
    Location:
    Kansas
    Rep Bank:
    $116
    I am not interested in making money any time in the near future. My main objective is to increase my competence and ability in making games. I think if I spend a significant period of time creating in pure C the foundations will transfer over nicely to C# in Unity 2D. Then I will think about ways to monetize what I have learned. In the meantime I think C is a great language and there is much more I can learn from it.

    I believe I have fixed the problem. I linked it using the "share" link this time, which I hope is different. If it doesn't work this time I will upload it to Github.

    That is incredible dude! I can't believe you created an entire 3D engine in C. I love that you did it just to improve at game programming. That is the legit method, actually mastering fundamentals and learning game engines properly. May I ask what library you recommend for 2D? I assume you recommend OpenGL for 3D. I am interested in your process: how did you get to your current level of proficiency? I think based off your results are a great role model.

    I have PM'd you on the tutorial series.
     
    404profound likes this.

Join 1000s of entrepreneurs who are rewriting life's script and winning financial freedom.

---- ----

You must be a member to join the conversation.

Create Account

Join the community fast and easy!

REGISTER

Log In

Already have an account? Login here.

LOG IN

Share This Page