Game NU

Discussion in 'Community Creations' started by Zaart, Aug 25, 2019.

  1. Zaart

    Zaart Deer Master Race

    Joined:
    Oct 15, 2016
    Messages:
    1,320
    Likes Received:
    2,011
    Reading List:
    Link
    Last edited: Aug 25, 2019
    AMissingLinguist, Reak and C_tgl like this.
  2. MaliMi

    MaliMi The Cookie Guardian

    Joined:
    May 24, 2017
    Messages:
    246
    Likes Received:
    1,514
    Reading List:
    Link
    In school myself, so my help might be limited, but... Well, to help you, you should post your code. Also, tried stackoverflow? C is good for computation thanks to its speed, but I am not sure how it fares in visualisation compared to other languages. Anyway, thanks to Qt it should be getting better. Or did you try VTK library?

    Also, one of the problems with C is that although you can compile it anywhere, you must compile it first before you run it, unlike java where you compile it once and then you can run it anywhere (IIRC, please correct me if I am wrong. Have not tried java yet).
     
    AMissingLinguist likes this.
  3. Deleted member 155674

    Deleted member 155674 Guest

    Reading List:
    Link
    Because there are alot of more specialized programs for making games such as Unity, as for programing in general, C is considered one of the hardest programming languages to use (I am not saying it is bad, if anything it is a very powerful and excellent language to use), people don't like using low level programming languages and who does with lots of new powerful languages that are way simpler to use and understand :blobsweat_2:
     
    Amethyss, Digix and MaliMi like this.
  4. Digix

    Digix Owl-sama Follower

    Joined:
    Mar 12, 2017
    Messages:
    1,195
    Likes Received:
    1,546
    Reading List:
    Link
    +1 to @Kalto
    also game engines are literally built for this C is not. most game engines are also free and come with many tutorials and free plugins unity is probably the easiest to learn currently.
     
    Deleted member 155674 likes this.
  5. Zaart

    Zaart Deer Master Race

    Joined:
    Oct 15, 2016
    Messages:
    1,320
    Likes Received:
    2,011
    Reading List:
    Link
    https://drive.google.com/open?id=1PqYdKGs6XJRZ7a67d5mD7GkXJ8i1YOl4
     
  6. Digix

    Digix Owl-sama Follower

    Joined:
    Mar 12, 2017
    Messages:
    1,195
    Likes Received:
    1,546
    Reading List:
    Link
    @Zaart to give you an idea on the difficulty and silliness of making a game in C. It would be like digging a well to get a glass of water instead of turning on the faucet to get a glass of water.
     
  7. sleepingloli

    sleepingloli Well-Known Member

    Joined:
    Feb 13, 2019
    Messages:
    60
    Likes Received:
    65
    Reading List:
    Link
    More like getting a degree on Linguistics so you can get a perfect score on a high school essay.
     
    AMissingLinguist and Digix like this.
  8. Zaart

    Zaart Deer Master Race

    Joined:
    Oct 15, 2016
    Messages:
    1,320
    Likes Received:
    2,011
    Reading List:
    Link
    well it still work -.-
    but if you have something better that is not unity i am all ears ^^
     
  9. MaliMi

    MaliMi The Cookie Guardian

    Joined:
    May 24, 2017
    Messages:
    246
    Likes Received:
    1,514
    Reading List:
    Link
  10. sleepingloli

    sleepingloli Well-Known Member

    Joined:
    Feb 13, 2019
    Messages:
    60
    Likes Received:
    65
    Reading List:
    Link
    I'm not complaining. C is wonderful for execution speed, low resource usage, and executable sizes. If all you want is to learn C, then your approach is as nice as it can get.

    But if you want to go down the game development path, you usually want experience developing the games themselves. Testing ideas, iterating fast, making a bunch of games as fast as possible so you can get the feel for it, for the process, the requirements, dependencies, your target market (if you're going legit), etc.

    And if you don't know C very, very well already; and you haven't had your fair share of experience building programs on the operating systems you will be targeting; then you will only get slowed down for trying to learn too many things at the same time, and maybe discouraged for the lack of progress in your game.

    (Btw I haven't found much documentation of the SFML C API so I can't say for sure, but if `sfText_setString` is copying the string instead of using the pointer as-is, then you probably have a memory leak.)
     
    AMissingLinguist likes this.
  11. Zaart

    Zaart Deer Master Race

    Joined:
    Oct 15, 2016
    Messages:
    1,320
    Likes Received:
    2,011
    Reading List:
    Link
    there is a create text and a destroy text function ^^
    no problem ^^
    but if you ever are interested
    https://www.sfml-dev.org/download/csfml/index-fr.php
     
    MaliMi likes this.
  12. sleepingloli

    sleepingloli Well-Known Member

    Joined:
    Feb 13, 2019
    Messages:
    60
    Likes Received:
    65
    Reading List:
    Link
    I'm more talking about stuff like

    Code:
    rpg->coin = text_crea(inttochar(rpg->money), NULL, 734, 160);
    ... where `inttochar(rpg->money)` returns an malloc'd string which is passed to `text_crea`, and inside `text_crea` (as `char *disp`) you only mention it in the line `sfText_setString(text->text, disp);`.

    The stuff you malloc'd inside `inttochar` is never freed by you. So, if `sfText_setString` is copying the string instead of using it as-is (and my C++ knowledge is zero but this looks like it is indeed being copied), you will now have the C string you malloc'd in `inttochar` never used again but forever in memory until the program ends, and also whatever C++ thingy is created from that string for whatever lifetime it has.
     
    AMissingLinguist likes this.
  13. Zaart

    Zaart Deer Master Race

    Joined:
    Oct 15, 2016
    Messages:
    1,320
    Likes Received:
    2,011
    Reading List:
    Link
    oh thanks, i must say i indeed rushed the end a little bit
     
  14. lighterxx

    lighterxx Hoshi stan before a human °^°)

    Joined:
    Jan 31, 2019
    Messages:
    1,269
    Likes Received:
    2,143
    Reading List:
    Link