Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by dominic

Impact 1.20 was just released! The changelog is in the blog.

If there are no severe bugs, this will probably be the last minor release for 1.x.

I want to concentrate my efforts on Impact 2.0 now. There will be blog post about my plans for 2.0 in the coming days. One thing that's for sure, is realtime multiplayer through NodeJS and hopefully lots of cleanup and simplifications.

1 decade ago by Bushstar

The pause function on the Timer does not seem to be working for me. I've set this in the init of an entity.

this.chaseTimer = new ig.Timer();
this.chaseTimer.pause;

In update I call...

alert(this.chaseTimer.delta());

It initially shows 0 but then counts up. Am I doing it wrong.

Also if we reset a paused Timer does it unpause the Timer?

1 decade ago by dominic

.pause() is a function. You have to call it :)
this.chaseTimer.pause; // <- does nothing
this.chaseTimer.pause(); // <- pauses the timer

Quote from Bushstar
Also if we reset a paused Timer does it unpause the Timer?

Yes. I should probably put this in the documentation.

1 decade ago by Datamosh

YAY! multi-line for iOSImpact and ig.System.drawMode! Today is Christmas for me!

1 decade ago by Bushstar

Thanks for pointing that out on the pause function. I should double check myself before posting anything.

1 decade ago by paulh

One of

ig.System.DRAW.AUTHENTIC
ig.System.DRAW.SMOOTH
ig.System.DRAW.SUBPIXEL
The default is SMOOTH.

awesome.

thanks

1 decade ago by Joncom

The new zoom feature of Weltmeister is particularly handy if you use tile sheets which don't completely fit on the screen using your ideal scale. :)

1 decade ago by alexandre

Useful feature yes. OTOH my (mac) mouse doesn't play nice--too sensitive--with the mouse-evented aspect of it and I had to disable mousezoom by editing config.js.

1 decade ago by Joncom

Since the 1.20 update I've noticed that changing the FPS in the ig.main constructor has no effect.

1 decade ago by quidmonkey

I noticed the same. I believe the culprit is line 389 of impact.js:
	window.ig.setAnimation = function( callback, element ) {
		return window.setInterval( callback, 1000/60 );
	};

If your browser does not support window.requestAnimationFrame (I'm using Chrome 19), it'll default to the old setInterval method, which is locked in at 60 fps. What's more, from my code review, it appears that the requestAnimationFrame method isn't even using a locked timestep, and instead, always opts for the next available frame.

Is this correct? I, for one, would prefer the option to choose a locked (specified) vs. next available fps option. I 'd also like the option to choose either requestAnimationFrame or setInterval.

1 decade ago by paulh

im on chrome 19 and i jumped to 75 fps since update (set at 60fps)

1 decade ago by alexandre

@quidmonkey
I, for one, would prefer the option to choose a locked (specified) vs. next available fps option. I 'd also like the option to choose either requestAnimationFrame or setInterval.

+ 1

1 decade ago by dominic

I should&039;ve documented this better: the #fps parameter is indeed obsolete/ignored in 1.20. [Edit: updated the docs for ig.main()].

In hindsight it was a bizarr idea to include this parameter anyway, because it gives the impression that you have any say in what the actual frame rate will be, when in reality you are, and always have been, at the mercy of the browser. You just have to use the tick instead of fixed values when calculating movements.

Now, the advantage of requestAnimationFrame over setInterval is that the browser tries to be smart instead of random.


The reason your game now runs with 75fps is that your display&039;s refresh rate is 75hz - this is one of the main benefits of #requestAnimationFrame: The browser knows the refresh rate and adjusts the drawing interval accordingly.

In contrast, running a 60fps game on a 75hz display means that in the worst case one frame might be presented 16ms later than it was computed/drawn. Even worse: some frames are presented twice, some only once - this introduces an awkward jitter.

Consider this: at 60fps, one frame is produced every ~16ms. Your 75hz display presents a frame every ~13ms.

(Yay, ASCII table :D)
display ms: 0   13  26  39  52  65  78  91 104
game ms:    0   0   16  32  48  64  64  80  96
lag ms:     0   13  10  7    4   1  14  11   8

Your display will first refresh 13ms in, however there's no new frame to show, because the game only produces the next frame 16ms in. At the next refresh, 26ms in, the frame that was produced at 16ms is finally shown - a lag of 10ms. Also notice that some frames are displayed twice, while others are only displayed once.

Converting movies from the big screen (24fps) to TV (60fps) meets the same challenge. They're smarter than just presenting the same frame twice, but it still introduces visual artifacts: " there are four frames of film for every five frames of 60 Hz video". That's why the 24hz mode of modern TVs is such a big deal.


tldr: It&039;s a good thing that the browser decides the frame rate and I won't bring back the #fps parameter.

1 decade ago by paulh

what if i want to lock at 30fps on say an iphone. Im doing a driving game (for example) and i want the car mechanics to be consistent throughout the game experience, so although i can sometimes achieve 60 fps, the game might run at 54, 42 etc, so why is it still not better to lock the fps at a constant value for a consistent game experience, especially from a user input perspective?

How will this work on a 120hz monitor, what sort of optimisations/game compromises will i need to make to make it run smoothly?

Genuinely interested in your opinion on this one .....

edit: im making twitch games that require a consistent user experience :- input and feedback.

1 decade ago by Arantor

Also how do these changes apply to iOSImpact?

1 decade ago by dominic

@paulh: physics (movement speed etc.) in Impact are independent of the frame rate. If you do your own movement calculations, be sure to include the tick value. The game should behave the same with 120, 60, 45 or 30 fps.

You could rely on a fixed frame rate on game console, where you know exactly what hardware you have to deal with and you can be sure your game is the only thing running. Doing this for browser based games is impractical.

@Arantor: iOSImpact still uses setInterval which is implemented via Apple&039;s #NSTimer in ObjectiveC. It will try to run at 60fps.

I want to release iOSImpact as open source soon, but want to remove some Impact specific hacks before. I&039;ll probably also add support for #requestAnimationFrame via the "new" CADisplayLink then.

1 decade ago by dengjiuhong

good job!

1 decade ago by GoatsOrSomething

I've been eyeballing ImpactJS since last night and I just had a question after reading this thread.

From what I understand, anyone that has paid (or pays now) for Impact gets all updates before the next major version (in this case 2.0)

_This will probably be the last minor release for 1.x.


Should I be waiting for the next major release before buying?

I think I remember reading that it's a smaller fee to upgrade from one release to the next, but I don't believe I've seen any price. I'm guessing it's not set yet?

1 decade ago by alexandre

anyone that has paid (or pays now) for Impact gets all updates before the next major version

That's what we were told. So, yes.

Should I be waiting for the next major release before buying?

Dominic was hoping to release later this year. Projects sometimes slip. How long you wait is up to you. In the meantime, we're busy coding with it on this side. ;)

1 decade ago by Graphikos

Should also be noted that major versions will be sold at a discount to current license holders.

1 decade ago by paulh

:-)

http://www.pcgamer.com/2012/06/06/john-carmack-is-making-a-virtual-reality-headset-500-kits-available-soon-video-interview-inside/
Page 1 of 1
« first « previous next › last »