 Two minutes. All right Welcome again. Yes, it's difficult. See If you've never given a talk before when you when you stand over here, you're very nervous and you try to I don't know Invent a way to not be nervous, right? So and this is what I'm doing right now. I'm just making stuff up. So now it's really difficult. It's really hard Doesn't go away No, no Yeah Was saying my friend this yesterday and he told me messy the football player I'm not into football, but he told me messy apparently messy up to this day. He throws up every time before a match Which is very strange. I mean the best player of all time. He still does it. So Go to show you. I'm not saying I'm messy, but I Do throw up before every talk Yes I will try I will try. Yeah, I don't think the microphone is connected to anything So I will try I will try and if I forgot just wait, whatever Can people in the back? All right, I think there's kind of a seat over here I'm not sure if it's We have a free seat over here. I know we don't want to sit over but I don't blame you I don't blame you Oh, that's I guess start I will wait for this gentleman. Yes All right So Yeah, okay. Welcome. I guess again My name is more about that any which none of you will be able to pronounce but but still And I will try to convince you find people that Java is an interesting language to develop games in And if nothing else I will change your mind about some things But but like I said before I didn't expect so many of you to do Java, right? So that's really for me personally, it's a little bit disappointing, but But fine for you guys, right? You do enterprise Java most of you, right? All right, I do enterprise Java as well and as you can I will be able to sell I'm a big fan So let's see Alright, so I'm also like I just mentioned This is for the benefit of people who are not watching at home, right? But like I just mentioned I really have a Difficult time starting a talk, right? How do you start right and I used to make fun of people, you know And when you always have those talks in the first couple of slides are about your hobbies and whatever and how many cats you Have and that kind of stuff But till you give a talk and when you give a talk you can understand because How do you start a talk, right? This is room full of people. You don't know the people. You don't know their interests So how do you start so? so introduction, right, so Yeah, all right, so so so my The okay again so background of course like I said in the description which I think nobody read the description, right? the reason I'm doing this is because I I'm porting doom 3 to Java, right and I learned a lot of stuff so this is Okay, I don't know. I'll just go through this right Most of my slides are like this actually so it's kind of boring, but we'll see All right, so June 3, right? So that's the name of my project, right? Because we are excellent at naming stuff, right? I don't know and like I said like I say here. It's a temporary name I honestly I just you know, I need to create a new project. So what do you call it? Yeah, June 3 right at first I thought I would call it doom 3j right like 4j like everything in Java like log 4j whatever 4j, but 3j But then I named it this and whatever, right? It's up on github. You can check the codes and I don't know why So this is the question Everybody seems to ask me. So why are you doing this right and the honest answer and most people find this answer very amusing But it's not meant to be amusing is that I don't remember Thank you. Yes, but it's honestly not meant to be amusing like I said, it's just I honestly to remember I started it as five years ago kind of right Sorry But I don't remember why I started to be honest, right? I have some ideas about why I started it, but I don't remember the exact reason I started right But as far as I can remember right so five years ago, I had the doom 3 source code on my hard drive And it was just there That's it. I started reading it and I thought I think this is how it went. It probably didn't go like this, but you know, I thought hey This is a cool project And what I've just mentioned five years ago, right at the time This I do remember at the time. I thought I would be done in six months. I thought no seriously I thought six months. I would be able I was I would be done one thing and the other thing is I would be The Java version would outperform C++ version, right? So, yes, planning, right? So anyways So five years, right So what what what's what what do I use? I only use core Java and I only use open gel and open gel Rapper and the open-air wrapper. That's the same effort actually, but whatever and if you have any questions remarks So I close whatever just send me over there, right? Let's see so my Yeah, so I'm not an expert obviously, right? One time. This is very interesting actually because in description. Usually I say this is a hobby project, right? One time after somebody came starting talking to me That this is an official port of Doom 3 to Java, right? And I'm officially affiliated with his software, which is not true Fully, I don't with anybody so myself, but I'm like not an expert not expert game developer I don't actually see myself as a game developer my expert in Java, which is very important Not next to C++. I'm not expert in a lot of things. I tend to offend a lot of people when I talk about this stuff, so I'm sorry if I find you and I hope somebody learns something Least of all over to come to any of my talks again, right? So yeah, this is just my disclaimer, right? So, yeah Like I said, I expected less people here to know what Java is But but this is kind of important to the context of the rest of us up, right? So what is Java, right? So some people says interpret language some other people say it's a compiled language Some other people say it's something else. It's actually something else. It's not really interpreted. It's not really compiled, right? Who doesn't know Actually, I'm just gonna explain it Okay, this will come back later. Just ignore this for now, right? So yeah, open source Java's open source, which isn't actually 100% true, right? So if you go to the Java room here at Pustum, it's called free Java and If you ever thought why it's called free Java, it's because not everything in Java is actually open source which is a very complicated story and I think most of you know this better than me because I don't know the exact details of why, right? Some people blame Oracle for this, but this is a problem that exists since Java was some actually so but Mostly, you know the great the biggest part of it is open source, which is also important for the rest, right? Java chose to do sign math, right? So signed and unsigned, right? So unsigned is numbers that don't have a negative Component there are basically positive. So if you have 32 bits, it's 32 bits positive Joy and whatever, right? and Java chose not to do this and the background story behind this which is a kind of funny story is James Gosling back in the day. He couldn't decide whether to put unsigned math in Java or not So what he did at Sun, he wrote a lot of equations unsigned math in the hallways, right? And he just asked all the engineers at Sun to solve it, to solve them and Surprising enough, not the single one was solved correctly. So we decided it was a bad idea I disagree with him, but He's him and I'm me, right? So that's something else Java We use references for everything, which is strange. That's not strange. It is what it is, right? It just is. What is strange is that you have no point to exceptions when you don't have pointers And the reason this is strange if you don't know why this is strange actually is because Technically speaking a reference could never be null But the way we use references in Java, they can be null because we use a kind of a hybrid reference It's something in between a reference and pointer something weird That's why it's a reference by values actually more accurate Right Yeah, we don't support operator overloading So yeah, if you've ever tried to write a game engine a 3d game engine, especially right without operator overloading It's very very annoying It's very difficult. I Remember talking about them I think last year or something and somebody mentioned the same thing and he had this comments, which I love It's like doing math was talking about go I think but doing like this kind of math without operating overloading makes your eyes bleed, right? It's just it's just terrible. It's just terrible And there's also a lot of stories about why they didn't do that But we're not getting into this because I stuck with time and My timer isn't working. How much time do I have? How much time do I have? People in blue. I've been talking 10 minutes. Seriously Okay, I've been talking 10 minutes on slide one or slide two to whatever, right? And in Java we have final which is kind of like comes but it's not really right So Yeah, so I'm gonna give you this slide. I'm gonna skip this one actually but Right, so I love this comment on stack overflow No, it's from Hacker news about why Java kind of sucks, right? I'm not sure if people can read it in the back, but if you can't it's amazing Just trust me and when other people start to laugh left with them. It's just amazing, right? But this is absolutely true right, there's a lot of like A lot of the hate that comes with Java is just like, you know, it's It's what people are used to doing in Java right the way people are used to writing code in Java like getters and setters Right, everybody here writes getters and setters. Have you ever thought that that was a retarded idea? Right, because yes, thank you because it is right. You actually don't need it There is a historical reason for why you needed it's Like 10 15 years ago, but people forgot that reason are still doing it But we actually don't need them, right? I'm not talking about something like project long buck or whatever. No, you don't actually need them And when you write getters and setters you force the jvm to To do like an extra Extra optimization stuff for it, right? Which shouldn't be there anyway because you're creating like an interaction, right? That's whatever right, but that's that's like I just love this anyways So I'm kind of like so how many people don't know these terms Be honest You're not appearing on the camera anyway, right? Yes, okay So, yeah, so actually the first slide, you know talking about java is kind of like me ranting about all this shit I hate about java, right? This is actually so what is java, right? So java because you can call a lot of things java, but it's it's kind of inaccurate in times And it's kind of incomplete all the time. So you have the jls java Something something it's a language language specification actually, right? So some people call that java, right because the language specification is completely open source And if you implement it to the sorry you can implement it in your own way as long as you produce produce these results And we will recognize you as java, right? So that can be java You have the jdk or the language itself, right? So the actual code you write which is based on the specifications some people call that java Maybe it is other people and most people actually or most purists, right? They tend to call this java actually, right? So the jvm the java virtual machine which does garbage collection for you Which does just an uncle compilation for you Which has the java the java memory model for you, right? So it's kind of strange what's called java, right? But we'll get to that So to you right because no, no, no, it's just something so No Just No, no, no, it's just Because it's why I saw closing your eyes, right and one time I was giving him talk Right and I saw a gentleman the first time he was just like snoring, right? Obviously, right it was after lunch and people say you have a soothing voice or boring Which is code for boring voice, right, right? And it just but at the end I gave a demo and he was just clapping like like crazy Like like he was awake the whole talk but whatever doesn't mean so I don't blame you. That's that's my thing, right? A friend of mine gave a talk once, you know, he did it It was a lightning talking. He did it like like a boxing match, right? So at first I wanted to structure this talk like a boxing match the same way because I like that really, right? Which I didn't in the end, right, but I had made this slide already. I love this slide. So I just kept this slide, right? But this is the idea, right? So c++ is the reigning king of the game development world, right? Whether you liked it or not whether you admit it or not, right? And I see java as kind of like a contender, right? It has a lot of good stuff that it can offer. I think it can offer, right? I'm gonna kind of like like show it, right? Which again doesn't work very well because most of you do java, but I'm gonna do it anyway, right? um Yeah Yeah, I was listening to this song while does anyone know what song this is? Excellent So I was listening to this song, uh And just wrote it here. So yeah right So like I said, this is based on the project I did, right? So the first thing you come across is setting up your environment, right? And I cannot stress enough How much hell it is to set up an environment c++, right? The reason I'm still using this laptop with 70 or 70 a year old laptop will have a like a couple of months Old laptop at home Is because I have set my c++ environment on this laptop and I don't want to do it again on my other laptop And I know it sounds stupid, but really I hate it. I hate it so much, right? Um But I'm not a full-time c++ developer. So it's probably easier for them But still there's so much that can go wrong, right? You have to like You have the have the right dll's the right version the 32 bits or 64 bits Set up the linkers You have a lot of like macro and pre processor bullshit. You have to deal with it's like it's really hell, right? And in this one, right? So this one is actually this comment here, right? So at one point I upgraded to a different I had I have a different laptop with a different version of visual studio We just didn't work right because the project was written in that visual studio And you have to have like the professional version and I was using the expressive version because I'm cheap, right? And it didn't work, right? So it was just hell, right? And these are two guides And we're written I wanted for this for windows and this for macOS, right? It's kind of more detailed only to get the project running in your IDE. That's the only thing in this guide. That's a very long guide, right? And it's a lot of work And yeah so Yeah money Does anybody know what sconce is? Yes, thank you You can come sit over here as well No, but so sconce is kind of like If you know what make is it's like a supermake let's go with that, right? And this is one of the things it was also included in the project So it's a visual studio project, but they also had like a sconce file which you can see as a supermake file, right? For the linux build of of the game, right? And I want to do some benchmarks for gcc So I just thought it would be easy to do this right to just load the sconce file and and compile it And it wasn't Right. It was really a lot of work I can I won't describe it here because I've already rented about this enough, right? Um, a chromium. Yeah, let's not talk about chromium Suffice it to say it takes like a day to compile it, but that's that's a different story But yeah, so this is this this is c++, right? This is this is very difficult It takes a lot of time, right? You have a new developer you want to set up your environment You literally you're literally doing before a day or whatever, right? And it works sometimes it doesn't you upgrade it doesn't whatever it's difficult, right? But this is kind of actually what what we want, right? And this is kind of what we get in Java And the reason I say kind of is because like most of you know You can fuck this up anybody can fuck that anybody can make anything as difficult as they want, right? But in the purest sense you can make it this easy, right? You download an id it has a jdk sometimes it has maven sometimes and that's it You load in your project and it works Right most of the time But like I said, you can make anything difficult for everybody, but yeah Right, so this is kind of like how I see it in Java, right? You have a lot of wizardry Stuff right nowadays in intelligent you can just point it to a folder and tell it Okay load some stuff and it will figure out how many projects you have how many dependencies you might have and not have and that kind of stuff They're getting good at it, right? And it's mostly open source Right in the c++ world everything is closed source and everything you have to pay for And sometimes you have to pay a lot of money if I don't mind want to use like three plugins from a company It was like one plugin is five thousand dollars But if you buy all three you get them for ten thousand dollars, right? And we were very simple algorithmic plugins, right? He could only implement them himself, which he did Right because it was cheaper Right, so, uh, but that's the world of c++ is a different world, right? But not everything is fine, of course in the world of Java. I mean paths, right? You have to set up so many paths if you want to run it from command line just can be shitty And sometimes 32 bit verse 64 bit can be very annoying, right? Especially if you native code sit stuff like what I do with open gonsu and such So it's not perfect, of course, but I think it's it's better than than c++ Right, how many of you do c++? I didn't ask that actually Wow I feel betrayed, right? It's like it's like the same people also also do Java actually, right? So But okay, so All right. Oh, I thought I removed this slide, but okay So another thing, right? Like I just mentioned make files, right? How many of you? Okay, let's let's not keep doing that, right? I actually find it annoying when speakers do that But I sincerely want to know which is weird Um But if you've never used a make file or any make so I use I use the word x make because there are a lot of variants He make q make or whatever But they're essentially mostly the same And if you've never used them, they're basically just meant for building like you can do some testing sometimes You can have some profiles in there sometimes depending on like sconce can do a lot of cool stuff Right But it's not maven, right? And if you've never used maven Which is Some of you right you can do a lot of cool stuff in there, right? So a lot of this stuff you can do also in make files, right? But this one, right? This is the most important one. I think this really makes maven the best thing ever, right? And and and that's yeah How to how to explain this? I don't know how to explain this does anyone know how to explain this Does anyone want to explain this? So transitive dependencies especially right so when you have a dependency it has a different dependency, right? Usually if you have a palm file if you have a maven file or or a make file One of those cool make files that have dependencies because most of them don't you just know what the dependency is But you don't know what the dependency depends on, right? Maybe sometimes you do maybe sometimes you don't Maven deals with this right maven is excellent in this right? It will get the transitive dependency for you right the right version as long as you adhere to the maven Like like strategy, right? I think this is really really really amazing, right? and Java cool, right c++ doesn't have this When I talk to a lot of friends of mine who do full-time c++ They're they're also amazed that c++ doesn't have this because it's actually kind of a very simple problem to solve The problem is c++ everybody is very protective about their own things, right? And nobody wants to communicate or lie like say, okay, we're gonna have one standard or whatever so But it's it's kind of timble so but yeah Yeah, this was tweeted a couple of days ago. Did anybody see this so when you see something like this right And you've never done c++ you're kind of amazed by it, right something takes 48 hours to compile and With one small optimization it goes to four hours, which is still a lot of time actually, right? I know 10 tensorflow is huge, but still right? um So this is something so this is this is the part where I talk about where I Needed to do some scone stuff to do some benchmarks, right? so at the beginning, right? Compiling doom 3 in java and c++, right? It took me really like 25 minutes But the reason I have a question mark is because I don't have windows 7 anymore So I can't really reproduce it. So you're just gonna have to trust me, right? So is it so yeah, but yeah now it takes like 10 minutes, right? You like a multiprocessor up to my switch, right? It takes three and a half minutes with 100 cpu and this thing has like eight logical cores I think which is a lot even if it is like a six seven year old machine, right? Gcc Okay, kind of the same I'm not sure. So when I got an error and you're doing it with o2 optimization And there's a reason why I did it with o2 optimization, which I'm gonna tell you about But when I got the error, it was like 30 minutes But then I fixed the error and took only 20 12.7 minutes I'm not sure why And I'm not good enough in gcc to know why actually. So let's just leave it at that an o3 optimization My code currently it compiles in like 25 seconds And like like six seven seconds of those are like like maven just starting up and doing stuff doing nothing actually, right? I don't think this is amazing. I think before game development, this is amazing Right, you want to prototype the whole time. I know so none of these are incremental builds, right? So all these are like clean and builds, right? What it says there from scratch, right? Oh, yeah, and if anybody has any questions or remarks anytime just shout, right? I prefer that actually so not shouting, but I prefer questions like in the middle, right? So any any questions? No Really? You You have a question You want to say something You don't believe this It's true Sorry You want you're trying one? Oh, you're gonna trying to think of a question. Okay Next slide. I'm gonna come back to you but But but this right so and and I tried like so incremental builds are very fast, of course, right? So and but incremental job also has incremental builds, right? So that's why I'm kind of like like trying to to to to compare apples to other strange apples, right? This is amazing. I think this is amazing, right? And granted this doesn't give you an executable, right? So you still the way Java works, of course, this is like a meta something in between bytecode really, right? But this is the reason I did the O2 optimization Here for the benchmark, right? Because a lot of people they they they they they talk about this So like like if you talk to a jvm architect or jvm compiler engineer or whatever, right? They say actually you shouldn't compare What the jvm does for you was like pure GCC, right? So like O2 optimization O0 optimization You should compare it to O2 and the reason for this is because At the end of the day the jvm still jips code for you, right? It does like like hotspot optimizations for you when it runs, right? And it's kind of the only way you can compare it to something is with optimization So that's why it should be O2 I was kind of disappointed that the difference in time between O0 or O2 was so small but That's something else. It doesn't matter So yeah, so in the boxing match thing that I didn't do that I should have done, right? I think java wings here, right? For me at least, right? You have a question? Still You have to you have to have a question, right? So start-up times, right? And this is also kind of surprised me but Okay, so not this slide but the slide after this kind of surprised me So, yeah, I'm trying to compare them, right? So the game runs maybe I'll show you the game if enough people want to see it but At the end and if we have time because How long how much time do I have? Okay, all right, so So yeah, so I kind of expected this, right? So this is the java version the c++ version Which I should have maybe like labeled or whatever, right? But you're starting up the game, right? So java should take longer, right? It's per definition java cannot start Faster than something that is optimized c++ because java itself has to start the jvm itself jm f warm-up time, right? so yeah, so This is actually not what jvm warm-up means, but you know that and you're going to pretend you do so But yeah, right? So java version of the game takes like approximately like nine seconds longer for the jvm itself to start up and do stuff, right? So I expected this so I'm not kind of I'm not really that disappointed to be honest If it is a huge code base so So yeah, it doesn't matter, right? Yeah, I said they're pre-warm up with a question mark, right because yeah nowadays you have a lot of techniques actually to to To like avoid this kind of shit But I'm not sure if you want that. I mean it doesn't matter. It's nine seconds. Who cares, right? So So yeah, um, but this one did surprise me, right? So these are actually loading times. So this is kind of like loading the first level This is the loading time of the first level And the java version was faster And unfortunately, I don't know why because I kind of like just made these slides like a couple of days ago And I was very at deadlines and stuff. You enterprise developers know how that goes, right? So I didn't really have enough time to to to like like dig into this and see why actually the java version was faster Right, it's not much faster, but I expected it to be much slower actually at least Exactly the reverse, right? Because always when I'm starting the game, right at the end result is always right the c++ version runs runs first, right? So I honestly thought this would be slower, but it's faster. I'm not sure why So don't ask me that. Oh, you have a question. Yes In what sense who's they in this conversation? Sorry See if they're not here. They're not allowed to hear the questions, right? It's it's it's your right now. I'll repeat the question. Sorry, but but but I'm still trying to to understand the exact question. Sorry Hi Version, yeah, yeah, oh that way Okay, so the question is so So first the clarification the original game is c++, right? So it's not really a port So the question is so so the people that that did the c++ port of the game Did they compare to Java? Right? That's that's basically question. So, yeah, so it was originally developed in c++ Unfortunately or fortunately, I don't know, right? And actually funny thing about that actually so so people would do c++ a little but if you look into the code of doing three A lot of it looks like c Right, and I know a lot of people don't Like to admit that there's a difference between c and c++, but it's like a shitload of structs for example They also have classes, but they have like Amazing amazing amount of structs, right and a lot of c paradigms in the game, right? and There is a story that says because this was like the phase that they were starting to learn c++, which is interesting because this was I think late 90s till like 2005 the game took like five six years to develop And this was the phase they were learning c++ and they didn't like a lot of stuff. So they didn't see Right another thing which yes, sir Okay, so you're curious about my opinions about c versus java, right? So that's an interesting question. I like c more than a like c++, but that's something personal, right? It's not really about i'm not talking about this For you mean from a game development point of view, I assume, right? Yeah, I'm gonna touch touch on this a little bit later, but but right now at least For For the purpose of this you can see and c++ are kind of the same They're not the same. I know right and i'm looking at you the one who knows what scones is because Excellent, right? They're not the same, but for the purposes of this you can you can claim that they are the same And the reason for that is Yeah, I'm gonna skip this for now, right, but I'll come back to it later. Sorry Um Answer your question, sorry You have to have another question. Yeah, so begin preparing for now and All right, so I don't know why like I said, why this is faster, but And this part as well, which is strange, but I will do you But yeah, I was mostly interested in the in the in the warm up time actually not not the loading time itself, right? I wanted in this slide actually I wanted to like demonstrate that c++ was better, but the backfire so Doesn't matter Yeah Actually when I found this picture online The first thought that came to my mind is actually isn't this kind of like child abuse, right? Because if you put your child in this position and you photograph him for like or her For like your own profit and fame and whatever likes on youtube or or some kind of stuff It's kind of bad actually, but it's a nice picture that aside, right? um, so yeah So multitasking is really difficult, right? um, so this is something else. I want to really talk about is is like CPU utilization in in java or what you can do with CPU is utilization in java Which can do with it in in c++, right? Basically can do exactly the same things, right? But c++ java it's it's it like facilitates a lot of this stuff for you, right? And I think the the next slide Or the one after that at least or something like that touches on the thing that everybody hates garbage collection, right? um, but actually garbage collection is kind of like like I Married to uh to to to to to multi-threading, right? So yeah, threading bonanza threading is hard third safety is very expensive I think I hope everybody knows why does anybody not know so threat safety So the idea of threat safety is that when you make a structure for example, uh, whatever like a list Threat safety means that when I access something or I change something in the list Not a different thread is not allowed to do something else in that in salamu finish. That's basically right It's actually not that at all, but that's that's like the like the hello world example of that, right? Uh, so yeah java does that very well, right? It facilitates a lot of stuff It has a lot of like safe and unsafe for flavors of structures, right? Like Um, yeah, what I just explained is kind of like at an at a missus. I don't know where to put the missus in Your your native speaker. How do you pronounce this? Yeah What he said right at a missus Thanks, man, uh Right, so so basically the idea here is is what I actually want to touch on Because there was there was a podcast a couple of days ago Jonathan blow right and he he mentioned. Yeah, you listen to it for three hour thing You're laughing so you have must have listened to sir Oh, you've heard about okay, so Jonathan blow is a developer of braid and the witness, right? It's a pretty cool guy not a lot of nice ideas. There was a podcast a couple of days ago. It was three hours And and he got asked the same question right like multi-threading and whatever and his answer and the answer of a lot of game developers Especially the the engine developers is there's actually not a lot of Things in a game you can do that requires multi-threading and parallelism and concurrency of that kind of stuff, right? Which might be true, right? Because he if he says that he probably knows that it's this better than me I have no idea But my problem with this idea at least right whether it's true or not is this this this kind of thing, right? So you have morse law That that you don't require multi-threading in Yeah, okay, but but but their comments or mostly those guys are in like engine developers, right? So they mean like in graphics engines that kind of stuff, right? But give me just like one minute to explain this, right? Um So you have morse law you have amdahl's law, right morse law says something like every like 16 17 months I don't remember somebody will know the correct number number of transistors on a cpu thing will double, right? But there's an end of life to that because we can't get any smaller or whatever, right? So at at some phase, right? We cannot expand the cpu more than that and technically speaking We've actually reached that a long time ago, right? But we changed how we view morse law, right? So first we looked like okay, so what's the maximum speed you can gain from the cpu? And now we turned it into something like oh, how many cores can you get on the cpu? Which is kind of different because how many cores comes back to this story, right? And how much how how fast something gets is is Is this story actually and amdahl's law which i'm gonna screw up But if somebody can correct me then please, right? Amdahl's law it says something like There are certain not all problems can be paralyzed. That's that's kind of like the So it's actually what the law says as far as i remember, but it's kind of like the takeaway that i need here actually for this proof my point Let's let's go keep it up, right? hello so Sorry So that's that's my problem, right? So true not all problems can be paralyzed, right? That's what a lot of the engine developers say, right? Let's assume that's true But if you like don't think this generation don't think the next generation but like six seven generations of graphic engines later, right? You're you're gonna hit the roof of like, I don't know a single core of I don't know What's the fastest now three and a half gigahertz or something you're gonna hit that Okay, so you can't paralyze the problem. What done, right? I don't know right and yeah like this thing says, okay So maybe we'll we'll be better get better programming again, right? Because we've kind of like unlearned how to optimize stuff. So maybe we'll learn it again But still there's only so much you can do because it's not gonna expand anymore, right? You're gonna hit the roof and that's it, right? So that's why I think this is interesting, right? I'm not saying you need it. I have no idea if you need it in doom 3 I don't really need it. I have like two threads for the whole game, right? And the second thread actually I don't need it, but it was in there in the C++ version So I did it also in a Java version, but technically I think they were experimenting with threads as well Actually, so that's why they put it in there But yeah, do you need it? I have no idea, right? But it's just a question and if you need it then Java is actually pretty interesting for you, right? And why? Again a cool tweet this one was from like a couple of years ago Does anybody not know who this is? All right, so I assume none of you know who this is So this is Tim Sweeney. He's like the the guru developer of unreal and all the unreal engines or whatever, right? He doesn't do it by himself, but he started once upon a time by himself, right? And there was a discussion something about the garbage collection and he said this, right? Lately the last couple years he's been doing a lot of research. I think about Dude dude Dude Dude Dude That's like okay, so It was doing like research about program languages and that kind of stuff And he tweeted this right and it's like the first tweet. I think I liked or Or like saved or something like that, right? And I found it very interesting argument actually And I dare say this tweet is actually kind of like what made me do this talk So if you need somebody to blame blame him But it's correct, right? So usually when you have like a big game engine you have like Scripts, right? Because you don't want to hard code everything So you want AI to be scripted. You want your enemies to be scripted. You have everything to be scripted, right? And when the scripting language gets so complicated or complex, right? You kind of like Like interpreting your own interpreting your own parser for that and that's what he's talking about, right? So none of the developers that keep keep keep crying about garbage collection, right? They actually You know, they they mind this right that you have a large overhead of parsing and interpreting these things during runtime Right and they can be huge and doom. There are fucking huge, right? So, uh, that's interesting It has nothing. Yeah, it's kind of had something to do with my point, right? So this is actually the part where I wanted to play this video um Which we will try in a minute and if everybody everybody stays quiet you will hear it I think But um We will play it now actually because I'm running out of time. Uh, let's see. Where's my pointer? no woman Let's see if it works Can anybody hear that? Not even the people all right excellent, okay, so Okay, sorry But anyways, so that's actually it's related to this thing, right? Embracing gc a lot of people don't understand how the gc works actually, right? And this guy, I don't remember his name brian something This is actually talk about rust right and he was using as example the gc in javascript And I didn't know the javascript script was actually garbage collected. That's my fault, but But he was using as an example, right? Is is and this example it just shows that you can have memory You can have memory leaks in java in in javascript, right? And that completely screws up your gc, right? and that's kind of like The reason that's important is is kind of like this slide again, right? The spiky one percent for garbage collection, right? Because the whole time I have 15 minutes left. Thank you very much The whole time people only talk about stop the world garbage collection, right? Which shouldn't happen anyway, right? So some of you are the java developers and know this if you ever stop the world garbage collection Something is wrong. It's not the norm. It shouldn't happen, right? But that's the only thing the outside world sees Right and I did some digging and I didn't know this either actually, but unity is garbage collected, right? Unreal has a garbage collector and there's an awesome talk from gdc about mortal combat I don't remember which mortal combat mortal combat has a garbage collection thing I remember management more actually about the garbage collection thing, right? And the reason and that's actually the reason I put this thing here Because one of the things garbage collection can solve and you cannot solve or very difficult for you as a person doing pure C++ Solve is memory fragmentation, right? So let's say you you allocate a these are 30 bytes, right? A and B are both 10 bytes, right? You free a now you have a gap of 10 bytes and gap of 10 bytes and you have new object of 15 bytes How do you allocate it? Right, this is called memory fragmentation garbage garbage collection solves a problem for you You yourself if you do it in C++ it is solvable everything is solvable, of course, right? But it's a very difficult problem to solve, right? I'm gonna skip the rest kind of because I'm running out of time Um But yeah, not everything is great, of course in Java, right? Memory footprint bad, uh, I don't What anybody no you have question No, you sir. You sir. Yes I have not so the question is yes, sorry The question is have you tried compiling it with growl to native code ahead of time compilation of that kind of stuff, right? I haven't tried it to be honest Currently, so these are problems. I'm just trying to like If I show you the demo at the end you will see that I have much bigger problems than this, right? This these are just kind of like because I'm like I'm seeing a lot of bad stuff about c++ Which isn't fair, right job also has a lot of bad stuff, right? So this is kind of like that, uh, but I haven't tried it, uh, although a lot of people have asked me that and I'm very curious myself to be honest Yes, any other questions? Oh, yes, sir I'm sorry, I really can't hear you Collections, yeah So the question is thank you I haven't encountered the same problem. So the question is to repeat. Do you use Java util collections in your in the game, right? Because I mentioned that earlier Because his experience is they're very bad for performance. This is also my experience. They're very bad for performance Um, this is also the experience of the developers on the c++ version of the game Because they created their own collections Um, and arrays are much faster, of course arrays are much faster Um, unfortunately, I could not use an array for everything But but I try to use arrays where I can And if if anybody wants to know more about this Raise your hand now or stay silent forever or something like that Because because this is a Java question. He knows what he really sucks I'm not everybody might know this does anybody want more information about this part We can talk more about this. No, no we can Trust me we can but We can we cannot No, we cannot But but but anyways, uh, so yeah, so the memory footprint is just horrible in Java, right? But yeah, if you didn't expect this then you're kind of deluding yourself, right? Java and it's kind of so I think I have another slide on this Yeah, so cpu over is negligible. We don't care about that memory over But kind of also depends on which kind of GC you use, right? So I don't remember which GC does what right? But certain GC garbage GC is for garbage collection Certain garbage collection algorithms require that you have double the amount of memory, right? Because double the amount of memory you actually need because you do something and then you copy the whole thing to the other thing And you copy it back and whatever, right? So kind of depends And don't look at me like that. I think I know what I'm not talking about, but But yeah, so uh, uh, but yeah, so it's terrible and to give you an example I didn't put it in here actually because I don't want anybody to like like put a screenshot of my slides somewhere and say Java's terrible But like the c++ version runs this is like it's again for 2005, right? And it was highly optimized it runs. I think Average like 128 megs of RAM and if you like like like put the settings to ultra super duper or whatever I think it runs like 256 megabytes of RAM The Java version runs. I think an average of like one gigabyte of RAM, right? Hey, hey, hey don't this is Java, but uh, yeah But again, this is not optimized none of my Java code is optimized So actually most of the code is is the opposite of optimized Because the way I developed it I tried to stay true to the c++ code Because at certain points actually at most points I want to debug it, right? So if I optimize it and no longer looks like this like c++ version it's kind of difficult to debug, right But yeah, it's it even if it's optimized. Let's put it this way. It will never reach what c++ reach, right? It will never happen, right But so what people say memory is cheap which it isn't but whatever, right? How much time do I have? Excellent gonna skip this because Um Yeah, so these are things that okay, so very quickly. So these are things you don't have pointers You don't have macros. I hate macros, but you don't have they can be very useful They are very useful in the gaming world. No, I mean every c++ world actually And you don't have operator overloading which I really really miss, right? I even wrote something for operator overloading, but that's a different story But you have type safety, which I really love, right and Like I said, I'm gonna skip this. I'm just mentioning it because I don't know why So yeah, so this is the thing I think one of you two guys asked about this before it's kind of related to what you were talking about, right? So why use so you use arrays instead of of collections, right? Especially, right? Um stl is kind of like the java util collection thing It has much more, but it's kind of like that, right? And stl is like it's an extension on c++ which has a lot of cool libraries, right? Am I saying this right? I'm looking at you because you know a lot of stuff. I miss am I saying this right about stl It's a lot was there? Yeah, but c++ doesn't care. Yeah, I mean stl is I don't know is stl actually part of the standard. I don't know It is okay. So it is right So, uh, yeah, I honestly didn't know that because back in the day Okay, so I have no idea. I always thought it wasn't part of the standard, right? I think I thought that because effective c++ has a separate book for stl So I thought it was something separate, right? But uh, if you don't know what effective c++ is, you know effective java That was actually stolen from something called effective c++. It's a different book and they whatever doesn't matter doesn't matter, right? But stl has a lot of stuff, right? But java has like a lot of better stuff. I think right java has put a lot of thought into that, right? So it's cool Intrinsic for the win, right? So you have a lot of java functions c++ if you have a function gets gets compiled like it is, right? And the compiler does some optimization for you in java. It's kind of different if you open something and I assume most of you know this actually but but if you open something you You see a piece of code and you copy that piece of code and you run a benchmark It will be much slower than if you don't run it, right? If you if you run the actual call, right? Something in the Yeah Okay So to repeat the question because you're my friend, yeah, so Because we're running out of time. He wanted to ask a question that's unrelated to this but Is how did I approach the inverse square roots? Yeah, I don't know if it's an algorithm but that part right and if you don't know the inverse square roots It was something they nobody knows for sure who came up with it, but it speeds Sorry, yeah, he himself says he didn't come up with it, right? So From the MIT book It's possible. I have no idea but That's just assume. We don't know. It's just some aliens, right? We don't care But but it's it's a very known algorithm and it was written c++ And it only works in c++ because in c or c++ actually because you kind of like directly talked to the registers, right? If you do it without that Yeah, then you're talked to a vm which talks to the registers, which is what I do to answer your question Like I said debuggability is very important to me at this point, right? Uh optimization performance only if it kills me then right if something takes like seven minutes to load or whatever I don't see you. I don't see you. So Only if it takes like a very long time So I had a problem with file i o for example, right because I ported it the way f read does it and that kind of stuff Which was like the shittiest thing ever, right? Uh and something was was like loading in like Three minutes, right? And in c++ version took like two seconds, right? So that part I rewrote in java. I wrote you rewrote in a completely different way, right? But mostly I don't do optimization yet Approx what's approximation For the you mean for the infrasquare root Yes Yeah, but the way the way java implemented all that stuff is kind of still it still holds kind of true Right. Um, and yeah, it's not 100 so yeah, it is kind of approximation what you say But the the funny thing about this if you approximate it everywhere It's it's it still holds true, right because you're off by the same error everywhere Right, let's not talk about this anymore Any other questions because yes sir Do I have time to show them the demo? Is that including questions or excluding questions? Because I haven't had any questions yet And I need time for that so Okay, so I have five minutes yet. So I'm gonna sorry Yeah, okay, okay. I'm gonna show you the demo. Uh, I'm gonna skip this cool stuff. Just look at it cool stuff This isn't true, but cool stuff Uh, this is true, right? So you don't have console support For java, which is I think the biggest problem with game development, right? Because you don't have any native jvms for For most of the game consoles, we know But And this is about I don't say you should do this, but it's just cool. So I want to show you guys Apparently, uh, the blu-ray Specification, uh has a part of java in it. I did not know this I just discovered it like a week ago, right? And this is somebody who made a video He created like a small game in java and he ran it on xbox one and then on the playstation 4 Through the blu-ray the part of java that is in the blu-ray specification So unfortunately this is a six minute video. So I'm not gonna show maybe I'll like show you like the part where it says it's java Okay, this didn't work Okay, just trust me it's uh, it's cool. I don't know how to get this No, okay, that's I should have thought about that Anyways, it works. It's just amazing. Just just search it on youtube. You will find it, right? This is some cool stuff. I wanted to mention but Yeah, because because of the demo there were the one thing Just gonna start up inside the j in the meantime But the one thing I really want to mention is just there's a lot of untapped potential in java, right? So a lot of things a lot of problems that we might face in game development A lot of problems we do face in game development are kind of easy to solve And I'm not I don't mean easier in the sense. So that's why I said we're cheekier, right? Because he has a whole talk who explains the difference between easy and simple apparently I don't mean easy in the sense that It's you can solve it in five minutes, but we already know what the solution is, right? But nobody does it. Nobody takes the time to actually do it, right? So, yeah There's a lot of stuff like that. Um, I'm gonna show you the demo And I mean literally the demo Um, I hope this works The number works with the two screens in the meantime questions Just ask Sorry, this is the demo This is literally the demo It took me some time actually to get the demo itself working because apparently the demo was In the olden days that reached the demo like months in advance, right? Nowadays. I don't do that anymore You can kind of hear the music But the demo was made with different build of everything different build of the script different build of of like code whatever So I had to like do a lot of like exceptions in the demo Um Shit Yeah, don't comment about the mouse. I haven't captured it because it's easier this way Questions remarks Does anybody still like java? Sorry Sorry It runs pretty good. Yeah. Yeah. So the question is yes. Yes. My friend my friend So how does it run right? So I mentioned because I mentioned a lot about loading times and that kind of stuff So how does it actually run? So my answer is you will kind of see it right now, but but you know, it runs pretty good, right? and One of the lighting talks he mentioned something I think was about No, I don't remember which talk but he mentioned something about something was ported and they had to port it with errors Right because the same errors, right? This is actually funny because I had a similar thing I have a specific level that I load and it's just very slow at the beginning I thought oh shit, man I broke the game whatever right, but then I load the c++ version of the game the same level It's also very slow at the beginning. So I mimic the inefficiency, which is very important right I'm just skipping this stuff because we don't have time I think Yeah, so this is the problem doom is a very dark game, right? and Oh, no, no, no I want to console Yes, and I have to turn off shadows because that part is still broken Yeah, so it's a very dark game We don't have a light switch here. Do we have a light switch? In the olden days I used to show them wireframe, but I thought we were beyond that point So yeah, we can do this. I think no We can do this we can cheat we can always cheat right and the reason we're cheating is you get the flashlight Okay, you don't get the flashlight I don't know. I don't know why I didn't get a flashlight But yeah, this is really tiring. I must say it actually looks better from here. So if you want to see it, you can Where am I I'm probably over time so If anybody has any questions All remarks you can just Tweet them at me Don't tweet them at me send me a dark private message. Oh, just tweet them at me. It doesn't matter How much time do I have? Minus two Excellent Yeah, okay, so so yeah, thank you very much