Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 25 KB, 650x522, R14kkDj.png [View same] [iqdb] [saucenao] [google] [report]
66789263 No.66789263 [Reply] [Original] [archived.moe] [rbt]

should I use C or C++ for my games?

>> No.66789278

Use Haskell

>> No.66789284

Binary

>> No.66789341

Use Javascript

>> No.66789357

Install Gentoo

>> No.66789374

Use assembly

>> No.66789381

>>66789263
Install GNU+Gentoo

>> No.66789390

>>66789381
The G in Gentoo literally stands for GNU.

>> No.66789409

Use HTML

>> No.66789414

>>66789263
>C or C++
Use what ever you want, best case you'll end in the endless pit of wanna be famous developers, average case you'll drop your project

>> No.66789444

>>66789263
I like using C++ for my games. However, if you are asking that question, you should not use C or C++ for your games. Just use C# with Unity like every other brainlet.

>> No.66789480

are you willing to do everything from scratch?
If the answer is yes, then yes

>> No.66789501

>>66789263
potato

>> No.66789511

>>66789381
>>66789263
Install Gentoo-OpenBSD, Gentoo without GNU bloat

>> No.66789558

Don't ever use C.
If you don't like some feature of C++ just don't use said feature.

>> No.66789612
File: 7 KB, 320x180, NEdJCcABnfvCKFAvUH8i4R-320-80.jpg [View same] [iqdb] [saucenao] [google] [report]
66789612

>>66789263
>C or C++
Nope, use X Y A & B like a professionnal gamer.

>> No.66790033

>>66789612
Maybe wasd

>> No.66790692

>>66789558
>Don't ever use C.
>If you don't like some feature of C++ just don't use said feature.

This. Fuck. How many times I found a C++ thing I didn't like, thought "I don't like the way C++ works, I'll write plain C" and after writing 30 lines of error handling, bounds checking and more stuff that shouldn't be necessary on any sane language, I give up and come back to C++

>> No.66791364

C, it's just easier because there is less choices to be made. Everything is just pod structures and functions. With c++ you immediately start thinking pointless shit like whether should I lamda this or template that should I make a new class for this or include it in the existing one. There is a 10 different ways to do everything in c++, I believe decision fatigue is a thing. Btw the best most efficient way to implement something in c++ is going to look something like pods and functions anyway.

>> No.66791377

>>66791364
>With c++ you immediately start thinking pointless shit
sounds like you is the problem

>> No.66791380

>>66789263
go back to /agdg/ cris

>> No.66791418

>>66791377
If using c, whether the problem is inside my head or not, solves the problem, it is good enough for me.

>> No.66791445

>>66791418
Fair enough. But isn't decision fatigue only a thing if you are actually forced to make a decision?

>> No.66791464

>>66789263
C++. Function overloading, virtual functions, and abstract virtual functions are so nice for game related concepts.

>> No.66791474

>>66790033
THIS. Eclipse and Java were designed for games development in mind. The best games on Xbox are written in Java.

>> No.66791487

>>66789263
Any serious developer will choose C++.

>> No.66791488

>>66789263
Gamedev here, just use whatever the fuck works.

>> No.66791503

>>66791364
This guy loves to write the same shit 10000x on the code.

>> No.66791574

Just wait for Jon Blow's new language to come out

>> No.66791744

>>66789263
Godot and C++ is the way to go

>> No.66791765

>>66789263
C with C++'s OOP
and some STL data structures while you're there.
nothing else.

>> No.66792020

>>66789263
C
it's way more fun

>> No.66792031

>>66789390
The GNU in Gentoo literally stands for GNU

>> No.66792522
File: 138 KB, 960x960, 1529016838790.jpg [View same] [iqdb] [saucenao] [google] [report]
66792522

>>66789263
Use whatever you're better at. If you're equally skilled at both, use whatever you like better. If you're bad at both, quit being a retard. If you use whatever the fuck language /g/ chooses for your and it's not something you're familiar with, comfortable with, or a language you enjoy, you'll end up fighting the language more than you fight the problems you're trying to solve making a game and you'll be more liable to quit.
That you had to ask at all is a bad omen from the start.

>> No.66794158

Whatever you are most comfortable with, whatever you do some fat autist on welfare that doesn't have any skills will tell you how what you are doing is wrong.

>> No.66794206

>>66789263
Single person asking whether to use C or C++ for their solo game development.... It doesn't matter, you'll never get it done.

