[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/agdg/ - Amateur Game Development General

AGDG - The Board
Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
dicesidesmodifier

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov, swf, pdf
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


Welcome to AGDG, keep working on your game anon!
See also: /ideaguy/ | /vm/

File: 246c9c276c941ff⋯.png (25.69 KB,468x312,3:2,quake3-files.png)

401655 No.28201

Hey /agdg/

I'm building a game in the Quake 2 engine. I'm learning C from online tutorials but I'm wondering if you guys know of any good resources for learning C.

I know realistically it's going to take a while before I'm competent enough to advance beyond scripting in the engine but I'd like to get started somewhere.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28202

File: 5e89e6dd00fd590⋯.png (40.98 KB,1000x1405,200:281,The_C_Programming_Language….png)

Anything else is haram.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28203

File: 0aa9ff85d33c4d6⋯.jpg (2.55 MB,2340x4160,9:16,20161201_230530.jpg)

pict related,

also, learning C isn't that long if you already have some programming knowledge. It's not a massif language in size. To me C has always been the cleanest language I've learned in my life.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28204

File: c0515e1b6964489⋯.jpg (135.34 KB,1000x750,4:3,snhvea1.jpg)

>>28202

Someone I know actually has the first edition of this book. He had it in university. It's old as shit and ragged.

I have a pdf of the second version and I noticed a difference immediately between the two. In the hello world program the first version of C lacks the #include<stdio.h>

I know that #include points to a header file, which includes the print function, the brackets refer to a system file rather than one of my own files, and stdio.h is the specific file in question. (at least this is my laymen's point of view of what that command is. Pls don't bully)

Are there any other differences between the two versions?

>>28203

>also, learning C isn't that long if you already have some programming knowledge

The most I've done is scripting in some game for mod projects. I've never done straight programming before. But I have to learn it in order to make the game i have in mind.

I read online somewhere that learning C as a first language was the equivalent of learning how to drive stick compared to learning other languages like Python

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28231

>>28204

>learning how to drive stick compared to learning other languages

absolutely not! My first langauge is actually C when I was 13(took me a full year cause I wasn't the brightest kid). I will recommend C as you first language! Atleast, the first month.

let me recommend you the most vulgarized tutorial on the web: https://www.youtube.com/watch?v=2NWeucMKrLI&list=PL6gx4Cwl9DGAKIXv8Yr6nhGJ9Vlcjyymq&index=1

It's a great channel for people who wishes to learn basic computer programming.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28237

File: 04e180cdd100c6f⋯.pdf (1.85 MB,ModernC.pdf)

God damn, OP, you've got some great timing. Jens Gustedt just released a free book on modern C for beginners: https://gustedt.wordpress.com/2016/11/25/modern-c-is-now-feature-complete/

PDF: http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf

I've only skimmed it, but it's written really damn well, and seems to have really fucking good coverage. I'd recommend it.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28238

File: 9a34a41b0168eac⋯.jpg (26.68 KB,648x486,4:3,0d94c006a22257cd441657462b….jpg)

>>28231

>>28237

Thanks a lot anons

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28274

>>28204

> the equivalent of learning how to drive stick

So more fun, more efficient, and actually kinda cool?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28355

Looks like other people have already answered your question, so I'll just say this, don't learn c++. It's a shitty language.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28356

>>28355

>c++ is shit

no it's not!

being compatible with legacy code killed C++ aesthetic just like it saved it.

I wish I haven't been used to it. I also wish openGL tutorial weren't all written for c++

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28371

>>28355

I think C++ is a powerful language filled with all kinds of powerful features. My opinion is that if you get to the point where your designs actually make use of these powerful features, it'll probably be easier to use a different high level language like Scheme or Rust.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28376

>>28371

I disagree. Both are far harder to use than C++.

Scheme has no native datastructures other than the list, no easy manipulation of memory contents, no easy use of procedural programming, and it's a functional language. It's a beautiful language for sure, one of the very best I've ever learned, but it is absolutely shit for games. Take a read through SICP and think about whether you'd rather use C++ or C to make a game, or a LISP: https://mitpress.mit.edu/sicp/

Rust is much better for games than a LISP, but it's also far harder than C++. It doesn't have the full-featured generics that C++ has to get you going, and it has far stricter memory management, making your life very hard if you're not already steeped in tons of computer science concepts. You're not going to have very much fun with it unless you're fully fluent in a couple other native high-level programming languages already (C++ or C at the very least).

Recommending Scheme and Rust to somebody who doesn't know any C is pretty fucking off, Anon.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28377

>>28376

The C++ language is outstandingly complex. The reason for this is because of the combination of its OO model, its backward compatibility with C and its Turing-complete template metaprogramming language. The reason why programmers like the control of C and C++ is because the programming model maps neatly to the machine model. Other high level languages do not make the same assumptions about the connection to programmer features to the machine control - C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.

I recommend Rust and Scheme because if you're taking the time to learn a general purpose language in order to study the art of writing a full game engine, Rust and Scheme lets you focus on the logic of the engine without having to shoot yourself in the foot (pointer bookkeeping).

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

401655 No.28378

>>28377

I agree, but it's still easier to use, even if it's harder to reason about and fully understand. I'd agree with Rust, but I don't think it should be a first language. There's some high-level computer science understanding involved, including memory management, reference,s and type discipline.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

3770f4 No.29116

>C

anon pls

>why even?

https://isocpp.org/wiki/faq/c#c-diffs

>if you still insist on tormenting yourself and others bcaz muh 1337 haxorz

http://en.cppreference.com/w/c

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

714aaa No.29127

>>28201

You should know about the Gentoomen Library by this point, Anon: https://g.sicp.me/books/

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4d8400 No.29129

File: 9d7e86edda74242⋯.jpeg (36.94 KB,596x627,596:627,but_why_tho.jpeg)

>>29127

>SICP

>LISP

>ever

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a3e538 No.29133

>>29129

I mean, it has some good books about C.

Besides, SICP is a good book about computers and shit. You don't have to use LISP after reading it.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

dd9cbb No.29137

>>29133

>I mean, it has some good books about C.

Fair enough. If you want to torture yourself w/ C, then at least use modern C approaches that lean heavily on the library. There are a couple of good books out there today.

>You don't have to use LISP after reading it

Good thing heh. This is after all a gamedev board.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

9eaef3 No.29882

Why the Quake 2 engine specifically? Darkplaces or ioquake3 seem like much better candidates.

Also, your pictograph is the Quake 3 source code.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a13815 No.30010

>>29882

>Why the Quake 2 engine specifically? Darkplaces or ioquake3 seem like much better candidates.

Mostly because Darkplaces is too modern for my taste and Quake 3 is a multiplayer games engine that developers had to write their own scripting languages to make singleplayer games with. I remember both Raven and Ritual created ICARUS and Ubertools respectively

I've thought about just using Jedi Academy as a base since its source code was GPL'd and it includes ICARUS scripting and the fancy lighting effects Raven made built in. But I also can't use Trenchbroom to make levels without going through a very annoying process of converting maps

I dunno at this point if it's worth going through all of this hassle and instead just using Unity instead.

>Also, your pictograph is the Quake 3 source code.

Yes I know I just wanted a convenient image

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a47f9f No.30060

File: b471e819719f67c⋯.jpg (118.33 KB,500x417,500:417,jZj7syG.jpg)

Tutorials give you a start, but don't forget that you need to write code to learn to write code well. If you read through the tutorial series from start to finish, without stopping to write some fun programs in between, then you'll probably fail to develop intuition and fluency. Slow down, write some cool toys, and when you finish the series it will be with far higher fluency than otherwise.

At first breaking problems down into explicit enough subproblems to start solving them will be difficult. This will become easier with experience. Soon translating from thought to code will become easy, and the main burden will shift from how to write something, to what you ought write.

For learning, I'd advise writing a bunch of tiny games, without an engine, increasing in complexity with your skill.

You can get started right away (well, after functions/variables/printf/scanf/if/while) if you make small and simple CLI CYOA/IF games.

Then make something more complicated, a tiny CLI roguelike maybe (see nethack if unfamiliar). You'll want to become more familiar with C at this point (malloc, free, intuition for pointers (literally just memory addresses), structs, and linked lists (just implement them, don't go find a library or copy/paste, it's short and good practice)). Eschew ncurses and portability here in favour of system("clear")/redraw the game/getchar() and a simpler interface.

You're looking to practice and have fun here, not make a cross-platform user-friendly game with a complex and slick interface. ncurses and the like would be overkill, boring, and probably frustrating for having to deal with antiquated faux-teletype shit. Just hardcode the width/height if you like, you're just learning here and will never need to support other sizes since this is just a fun and useful stepping-stone not a polished product.

While you could probably go straight for an engine at this point, writing a small 2D game using SDL will give you a nice big chunk of experience. You'll want to be comfortable with breaking down problems and solving them in terms of code by now, this will come with practice. SDL is nice and easy IIRC, http://lazyfoo.net/tutorials/SDL/index.php

At this point you'll be wondering if you should use opengl instead of SDL's functions. No, fuck that for now, you don't need it and it would only slow you down without benefit. Do it later, when you have good reason (e.g. 3D graphics/constrained by SDL), or never (if you like engines or don't feel constrained by SDL).

This will get you some experience writing a decently complex program where you can't just throw it out and rewrite it all on a whim. Don't bother making menus, just make the gameplay and worry about the rest later. You're here to learn and have fun, not make a product, so fuck the menus. Worry about UX when you have something worth polishing, until then YAGNI.

Never throw code out because you read something along the lines of "X is bad, code which uses X is bad, X considered harmful." Rewrite code only after it causes you pain (buggy/hard to work with/leaves too much busywork for the caller), or when it significantly improves something you care about (speed/memory/beauty (but don't get too into this, code is ultimately a means to an end)).

Most importantly don't decide that something is above your understanding and fail to pursue it. Look for example code that uses it, and figure out what each line does. Don't copy/paste without understanding, take the time to understand and you'll save time in the long run. The last thing you want in your work is code you don't understand. Read the docs until they're no longer intimidating. Sometimes it isn't you, documentation can just suck.

NB: Don't try to write an engine, just write the game. YAGNI.

FYI: You only have to learn to program once, moving between languages within a paradigm is easy. Moving between paradigms is just exciting because of all the new ideas you get to try out.

Have fun making stuff, and good luck.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a47f9f No.30061

File: f3777f65c04369b⋯.jpg (112.54 KB,912x727,912:727,qr5sknv18vay.jpg)

>>30060

As for tools, become familiar with gdb once you touch malloc/free: run, break file:line, print varname, backtrace, up, down. You need to compile with -g for these to work.

It's vastly faster than printf binary searching your way to the bug, just run as "gdb ./name args", type "run" and the prompt and then cause the crash, and type "backtrace" to see where you are. You can move up and down the callstack with "up" and "down" and inspect variable values with "print foo".

You can also run you program line by line, watching for where things go wrong, among other useful things. gdb is invaluable, even if you never learn more than is in this post.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

aa73e2 No.30128

>>28204

>ad online somewhere that learning C as a first language was the equivalent of learning how to drive stick compared to learning other languages like Python

If you don't start with C it will be harder for you to learn how to manage memory. And You might find disdain to such task.

Symptoms usually are believing you have unlimited memory nowadays anyway, or unlimited processing power.

Don't get me wrong. I love python, but it isn't training wheels, it's a tricicle.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c9e6e0 No.30386

>>30128

>>If you don't start with C it will be harder for you to learn how to manage memory

What you really mean is ASM, and on platforms such as Gameboy or Sega Genesis.

That's when you really start to do some crazy shit for memory management.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

5ada9e No.31488

File: eb43cc016953b39⋯.jpg (103.24 KB,1170x677,1170:677,xPPP2frontNback.jpg.pagesp….jpg)

>>30128

>If you don't start with C it will be harder for you to learn how to manage memory

TBH, the vast majority of developers never really need to learn how to manage memory at a deep level, nor should they. It's a tricky area to get right. If you really want to go off the deep end and learn resource management of all types, including memory management (as any true autist should heh), then you learn machine-specific ASM, not C.

Instead using C++'s RAII idiom gives you all the performance and efficiency in time and space that C (or even ASM tbh) brings, w/o nearly the mental burden on the developer. Software reliability goes way up on average, as does ease of maintenance.

The single best approach for any newb needed a grasp of C is to read and understand Ch27 of Stroustrup's PPP2.

http://www.stroustrup.com/Programming/

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

96c021 No.31517

>>31488

This meme needs to die.

Managing memory in C or C++ is easy if you take the time to learn how to do it.

And if you're making a game, you should be programming your own memory allocator anyway.

And that means conforming to the C++ STL Allocator model so that you can use the STL containers.

If you're only interested in PC, your own allocator isn't as important. But the second you need to do Network programming, Graphics programming (with OpenGL or some such), or need to be able to debug your own fucking code with a debugger, you damn well better be able to handle memory.

Otherwise, every programming problem you come across will become a question of "what existing library can I leverage?", and you'll forget how to be a fucking programmer.

This is like telling a driver that they don't need to worry about petrol.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

64a6a3 No.31537

>>31517

>"what existing library can I leverage?", and you'll forget how to be a fucking programmer.

haha sounds like a suit

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1580b4 No.31541

>>31537

You know it

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]