C or C++ for game programming?

C or C++ for game programming?

Attached: ckeen42b.png (640x400, 8K)

Other urls found in this thread:

docs.unrealengine.com/en-us/Programming/Introduction
youtu.be/JH8xwNOQ0TM
rbt.asia/g/search/text/spoiler:lit/
github.com/jessehorne/billy
store.steampowered.com/app/341060
github.com/crcx/glypher
github.com/cthulhuology/sdlforth
github.com/s-macke/starflight-reverse
en.m.wikipedia.org/wiki/Category:Unity_(game_engine)_games
twitter.com/NSFWRedditImage

C++ you fool.

Python duh

punchards punched out with gunshots
hopefully a few hit you

C# and Unity

Bump, Im deciding to bail on unity and get into Unreal/ C++. need insight

Attached: Qpokm0s.jpg (800x600, 434K)

[spoiler]Assembly[/spoiler]

Attached: xcfyxb6jujcy.jpg (343x326, 51K)

Haskell

Read this
docs.unrealengine.com/en-us/Programming/Introduction

C# or javascript if you want to get job done ;)

C+

Godot engine

c++ no duh

There are a ton of books and resources for learning C++ for game programming. There are none (or basically none) for C. That alone makes the answer pretty clear, even ignoring the fact that C++ dominates the game industry right now.

If you're a beginner to programming though, I'd recommend something like Python (with Pygame) for learning the basics of programming and game development.

no c--

>spoilers
>on Jow Forums
Newfag detected. But how come there are many successful games and franchises made with assembly, but seemingly not many with C?

C+=

im seriously tempted too. but the resources online are trash.

examples user?

All the early handheld games like Pokemon for Gameboy are in assembly

Attached: 1548299776168.gif (400x225, 1.58M)

Forth or lisp (or both). Accept none other.

Am I a brainlet if I can't imagine game programming without OOP?

It's also basically impossible to find modern C game libraries, they're all either ancient, piecemeal, or in C++.

Rollercoaster tycoon

ruby and the gosu gem for maximum noob

Attached: tumblr_inline_odj94iH5MZ1sqcz0r_540.png (540x270, 52K)

Literally every Nintendo game up to the n64

Common lisp? Racket? Emacs?
What's your favorite lisp for gamedev?

check this out
youtu.be/JH8xwNOQ0TM

Attached: 1549602918560.png (434x327, 32K)

You do know the spoiler tag is used ironically on literally every board it's not allowed on right?

C++ but with an program that use a C like structure for the most part, but classes where they actually make the code easier to read.

[spoiler]kys[/spoiler]

>gets outed
>i-it was just ironic, I swear

Attached: 1432378345829.jpg (1008x716, 311K)

id only switched to C++ with Quake III Arena, so if your game is less complex you can definitely make it work using C alone.
Keep in mind you are going to have to build a whole mountain of code for yourself. But it can be very rewarding.

Currently doing a clone of the Wolfenstein engine using C + software rendering, pretty fun

C#

I'm not even the guy that made the post, do you know what the IP counter is for?

Depends on the game and target audience.
Common lisp implementations like ccl and sbcl are extremely fast, more than fast enough to power AAA-tier games if you use the same wizardry you'd use anywhere else. Its image-based facilities make development workflows infinitely better than in alternative languages: you can live-edit your game as you are playing it without having to close anything or lose any state, for example. And if something crashes, you still don't have to restart, you can use a recovery right there at the repl and get the game back on track right where it halted.
When development is complete, you can generate native executables as well.
Elisp is obviously only particularly interesting if you're making a pong clone inside emacs.
Racket is like a slightly faster python, with fewer libraries and worse error messages. Would only recommend if you're married to parentheses, otherwise it's a useless language outright.

Wow thanks for this user.

Damage controlling this hard despite being anonymous.

Autism is one hell of a drug

rbt.asia/g/search/text/spoiler:lit/

thank ya
have a classic GIF

Attached: science.gif (302x240, 1.83M)

Interesting. Among lisps I've only learned Common Lisp (and elisp) and I love it. I've been reading through the Racket docs recently and it seems fine so far. What puts CL ahead in your opinion? CLOS, speed, and variety of implementations seem to be the stand out features, but Racket seems to have a much more coordinated design (eg. actual naming conventions). FFI is capable in both languages so speed isn't a deal breaker necessarily. Do you dislike schemes as a whole or would you take a fast scheme like Chez?