>> No.66794703

>>66789263
>developing game in C
Don't even do it. C++ is better, but don't fucking develop games in C. Graphics alone in C is a pain in the ass. I haven't done any graphics work alone in C for years, but don't even get me started on the shit ton of rc files I had to write years ago.

>> No.66794753

>>66789263
Probably neither

>> No.66794773

>>66791574
>implying it even exists

>> No.66794857

>>66789390
Gentoo is a species of penguin you retard

>> No.66794953
File: 195 KB, 1224x1445, sLe13h3.jpg [View same] [iqdb] [saucenao] [google] [report]
66794953

>>66789263
3D/Unreal? C++
2D/Unity C#
Godot C++ or C#
Homosexual? Java/Python/Lisp
Got something to prove? Brainfuck/Assembly

How the fuck are we supposed to give you advice if you don't tell us what you want to do? Fuck off tell you tell us what kind of game you want to make.

>> No.66795036

>>66789263
C++ , Unreal is good desu

>> No.66795272

C++
You can use C++ as a better C, basically, and still call functions from the C library if you want.
C++ design principle is that you don't pay a cost (in complexity, performance, etc.) for what you don't use.
There is no reason to use C except where you cannot use C++ (embedded systems, platforms with no good C++ compiler, etc.) Otherwise C++ is a better approach with no downside (because, again, you can write C++ that basically looks like C, if you wanted to do that).

t. write audio apps in C++ (and sometimes I use old school calloc/free for audio buffers, if I need to)

>> No.66795285

>>66789263
>he doesn't do everything in scheme

>> No.66795288

>>66791574
We're talking about things that exist

>> No.66795324

>>66789263
>2018
>not writing 8086 assembly in at&t syntax

>> No.66795329

>>66789263
Fortran

>> No.66795342

>>66791474
are you high?

>> No.66795357

Use a god damn scripting langauge or game engine you tard. Building a game from scratch is fucking retarded.

>> No.66795368

>>66789511
It's literally GNU bloat on top of the openbsd kernel

>> No.66795397
File: 54 KB, 680x598, ayo.jpg [View same] [iqdb] [saucenao] [google] [report]
66795397

>>66789263
>C if you want to be a better programmer
>C++ if don't want to use an bloated engine
>Unity/Unreal/Gamemaker if you want to learn and use bloated software for your dumb little game
>Godot if you want to make a game

>> No.66795454

>>66789357
TELL ME HOW THE FUCK WOULD THAT HELP ME??????

>> No.66795469
File: 142 KB, 960x801, gamer girl.jpg [View same] [iqdb] [saucenao] [google] [report]
66795469

>>66789263
I use Steam for my games :)

>> No.66796287

>>66795357
>HURR DURR

>> No.66797528

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1108r0.html

>> No.66797533

>>66797528
virus link dont click

>> No.66798613

>>66789263
Your engine will be C/C++ and your data will be Python/Lua/JS.

>> No.66798713

>>66789263
C will be easier in the long run, don't let pointers scare you. People are under the impression that good C++ involves no usage of raw pointers, but in gamedev that couldn't be any further from the truth. Especially when you consider half the middleware out there is written in C.

>>66790692
>>66789558
that being said these two anons make a good point, you can still write C-ish code in C++. If stack overflow CIA niggers have a problem with this they need to realize that in the game industry anything goes

>> No.66798728

>>66789341
This. I unironically used node.js and html5 canvas for my gaem. It was a pain in the ass but it works and still easier than c/c++

>> No.66798772

Orthodox C++

>> No.66799702

>>66794953
visual novel

>> No.66799876

I recently took the plunge and made my C++ engine-code into straightforward C.
Things I have seen during this process:
C++ is not needed.
My code is now cleaner.

It was pretty easy, since I practically programmed C in C++ anyhow.

>>66794703
> Graphics alone in C is a pain in the ass.
What the hell are you talking about?
OpenGL is a C Api, so you will be writing C Code anyway.
Also it's not hard at all. Graphics in C super straightforward.
Declare your data. Know your data-transforms.

>> No.66799899

>>66798713
>you can still write C-ish code in C++.
You can, but if you have don't have much of an idea about C vs C++, then you will probably end up using C+crap.
For anyone learning, just write C.

>> No.66799910

