Search found 75 matches

by RNavega
Sat Sep 05, 2020 8:58 pm
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 11504

Re: how to get the compass direction between two points ?

Furthermore, I'm pretty sure that the big branching factor adds a performance penalty with respect to a pure atan2 + lookup implementation. See for example the benchmarks at https://love2d.org/forums/viewtopic.php?p=218409#p218409 Totally, if i had to pick a method I'd also go with ivan's atan2, it...
by RNavega
Sat Sep 05, 2020 12:42 pm
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 11504

Re: how to get the compass direction between two points ?

Hm, if it were some arbitrary float number then I would agree, but it's zero. I think it should be safe, even if either dx or dy are +0.0 or -0.0. If you remove that check, which you can do, then whenever the source and destination are at the same position the result will be whatever passes the test...
by RNavega
Sat Sep 05, 2020 11:37 am
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 11504

Re: how to get the compass direction between two points ?

For the challenge I did it a different way (comparing the tangents inside a quadrant to pick the "slice"/octant, then picking the quadrant based on the sign of dx and dy). I also changed the order of parameters in the direction function, LÖVE usually puts the position parameter first and t...
by RNavega
Sat Sep 05, 2020 8:06 am
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36841

Re: Love CPU usage

I still don't see why the events processing time should not be included in the total measurement. I don't understand the confusion, timerStep() (alias for love.timer.step()) returns the time that's elapsed since the last call to it. So in that first code that I posted that we're talking about, when...
by RNavega
Thu Sep 03, 2020 10:43 am
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36841

Re: Love CPU usage

The goal is getting a main loop that's as generous as possible to the CPU so you have low usage/no busy-spinning, it should do a game tick and then sleep to give all the remaining time back to the OS. The loop I posted I based on the first one in the deWiTTERS game loop article . To get my head arou...
by RNavega
Wed Sep 02, 2020 1:02 pm
Forum: Games and Creations
Topic: Fast 2D mesh animation
Replies: 9
Views: 5822

Re: Fast 2D mesh animation

@Nikki a blend file for 2.83 is in this folder: https://github.com/RNavega/2DMeshAnimat ... dd-on/2.83

PS: I've experience porting scripts to 2.83, if you get in trouble you can send a PR over there and we can work on it.
by RNavega
Tue Sep 01, 2020 10:15 pm
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36841

Re: Love CPU usage

Thats important to know, thank you for the pointer. I'm personally only interested in the desktop and Android platforms. I searched and the discussion behind changing love.run() from a loop to a function is in here, pretty interesting: - https://github.com/love2d/love/issues/1273 - https://github.co...
by RNavega
Tue Sep 01, 2020 1:07 pm
Forum: Support and Development
Topic: Waiting for user input?
Replies: 5
Views: 3394

Re: Waiting for user input?

I'm also getting familiar with LÖVE, so if you make any breakthroughs do share! x) Hm, I just tested here, if you paste "love.event.wait()" in the middle of your code, when the program reaches that point it halts until you do any of the unblocking events (mouse-move/mouse-press/keypress/ke...
by RNavega
Tue Sep 01, 2020 6:56 am
Forum: Support and Development
Topic: Waiting for user input?
Replies: 5
Views: 3394

Re: Waiting for user input?

The logic should be similar to when doing a pause screen ("Press P to pause"): you need to set up a finite-state-machine that has a state for this. Here's the theory: - http://howtomakeanrpg.com/a/state-machines.html - https://gameprogrammingpatterns.com/state.html - https://gamedevelopmen...
by RNavega
Tue Sep 01, 2020 6:21 am
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36841

Re: Love CPU usage

If you can guarantee that you won't overwrite or nillify love.draw or love.update, then you don't need to keep checking their presence at every cycle. These table lookups should be pretty fast already, but if you want to be pedantic you can cache them. This is a love.run() for v11.3: local FRAME_TIM...