Scheme implementations are in general much better languages than common lisp. They usually have significantly stronger module and macro systems, much better "vocabulary", and more modern features (such as reader expressions for hash-tables and other modern datatypes).
However, all of them have deal-breaker issues even in a vacuum, let alone compared to common lisp.
I already mentioned that racket error messages are really bad. The same applies to most schemes. There is limited support for reflection and introspection compared to lisp. There is no proper image-based facility (e.g. if you redefine a symbol, you have no guarantee it's redefined throughout the image, and in modern scheme, it's actually guaranteed NOT to be modified if it's e.g. a basic construct). There is no condition/restart as lisp has them, which means that a typo or a bug will bring down the system and force you to rerun everything from scratch (like in any other repl language), whereas lisp allows you to recover and continue. Actually, it's even worse than python in that regard since you can run python at full speed (such as it is) through ipdb and get partial recovery at error points.
Speed and the ability to generate proper native executables is very meaningful for things like scientific computing (because not everything can be vectorized) and games. But also, the GCs in schemes are mostly crap (except chicken).
All schemes are slow, even the fast ones, compared to sbcl/ccl. For games, you can't easily ffi to existing libraries because they're mostly in c++ and not in c, making it all-the-more important to have good performance in-language (or else lisp is only useful to (defun main () (run-my-c-code))). On that note, you might also be interested in clasp, which allows c++ interop.
The lisp ecosystem is also somewhat more mature, but really not by that much. Though the portability advantage is certainly there (you can swap implementations based on changing needs).

ASM imo

Attached: 1426331664009.png (507x832, 68K)

c++ with sfml

Damn I didn't even think about the condition system. Yeah seems like CL is the way to go.

While you're here, you mentioned Forth earlier. I've read a bit about stack based stuff in the past; do you think learning that kind of PL has a similar kind of benefit to learning lisp macros for the first time or learning FP or something like that? It's intrigued me but I havn't gotten around to it.

It is definitely an eye-opening experience in that the way forth works pretty much forces you to decompose your problem into very tiny pieces, and at the same time, one-liners in forth are extremely powerful. The ability to redefine everything at all (even the comment symbol!) is wonderful. Forth itself is very quick to learn though obviously takes a while to master.
Actually using forth in practice is a bit more tricky since, like schemes, it has no good implementation (especially no non-commercial ones). A shame because I believe it could be used to replace C for all modern C use-cases.
I definitely recommend playing around with forth. It's actually still in use for small embedded devices in some places, and until recently, freebsd still used it for bootloaders I believe.

Thanks for the chat

the only acceptable answers

Attached: 44672374_1491722657629391_704978985687187456_n.jpg (960x868, 62K)

Would making a game in Assembly make it very difficult to port to other hardware?

those games could've easily been made in C.

Yes, but there are also portable assembly languages (see gas, fasm, nasm, and of course llvm-ir).
Of course, console devs weren't exactly concerned with portability as opposed to getting the most out of the device.

No proper (correctly optimizing) C compiler for those platforms. Making a trivial one is easy, making one good enough to replace assembly is a herculean tasks since those are often strange platforms with unique quirks. Forth does not have that problem.

PHP
github.com/jessehorne/billy

I looked it up, and no. Extremely constrained hardware combined with inefficient compilers makes assembly the only viable option. You'd have to be writing tons of assembly anyway alongside the C to combat compiler deficiencies, so might as well write it all in assembly from the get-go.

C++ for overall utility,

However, in school I use whatever tools are available.

im not interested in programming my own engines and shit. And I have yet to come across some kind of problem that requires me to program my own compiler from binary

I'm more into scripting and design though. I'll leave the low level stuff to the other guys (that probably get payed more than me)

>It works by sending data to a client written in Lua, which will handle things such as displaying graphics, playing sounds, or printing text to the screen.
>php program that sends data to a lua program that sends data to a C program all for a 2D game
Jesus christ how horrifying

well, there is not too much port for nintendo games

How are those portable when assembly isn’t supposed to be?

Holy C

You can’t make games in forth

based

Attached: ss_12036337fe569dee7853cdd275808b49c0f7339d.1920x1080.jpg (1024x768, 454K)

It's not real asm, or equivalently, it's asm for a virtual device that is translated to native asm at a later step.

How was it so portable?

javascript & html5

How big of a difference is it from real assembly?

Sure you can. Many arcade games were made in forth. More recently,
store.steampowered.com/app/341060
is made in forth.
Also see
github.com/crcx/glypher
github.com/cthulhuology/sdlforth
And
github.com/s-macke/starflight-reverse

The main reason why examples are sparse is that nobody uses it. But it's perfectly able to do it.

Y I K E S

The absolute state of nu-Jow Forums!

Depends which. llvm-ir is pretty different, it's notably higher-level. A bit like ASM-flavored C.
nasm/fasm are based on intel syntax so they're just normal ASM pretty much.

crosscode is made in js & html5 and is best game released in past 10+ years

whats your suggestion?

C/=

Nim or D.

Only 1 was written in x86 assembly. 2 was rewritten from scratch in C.

His answer is this.

Checked and lol'd. Just tipping my fedora, nothing personal kids.

Go to the real, rise has fallen
Phoeni x down. Remember this day.

C++ if you have a brain

Neither.

>making games from scratch in the year of our lord and savior 2019

write your own library!

Why do millennials always act like this is the only DOS game programmed in assembly? Tons of DOS games were written in assembly. It's not fucking black magic, assembly is not complex, especially not if you had been writing assembly programs for the past 20 years since practically all concepts are transferable from one assembly language to another.

Obviously C#, unless you're making a visual novel in which case Python is fine

Attached: flying_rat_shovel_knight.gif (480x480, 27K)

C++
Python if you like laggy games.

>ironic spoiler

Attached: lul2.jpg (795x767, 165K)

WebGL

every single suggestion there is a better solution than C++ for modern games dev

Attached: go_home.jpg (300x168, 5K)

>t. nodev

>t. tech dinosaur
en.m.wikipedia.org/wiki/Category:Unity_(game_engine)_games
I don't even think that list is exhaustive but it has some huge titles on it. C#/Unity is dominating games dev right now.

Obviously C# but Python is also fine for static content with little logic like some visual novels

Javascrypt.

Everything else is a waste of time and you won't find much help with them no matter how good your google-fu is.

because it's one of the more impressive ones, there's so much going on I'm amazed I was able to run it back then

no

No, you are just sane.

Nim

Attached: nim.jpg (1600x1200, 500K)

apl you retard

>C#/Unity is dominating games dev right now.
*is dominating hobby/amateur game dev

Employed Haskell game programmer reporting in

Attached: 1483073157801.jpg (1280x720, 110K)

you made the right choice

Pretty much, I've been developing with the engine for six months now and I've only recently began to understand it. It's pretty good though.

What game?

Yeah but it stutters like crazy when you have more that 5 NPCs on screen.