My own action adventure engine

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: My own action adventure engine

Post by VideroBoy »

I've removed the map transition crashes by doing it manually instead of using the physics engine.

I've also separated the collision bodies used for actor-terrain collision and actor-actor collision. Tell me how it feels, guys.
Attachments
SpaceNinja.love
Now with 5% less crashing
(147.67 KiB) Downloaded 388 times
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: My own action adventure engine

Post by TechnoCat »

Animations are still super sped up for me.

animation.lua:19

Code: Select all

    anim.time = anim.time - 1
You're missing dt.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: My own action adventure engine

Post by VideroBoy »

TechnoCat wrote:You're missing dt.
On purpose.

Code: Select all

local FPS = 60
local SECONDS_PER_FRAME = 1 / FPS

local accumulatedTime

...

function love.load()
    accumulatedTime = 0

    ...
end

local function doUpdate()
    ...
end

function love.update(dt)
    accumulatedTime = accumulatedTime + dt
    while accumulatedTime >= SECONDS_PER_FRAME
    do
        if not isPaused then
            doUpdate()
        end
        accumulatedTime = accumulatedTime - SECONDS_PER_FRAME
    end
end
Though now that I think about it, I'm updating the animation frame inside the draw function instead of the update function, which might be causing your animations to be too fast. I'm working on an update now.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: My own action adventure engine

Post by TechnoCat »

Why are so many people lately trying to bypass dt?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: My own action adventure engine

Post by bartbes »

Because we don't hit them enough. These unguided projectiles need re-education! :P
Seriously though, don't try not to use dt, just use it, it's not like it's hard.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: My own action adventure engine

Post by tentus »

TechnoCat wrote:Why are so many people lately trying to bypass dt?
Because it's not that well explained on the wiki. If you search for dt in the wiki the results are kind of a mess. It's first explained in the Hamster Ball tutorial, pretty far down the page. We really need a tutorial just for combining dt with animations.
Kurosuke needs beta testers
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: My own action adventure engine

Post by VideroBoy »

TechnoCat wrote:Why are so many people lately trying to bypass dt?
Because I don't want to put "* dt" beside everything.
And because variable timesteps makes some things like physics numerically unstable. I've posted the link to this article before, though you're going to have to scroll down a bit.

Anyway, I think I've fixed the animation speeds. I know I've fixed a few other things anyway.
Attachments
SpaceNinja.love
dt sucks
(150.33 KiB) Downloaded 231 times
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: My own action adventure engine

Post by bartbes »

The solution to that physics problem is running physics multiple times in smaller timesteps, not not using dt.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: My own action adventure engine

Post by VideroBoy »

Throws up hands
Yeah, well, I'm still not using dt. :x
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My own action adventure engine

Post by Robin »

If you don't use dt, people with other machines than yours will hate you. ;)
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests