Пікірлер
@Tik_Barattolo
@Tik_Barattolo 11 сағат бұрын
Game name?
@TheAstroPhoenix
@TheAstroPhoenix 14 сағат бұрын
An elegant solution! Polar coordinates in situations like this definitely make life a lot easier. For more complicated scenarios (which don't follow circular spawing points), it might be worth reading into basic monte carlo implementations. These will randomly sample a space of x,y points (which you can restrict the range of using polar coordinates), and when chained, you can make them converge to a region of interest.
@aqua-bery
@aqua-bery 19 сағат бұрын
How are you generating the shape for the sprite at the end? To represent the spawning range I mean
@nick-brooking
@nick-brooking 18 сағат бұрын
When I create a new platform I create a Polygon2D and add it as a child. Polygon2D has a variable called 'polygon' which is just a list of vertices. So I calculate a bunch of points around the far edge and then calculate more but backwards on the near edge which creates the loop of the shape. Then I can rerender it when it needs updating by calling the same function again. I wrote it super quick and dirty because it's just a debug tool, not intended for the game.
@owenhey3187
@owenhey3187 23 сағат бұрын
ah yes sexy game dev
@davidvarga2916
@davidvarga2916 Күн бұрын
You know you could just code like 20-30-ish next platform positions based on the current one and just pick one at random from that list. Well you could play around with it by adding weights to the randomness so that you get more of the ones you want or don't want at certain times. Like let's say 3 minutes in you start adding more of the thin platforms or what not. If you read my previous comment about adding more objects in. I'll give you an example: You have current platform and in the next platform you won't only have the info about the next platform stored, but also some coins and spikes and what not. This would simplify the work greatly. I think.
@nick-brooking
@nick-brooking Күн бұрын
Yeah interesting. I'm thinking I will have some set pieces, ie areas where I have specifically laid out the positions. But I think I've done enough on the platforms for now, I'll come back to them once I've added a few other things to the game
@davidvarga2916
@davidvarga2916 Күн бұрын
Just jumping on platforms is boring. Add a few more interesting objects that change the mechanics like a simple moving platform or pick ups or an objects that deals damage like spikes or what not. And you can start scratching your head on how to place them in correlation to one another randomly, but thoughtfully.
@nick-brooking
@nick-brooking Күн бұрын
Yeah I have plenty more planned. Just need to keep testing what is actually fun
@ImNotCyan
@ImNotCyan Күн бұрын
👾
@aksvinss
@aksvinss Күн бұрын
Procedural generation has been always really fascinating to me
@rikvanduijn7060
@rikvanduijn7060 Күн бұрын
Very nice loved the explanation. Not very good at math would like to see how you actually implement this.
@nick-brooking
@nick-brooking Күн бұрын
Hey glad you liked it! I just added a code example to the description of the video
@dorusie5
@dorusie5 2 күн бұрын
Very cool. Nice thing with your approach is that you can also clamp the generated values to the allowed range of the angle and distance, so any generated number is valid.
@nick-brooking
@nick-brooking 2 күн бұрын
Yeah that's exactly right!
@user-dw5ch6ux3u
@user-dw5ch6ux3u 2 күн бұрын
3:48 realistically speaking the "make a guess and if it is wrong through it out and try again approach" is absolutely fine. did you notice any lag? what did your code look like? you would need to run this code no more than ten-fifteen times (judging by eye) and not every frame and that should take a negligible amount of time. if you really want to squeeze out maximum efficiency from your code to the point where you would care about such small optimizations i suggest gdnative instead of gdscript (i am not trying to judge you btw. if you want to go full optimization on your code be my guest, i am just saying that it's not the best use of your time, especially if you are an indi dev)
@nick-brooking
@nick-brooking 2 күн бұрын
Yeah for sure. And you're right that I'm not overly concerned with performance at this stage. However the guess and check method involves the conversion between polar and Cartesian coords anyway so by the time you've gotten 1 wrong guess, the other method has finished running, forget the other 10 - 50 other guesses you might need. Imo the code is also less intuitive making it messier. Imagine I made the shape really tiny so it took up 1/500th of the x and y range. I would expect to need this to run 500 times, in which case I might want to cut down the range of x and y so it doesn't miss so much and all of that is unnecessary complexity. My point is not that I care about performance too much at this stage, more that it's a decision with no trade offs 1. We like the bias it introduces 2. The code is more straight forward and simple 3. It's more perfomant
@user-dw5ch6ux3u
@user-dw5ch6ux3u Күн бұрын
​@@nick-brooking ok fair enough but to clarify a couple of things : the 10-50 other guesses are a matter of milliseconds, your computer is capable of running billions of calculations it truly does not matter at all for code that runs once a second if you made the shape really tiny you would make the x,y range really tiny as well. for example if your shape had values of x [0,0.005] you wouldnt generate random numbers from 0 to 1. unless you had some really weird shape with some really thin areas that require a lot of empty space in between them it truly doesn't matter now to give the devil his due i agree with the benefits of the bias but there are more "brainless" ways to induce said or similar bias that would need less thinking and time. now the reason i am saying all that is that i see a lot of gamedevs that are working on personal projects overthink and over-engineer unimportant parts of their code without taking into account their lack of time/manpower. to write the function in the brainless way i suggested would land you with a couple ms of delay but could be accomplished in 5-10 minutes while to actually sit down and think on how to deform the random generator to fit the area i had in mind and how to change the biases of the generation function to get more platforms slightly closer to the player would take a lot longer which is time an indi-dev could use to add a more important mechanic to their game or to fix bugs. that is not to say you shouldn't do what you want with your project but i am just saying for most indi-devs its not a good idea to focus on such things because most indi-devs leave their projects half way through and over-engineering (i believe) is a big reason why.
@nick-brooking
@nick-brooking Күн бұрын
@@user-dw5ch6ux3u I completely agree with you that people waste time on things that don't matter and that in general, people spend way too long on solving problems they shouldn't. I laid it out my video the way that I did because I believe it made the most sense to explain the concepts that way. My goal is to share info about such concepts and describe what solutions I choose then let people do what they want with that info. When I actually wrote the code it took about one minute. Here it is, I don't know how to write the guess and check method and simpler than this but let me know if there's a way. var theta = _rng.randf_range(_theta_1, _theta_2) var r = _rng.randf_range(_r_1, _r_2) var x = r * cos(theta) var y = r * sin(theta)
@user-dw5ch6ux3u
@user-dw5ch6ux3u Күн бұрын
@@nick-brooking oh i don't disagree that the code is simple but you also have to factor in the time you spent thinking about it up until it clicked in your head to use polar coordinates and just mess with the radius and angle. now you might have polar coordinates and imaginary numbers fresh in your mind in which case it might come to you automatically or even faster than the "guess randomly and throw away" method but if you haven't recently worked with it it will take some time until that metaphorical light bulb lights up. since you asked the naive method would have been to get a random x,y pair and do these checks: x^2+y^2<r_large x_2+y^2>r_small vector from center to the x,y pair has angle within theta_1 and theta_2 the good with this method is that its easier to come up as a first thought not that its programmatically easier. that is because if you have a specific amount of time to allocate to a project it doesn't matter if that time is spent in thought looking at the ceiling or actually coding.
@nick-brooking
@nick-brooking Күн бұрын
Yeah totally, thanks for sharing. Hey are you working on any projects of your own? I'd be keen to hear how you apply this progress-focussed mindset
@HappyGaminz
@HappyGaminz 2 күн бұрын
Amazing video! you are so under-rated!!
@nick-brooking
@nick-brooking 2 күн бұрын
Thanks! Glad you enjoyed it
@Descifrando_la_economia
@Descifrando_la_economia 2 күн бұрын
Great video,Great explanation, anyone could understand it
@thedopesquad7179
@thedopesquad7179 2 күн бұрын
Awesome video omg!!!
@nick-brooking
@nick-brooking 2 күн бұрын
Thanks so much :)
@bellbobs
@bellbobs 3 күн бұрын
Randommmmmm (but thoughtful)
@poggersbro5505
@poggersbro5505 3 күн бұрын
The megaman sprite was so #RETRO
@darkar932
@darkar932 4 күн бұрын
W video
@Firecracker511
@Firecracker511 4 күн бұрын
For a split second I thought he was filming his monitor and moving stuff in front of it, very good tip indeed
@NessRobloxian
@NessRobloxian 4 күн бұрын
Why thie video got barely any views?
@The.Jelly_Gamer
@The.Jelly_Gamer 4 күн бұрын
for real this is awesome
@KaiDevvy
@KaiDevvy 5 күн бұрын
Now make em bouncy!
@nick-brooking
@nick-brooking 5 күн бұрын
Yeah bouncy platforms are fun! I'm playing around with that idea
@johnjeriepantoja1818
@johnjeriepantoja1818 5 күн бұрын
You call it a bug I call it wall jump
@bananaboi7634
@bananaboi7634 5 күн бұрын
Looks great dude, love solo dev games! Hope it turns out well!
@nick-brooking
@nick-brooking 5 күн бұрын
Thanks so much! The encouragement from everyone is going a really long way. Comments like this mean a lot!
@bananaboi7634
@bananaboi7634 5 күн бұрын
@@nick-brooking yee
@maxkasters2198
@maxkasters2198 5 күн бұрын
Btw, I think its better to make it like you have limited amount of platforms, so you have to touch this black parts to get this platforms back
@nick-brooking
@nick-brooking 5 күн бұрын
Yeah great idea. The game will be like a rogue lite so this might be a great upgrade to help you get more platforms
@dogedev12
@dogedev12 6 күн бұрын
Funny! This was actually a bug in my game.
@nick-brooking
@nick-brooking 6 күн бұрын
Yeah it's quite a natural mistake to make. What did you do about it?
@TheUninvitedIdiot
@TheUninvitedIdiot 6 күн бұрын
Monjang about to hire this man
@nick-brooking
@nick-brooking 6 күн бұрын
Haha, I think they need people who actually fix their bugs lol
@MHE-xp7lz
@MHE-xp7lz 6 күн бұрын
You could maybe make a ghost hitbox that is at the bottom and side edges to detect if you're hitting the platform from the bottom or side. This way you could make an intager variable that sets to 0 every 2 seconds of not changing, when the jump counter resets while in the ghost hitbox, the variable goes up by one and at around 3 the jump counter wont reset when in the ghost hitbox anymore for some time. If this mechanic is too unfair for players figuring out the game, you could make the penalty occur at like 10 of the variable and make a warning before it reaches that. OR MAKE A MONSTER THAT EATS YOU IF YOU DONT MOVE ENOUGH HAHA
@nick-brooking
@nick-brooking 6 күн бұрын
Haha! That's a funny idea. I think I'm going to have something in the level that chases you but haven't figured out what yet. As for the hitboxes, I think it's simple enough just to detect which side of the platform you hit
@MHE-xp7lz
@MHE-xp7lz 5 күн бұрын
@nick-brooking how do you detect which side you hit? Didn't know that was possible 😅
@nick-brooking
@nick-brooking 5 күн бұрын
There are a few ways. You can break the platform up into pieces and detect which one you hit. Or you can check where the player is relative to the block at the moment of collision. You could even detect it with velocity upon collision which works a little differently but might suit your needs. You could even do all of this in reverse and detect which part of the player is touching the platform. All depends on what you want to achieve.
@MHE-xp7lz
@MHE-xp7lz 5 күн бұрын
@@nick-brooking good to know, thanks!
@sophthetoast1997
@sophthetoast1997 6 күн бұрын
Idk what I expected from a game where you play as a Tic-Tac
@nick-brooking
@nick-brooking 6 күн бұрын
Haha! That's so funny! It's just a placeholder!
@sophthetoast1997
@sophthetoast1997 6 күн бұрын
@@nick-brooking Oh
@nick-brooking
@nick-brooking 6 күн бұрын
But I kinda like the Tic Tac now
@sophthetoast1997
@sophthetoast1997 6 күн бұрын
@@nick-brooking You do you
@sven7781
@sven7781 6 күн бұрын
Maybe make each double jump a little weaker than the last so you cant keep going infinitely without touching the ground. The power of double jumps will reset when you actually stand on a platform instead of touching it
@nick-brooking
@nick-brooking 6 күн бұрын
Hmm, interesting. I'll have to test a few ideas and see what feels best
@StutteringStupidity
@StutteringStupidity 6 күн бұрын
Maybe make it so only the edge of the platform on the bottom allows for the double jump to be reloaded
@nick-brooking
@nick-brooking 6 күн бұрын
Yeah wow, completely the other way! That would make it have quite a unique feel
@sesemuller4086
@sesemuller4086 6 күн бұрын
Also consider changing the physics a bit, like easeing in the players y-speed and setting a lower max y-speed
@nick-brooking
@nick-brooking 6 күн бұрын
Yeah I need to tweak the whole character controller at some point. I want to add a few more features first though because a character controller doesn't exist in a vacuum
@pavelbce6905
@pavelbce6905 6 күн бұрын
Make it so you can doublejump from the bottom or side like 5 times and then you need to touch the upper side of the platform to reset complitly
@MHE-xp7lz
@MHE-xp7lz 6 күн бұрын
A problem might be that the game probably can't detect where you are touching the platform.
@nick-brooking
@nick-brooking 6 күн бұрын
Anything is possible! I'm still deciding what to do but detecting which side you touched isn't too hard, I just forgot
@Bean_Lord531
@Bean_Lord531 6 күн бұрын
A simple fixs for people just jumping under platforms is to give them brain damage
@Bean_Lord531
@Bean_Lord531 6 күн бұрын
Nothing a good cranial crater can't fix
@Nameless44
@Nameless44 6 күн бұрын
Jesus christ this is the best fix ive ever heard
@Whhatt
@Whhatt 7 күн бұрын
Nice
@aqua-bery
@aqua-bery 7 күн бұрын
Shaders? Oh no my weakness!! I literally got decent at art instead of doing shaders :(
@nick-brooking
@nick-brooking 7 күн бұрын
I'd rather be good at art. Shaders you can just learn
@GreenFox1505
@GreenFox1505 7 күн бұрын
You adjust values a lot in code. If you `@export` those values, you can adjust them in-editor. Then while the game is attached to the debugger and it will propagate to the game without having to restart all the time. This is REALLY helpful while tuning values for jumps or even level geometry (you can move world objects as well).
@nick-brooking
@nick-brooking 7 күн бұрын
Yeah great shout. It's so important to have fast workflows that don't interrupt your thought process
@keksik301
@keksik301 7 күн бұрын
Physic is tr- good but need to fix
@hyper_1337
@hyper_1337 7 күн бұрын
why did you choose godot?
@nick-brooking
@nick-brooking 7 күн бұрын
I find that it so fast to develop in. I like working quickly and godot definitely has a nice balance of capabilities and simplicity. I also like that it's open source and the community is great.
@yuvalkrispin
@yuvalkrispin 7 күн бұрын
Looks incredible
@austink3407
@austink3407 7 күн бұрын
Why add underscores in front of vars? I'm not too familiar with game development, but are you doing it to remember it is a boolean (or whatever other type of variable you intend it to be)?
@nick-brooking
@nick-brooking 7 күн бұрын
It's a convention to indicate that the variable should only be used in this file. It would be possible to reach in and change the value from elsewhere in the code. We add the leading underscore as a reminder that it's created with the intention not to do that. This keeps the code much cleaner and easier to work with.
@ThrowTop
@ThrowTop 7 күн бұрын
​@@nick-brooking wouldnt it make alot more sense to do some specific thing like that for non local variables.
@nick-brooking
@nick-brooking 7 күн бұрын
Yeah maybe but this convention is older than godot. People do something similar in c++ for example. Although in c++ they have proper public/private keywords, also sometimes they use m_ at the start instead of just an underscore. I have very strong opinions about a number of things in programming but these sorts of conventions I'm happy just to follow the norm. I think the value of everyone being consistent is better than any one idea.
@MiraWrenFenn
@MiraWrenFenn 8 күн бұрын
Just move the platform a bit to the left! So easy smh /j
@UltraBaconKing
@UltraBaconKing 8 күн бұрын
Another underated developer... Great video btw
@nick-brooking
@nick-brooking 8 күн бұрын
Thanks so much! Yeah I'm hoping to post more as I feel this particular project has legs... but we'll see
@bellbobs
@bellbobs 3 күн бұрын
Here before you blow up ❤
@MadsterV
@MadsterV 8 күн бұрын
I'd take a second look at those mechanics before even caring about graphical details.
@nick-brooking
@nick-brooking 8 күн бұрын
That's a great approach too. I want my game to have expressive art so prototyping it and experimenting with it early is important to me. I'm open to changing anything I've made so no loss. The advice about not doing art too early is about avoiding the need to throw away work right? I'm curious if you have any other reason? Or anything you've learnt from experience? I'm willing to make a trade-off and potentially throw any of this away to get the benefit of forming the artistic vision along with the mechanics.
@pastrapatur1034
@pastrapatur1034 8 күн бұрын
Its a good start
@sporktank
@sporktank 9 күн бұрын
Looks good, nice to learn some more simple tricks for better art. 😀 My only thought is that the camera (seems to?) vertically follow the player when jumping. I think it's quite common for this not to happen, especially if the player remains relatively close to the middle of the screen for the entire jump. Keep up the good vids!
@nick-brooking
@nick-brooking 8 күн бұрын
Yeah totally. Some people are so clever with their camera. I haven't looked into camera movement at all. I think for now I'll move the player a bit lower down but keen to revisit this as a topic and find a solution so it's not so locked.
@TheMaJestic14
@TheMaJestic14 9 күн бұрын
Hi , love the work!! really good ideas , was wondering what program are you using at 3:20?
@nick-brooking
@nick-brooking 9 күн бұрын
Thanks so much! That's Canva, I like to use their whiteboard to do unstructured thinking and planning.
@natriumchloride3112
@natriumchloride3112 9 күн бұрын
Does look considerably better, but I feel like the character is too static (and looks like a tic tac) Also the world still feels a little empty if you ask me
@nick-brooking
@nick-brooking 9 күн бұрын
Completely agree with both of those! I still need to make a character, but it's enough of a design direction to keep building
@paravalent7974
@paravalent7974 9 күн бұрын
​@@nick-brooking turn it into a chicken
@nick-brooking
@nick-brooking 9 күн бұрын
Haha, cool idea. I have a bunch of ideas for the mechanics so I'm going to explore those more first. I'm hoping the personality and form of the character will emerge from their movements and abilities.
@SableSpiritStudio
@SableSpiritStudio 9 күн бұрын
Why so seductive during face cams ? 😄 Or is it just me ? 🤔
@nick-brooking
@nick-brooking 9 күн бұрын
Haha! Oh no. I'm questioning everything I know about how people perceive me. Maybe it's because I'm doing a weird lean to get my head in frame because I couldn't be bothered to put more books under my phone lol
@luckless8
@luckless8 9 күн бұрын
I feel like it's really good lighting and framing. The glasses also fit his face shape well.
@Ninjujitsu
@Ninjujitsu 7 күн бұрын
I'm not complaining 👀
@SableSpiritStudio
@SableSpiritStudio 7 күн бұрын
@@Ninjujitsu Neither do I 😄
@keenoobeats
@keenoobeats 9 күн бұрын
Good stuff, keep it up!
@nick-brooking
@nick-brooking 9 күн бұрын
Thanks so much!
@art.masson
@art.masson 9 күн бұрын
Nice video!
@nick-brooking
@nick-brooking 9 күн бұрын
Thank you!
@brunoob1557
@brunoob1557 9 күн бұрын
It looks great
@nick-brooking
@nick-brooking 9 күн бұрын
Thanks!