Game Engine Programming: Drop-Down Console

  Рет қаралды 37,335

Jonathan Blow

Jonathan Blow

Күн бұрын

Пікірлер: 58
@EhKurd
@EhKurd 5 жыл бұрын
The game engine programming playlist is a gold mine
@MikeCampo
@MikeCampo 7 жыл бұрын
1:44:45 "I think I've got enough snacks. Hmm, I kinda need to go to the store to get a wider variety of snacks. If the coding suffers in this next segment it's cause there aren't enough different snacks." ... *looks off to the side with a pensive stare.*
@ZAKKORD
@ZAKKORD 7 жыл бұрын
This is getting better and better
@StevenOBrien
@StevenOBrien 7 жыл бұрын
19:47 My favorite one-line trick for that sort of smooth low-passed movement: open_t += dopen * (open_t_target - open_t), with dopen being some rate between 0.0 (doesn't move) and 1.0 (instant movement) relativized to the time step.
@markusthefish
@markusthefish 7 жыл бұрын
22:44 "Ugh you people"
@omgomgomgd
@omgomgomgd 7 жыл бұрын
I'm getting interested in writing my own code with this language. I love all the little Quality of Life features you've put in, as they solve things I have problems with using other languages as well.
@qwesx
@qwesx 7 жыл бұрын
I'm not even into game programming (more of an embedded C guy for profession) and I want to use that language. It feels like a C with convenience and without all the C++ cruft. Does Jai allow setting pointer addresses manually? Would be interesting to try to get this to work with avr-gcc or gcc-arm and see what happens. Spoiler: The compiler would probably just "optimize" all the ISRs away because there's no way to mark anything volatile... But other than that it could be neato.
@0xCAFEF00D
@0xCAFEF00D 7 жыл бұрын
I really like these.
@mattetis
@mattetis 7 жыл бұрын
26:28 "This might be some serious tea happening..."
@ivanbraidi
@ivanbraidi 7 жыл бұрын
I love this man so much!! XD
@warrenhenning8064
@warrenhenning8064 3 жыл бұрын
He seems so much less grumpy in older streams.
@mattmurphy7030
@mattmurphy7030 9 ай бұрын
Riding the high of having made something
@rationalcoder
@rationalcoder 7 жыл бұрын
Man, watching someone struggle through all of the keyboard shenanigans makes me appreciate SDL2 even more. Even if you insist on handling events at a lower level (which is understandable), you could probably strip some keyboard stuff out of SDL, or, at least, use it as a reference.
@jblow888
@jblow888 7 жыл бұрын
Ehh. The amount of time it would take to do that would be equal or longer to the amount of time it took to do it without dependencies.
@jblow888
@jblow888 7 жыл бұрын
It's very important to understand that adding layers *never* simplifies things. It only hides the mess, which will come back to bite you later.
@rationalcoder
@rationalcoder 7 жыл бұрын
I don't want to post two separate replies (b/c that is really annoying), but I do have something to say to both comments. 1. I guess I could see why it might not be a good idea for someone on your level. For me, already knowing the ins and outs of SDL2 (and not knowing too much about low-level keyboard business), using it undoubtedly saves me tons of time. Maybe, if I see your implementation pay off in a way that I can't currently implement, I will invest the few days to lookup the nitty gritties. Even if I did, though, I would certainly use their design as a reference because I think they have done a good job. 2. In the context that you originally said this in your stream about some OpenGL stuff, I completely agree; however, in the case of libraries that handle things like keyboard input, language translation, etc, if the mess is well managed, its ability to hide the mess is exactly why I would choose the library in the first place. Granting that your experience has giving you some perspective that I don't currently have, what mess could SDL2 be hiding in its keyboard input management that could bite me in the future? As a side note, I think, "adding layers never simplifies things" is too pithy and could be understood as an argument against abstraction in general. I think good arguments can be made for adding layers in your architecture on the same token as those made for using a compiled language instead of assembly(as long as the "assembly" is still accessible when needed).
@jblow888
@jblow888 7 жыл бұрын
With regard to (1), you are just seeing work that isn't done yet. Obviously the keyboard system should be figured and and set up to do the right thing (it has been since this video) -- no matter how you do it, that takes some time. What you are seeing in this video is that that time had not been invested yet, because there were other things I considered more important, but then when it came around to doing this stuff, the input system started to get in the way. That's natural -- it is how you know this thing that's been delayed is now important enough to do. So what you are seeing is not an actual problem, it is my development method working as planned! So the question then is, how to approach that. Well, I have done Windows input stuff directly often enough that I just know basically how it goes (but have forgotten certain details which is why I didn't start to fix it right there). And I know that I don't want a huge library like SDL as a dependency on every operating system. And I suspect, from doing similar things many times in the past, that even understanding what SDL is doing with regard to input is going to take a lot of time ... and there's no guarantee that SDL is really doing it the best way (though it's probably at least reasonable) ... so I chose to just do it the direct way. I can report, having cleaned that stuff up, that it was fine and took a short amount of time. (2) Hiding mess is indeed something a library should do for users. But you have to realize that I am not doing end-user programming here. I am building a programming language, and then a game engine, from the ground up. Both of those things need to be as simple as possible, in order not to fall prey to many of the problems that make a lot of software terrible. I am providing the *equivalent* of SDL (except better, because the goal of this system is to make everything better). Building *on top* of SDL would be a grave mistake (for too many reasons to go into here). And there is this weird phenomenon, where sometimes I get hostility from people for implementing things at a relatively low level. (I am not saying you are being hostile in the emotional sense, but there are definitely people who get that way, possibly as some kind of ego defense). But the thing is ... ***some people*** have to build and maintain the skillset of implementing things from a low level, otherwise software will just become an increasingly high pile of increasingly old junk that people don't know how to, or are afraid to, dig into the middle and modify and improve. I don't think that's a particularly controversial statement. Okay, so, I am one of those people. Not everybody has to be, and that is fine!
@rationalcoder
@rationalcoder 7 жыл бұрын
Understood. I actually strive to play the low-level role myself, and it has made me a much better programmer. I would say that I am pretty far along, but I just have just been putting off the replacement of SDL in my systems as I thought it was a low priority. Then again, I spend most of my time writing game-engine tools and subsystems that I then test on a mock engine that uses SDL. I figured it was more important for me to be able to be productive in things like graphics and memory management systems before looking at areas that SDL handles. Now that I am actually getting into putting together real engines, it could be time for me to replace it. I was hoping to just get a few ideas on where SDL falls short, so can emulate the good parts in my engines while leaving out the limiting features, but I understand that your time is valuable. I will probably pick up some intuition for it after I follow your series for a while.
@NatBookPro
@NatBookPro 7 жыл бұрын
22:44 MVC is taught in uni as standard, which I think is just because it is an easy way to demonstrate the idea of separation of responsibility. I am curious about how you write your code, because I'm sure you naturally form applications that follow the same principles of MVC, even if you don't do it explicitly or even intentionally. I wouldn't say that MVC is a complete answer, but it definitely is an easy way to teach basic code architecture.
@fromatic2
@fromatic2 7 жыл бұрын
online applications is where i learned that
@nesvand
@nesvand 7 жыл бұрын
It's a way of helping to teach separation of concerns, but outside of understanding that it's terminology that kinda just floats around in Web circles (specifically JavaScript) and has a kind of voodoo-magic in its invocation, even though most Web Developers would struggle to explain what an MV* is, let alone its benefits. Aaanyway, game programming has its approximations, but I don't see how the pattern holds here outside of general terms - you can see from Jonathan's code that the Model, View, etc. are intermingled, so it's not really applicable here.
@codeinclined
@codeinclined 7 жыл бұрын
When I think of MVC I think of those talks of cross platform C++ code for mobile apps. That's pretty much the only time I've heard it being mentioned honestly
@rafikrizik4722
@rafikrizik4722 4 жыл бұрын
He probably uses Immediate Mode UI IMUI, there is a video by Casey Muratori that explains it and is pretty straight forward
@youtubeenjoyer1743
@youtubeenjoyer1743 5 ай бұрын
"Separation of responsibility" is not something that makes your program correct or fast, and in fact is harmful nonsense. When you start programming with this academic mindset, you inevitably try to define "responsibility", and there goes your productivity.
@64jcl
@64jcl 6 жыл бұрын
With reference to the MVC question: Any framework you learn today adds layers upon layers of abstraction to simplify repetitive coding using what I call "magic markup". Ofc this markup is completely nonsensical so if you have not worked with the framework for some while, you have likely forgotten all about the magic that is going on and you have to learn all those strange things over again. Which is why I agree with the likes of John Blow and Casey Muratori which advocate a simpler down to earth coding style where you can actually read the code. So no MVC, no OOP, no nonsense magic markup. Keep it simple, keep it stupid. In the long run you become a better programmer this way imo.
@indycinema
@indycinema 5 жыл бұрын
by magic, you mean declarative. and instead of non-sensical, you might mean, arbitrary based on internal/sometimes historical logic. it's fine, but, i donno. there's so much hand waving when folks (including jon) complain about framework/library architecture. as if programming was just the native language patterns and no declarative libraries are ever useful. i think it's selective thinking is all.
@yksnimus
@yksnimus 3 жыл бұрын
Your console history grows forever? I was thinking a circular buffer or something alike. How do your allocators work? (any vid on that?) Like, do you handle array resizing/reallocation?
@dimarichmain
@dimarichmain 3 жыл бұрын
This strange 'j' synbol is probably 0x0A when Enter is pressed
@Scy
@Scy 7 жыл бұрын
Snacks, snacks, snacks? Are you a Kerbal?
@dimarichmain
@dimarichmain 3 жыл бұрын
A tea-minute break;
@lucaswrk
@lucaswrk 7 жыл бұрын
Super cool!
@AlejandroMartinez4
@AlejandroMartinez4 7 жыл бұрын
I'm curious about the overload function you wrote for the debug. Couldn't you just have added a default parameter instead? .jai supports default params right?
@jblow888
@jblow888 7 жыл бұрын
I am not sure which one you mean. Sure, you can always have default parameters, but you can't have them in the middle of the argument list with non-default parameters after. (If you think about why, you'll see it introduces potential ambiguities).
@AlejandroMartinez4
@AlejandroMartinez4 7 жыл бұрын
Oh yes! I forgot about that. I'm so used to named parameters which kind of solve the issue. Thanks for answering Jon! Loving these streams :)
@jblow888
@jblow888 7 жыл бұрын
Well we have named parameters also...
@AlejandroMartinez4
@AlejandroMartinez4 7 жыл бұрын
I know I know, but I don't see you using them a lot right? (or maybe i'm just blind).
@jblow888
@jblow888 7 жыл бұрын
I am not really in the habit of it. I start to use named parameters when I have a procedure with lots of parameters (say, at least 6) and I want to skip over the middle ones. That hasn't happened much yet, in part because this codebase is pretty simple still. But it does happen as things get bigger.
@flamendless
@flamendless 7 жыл бұрын
its not that much code. its just a thousand line.
@videouploader1677721
@videouploader1677721 7 жыл бұрын
Have you tried using a proportional font for programming? Its nicer to look at in my opinion but one cannot vertically align things without an editor with "elastic tabstops" feature.
@lithium
@lithium 7 жыл бұрын
Love these videos, but is there anything more frustrating than spotting a bug Jon is stuck on and not being able to convey it to him? ;)
@NitrosS
@NitrosS 7 жыл бұрын
why he use emacs? This editor so hard to learn.
@krux02
@krux02 7 жыл бұрын
Probably it was the best thing out there when he started to do programming, and it pretty solid. But you are right it is very hard to learn because so much works so different.
@NitrosS
@NitrosS 7 жыл бұрын
krux02 vs code is good for coding.
@krux02
@krux02 7 жыл бұрын
vs code did not exist when he started programming, and when you know something the argument how difficult it is to learn something is out of the window.
@NitrosS
@NitrosS 7 жыл бұрын
Totally agree
@jblow888
@jblow888 7 жыл бұрын
I used vi for a little, and "jove" which is kind of like emacs but way simpler, and switched to emacs around 1991 or 1992 sometime?
@stephenkamenar
@stephenkamenar 7 жыл бұрын
always reinventing wheels I just go on github and download a console lib and I'm good to go in 10minutes
@Raattis
@Raattis 7 жыл бұрын
You are joking right?
7 жыл бұрын
Pass me a link of a console lib written in jai.
@companerger9416
@companerger9416 4 жыл бұрын
Ok. WHAT THE HELL IS A DROP-DOWN CONSOLE!!!!!!??? P.S. I didn’t watch the video.
Game Engine Programming: Console commands, Cool metaprogramming
3:24:35
Game Engine Programming: Animation Groundwork (full version)
2:06:17
Jonathan Blow
Рет қаралды 21 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 8 МЛН
Game engine programming: Mesh VBOs.
2:30:59
Jonathan Blow
Рет қаралды 32 М.
Puzzle Game Water Rendering, discussion with Casey Muratori
2:34:27
Jonathan Blow
Рет қаралды 73 М.
Animation Control 1
2:38:31
Jonathan Blow
Рет қаралды 13 М.
Improving Invaders (part 1)
4:35:48
Jonathan Blow
Рет қаралды 36 М.
Sokobanana
1:47:38
UNOFFICIAL Jonathan Blow stream archive
Рет қаралды 3 М.
Game Engine Programming: Editor stuff
2:39:38
Jonathan Blow
Рет қаралды 34 М.
Data-Oriented Demo: SOA, composition
1:32:47
Jonathan Blow
Рет қаралды 161 М.
So I Made My Own Game Engine...
10:19
Chadderbox
Рет қаралды 101 М.
Livestream: Application Programming: Menu
3:12:57
Jonathan Blow
Рет қаралды 96 М.
The fastest CPU in the world
25:53
Linus Tech Tips
Рет қаралды 1,1 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН