moose-mousse - Electronic Moose
Electronic Moose

Helloooo! I am Moose! They/Them/He/Him I am a embedded software engineer with autism, depression and anxiaty ( Wooo! ). I post about... whatever I want... software things, mental health things... whatever I feel like Feel very wellcome to send me asks about... anything that strikes your fancy :3

266 posts

When To Add Delta In GoDot?

When to add delta in GoDot?

So I am slowly eating my way though the tutorial for GoDot. I already have some experience with moving things in space and calculating inputs for individual objects.... That is essentially half of robotics software. So in every frame, a function called _process is called. this function takes a number called "delta", which is the amount of time passed since last frame ins seconds (Usually close to 1/30 or 1/60). You add delta to the calculation of certain variables. The first example usually found is position, which is done like so:

position += velocity * delta

To me that was all good and obvious. But I found a lot of posts of people being confused when to multiply delta and when not to. And apparently doing it in wrong places is a quite common bug in GoDot games. Here is to figure it out! Think in term of units

Velocity is distance/time Position is distance

So you cannot add velocity to position. They are 2 different units. How to fix this? Remove the time component.

Since time is distance is divided by time, we simply multiply time onto it. You know what have the unit of time?

delta is time

Meaning it is obvious why you need delta in the line! :D position += velocity * delta

Because distance += distance / time * time

  • 20mice
    20mice reblogged this · 1 year ago
  • blackblooms
    blackblooms liked this · 1 year ago
  • ladyargento
    ladyargento reblogged this · 1 year ago
  • ladyargento
    ladyargento liked this · 1 year ago
  • quietmarie
    quietmarie liked this · 1 year ago
  • frog707
    frog707 liked this · 1 year ago
  • hydralisk98
    hydralisk98 liked this · 1 year ago
  • mbvisualarts
    mbvisualarts reblogged this · 1 year ago
  • mbvisualarts
    mbvisualarts liked this · 1 year ago

More Posts from Moose-mousse

1 year ago

Stop teaching top down!!!

So I am trying to learn GoDot because... Well, a game engine can make games, sure... but it can also do a lot of other things when you realize it really is just a GUI renderererer (help! How do you stop spelling renderererererer???) + physics engine. Anywho, so I started following the "official tutorial" (In quotes because I am honestly not sure... It is a big open source project so it can get muddy). And... Once again I am faced with a tutorial that teaches me the larger constructions and the orgenization before telling me anything about how the smaller bits work... This is called top down teaching. And it works, WHEN (And ONLY when), the person you are teaching, are already familiar with what the smaller things can do. It can work when teaching someone who already knows object oriented programming, functional programming. They already know how functions, variables, processes and code execution works. It does NOT work when people haven't gotten the faintest idea of what these boxes and structures you are describing are. We do not teach kids algebra before they know division and multiplication. When writing tutorials like this you cannot write for everyone. You have to go with assumptions of the majority. And it is not a great idea to assume that the majority of the people who tries to learn GoDot are veterans of game development. Sure, your tutorial will be slightly better for veterans, but you have just made sure that newbies have an even harder time starting learning your engine... Whenever I start feeling like I have a solid grasp on this, I will start a tutorial on this... BOTTOM UP!


Tags :
1 year ago

Denmark... is a elitist, right wing country

( Trigger warning, if you do not wish to hear about my political posts, blacklists the tag Danish Politics") So I am a Dane. And weirdly enough for my atheist, polyamorous self, I actually do want to be proud of my nation. And I AM, of several things Denmark have done... But overall? No. Denmark have widespread corruption ( A test in the spring of 2023 of "Who is willing to take bribes if we offer them 50k DKK (About 7.5k USD)" had 91% of politicians in parliament saying yes please) but a lot of the success of Denmark is based on what people THINK of Denmark, rather than what it actually is. For example, I finished university currently. And not only did the Uni teach students a way of doing databases that was in direct breach of GDPR (I documented this, and still have it all, since at the end of my education, I did not trust the university at all), but in at least 4 classes, the teacher did not bother to define what the students had to do to pass. In my robotics class, our final papers definition was "It must be 5 pages". That was it. No topic, no focus, no anything. You could still fail, but the requirements was inside a professors head, and you had to guess. If you ask the universities they will tell you that they received basically no complains. They forget to mention that there is no way TO complain. Despite this completely incompetent behavior, people having a danish education is thought of as high level. Because we used to be. Basically anything good you hear of Denmark, is inertia from its behavior in the 1990s (30+ years ago). Today it is a corrupt, right wing extremist state like so many other disappointments. We still have rights, but they are getting removed. And the majority of Danes do not care. They are busy yelling their sympathies to Israel.


Tags :
1 year ago

OMG I LOVE IT!

What is the dumbest thing you have coded and gotten to work?

a discord bot in my friend group server where it would scold people if they swore XD

What Is The Dumbest Thing You Have Coded And Gotten To Work?

An example hehe

1 year ago

I am average american man I work fifteen hours in hamburger mine to buy one rock and roll disk

1 year ago
Hey. Hey Guys You Know What Would Be Funny.
Hey. Hey Guys You Know What Would Be Funny.

hey. hey guys you know what would be funny.