Search found 1037 matches

by ivan
Wed Mar 22, 2017 6:08 am
Forum: Support and Development
Topic: Large Meta-Table Serialization
Replies: 4
Views: 115

Re: Large Meta-Table Serialization

Serialization is usually for data whereas metatables are not data, but moreover define the behavior when accessing and assigning keys in a table.
I think you need to include your code so we can see if what you're doing makes sense.
by ivan
Wed Mar 22, 2017 5:51 am
Forum: Support and Development
Topic: Jump Height Unstable
Replies: 8
Views: 227

Re: Jump Height Unstable

The formula that I use is: initJumpVelocity = math.sqrt(2*g*jumpHeight) Same as yours just without the division. The problem is that when observing this in action, the player fails to reach the desired height, and not only that, it also jumps a slightly different height each time dt varies between s...
by ivan
Mon Mar 20, 2017 6:16 am
Forum: Support and Development
Topic: Need an efficient binary networking example for server & clients.
Replies: 9
Views: 238

Re: Need an efficient binary networking example for server & clients.

Sure, you can pack 2x4 bits in a byte, but with networking - it probably won't make a big difference, except that your code will become more confusing and harder to maintain.
by ivan
Fri Mar 17, 2017 6:51 am
Forum: Support and Development
Topic: help with movement
Replies: 7
Views: 199

Re: help with movement

Hello eqnox, the code needs work, I recommend the following changes: 1.Don't allow holding W/S or A/D at the same time. local vx, vy = 0, 0 if love.keyboard.isDown("w") then vy = -1 elseif love.keyboard.isDown("s") then vy = 1 end if love.keyboard.isDown("a") then vx = -1 elseif love.keyboard.isDown...
by ivan
Fri Mar 10, 2017 10:41 pm
Forum: Support and Development
Topic: Avoiding fixed timestep death spiral?
Replies: 40
Views: 1154

Re: Avoiding fixed timestep death spiral?

seemed like the most logical thing to do; i mean, going from the second to the third of my examples, at least. I like the second option - it's simple, effective and most importantly fixed so you could theoretically expect the same results each time. As mentioned in the article, you could even use l...
by ivan
Sun Mar 05, 2017 6:42 pm
Forum: Support and Development
Topic: Avoiding fixed timestep death spiral?
Replies: 40
Views: 1154

Re: Avoiding fixed timestep death spiral?

I dont think there is much you could do with fixed time steps except to slow down the game altogether.
by ivan
Sun Mar 05, 2017 6:37 pm
Forum: Support and Development
Topic: Avoiding fixed timestep death spiral?
Replies: 40
Views: 1154

Re: Avoiding fixed timestep death spiral?

I like to use a max_frameskip constant. A simple technique is to count the number of substeps in each update until you reach the max_frameskip. This way the game will slow down in the rare event something terrible happens but it won't hog the cpu completely.
by ivan
Sun Mar 05, 2017 7:22 am
Forum: Libraries and Tools
Topic: Grav2D: Attraction causes LÖVE
Replies: 7
Views: 449

Re: Grav2D: Attraction causes LÖVE

Hello there, it's an interesting idea, although I'm not 100% sold on the implementation. Personally I like pure Lua - it's fine if you want to make an extension to love.physics but then you have to keep it decoupled from other stuff like love.graphics. This is a physics lib right, so IMO there shoul...
by ivan
Sat Mar 04, 2017 6:12 pm
Forum: Support and Development
Topic: About Magic Numbers
Replies: 13
Views: 409

Re: About Magic Numbers

ivan wrote:
Sat Mar 04, 2017 6:10 pm
bgordebak wrote:
Sat Mar 04, 2017 4:43 pm
I want the bigger the radius, the less the speed.
The ratio is between 0-1 so:

Code: Select all

local ratio = player.r/max_radius
-- lets reverse
ratio = 1 - ratio
Or ratio = 1-value/max_value
by ivan
Sat Mar 04, 2017 6:10 pm
Forum: Support and Development
Topic: About Magic Numbers
Replies: 13
Views: 409

Re: About Magic Numbers

bgordebak wrote:
Sat Mar 04, 2017 4:43 pm
I want the bigger the radius, the less the speed.
The ratio is between 0-1 so:

Code: Select all

local ratio = player.r/max_radius
-- lets reverse
ratio = 1 - ratio