Defold Timer - The native timer extension


#61

I’ve deleted timer extension and everything builds as it should without errors.


#62

Not really a workaround, but yeah.


#63

But what you mean by “any extension fails with this error”? I have a lot of extensions except the timer also but everything builds fine.


#64

Oh, really? I’ve tried with my other extensions and they have the same error. Interesting.


#65

Thx for reporting, I’ll fix this tomorrow!


#66

Maybe you have changed the configs for which url to execute remote compile on, maybe you disabled it. If not I would reinstall the editor to see if that helps


#67

@den33.info @sergey.lerg I’ve now updated the Editor 2 and it should now build each platform again (version cedf01dc1865c9ba4ac09ae9c800945094b05c3e)


#68

Editor 2 is currently released from our dev branch and uses the latest commit of both the engine and the native extension sdk. Sometimes, like here, this means we ship stuff that was more of ”work in progress” than something ready for release.

We are discussing moving to biweekly releases in sync with the engine/sdk to prevent this from happening, and giving the option to choose between dev or stable for updates.


#69

and also have a windows machine running regression tests! It should shift the community level to “even happier” state =]


#70

Yes, some extra CI steps are coming up. But why a “windows machine”? We build on Linux? :wink:


#71

I do get slapped when Windows users cannot build native extensions and Mac users can. Happened few times recently.


#72

*slap!

(Mathias’s Voronoi extension doesn’t build on windows)


#73

Well, it was built before we had windows support on my spare time (I don’t use windows personally :wink: ). I am currently debugging other stuff so I’m afraid I’ll get to it later…
Also, let’s stop hijacking this thread :slight_smile:

EDIT: The defold-voronoi library now also supports Windows \o/


#74

How does the time used in this timer relate to time passed into update functions as (dt)?

My space shooter game uses variable dt, since if it’s off the game runs super fast on Windows and normal on Android (I know, vague descriptions of how I perceive the speeds).

In my game I’ve developed missiles that attack the player. These have a timer for automatic self destruction, such as:

self.timeout = timer.seconds(3, function()
	explode(self)
end)

Developing/testing on PC, and these missiles will reach from the enemy at the top of the screen to the player at the bottom of the screen before exploding.

However, bundling to Android and running on my phone (Galaxy S7), the player can safely hide in the bottom of the screen since the missiles explode before arriving.

So, I assume this timer is really low level based (thus native extension) and in a sense disconnected from the timing/runtime of Defold itself?

I plan on using timers to implement sections and parts of storytelling in the game, where some parts will be based on how long it takes for something to happen in game, while testing during development.
Would it be wiser to not use this timer, and instead implement a game object that handles timing in an update function?


Variable dt causes game to run twice as fast (DEF-3146) (SOLVED)
#75

The timer does not rely on dt. It’s based on the amount of time elapsed according to the system clock (code).

This means that any trickery being done with the timestep on collection proxies or other things like that will have no effect on when the timer callback is triggered.


#76

This sounds like a vsync-issue. Defold relies on hardware vsync when variable_dt is not checked and will wait for each display refresh before updating, but if vsync is disabled in your graphics card driver settings it will just run full blast. You can try enabling vsync in your graphics driver settings. Failing that you can use set_vsync with swap_interval set to zero and we will try to respect the set update frequency in software instead.


#77

I’ve released version 2.0.0 of the timer extension. The new version has changed from timer to delay as module name to avoid conflicts with the native timer released in Defold 1.2.130.