Programming a Physics Engine for my Survival Game

  Рет қаралды 11,131

codergopher

codergopher

Күн бұрын

Пікірлер: 65
@PolyMars
@PolyMars 4 жыл бұрын
Just came across your channel and I loved this devlog! As someone who’s recently started making C++ games from scratch, I find your workflow and explanations really interesting :)
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank you, I appreciate that :) Your content looks very interesting, VR, good stuff. Just curious, did you find this channel through this video or someplace else? I'm just trying to get an idea of how much youtube is promoting this video, as it's my first devlog.
@PolyMars
@PolyMars 4 жыл бұрын
@@codergopher8270 Thanks! I actually came across this video early by coincidence- I found your 2D platformer collision detection video on KZbin search and went to check out your other videos. I noticed you had uploaded a video literally just a few minutes ago so I had to watch it, haha.
@benrex7775
@benrex7775 4 жыл бұрын
​@@codergopher8270 Cool, someone who looks at the channel of the people he's interacting with. I haven't seen that a lot. By the way I think you know how I found you. I was searching for vulkan stuff on KZbin. And your video was among the search results.
@codergopher8270
@codergopher8270 4 жыл бұрын
@@benrex7775 Oh thanks for letting me know, I appreciate that. Usually I'll end up checking out the channel of a long time subscriber who comments fairly often, or if they have an interesting looking profile pic or name.
@benrex7775
@benrex7775 4 жыл бұрын
@@codergopher8270 I do the same. And you are the first person I saw doing that besides myself. And I'm a frequent user of KZbin for quite a few years now. So it's actually quite surprising that I've never seen someone doing that. You mentioned almost all the reasons for why I look at peoples channels. The one reason you didn't mention is when I have a comment discussion, then the kinds of videos or subscriptions can give a hint on the background of the person. Sometimes you can also see the country. That way it is easier to get your thoughts across.
@DarshanSenTheComposer
@DarshanSenTheComposer 4 жыл бұрын
It's great to watch someone setting up something for the first time and getting it to work. Good job! :)
@codergopher8270
@codergopher8270 4 жыл бұрын
3rd time's the charm, right? Thanks for the complement :)
@beyondcatastrophe_
@beyondcatastrophe_ 4 жыл бұрын
To those looking for the source: research.ncl.ac.uk/game/mastersdegree/gametechnologies/physicstutorials/ (specifically Part 4 research.ncl.ac.uk/game/mastersdegree/gametechnologies/physicstutorials/4collisiondetection/Physics%20-%20Collision%20Detection.pdf)
@codergopher8270
@codergopher8270 4 жыл бұрын
Added to description. Thanks for reminding me, I was pretty sure I included it but I guess not :)
@fffade
@fffade 4 жыл бұрын
aaaaa your content is very fun to watch xP i remember seeing you a while back but i never subbed, glad i found you again i'm also into c++ game dev so that's cool lol
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank for the complement and the sub :)
@fakesilver746
@fakesilver746 4 жыл бұрын
10:13 i dont think that's what's called a memory leak. I dont really know the name of what you are describing but it is simply freeing memory to early. What happens then is as you said that there are "ghost" objects there remaining since the computer doesnt remove anything, it simply sees that that memory is unallocated, but doesnt stop you from accessing the adress. That is of course dangerous because then you can think that your program is functioning normally until it suddenly gets corrupted somewhere seemingly random. However, a data leak is usually when you have removed all references to an object, so you can't access it, but the object still remains allocated in memory. This is bad because if you run your program for long enough the heap and stack can crash into each other and you also take up uneccessary amounts of RAM. I think I've commented about this on an earlier video but I higly recommended that you look into Valgrind. I havent really done much with it in C++ but mostly C but i think it works basically the same either way.
@inlandcasserole9701
@inlandcasserole9701 4 жыл бұрын
That's use-after-free, as far as I know my programming. And I'd also recommend using some modern C++ library features like std::unique_ptr and std::shared_ptr, in addition to memory sanitizers and other tools.
@codergopher8270
@codergopher8270 4 жыл бұрын
Thanks for the recomendation. I tend to do a mix of old school C++ with delete and new, and modern.
@michaelkudrik4922
@michaelkudrik4922 4 жыл бұрын
Yay Im early!! Love your vids so much
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank you, I appreciate that :)
@Fezezen
@Fezezen 2 жыл бұрын
The most I can relate to rats is the occasional sight of rats in Toronto, but that's about it lol
@scottsturdevant9903
@scottsturdevant9903 4 жыл бұрын
Lol entertainy as always Marty!!
@ali51717
@ali51717 4 жыл бұрын
You mind friend just earned a subscriber for showing how to do things for the first, because that is the struggle that we all want to overcome.
@codergopher8270
@codergopher8270 4 жыл бұрын
Thanks! I'm glad I could help :)
@invalid9553
@invalid9553 4 жыл бұрын
Great video :D
@codergopher8270
@codergopher8270 4 жыл бұрын
Thanks you :)
@invalid9553
@invalid9553 4 жыл бұрын
@@codergopher8270 can't wait for more
@AjXsmile
@AjXsmile 4 жыл бұрын
You Have Earned A New Sub Your FUNNYYYY
@mattiaslaserskold137
@mattiaslaserskold137 2 жыл бұрын
Nice video :)
@cameronholt4735
@cameronholt4735 2 жыл бұрын
Not to be rude but I think you have the east and west mixed up on 9:10 nice video tho very entertaining
@collinmactaggart4014
@collinmactaggart4014 4 жыл бұрын
These are great videos to just game dev too 😂
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank you, I'm glad you enjoyed. Good luck on your game!
@ayoubdkhissi
@ayoubdkhissi 4 жыл бұрын
great video !!!!
@scotthutchinson9769
@scotthutchinson9769 4 жыл бұрын
Hey Marty, I am wondering if you are aware of the Address Sanatiser? It is a simple compile flag that you set and it will show you exactly where a memory leak is occurring in your code. I haven't had a memory leak problem take longer than a minute to fix since using it.
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank you very much, that's going to be life saver in the future!
@invalid9553
@invalid9553 4 жыл бұрын
Helps me too !
@pislify34
@pislify34 4 жыл бұрын
pitter fall 1000 fps me trying hard to get to 60 in a i9 computer : ok
@ShawCode
@ShawCode 4 жыл бұрын
How many devlogs will there be? Great video btw
@codergopher8270
@codergopher8270 4 жыл бұрын
Hopefully by 30 devlogs the game will be ready to release. Thanks for the complement :)
@ShawCode
@ShawCode 4 жыл бұрын
@@codergopher8270 Will it be on Steam?
@codergopher8270
@codergopher8270 4 жыл бұрын
@@ShawCode That's the plan.
@valorantnoob7457
@valorantnoob7457 4 жыл бұрын
what is the software u use to code?
@codergopher8270
@codergopher8270 4 жыл бұрын
I use Sublime Text 3 with CMake for G++.
@valorantnoob7457
@valorantnoob7457 4 жыл бұрын
@@codergopher8270 thank you
@rxn7
@rxn7 3 жыл бұрын
Whats your keyboard?
@bandanaboii3136
@bandanaboii3136 4 жыл бұрын
very cool project
@codergopher8270
@codergopher8270 4 жыл бұрын
Thank you
@rootwayder77
@rootwayder77 4 жыл бұрын
Do you use a drawing tablet?
@codergopher8270
@codergopher8270 4 жыл бұрын
No I don't, just a mouse.
@conorkerin5277
@conorkerin5277 4 жыл бұрын
Where can I see the code your game is made from?
@codergopher8270
@codergopher8270 4 жыл бұрын
My SDL series here is based loosely on the core engine of my game.
@friesofwisdom4399
@friesofwisdom4399 4 жыл бұрын
It's called a dangling pointer, not a memory leak.
@codergopher8270
@codergopher8270 4 жыл бұрын
You're right, thanks for pointing that out.
@sammycrazyyt
@sammycrazyyt 4 жыл бұрын
you look like idubzz
@eboatwright_
@eboatwright_ 2 жыл бұрын
11:24 hol' up
@collinmactaggart4014
@collinmactaggart4014 4 жыл бұрын
Yes
@inlandcasserole9701
@inlandcasserole9701 4 жыл бұрын
Cool stuff and good luck on your project... but that "fps drop" bit about box2d is telling nobody, nothing. Going from 8000 FPS at 0 rats, to 1300 FPS at 800 rats or whatever is... really not that bad? Especially since they're active objects, and you're generating lots of collisions and calculations when putting them on top of each other. And why would you render at anything higher than 60/120 or whatever reasonable FPS. And it doesn't look like you profiled anything... which you really should. That fps drop could as well be because of how you render stuff :wink: Also box2d is used, quite literally, everywhere, has lots of contributors and has been a thing for a long long time, constantly improved, and even google forked it to use in their games or whatever. If you just want to make a physics engine, then go ahead and have fun. But if you want to make something better than box2d... then that ain't happening, sorry. (Except maybe in a very specific case.)
@codergopher8270
@codergopher8270 4 жыл бұрын
Agreed. The odds of my pulling a physics engine out of my brain that can beat Box2d is slim, really. But like I said, instead of optimizing my code, which would have been the rational solution, I proceeded to make a physics engine. Mostly for the fun, and I wanted to put my Physics class to good use.
@rifqiggkrinyol6937
@rifqiggkrinyol6937 2 жыл бұрын
Hi, my name is Rifqi and I come from Indonesia, help me sir, currently in my country everyone is playing Higgss domino island, can you make cheatss / mod apkk / tricks tricks that are not detected and can used in the game? please help sir, so that our family life can change, good luck,.
@napptus
@napptus 4 жыл бұрын
Stolen from Randall, dislike.
@codergopher8270
@codergopher8270 4 жыл бұрын
Impossible. Randall doesn't use the glorious C++ anymore. Randall abandoned EpicC++Gang long ago. Thanks for the dislike though :)
@napptus
@napptus 4 жыл бұрын
@@codergopher8270 Sandbox Game: YES Physics Engine: YES Both are the same and Randall uploaded earlier, so its stolen. Regarding C++: He was enlightened and understood that C ++ is shit. However he'susing C now but Prof Reworkwill bring him to the god: *Python* Regarding the dislike: Not getting tired doing it ;)
@codergopher8270
@codergopher8270 4 жыл бұрын
@@napptus 1. Oh so Randall invented physics? I think your confusing Isaac Newton with Randall. I'll admit to stealing Newton's laws of physics, but that's about it. 2. I don't even watch Randall anymore. I liked him better as a smaller creator, because his jokes were clean and funny. Now he's a bit too rank for my liking. 3. My game isn't a sandbox game, it's a story based survival game.
Making a Game in ONLY 64x64 Pixels with Polymars
19:11
codergopher
Рет қаралды 31 М.
Writing a Physics Engine from scratch
9:24
Pezzza's Work
Рет қаралды 216 М.
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Music Video)
2:50
RAAVA MUSIC
Рет қаралды 2 МЛН
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
Programming A Particle System in 1 Week for my Survival Game
16:04
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
Designing a Physics Engine in 5 minutes
7:37
Winterdev
Рет қаралды 159 М.
The Ultimate Guide for Physics in Game Development!
1:04:41
Will Hess
Рет қаралды 151 М.
3D Physics! // Hazel Engine Dev Log
16:26
The Cherno
Рет қаралды 72 М.
Recreating Noita's Sand Simulation in C and OpenGL | Game Engineering
10:03
Nuking My Survival Game and Building an ECS
10:42
codergopher
Рет қаралды 16 М.
Building a Physics Engine with C++ and Simulating Machines
11:23
AngeTheGreat
Рет қаралды 724 М.
Can I 100% Superliminal and Get a Refund?
23:36
Gronf
Рет қаралды 399 М.
Nope. No way.
3:06
Phoenix SC
Рет қаралды 743 М.
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН