- 9
- 11 978
TheSandwichCoder
เข้าร่วมเมื่อ 21 ต.ค. 2023
I’m a sandwich that does programming and game dev 🥪🖥️
Python Developer learns Rust (and remaking my chess engine)
Wait what... I dont actually hate rust?!? I guess I just clickbaited yall then...
The Chess Video will be coming soon! After probably another 2 months... maybe 3 months.
Wow I am getting lazy at writing descriptions... probably no one will read this anyway.
Githubs:
Space Invader (why?): github.com/TheSandwichCoder/Bevy-Space-Invaders
Ball Simulation: github.com/TheSandwichCoder/Bevy-Ball-Simulation
Rust Chess Engine: github.com/TheSandwichCoder/ChessEngine-Rust
Whhhhaaatt... you are still here? here have a dinosaur 🦕
The Chess Video will be coming soon! After probably another 2 months... maybe 3 months.
Wow I am getting lazy at writing descriptions... probably no one will read this anyway.
Githubs:
Space Invader (why?): github.com/TheSandwichCoder/Bevy-Space-Invaders
Ball Simulation: github.com/TheSandwichCoder/Bevy-Ball-Simulation
Rust Chess Engine: github.com/TheSandwichCoder/ChessEngine-Rust
Whhhhaaatt... you are still here? here have a dinosaur 🦕
มุมมอง: 11 598
วีดีโอ
Making a Ray Tracer in Python #rtx #programming #gamedev
มุมมอง 4782 หลายเดือนก่อน
I made a ray tracer(path tracer) from scratch in python. This video is much more laid back in terms of editing and animations than the other ones, so tell me if you like it more! although I forgot to mention it in the video, this would not be possible without: Ray Tracing in One Weekend raytracing.github.io/books/RayTracingInOneWeekend.html I also mentioned: Sebastian Lagues RTX : th-cam.com/vi...
Making a Chess Bot from Scratch (part 1) #chess #chessbot
มุมมอง 8484 หลายเดือนก่อน
In this video I made a chess bot from scratch in c (first c project). Im hoping to improve on it and hopefully make a follow-up video where it might beat me. If I'm not lazy, a link to the Github to play the chess bot will be in a comment below. DISCLAIMER: this is still a massive work in progress, so there are many bugs and crashes still Pls subscribe since this video and bot took like 4 month...
Making a Checkers Bot in 60 Seconds #pygame #gamedev #programming #shorts
มุมมอง 1587 หลายเดือนก่อน
what I meant to say was that you can check the description for the game. Also I really did the bare minimum for this bot to play properly so if you're interested in a more detailed video on chess bot programming, come check on me in a month If you wanna beat the bot, you can download and try it here: github.com/TheSandwichCoder/CheckersBot Rules for my version of checkers: 1. All captures are f...
I made a Physics Simulator from scratch in Pygame #pygame #gamedev #physics
มุมมอง 3618 หลายเดือนก่อน
In this video I made a physics simulator in pygame. I actually made this quite a long time ago but hey making a video takes time. I also made the Suika Game. Take note: the Suika game has a lot of bugs the main one being you just cant do anything. Im too lazy to fix it. also how many people would actually read this anyway right? If you are interested in playing with the physics simulation or Su...
Making a Game for Christmas in Pygame #pygame #programming #gamedev
มุมมอง 38110 หลายเดือนก่อน
Merry Christmas! So I made a game for Christmas cus why not right. This was a really big challenge and I faced alot of bugs on the way, but I think it turned out well and was worth it in the end. Of course, I could not have done it without Perlin Noise code made by: Supreme Sector(1d terrain noise): Video: th-cam.com/video/QHdU1XRB9uw/w-d-xo.html Github: github.com/Supreme-Sector/Python-Perlin-...
I made a game for NNN in 7 days
มุมมอง 10011 หลายเดือนก่อน
Hey so I made a game for No Nut November in 7...8 days well you will know when you get to that part. Its a shame that I lost the first half of the recording but I think the video still turned out find right? This is the first full actual video on my channel, so let me know whether you enjoy it. I got the .exe file working, so download it and try to run it. I promise you its not a virus... I thi...
Very good editing for a ~500 sub channel! Came from the learning Rust video.
You're great!
10:40 You might try saving detected collisions to a list of collision events containing data about which balls to update and how to update them. Then you update one ball at a time using that data instead of copying the whole ball list.
It's worth noting: most popular libraries change things pretty regularly. Maybe not to the extent of a newish project like Bevy but for that reason ChatGPT will always be behind the times on the code it spits out.
this video is extemely well made i susbroobed
you can be racist without being asian just a friendly reminder
skill issue is not python or rust , skill issue is gaming operating system with browser based notepad++ clone
Awesome video. Peak cinema. You'll have one billion subs in no time
So you're asian? Name every asian person
Honestly, amazing. Do you have a Discord server?
In Python you can specify the variable type almost the exact same way as in Rust: a_number: int = 5 Not that it does much of anything aside from helping with documentation.
You know that coding in rust on windows is illegal, right?
1:16 jdh enjoyer spotted Also great video, as a Rust and Bevy evangelical i approve
And that’s how summer works as a guy! 😂 Memes aside - welcome to oxidation, and a phenomenal video btw
can't wait for this language to die soon so everyone can shut up about it and return to normal languages like c and c++
4 nested for loops is crazy
top 5 most unproductive things: 1. C++ (int*************************************** language, also manually mana- oop you forgor to free the memery, memery leak!!!) 2. Courses 3. Hello guy today we C++ tutorialing lik subkrib comant dawn belaw I can print empty TypeScript enums now with swc_ecma_codegen!!! n0oB
I also did the python-to-rust switch for game development, it's been about 2 months and I love it, the typing is so much more explicit, I no longer lay awake at night fearing my integer is going to get turned into a float without my consent I suggest you try using bevy's event systems ASAP, they really change how you can make your systems interact, and they're a good way to handle mutating your components without conflict, I did mine like this: put player input event writers in pre-update, put all event readers in update, put game logic event writers in post-update, there's a ton of benefits to doing things this way that I won't get into in this comment, but it prevents systems mutating the same variable at the same time causing crashes, and guarantees that when systems are reading data, the data will not change during the frame, the data is essentially "still" while systems read it and decide how they want to change it my first components I wrote in bevy were Velocity, Acceleration, and Spin, it was a great study on how to work within the ECS
3:20 this is completely wrong. Variables in C++ are always passed by value unless the parameter’s type is a reference
Bro really said if n == 0: return 0 if n == 1: return 1 instead of if n < 2: return n
BaloogaClone.init() [True]
I enjoy
Who up tracing they rays
A point of advice: Reading rust's documentation is a much better learning tool than ChatGPT, particularly insofar as it pertains to core Rust features. If you do not understand something, I recommend taking a break from your actual project and instead starting a new microproject to force yourself to understand that element of the language. By asking ChatGPT to write your code for you, you are deferring the valuable work of learning onto the computer, and you will never really understand what's going on or why you are doing it.
this video earned my approval btw im stupid yippee
I wonder, can you speed things up by simulating just a few pixels instead of ray tracing every pixel one by one. And then fill the area between 2 pixels with just smooth gradient that goes from pixel1 color to pixel2 color? This way you would get non-grainy image that still has somewhat accurate representation of what color light would be.
6:12 There are faster linkers, like gold, and you can setup Bevy to be made a DLL while developing.
4:43 A usize is an unsigned integer that is the same size as a CPU register, and is used for offsets and lengths.
4:04 &str is a slice (a.k.a. fat pointer), which can point to any UTF8 string in memory, and it doesn't own the string to which it points. A String is an owned string. You can borrow it as a 4:08 &str to pass to functions, but you can also append to it, which may cause reallocation (like C++'s std::string).
the wordle code is bruh ._.
Your explanation about C++ references doesn't seem right to me. C++ Vectors aren't implicitly copied by reference and there is also a difference between a const and a mutable reference. References in C++ is just a convenient way to pass around a pointer that is known to be initialised, so technically you can also pass a reference using a pointer where you can pass a pointer to a constant. I have included some examples below for you: // Pass by value. void foo(std::vector<int> vec) { //... } // Pass by mutable reference. void foo(std::vector<int>& vec) { // ... } // Pass by mutable reference using pointer. void foo(std::vector<int>* vec) { // ... } // Pass by const reference. void foo(const std::vector& vec) { // ... } // Pass by const reference using pointer. void foo(const std::vector<int>* vec) { // ... } Passing by reference using pointers can also be confusing but a great explanation is from a Stackoverflow post describing: """ const char* is a pointer to a constant char char const* is a pointer to a constant char char* const is a constant pointer to a (mutable) char """ (source: stackoverflow.com/questions/162480/const-int-vs-int-const-as-function-parameters-in-c-and-c)
1:55 is he actually using command line? dude, it's not the 80s, people use GUIs now.
This better be a joke
@@aarorissanen930 I mean it's really primitive
@@cheesepop7175 You must be a beginner in compsci to think that. The terminal is the MOST powerful tool for a person working with a computer, no doubt about it. Not everything needs to be a GUI designed for babies.
&str vs String in a nutshell: &str is a 'String' which you know how long it is, but don't know if you can write past the last byte of the &str. A String is also a 'String' which you know how long it is, but also have an extra field which we call capacity which lets you know how much more can you write to it
awesome video, the music and sound effects are just WAY too loud
10:04 You can just use .iter() on the lists when using them in the loop. Boom. No cloning.
A "usize" is an unsigned integer with the size of the platform. Example: "usize" on a 64-bit CPU is an unsigned 64-bit integer. There is also "isize" which is the same but signed. Other non-dynamic number types in Rust are: u8 i8 u16 i16 u32 i32 u64 i64 u128 i128 f32 f64 They are pretty self-explanatory, examples: u8 - Unsigned 8-bit integer. (AKA a byte.) f64 - 64-bit floating point number. i32 - Signed 32-bit integer. (Signed just means that it can also store negative numbers by giving up some of the larger unsigned numbers that it could store if it was unsigned.)
wait what would you need isize for
The borrow checker is actually quite simple. If you put something into a function call by value, it deallocates the variable after use. If you pass by reference, you can reuse the variable. And if you have something reading/writing to a variable, you cannot read/write to it somewhere else.
I believe you could use an Arc to view the balls instead of making a snapshot
10:30 Instead of copying the list of balls every time you want to check collisions, Why not use immutable references in your for loops and push the collision updates to a stack? Then after you've looped through each ball, you have a vector of the collision updates that need to be performed and can do all of them without needing 2 mutable references or having only half the balls have collision.
6:43 bro complains about having to read documentation, what a world we live in
That's what I was thinking, too. ChatGPT is great for specific, hard-to-Google questions, but you should use it only as a way to orient yourself in the right direction, not try to have it do the work for you.
FR
bro uses onedrive
lmao real
String is a data object internally represented as a Vec and is far more versatile. &str is a pointer to a string literal. They are much less flexible but faster. &String and str are almost never used. usize is an unsigned number the size of the systems pointer length.
to add ontop of that, string literals are &str and not String because Rust removes duplicate string literals, so you get a shared immutable reference this is an optimization done at compile time
281 subs? wtf?
Nice video! When implementing a spatial hash in bevy you should store the Entity instead of a components reference, this enables you to get back the entities components inside your system using the spatial hash Resource.
13:59 after seeing those comments why do i feel like it was written by chatGpt 🤔🤔🤔🤔
I love low chatgpt is insulting you. i'm glad he doesn't insult me. i use him 24/7 to write html and css.
I love how challenging it is. I feel like an idiot every time I use Rust, but I keep going because of my ego. Lmao
I'm actually amazed you got this far... Bevy uses high level Rust concepts, that can do amazing stuff when utilized correctly. But hell I'm tinkering with Rust now almost two years and I still do not feel comfortable enough to play around with bevy beyond its examples. Learning Rust is already hard mode, learning Rust with Bevy earns you respect from the Doom Slayer...
I mean you could've cached the python script at the start of the video...problem solved...
Too late for Rust man! Imagine Python but fast... They even call it Mojo!
just use pypy at that point
youre the sigma sandwichcoder thank you for the good content