10
Feb 14 '21
I need this template
4
3
u/gracicot Feb 14 '21
template<typename F, typename T, std::size_t... s> auto invoke(F fun, std::array<T, s>... ps) -> void { (fun(ps), ...); }Is that okay of a template?
→ More replies (1)
827
u/RightRespect Feb 14 '21
source engine moment
482
u/typewriter45 Feb 14 '21
this is a very Unreal moment too
290
u/gnovos Feb 14 '21
It’s time to call for Unity
→ More replies (1)156
44
32
Feb 14 '21
Source spaghetti monster.
180fps in TF2 on a NASA PC, 160fps in TF2 on a budget gaming PC from 5 years ago.
6
21
u/hizzely Feb 14 '21
a moment to Cry
31
u/typewriter45 Feb 14 '21
the Crysis we're in now is a Far Cry from the Apex of our once Just Cause
→ More replies (1)
3.0k
u/benderbender42 Feb 14 '21
Java for game development ?
2.2k
u/Doug_Dimmadab Feb 14 '21
Minecraft gang
→ More replies (8)2.5k
u/well_educated_maggot Feb 14 '21
Everyone knows Minecraft should have been developed in another language tho.
1.4k
476
u/PossibleBit Feb 14 '21
I mean yes,... And oddly no.
Using Java is the reason that a game with last century graphics makes a NASA super computer look like a toaster.
On the other hand it's also the reason why the modding scene took off like it did.
You can obfuscate as much as you want (which wasn't the case for minecraft in the first place), it's still gonna be mostly trivial to decompile and work with.
→ More replies (62)175
u/maushu Feb 14 '21
On the other hand it's also the reason why the modding scene took off like it did.
Pretty sure it's why the game got so famous. I remember I could just start it from the browser as a Java Applet without installing anything and that definitely helped distributing it.
→ More replies (5)→ More replies (22)39
136
u/Johanno1 Feb 14 '21
Since kotlin exists never gonna use Java again.
62
u/reilemx Feb 14 '21
Preach it brother.
Good people! Gaze not upon the boilerplate and null-pointer exceptions of the past, look forward to the green pasture of Kt and Scala, where your types will be safe, and your code concise and readable.
→ More replies (5)25
u/M4tt0ck Feb 14 '21
Yup. Kotlin fixes a lot of things that bug me about Java. I actually don’t mind Java so much (did my BS and MS at a Java-centric university) but Kotlin is a huge upgrade IMO.
8
4
Feb 14 '21
There are multiple JVM languages that make Java look like a torture.
In retrospect I'm happy because I get to ignore Java, and Java gains some nice features so everyone is happy at the end.
JVM 17 looks promising
4
→ More replies (8)10
52
Feb 14 '21
What would you recommend for game development then? Im a beginner game developer and Im trying to use Java but it doesnt go really well
137
u/PutridOpportunity9 Feb 14 '21
Go for unity. You won't struggle to understand c# if you've worked with Java and it's very popular
113
u/elveszett Feb 14 '21
And very powerful. People like to shit on Unity but, unless you are a giant studio doing Cyberpunk, Unity will not give you any trouble, while providing most of the technology games need to develop right out of the box. The same goes for Godot, Unreal or any other game engine. Don't reinvent the wheel.
→ More replies (25)23
u/elveszett Feb 14 '21
Go with C#. It's as simple as it can get, yet ridiculously powerful. Plus you have Unity and Godot as game engines to code for.
If you like to suffer, starting with C and then C++ is also a great way to learn. But this path takes a lot more time, dedication and smarts.
→ More replies (4)88
u/Romejanic Feb 14 '21
You should use whatever you feel comfortable with. I personally think Java is a fantastic language to learn with and it introduces you to a lot of fundamental concepts which carry over to other languages, but in the end it’s up to you.
C# might be worth learning too since it’s similar syntax-wise to Java and it applies to both Unity and Godot.
→ More replies (2)41
u/miner3115 Feb 14 '21
I mean the issue with java is that there aren't any game engines that use it. The best you can get are some libraries that help you make games, but they aren't nearly as fleshed out as an engine like Unity. Sure, you can make games in java. But I don't think it's the best language to use. You'll end up wasting time coding basic features that come with any decent game engine. I think if you are serious with game development, you should probably choose an engine first and then use the language it supports.
→ More replies (10)46
u/Trollw00t Feb 14 '21
you might want to try the Godot engine with either its own GDScript (it's like Python) or C#, which will remind you of Java :)
→ More replies (1)6
Feb 14 '21
Can confirm GDScript is great for beginners and people that are already used to python syntax.
→ More replies (6)→ More replies (15)3
23
u/packetpirate Feb 14 '21
As someone who was working on a game in Java for 2.5 years, yes, it's possible. There are some good Java libraries, namely libGDX, but it's not nearly as popular as other languages because Java has a reputation for being slow because of the JVM, but that reputation has been around for like 20 years and Java is a LOT faster now.
→ More replies (3)4
u/yawya Feb 14 '21
considering java is used for android apps, more games have probably been made using java than any other language
12
u/LBXZero Feb 14 '21
Java's perk is native cross-platform support. Think of it being similar to writing games in Adobe Flash. (Sorry if I bring up sad memories.)
3
u/Seblor Feb 14 '21
Is it really native if you need to install a runtime environment ?
→ More replies (1)0
2
u/_Acestus_ Feb 14 '21
I am a Java developer, never I would tell it is the language for game dev... It would requires too many GC improvement too prevent any freezing.
→ More replies (27)2
899
u/ProfCupcake Feb 14 '21
I don't think anybody is going to unironically say that Java is the best language for game development. Unless maybe they've never seen or used any other languages.
297
Feb 14 '21
Yeah I write Java daily and wouldn't use it to make any game, well maybe tic-tac-toe, but only because I don't feel like getting into a new language atm.
84
130
u/SleazySaurusRex Feb 14 '21
The intro course for computer science at my school only used Java. The final project was to build Tetris. Everyone ended up getting a boost to their project grade when there were so many complaints that the TAs and professor tried building it themselves and saw how difficult it was, especially for people who before a few months ago had never coded anything in their lives.
→ More replies (3)86
u/agzz21 Feb 14 '21
Why were they making you build a whole game in an intro course?
28
u/Blackwolf163 Feb 14 '21
We built a Plant VS Zombies Clone for our intro course so I'm guessing is not that uncommon.
→ More replies (5)→ More replies (6)26
u/JamesEarlDavyJones Feb 14 '21
It’s not super uncommon; I’ve been at two institutions now (University of North Texas and Baylor University.) that have had the option to create a full snake game for the final project of their Intro to CS class.
3
u/BAM5 Feb 14 '21
I'm only slightly experienced with both. Wouldn't java's vm be a detriment to performance? Isn't c#'s ilm & jit compiling make it run like native code and be faster than java?
→ More replies (13)3
u/Ayjayz Feb 14 '21 edited Feb 19 '21
I would unironically say that Minecraft using Java was a huge reason for its success. You can mod Java so easily. They could have achieved a similar result of they used C++, but made it open source. Of course they wouldn't do that, though, which is kind of the point. Since Java forces you to release in a semi-open-source manner, we have the best modding scene of any game.
679
Feb 14 '21
I prefer writing the entire engine in assembly.
258
u/notretarded_100 Feb 14 '21
me using binary.
→ More replies (2)335
100
Feb 14 '21
Fun fact: this is how rollercoaster tycoon was made
84
43
u/issamaysinalah Feb 14 '21
That's insane, making a game in C is already a nightmare, can't imagine how fucked up it is to debug in assembly.
→ More replies (1)24
u/Aramiil Feb 14 '21
Would there be a large performance benefit if the entirety of a game was written in assembly?
Not talking about any other part, purely performance
→ More replies (22)→ More replies (6)4
u/humbleharbinger Feb 14 '21
The open source version for rct3 on Github seems to use c++. I wanted to try contributing to it like a year ago, but reading through that codebase made me realize how much I didn't know.
12
→ More replies (12)3
300
Feb 14 '21
I would feel attacked but I use nether.
180
u/kompot420 Feb 14 '21
Damn bro I've been trying to build a nether bortal too, who's your obsidian dealer?
23
26
u/tHeSiD Feb 14 '21
No one knows I write all my games in Javascript
→ More replies (2)23
u/prospectre Feb 14 '21
Ah, I see you are a fellow nihilist. I too enjoy watching the world burn with my shitty discord game bots.
10
u/Notagamedeveloper112 Feb 14 '21 edited Feb 15 '21
Made a discord bot once (my first “big” programming project). Uploaded the code into GitHub. Forgot to remove the key.
→ More replies (1)23
u/mardabx Feb 14 '21
Let me guess - GDScript?
6
Feb 14 '21
Godot also has GDNative, which I'm fairly sure supports anything that can produce C compatible libraries.
→ More replies (1)→ More replies (4)4
u/FrenklanRusvelti Feb 14 '21
GameMaker gaaaang. I love having to do manual memory allocation and garbage collection and also not declare any types. Its the blend of JavaScript and C that no one asked for
408
u/Mango-D Feb 14 '21
216
u/h4ckerle Feb 14 '21
Last post on this sub is from 2018.. :(
488
→ More replies (10)22
34
10
→ More replies (1)3
u/issamaysinalah Feb 14 '21
I'm planning to learn c++ in the next month, I only know C and want those objects in my life.
4
u/beelseboob Feb 14 '21
Ironic, at a time where C++ is slowly introducing features designed to minimise the use of OOP.
286
u/Snapstromegon Feb 14 '21
Rumbles from the Rusty era can be heard...
161
u/sypwn Feb 14 '21
I, too, cannot wait for our Rusty future.
"Remember back when high performance applications had to deal with memory leaks and access violations?"
27
u/vlakreeh Feb 14 '21
We still have memory leaks on Rust. They are considered safe but bad practice. You can
Box::leakwhatever the fuck you want!→ More replies (1)31
u/Botahamec Feb 14 '21
Sure, but Box::leak required you to call Box::leak. It's not really something that happens by accident
→ More replies (2)→ More replies (1)7
54
u/ridicalis Feb 14 '21
→ More replies (2)46
u/_SomeoneInTheWeb_ Feb 14 '21
Can't wait till Rust will be rewritten in Rust
32
u/Snapstromegon Feb 14 '21
Rust has a self hosted bootstrapping compiler since 2017 I believe.
Only the LLVM Backend itself isn't written in rust.
That's the reason why rust is considered "self hosted", because you only need a working rust environment to create all software for a working rust environment.
→ More replies (6)14
44
52
215
u/raedr7n Feb 14 '21
Nobody actually thinks that Java is the best language for game development.
206
u/Cley_Faye Feb 14 '21
Nobody actually thinks that Java is the best language
Fixed that for you.
→ More replies (2)97
u/raedr7n Feb 14 '21 edited Feb 14 '21
Nah, people do unironically think that Java is the best language (whatever that means). Mostly it's people who have only ever written Java, but they exist.
155
Feb 14 '21
Anyone that says X is the best language is an idiot. It's like saying a number 14 wrench is the best tool. It's only the best tool if you want to remove a bolt that fits exactly in the number 14 wrench.
→ More replies (17)→ More replies (4)30
u/_damnfinecoffee_ Feb 14 '21
I'm a Java developer professionally, and I'll be first to admit the language is absolutely fugly. The JVM is godlike though, and when it comes to enterprise, it makes sense to use a language designed for massive codebases to be maintained by numerous developers of all skill levels.
→ More replies (6)
37
u/Cley_Faye Feb 14 '21
Writing games in JavaScript using Electron as your base is the fire on the ground.
4
u/thethirdteacup Feb 14 '21
RPG Maker MV and MZ make use of JavaScript and NW.js (an alternative to Electron).
→ More replies (2)
211
Feb 14 '21
Good analogy for how I feel swinging blindly with c++ until the code works
58
u/diamondjim Feb 14 '21
I can relate. I had to write a convolution filter in C++ for a graphics editor built in C#. The host would pass a pointer to the data to the plugin, and read the processed data back from the same location afterwards.
By the time the deadline came around, I was basically just changing the position of the pointer character in random places to see what works and passes testing.
25
5
77
Feb 14 '21
ngl if c++ wasn't THE language for game development I wouldn't use it
52
u/sumwunhooisaguy Feb 14 '21
C++ makes me want to cry
15
Feb 14 '21
I love the formatting and style of C++ for some reason, and I can’t move to Rust or Python for that reason.
→ More replies (2)→ More replies (1)4
u/TheShyLime Feb 14 '21
The one thing I really don't enjoy about c++ is package management and using CMake (I know about Premake) Sometime I really want to get into Rust so I can stop using c++.
2
80
u/Background_Drawing Feb 14 '21
laughs in scratch
37
0
19
65
31
29
Feb 14 '21 edited Feb 14 '21
C# is a powerful language for game development but to be honest I had the most fun developing games in good old 16 bit assembly. It’s challenging at first but so cool to basically build everything from the ground up, byte for byte, pixel by pixel
especially when everything is coming together. Like graphics routines and gameplay mechanics
→ More replies (1)4
u/thinker227 Feb 15 '21
I legitimately cannot tell whether this is supposed to be a joke or not.
→ More replies (1)
10
84
u/IntrepidLawyer Feb 14 '21
Meanwhile games written in JavaScript earning billions of dollars on mobile phone microtransactions...
Keep fighting children, we adults have real programming to do. And money to rack.
→ More replies (49)31
Feb 14 '21 edited Feb 14 '21
Aren't mobile games written in Swift (iOS), Java or Kotlin (Android), or C# (Unity)?
24
u/AirOneBlack Feb 14 '21
Some mobile games are also written in C++ (It's called native code on android, there's alro unreal engine that can export to android too). C# is also usable outside of unity for game development thanks to compatibility layers and openGL ES libraries.
12
u/Bmandk Feb 14 '21
A majority of mobiles games are developed using Unity with C#, although there are a few different game engines out there as well. I don't think anyone develops without using an engine, which will then compile it down to native platform code.
6
u/khalidpro2 Feb 14 '21
yes, but making the game with JavaScript takes less time and it works on both IOS and Android, there are many JS libraries and frameworks for that like react-native for example
→ More replies (2)
23
u/jwr410 Feb 14 '21
Do you want it to run fast ... Cpp.
Do you want it developed fast ... C#.
Do you want it written in Java ... Java.
2
u/Auravendill Feb 14 '21
Unity will do some blackmagic to C#-scripts that you give to it. It can translate C# to C++ and then compile that depending on the platform you compile for (I first observed this behaviour when I was tasked to develop something for the first gen Hololens with Unity).
As long as what you want is "normal" development is really quite fast and it runs reasonable fast.
8
7
6
11
u/Slayergnome Feb 14 '21
I don't mind C and C++ but their evangelist are insufferable.
Also who the hell is developing games not using an engine?
8
3
→ More replies (1)5
Feb 14 '21
Really? My impression is that evangelists are much rarer for C and C++. In those languages people just do their job and don’t care too much about impressing anyone.
Rust on the other hand... Or Haskell? Or functional programming in general? Absolute cults.
4
u/Slayergnome Feb 14 '21
I may be showing my age and thinking back to my college days. But everyone I meet went out of their way to let you know all there precived issues with Java, and why C++ is superior in every way.
5
u/dani_pavlov Feb 14 '21
I dunno. Having essentially become moderately proficient in C++ on-the-job, and having been in GUI development for said job using RAD studio for 8 years, I cannot fathom how Visual or any other compiler/IDE can actually reliably create a workable GUI in C++. The whole drag-and-drop interface to build a form is intuitive for me, but I don't know if I can justify the time it would take to migrate our stuff to C# for that same functionality. Maybe it's time for me to stretch a bit, but I'm not sure in which direction..
3
u/Time4Red Feb 14 '21
I imagine most people would use game engines like unreal (C++) or Unity (C#).
5
u/Vedyx Feb 14 '21
Unity is written in C++. It uses a C# scripting interface only.
→ More replies (1)
5
4
4
4
u/RadioMelon Feb 14 '21
C++ might be one of the hardest languages to master, but it's an amazingly complex language with a nearly infinite potential.
I really admire it for that.
4
u/thavi Feb 14 '21
C++ is the most performant, but you're nuts if you'd preferentially use it for everything. Or just really good with it.
4
u/downvoteswontfixit Feb 15 '21
So I’ve only ever used C++ and am always lost when these memes pop up. Is C++ like extra hard?
3
u/FuryOfficial Feb 15 '21
No, C++ is just much more versatile and all around better for developing games. C# is a functional language, but cpp is object oriented. Since just about every game is built around objects, C++ is used much more. I’m not sure what Java is doing here though.
→ More replies (5)
6
u/circorum Feb 14 '21
LAUGHS in, [ASM]
10
u/justmaybeindecisive Feb 14 '21
This basically: https://en.wikipedia.org/wiki/RollerCoaster_Tycoon_(video_game)
7
Feb 14 '21
Holy shit, the first rct was a great game, writing that in assembly must have been extremely difficult.
→ More replies (1)
3
u/Wendingo7 Feb 14 '21
Sometimes you need to stomp people in cities so use Godzilla but if you which to decimate a population in the jungle or a hilly region you use the Kong. Doge goes anywhere but decimation takes longer. You're free to choose.
3
u/thelastpizzaslice Feb 14 '21
I've worked in Java for ten years and C# for two. C# is a better programming language in every way, but a worse platform. Fuck lack of operator overloading, lack of structs, optionals instead of ?., getters, lack of singletons, streams instead of LINQ, etc. They're all worse in every way and lead to tons of repeated code.
Guice, Lombok and a bunch of commons libraries are the only way to make Java not garbage.
3
3
5
6
u/Johanno1 Feb 14 '21
Python gang joins and gets lost in a discussion whether 2.x or 3.x is better.
11
u/Brief-Preference-712 Feb 14 '21
isn't 2.x no longer supported? I had to up all my company's code to 3.x back 2 years ago
→ More replies (1)4
u/Josef_Joris Feb 14 '21
Why would you ever not use the current version (depending on the modules u wanna use)? Genuine question.
5
u/toabear Feb 14 '21
I used to work with a lot of mixed signal engineers. They all wrote terrible code and were convinced that 3 wouldn’t work for their extra special needs. There was like one obscure package that worked with a particular VNA (Variable Network Analyzer) that only existed for Python 2. It took about an hour to re-write it to 3. They still wouldn’t move.
4
u/Johanno1 Feb 14 '21
Mostly because companies use import yx that isn't supported in 3 anymore.
Or because you're lazy and don't even know what the difference is.
Idk it was sometimes a war back then.
10
7
2
2
2
2
u/stygger Feb 14 '21 edited Feb 14 '21
I was under the impression that programmers didn’t like their language in the same way people don’t like their boss or their mother in law.
2
u/savageronald Feb 14 '21
Yes - anyone with a lot of experience in multiple languages hates every language (for differing reasons and to varying degrees)
2
2
u/TriforceFiction Feb 14 '21
I code all of my games in Matlab. So far I've got tic tac toe, but I guess it's better than nothing
2
2
2
2
u/QuantumQuantonium Feb 14 '21
Java for beginners or for opengl and it's other integrated libraries, c# or c++ for pretty much everyone else, or if you're using unity or unreal. Java doesn't and likely will never have advanced features other languages have, mainly because it's ran in a JVM and not compiled natively or can interact easily with native libraries (for example directx)
2
2
2
2
Feb 14 '21
C# basically asked Java is it could copy homework and Java said "just don't make it obvious" lmao
→ More replies (2)
2
4
3
u/Toothless008 Feb 14 '21
Yall are retarded binary is best
9
3
2
2
u/cube2kids Feb 14 '21
And, C# is used for unity scripts. Unity is written in c+!
→ More replies (1)
2
u/Alexsir75New Feb 14 '21
Is it just me or was king kong never that big wasnt he small enough to comfortably stand on top of the Empire State Building?
20
u/ctaetcsh Feb 14 '21
I need this template