Programming

Discussion in 'General Chatter' started by Morven, Feb 26, 2015.

  1. Also technichally I learned in C++, but we didn't use any object-oriented features so it might as well have been C.
     
  2. NevermorePoe

    NevermorePoe Nevermore

    Does anyone have tutorials they'd recommend for learning C?
     
  3. Morven

    Morven In darkness be the sound and light

    I learned with the help of the original K&R book, but that was obsolete even then (late 80s). Not sure what's good now.
     
    • Like x 1
  4. BlackholeKG

    BlackholeKG I saw you making fire

    Fucking hell this code is a headache. Part of the issue is that I'm working with three different coordinate systems that I have to convert back and forth from depending on the context, because I built systems with different co-ordinates over the top of eachother ><

    Anyway, game update; line simulator 2k17

    upload_2017-4-15_14-52-49.png

    Next job is to write the code to load in level sections so they don't spontaneously pop into existence when you enter them, and also to unload sections because at the moment it renders a new set of polygons each time you enter a room and just dumps it over any previous set which really clogs up my render queue.

    I also have to push the code which loads that into a different thread because at the moment it's running in the main client thread which calculates things like player movement and the algorithm that generates the polygon sets is intensive enough that it causes the whole game to stutter whenever it has to load a room.
     
  5. BlackholeKG

    BlackholeKG I saw you making fire

    Anyway, things not to do again for future reference; create a text based adventure game and then awkwardly bootstrap a graphical interface on top of it, in a manner which looks vaguely like the graphical code is some sort of alien fungus burying tendrils in the initial text adventure code to hijack it.

    I've created the "the girl with all the gifts" zombie of game engines. At least it only spectacularly breaks some of the time.
     
    • Agree x 1
  6. winterykite

    winterykite Non-newtonian genderfluid

    or at least start with simple 2d png image displays. maybe some layering if you're feeling fancy.
     
  7. BlackholeKG

    BlackholeKG I saw you making fire

    Most of the game objects are represented with 2d png sprites but I needed to devise a system whereby I could dynamically create room walls with randomized roughness, which it turned out necessitated creating a whole 2D polygon engine.
     
  8. BlackholeKG

    BlackholeKG I saw you making fire

    Poking through Visual Studio's analysis tools, I today discovered the concept of cyclomatic complexity, and after looking through the listings for some of my more complex functions I have a feeling that professional programmers might be upset with me. *Looks at level generation and combat ai functions that weigh in at 100+*.

    Is it wrong though that I take a kind of pleasure at that, though? I have a real love of intricate complex systems. The relative code density is actually incredibly appealing to me, like seeing a clockwork with lots of tiny, intricate parts. Plus if I kept splitting everything into subfunctions then it'd just become a distraction. Is it probably a bad idea to work in such a way? Maybe? Am I going to keep doing it anyway? Almost certainly.

    Besides, I'm an amateur hobbyist, nobody's paying me to write more readable code, and nobody else is having to work with my code except for me, so /shrug
     
  9. BlackholeKG

    BlackholeKG I saw you making fire

    Besides I'm fairly sure that the thing I read about "splitting a section module if the CC exceeds 10" is in practice bullshit, unless I am missing the definition of module here and my code is already doing it. I mean, it's not like there aren't different distinct sections within continuous functions. Hell, sometimes I even separate them with code comments! (Sometimes. Occasionally.)

    I'd probably be able to work with these recommendations and the language they use more effectively if I'd ever actually taken a programming course. But! Oh well :P
     
  10. BlackholeKG

    BlackholeKG I saw you making fire

    Speaking of analytics, I wish there were more things I could run my code through to see the overall structure of it laid out. What I wouldn't give for some way to view program flow as like... a visual representation with lines to represent the connections between objects and variables. I DESIRE TO SEE THE WEB OF MY MACHINATIONS :D
     
  11. BlackholeKG

    BlackholeKG I saw you making fire

    Oh God dammit, of course the code maps feature would be restricted to the high cost versions of VS.
     
    • Agree x 1
  12. iff

    iff Well-Known Member

    i have a python question.
    Does anyone know how to import some of your code into your other code that is in the same directory in python 3?
    all the answers i can find are SUDDENLY WALL OF TEXT with multiple options and much meta discussion and i just cannot right now
    eta: I'm using python for blender scripting, which may affect things??
     
    Last edited: Apr 23, 2017
  13. chaoticArbiter

    chaoticArbiter an actual shiny eevee (destroyer of worlds)

    noofs into this thread
    I do not have an answer to the question above, for which I am sorry, but I am wondering if anyone knows a good place to start learning Python and/or Ruby
    I know C++ and Java pretty well, but I'd like to learn some other ones too
    I have.....no real idea what programming languages are mainly used for game programming, or really for any programming in general, so I figure I'll just learn the ones I've heard of the most and hope that works?
     
  14. iff

    iff Well-Known Member

    from what I've heard in random places c++ seems to be the language to learn for game development and apparently lua is used a lot for game dev scripting (not sure what that means tbh). Unity uses c#
    for learning python... there's this. it seems insufficient but it has a bunch of interesting-looking links at the bottom. And there's codecademy. (They both also have things for ruby)
     
    • Like x 1
  15. chaoticArbiter

    chaoticArbiter an actual shiny eevee (destroyer of worlds)

    :D!! thank you!
     
    • Like x 1
  16. winterykite

    winterykite Non-newtonian genderfluid

    There's also Khan Academy, and Learn Code The Hard Way, which has Python, Ruby, C, SQL, Javascript, Unix, and Regex.
     
    • Like x 2
  17. BlackholeKG

    BlackholeKG I saw you making fire

    Lookit my (currently highly incomplete) game thing progress

     
  18. NevermorePoe

    NevermorePoe Nevermore

  19. iff

    iff Well-Known Member

    this seems useful. it's an app that gives you 5 mins of programming tips and exercises per day. it has javascript, java, css, git, linux, compsci, and python, and it seems to have more advanced stuff than regular online courses, aside from beginner stuff
     
    • Like x 2
    • Informative x 1
  20. @NevermorePoe Nope sorry, I learned at community college.

    Yeah the big drawbacks of that are:
    1. You will probably end up repeating code, which makes your code harder to maintain, in the sense of refactoring/changing it as well as bug squashing
    2. It takes more time to write honestly because you'll forget you already wrote this and write it all out/think it all through all over again
    Like you said though you're a hobbyist, I'm not gonna wag my finger at you. Just be warned.

    What language and what exactly is a CC?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice