Steemdya Updates: Solving Overshoots

in #gamedev6 years ago (edited)

shouldntcross_j.jpg


for the past few days steemdya had been overshooting on the wall while colliding. if you imagine the player to be a rectangle, it should be physically impossible for any part of that rectangle to go through other objects.


overshotprob_wb.jpg


i don't know whether i was doing something wrong, or pygame is just weird. but pygame's collision detection always came after a single frame. so by the time steemdya stops running, it's already too late. part of him would always go through. to make matters worse, depending on his location one frame before collision, how much of him went through was completely unpredictable. such uncontrolled randomness can be catastrophic (for any game).

so i started predicting steemdya's next location whenever he was moving. because pygame would always detect collision on the next frame, i simply had to double the distance.


movespeedx2_j.jpg


singleframedecrease_j.jpg


by predicting where steemdya will be on the next frame, and limiting his movement speed according to the leftover distance between him and the wall, i could solve the issue.


runstopwall_j.jpg


i thought about simply ignoring it because it's only a few pixels. some will even consider it to be negligible. but stuff like this often drive me crazy (yes, i'm weird).

sometimes i worry i might've gotten myself into a giant mess by not using unity. pygame is a mere library that is horribly outdated. in engines like unity or unreal this wouldn't even be an issue.

but once you start on something, you should finish it (especially a gamedev project). there's always something to learn. with steemdya i already feel like i've improved as game developer and can do a better job on the next project.

today i don't have any personal stuff to share so i decided to have this instead. technical stuff can be boring but it is what it is. let's hope something exciting happens tomorrow. thanks for coming. have a nice day.



We're indiegame developers.
@imaginalex is the artist. I'm the programmer.
You can follow the progress here (youtube link)

Sort:  

Friend @roundbeargames, your game concept is very good. I hope you'll get your concept link to this game very soon. Best wishes for you too

yes i hope it gets finished soon too! my best wishes! 👍

Ok friend . I am waiting....

always nice and challenging buddy, I certainly love it,☺️

Aqui con usted, bonitas imagenes y buen trabajo. saludoss

greetings friend. thanks for coming 👍

Wow It amazing news dear friend....I think soon complet this game work...☺☺

yes hopefully it'll be soon!

Yes, I will agree 60% that it is boring but when you got it right you will surely smile at then enf.

technical work is for people with brains, observers, thinkers and those who has great zeal.

End result is always fun

oh yes hopefully we'll have something cool at the end 😎
gotta endure.

I like what you say "when you start something, you must finish it", you are absolutely right. Success for you.

yes i've already failed and given up on too many! but there's always some hardship for all projects.

That's true, I'm not good at games. But I have also failed in other things. Greetings.

Good post👍

wonderful your gamedeb..i am a your new follower.

thank you. i follow you too. great ulogs on your page!

Yes you're right if you start something you own that should finish it, do it😄

yes even though i say it, too many times i've given up on something shortly after starting it. too many..

Must be spirit ok .. I support mu😄

I know if you can do a better job on your next project, all this should not be easy
I wish you all success for what is coming, happy afternoon friend

after each project i get better. and each time i learn new stuff and it become additional source of energy. happy day friend!

you are a very intelligent person and this type of work is not for everyone, you will have successes in the end friend👍

well anybody can do it as long as they're willing to learn! i still have a long way to go. we'll see what comes out in the end 😺

good job bro, all this you do is really for geniuses I congratulate you, and follow the successes in all your projects

thanks for following. we've slowed down a lot but definitely will finish!

Excelente @roundbeargames como le agregas mas y mas tecnicas a tu videojuego muy interesante para aumentarle su velocidad y la capacidad para moverse. Saludos amigo

Saludos amigo. always appreciate your kind words.
i'll have more and more mechanics until it's done!

wonderful concept my friend @roundbeargames hope so very soon we get its video link ☺

yes thank you. i'll have new videos soon! 😺

wow thanks for your information dear. its amazing post dear @roundbeargames

thanks for coming. btw you have some great photos!

saludo hermano, no se mucho de esto pero le deseo éxitos y mas éxitos en sus proyectos, y cuente con mi humilde apoyo, Gracias hermano por su apoyo tambien

no need to know too much! we'll distribute a playable version as soon as it's ready!

I love your game conceft

thank you. stay in touch!

Friends love you at your game artistry. Best wishes for your game. I hope you will raise many beautiful concepts. Thank you for sharing beautiful posts ..
i resteemed your post ............

thanks for the resteem. i shall always return the favor.
wish you the best 👍

i everyday resteemed, upvote, comment your post must

Thanks for sharing.

thank you for your support. glad you're not a bot! 😃

Creating a game is not an easy thing, just smart, creative and never giving up people who can create and finish a game well and you're a smart, creative and unyielding person.

Keep the spirit @roundbeargames 💪👍☺️

i thinks this game make sestem. thanks friend

Thanks for this brother, the information is very interesting..

nice sestem. overshort :-)