>>66789263
C++. You will spend your entire time in C tracking down memory leaks, fucking with strings and trying to construct useful structures without template containers or object orientation to help you.

>> No.66799934

>>66789444
Pretty much this. Nobody will care what your game is written in if it sucks. Use unity or unreal and focus on making good art, story, etc.

>> No.66799938

>>66799910
You are a fucking faggot and should end your existence.
At this point I only feel resent for C++ fuckers.

>> No.66799947

MIPS desu senpai.

>> No.66800337

>>66789263
C++ definitely. OOP seems like it would be incredibly useful in game development

>> No.66800468

Use Rust with Piston engine.

>> No.66800480

>>66789444
This. A good pick is also Javascript + three.js, expecially if you want to learn how stuff works on a lower level.

>> No.66800483

Stop with this this bullshit, the answer is Racket

>> No.66800496

>>66799899
Someone link the Write in C song

>> No.66800517

>>66799702
Then just use ren'py with python and focus on making a good story and art

>> No.66800552

>>66791574
Stop this shitty meme, please. A basedboy making technically insignificant indies waking up one day and telling other people how his language is the good one is the most pathetic thing ever.

>> No.66800682

Use the most recent C++ standard for getting rid of boost like dependencies. Especially recommending C++17 for std::filesystem. Start by writing a good logger/tracer and use as many assertions as possible if you're writing things from scratch. Get gtest and try to write unit tests for every component you finish. Proceed with resource loading, especially async loading with callbacks and shit. Don't overthink about early optimization but be always aware that you may need to change lots of things for the future. Write a very simple renderer and try to optimize it by stressing your scene. If you are so knowledgable about graphics APIs, make the renderer as abstract as possible for future underlying API changes.

>> No.66800949

>>66789278
fpbp.

>> No.66801136

>>66800682
Wow, you're dumb.
Many of these things one can maybe do if you have a large team of full-time employees.
If you are on your own you will never get done this way.
Or else have fun trying to write Unit tests for your renderer or for your physics engine, or even better, your net-code.
Protip: This will take much longer than even writing those components.
Making your renderer (a common bottleneck) as abstract as possible is a dumb fucking idea.
Making it "abstract" when all it does is send data to your graphics-card is idiotic.
A smarter way is to make it so that the interface matches what opengl (or whatever API) expects. This makes all your code simpler, since at some point you will have to transform that shit anyway.
> callbacks and shit.
Kill yourself. Just end your life you fucking piece of shit.
Callbacks are so fucking retarded, I want to punch whoever thinks they are a good idea.
You don't need a callback for asset loading in games because the frame-boundaries are always clear.
Just set a flag somewhere when a thing is done loading, and only when the flag is set, decide to render.
When something is about to unload, then unset the flag.
Fucking easy, and simple. No dumb inverted control-flow necessary.

>> No.66801210

>>66801136
>absolute state of /g/

Callbacks are necessary when your specific resources (mainly meshes, textures, sounds) need to be uploaded to different devices after loading into the RAM is complete. Your async loader is not responsible for that, but the resource implementations and their callbacks.

>> No.66801283

>>66801210
No, they aren't necessary.
I have already explained to you how.
I don't want to deal with brainlets like you, so I will just close the thread now.
Have fun writing "unit tests" you fucking retard.
I don't care anymore. Anyone who gets tricked into writing C++ by bullshitters like you fucking deserves it.

>> No.66801449

>>66801283
>just set a flag bro
>poll it every frame
>uhh why is atomic polling killing my performance, WHAT COULD BE HAPPENING TO ME?

>> No.66801577

Do you want to set up invariants in a constructor and neatly clean up in a destructor, or do you want to create init and clean functions, pass structs to every function and have to free char*s?
Tl;dr use c++

>> No.66803331

>>66791464
This. You can have a vector of Enemy objects that all perform some function, DoStuff, and specific enemies can all inherit from Enemy and each have their own override for DoStuff.

>> No.66803441
File: 2.30 MB, 1366x768, platformer.webm [View same] [iqdb] [saucenao] [google] [report]
66803441

>>66789263
just so it's out there, you CAN write a game in C
github.com/Mark-Weston/platformer
github.com/Mark-Weston/libdragon

>> No.66803802

>>66789263
If you want to use a game library, then cpp + sfml. If you want to build EVERYTHING from scratch, then C.

>> No.66804356

>>66803802
or, you know, SDL/Raylib/Allegro

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action