Castle Trouble

[quote]I’ve only taken the “timer idea” (explained in your first post on that topic), because I’m not really interested in native solutions.

I know that a native timer is more accurate and that it don’t gives problems on different Window versions, but my library is “online oriented” and so I cannot use any DLL.
[/quote]
I think you missed what I was saying. You can drop the DLL from existance and the timer will run just fine, albeit a little slow on windows. The worst that will happen is a nice exception printed in the Java log. The exception is trapped and will not impact your program in any way. Sorry you had to do all that work. :o

[quote]I was not so clear.
The problem I’ve tried to solve happens when a computer has an “accurate” timer and its resolution (for example 15ms) forces the game to run above 50fps.
In that case I simply wait two beats in order to make the game run at half the framerate possible.
This to prevent the game from running at 100FPS (maybe too many for some computers) when it only needs 25FPS.
[/quote]
Umm… huh? Beats are not tied to any framerate. It simply a matter of trying to keep your animation as smooth as possible. If the timer generates 1000 beats per second, for 10fps you only want to render once every 100 milliseconds. Usually you’ll sleep in any left over time.

Sadly, no. :frowning: The loading screen comes up, the load bar fills, then the screen goes black. I’m using Safari 1.0 and OS X 10.2.

[quote]Sun has added a new Timer at sun.misc.Perf with 1.4.2, but that is not the postition it will stay, it is hidden there because officially the .2 is only allowed to have bug fixes, new features only in 1.5 …
[/quote]
Do you know when it will be released (I mean 1.5)?

I’ve understand, but also if is possible to have ONLY in Windows case a -perfect- timer, I don’t like to use it. This will give “perfect” results on Win, but at the same time I will remain slave of the imperfect timer on other platforms.

For the same reason I don’t use yet rotations or tranparency. I’ll simple wait for an accelerated implementation…
:o

Only a point of view 8)

Happly things can only get better.

Hmm, Ehrr…
Excuse my “out of mind” travel! :-[
I’ve fixed the “draw frames continuosly” problem only one week ago!
In fact now there’s no more reason to use that timer trick. :wink:

[quote]Sadly, no. :frowning: The loading screen comes up, the load bar fills, then the screen goes black. I’m using Safari 1.0 and OS X 10.2.
[/quote]
Can you give me a log of the game (taken from the console)?
Maybe I can do something.

Many thanks for your interest

Hmmm nope, the sound is still freezing the game for a while. Maybe it’s for a shorter time now, hard to tell, no big difference anyway.

[quote]I’ve understand, but also if is possible to have ONLY in Windows case a -perfect- timer, I don’t like to use it. This will give “perfect” results on Win, but at the same time I will remain slave of the imperfect timer on other platforms.
[/quote]
??? Now you’ve got me really confused. With the DLL, GAGETimer is designed to guarantee 1000 ticks per second or better on all systems. This means that it should be a “perfect timer” on all systems. The DLL is a workaround for Windows only! When Sun gets their own hi-res timer in, we won’t even need that. The timer now known as GAGETimer, is simply an abstraction to allow code to manage time effectively. The old timer and the GAGETimer are one and the same. I just added an alternate timing source.

Hmm… I can’t seem to find where logs are in Safari. On the bright side, while looking for the logs, I found out that I just need to wait long enough and the game will appear. It works, but it’s slllloooooowwwwwwwww… I think this is related to the Accelerated images problem. Mac Java Gaming is DOA until Apple fixes this. (Just tested GAGE Shooter example. Sure enough, 8 frames per second.)

[quote]Can you give me a screenshot (not necessarily full size) of the game in action?
[/quote]
The game crashes the browser as soon as I try to move - so this is as close to ‘in action’ that you will get :slight_smile:

http://www3.sympatico.ca/scott.palmer/CastleTrouble/test3.png

[quote]Hmmm nope, the sound is still freezing the game for a while. Maybe it’s for a shorter time now, hard to tell, no big difference anyway.
[/quote]
Maybe there’s no difference at all…
I’ve done only a try.

I can’t explain what that lag is, but for sure it is related with JavaSound.

What VM do you have?

Never mind…
Now I’ve understand what you said :smiley:

So the resolution trick has been integrated in GAGEtimer as one of differents beat source right?
And one of them is based on the DLL and works only on windows. :o

This means you have more sources (more than two) or just that the old timer (the one I’m using) is simply more accurate on other systems?

I don’t know if the problem is related only with accelerated images…
On my computer, running in pure software mode I cannot tell the difference.

Are you having the same transparency problem of swpalmer ?

I’m using 1.4.2

I experience trouble with the controls. Just doesn’t react…

[quote]I experience trouble with the controls. Just doesn’t react…
[/quote]
Are you using Opera?
I don’t know why but on Opera my lib (which works great with Netscape, Explorer e Mozilla) can’t catch key events!

I’m working on it…

Thanks

[quote]I’m using 1.4.2
[/quote]
Did you have experienced similar problems with other applet games?

Nope, IE6.

Nooo! :’(

I’ve understand why on my computer it doesn’t work on Opera.

The game loader is an Applet: it waits until the other Applet (the game) is loaded. Then the Game applet is attached (using add()) to the Stub of the loader Applet.

I add all the event listeners to the Game Applet. This works (on my computer as Haerkules show) on IE6, Mozilla 1.3 but not on Opera.
Otherwise if I add the listeners to the Loader App, the game works fine on Opera but not on the other browsers.

It seems also that IE6 has different behaviours!

Obviously no way to add simultaneously listeners to the Loader and Game applet…

Strange! :o

I will try to fix this problem for the beta.

To be more precise: I loaded the game again and first controls worked. After a couple of sceonds the figure stopped and started to move on it’s own, erratically.

I loaded the game again and even the one_player/two_player menu didn’t work. No selection possible.

Very strange!

Restarted again and found that after controls malfunctioning for a while, they can catch up again! As if there is some HUGE lag of several seconds or such.

Stranger…

[quote]So the resolution trick has been integrated in GAGEtimer as one of differents beat source right?
And one of them is based on the DLL and works only on windows. :o
[/quote]
Exactly!!!

[quote]This means you have more sources (more than two) or just that the old timer (the one I’m using) is simply more accurate on other systems?
[/quote]
Simply more accurate. System.currentTimeMillis() should update every millisecond. (Which would make sense since it returns milliseconds.) However, it doesn’t do that. Or I should say, it does that on every OS except Windows. On Win9x, System.currentTimeMillis() will always be a multiple of 50, and on NT/2000/XP it will always be a multiple of 10. When it comes down to it, the problem occurs because Windows sucks. :slight_smile:

[quote]I don’t know if the problem is related only with accelerated images…
On my computer, running in pure software mode I cannot tell the difference.

Are you having the same transparency problem of swpalmer ?
[/quote]
No, transparency works fine for me. The whole game is just slow tho. I’m quite sure the problem is related to accelerated images, because that’s the only thing that could make my GAGE demo work smooth but slow.