Mini Adventure

disclaimer: Newbiee alert :slight_smile:

Hmm, I noticed in your code (ahem :wink: that you have delta as the actual time between rendering, and you’re using


SystemTimer.sleepUntil(startTime+(frameInterval));

to get correct fps (i.e. 1/frameInterval).

But if you subtract the difference between your actual render time and wanted shouldn’t that give an even smoother animation?
Something like the following:


// private double sleepTime = frameInterval;
sleepTime = frameInterval;
if (delta > frameInterval) {
    sleepTime -= delta - frameInterval;
}
SystemTimer.sleepUntil(startTime+sleepTime);

Please correct me if I’m wrong - just interested if the above would help :slight_smile:

I’m not sure I understand it, but wouldn’t that only take effect if the render took more than the intended frame interval. At the moment, if thats the case then we don’t sleep at all. Not sure if its relevant but note startTime is recorded before we start the render.

Kev

Haven’t played the demo since the original postings.

You’ve come a long way so far. Keep up the good work.

I changed the SystemTimer to use System.nanoTime() and ran a test (limited to 100fps) with the gameLoop in case one having


SystemTimer.sleepUntil(startTime+frameInterval);

and in case two


sleepTime = frameInterval;
if (delta > frameInterval) {
    sleepTime -= delta - frameInterval;
}
SystemTimer.sleepUntil(startTime+sleepTime);

On my machine (linux, geforce2mx,java1.5beta1) the first case gives varying fps betwen 92-100 (100 when staying still, and varying between 92-98 when walking). Case two though gives a more or less rock solid 100 fps.

When I run your excellent :slight_smile: game with the gage timer instead, both approaches gives an fps a little more solid than case one but still not 100fps most of the time.

This is of course just a minor observation as the “feel” of the game on my machine is smooth regardless of which timer/timing code is used. The reason I tried this was because I was curious if it would make any difference to actually sleep the “correct” (well…) amount of time :slight_smile:

Sooo, my conclusion is that any stuttering problem is probably due to timing inaccurracies on the platform and not depending on which “sleeping code” is used (as you’ve already written).

I considered that it might be to do with not having yield() in the loop anywhere (on some threading models thats going to matter). I’ve added that to the latest version (not uploaded quite yet)

In addition, as a side effect of my last update the context menu that someone wanted (logged as a bug) has made the release code.

If you right click (or press space if you’re a keyboard user) on the “active” items, a menu will appear to show you the supported options. At the moment only a single option is defined for each item. (Note: if you’re using keys the menu is controlled with the cursors, space and escape).

Small addition I know, but its honestly still going

Kev

Ah. Useful tidbit. My processor is a bit underpowered as well. When it comes to Java apps on Mac OS X (and my 400mhz box) , Eclipse is just usable enough and Poseidon(UML) is almost not usable.

I don’t think I’ve tried any games other than yours so I’m not sure if scrolling/stuttering is a problem there as well. I just checked Apple’s developer site and no 1.5 beta/preview yet. probably a few months away.

Doesn’t seem to do anything on my WinXp box, just uses 90% CPU with nowt happening! Am I doing something wrong?

Not had a chance to get back to this for a while, any time now… honest.

As to the failure on XP, anything reported on the Webstart log? Do you actually get the login box? Do you get anything?

Kev

Webstart has a log? Where’s that then?

I get the login screen, and I’ve registered successfully. I click Login, it says “Connecting” then…nothing. I did a netstat and saw the established session to 146.67-18-125.reverse.theplanet.com:10990 so it looks like it can communicate ok. I thought it might be my firewall so I disabled it but to no avail.

Maybe it’s cos I’m in Australia :-/

Webstart log, File->Preferences->Advanced->Show Java Console.

Whats your username? I can check the logs and see if you managed to get a connect…

What Java version? Platform etc?

Kev

OK, logging enabled. Unfortunately it doesn’t log anything apart from the fact that it’s started logging!

Username = mcr

Platform = WinXP Pro, GeForce Ti4200, 512MB RAM, P3 1GHz
JRE = 1.4.2

“mcr” doesn’t even make recent logs so the connection is just not going through, unless is fails on sending data I suppose… I’ll add more logging to the network layer as soon as I get back to the client… hopefully we’ll be able to work out the issues.

More questions:

  • Are you sure the session in netstat wasn’t establishing?
  • Did the connecting dialog eventually disapear?
  • Have you tried again recently, it may have been some sort of network outage?

Kev

I tried re-registering as “mrennix”. It came back with “registration complete”. Then I clicked login, and a dialog appeared saying “connecting”. This dialog disappeared after about 0.5 seconds. Netstat said “established” to port 10990 at IP 67.18.125.146. Then nothing, no window, just 90% javaw CPU usage.

It appears you registration is actually failing. However, even if your username wasn’t recognised I’d still expect you to see an “Incorrect Login” dialog.

Kev

Well, I’ve not managed to work out whats wrong with it not letting you connect however I have managed to do some updates:

From the new news.html:

Added some dialog type stuff - fixed some of the issues people were seeing with frame rate drops and the dialogs crashing.

Added channels to the chat area - the chat area output is now organised into 3 channels which are selectable with the 3 “gems” to the right of the chat area (these can also be toggled with ALT-1,2,3). The gems should also highlight when text has been added to a channel you can’t see.

Change large buttons to icons - changed the big ugly buttons in the bottom right to some small ugly icons (did I mention I could do with some bespoke art for the GUI?)

Adding this news page to the login dialog - The login box now features a panel that gets the news.html file containing the recent updates (preventing the frequent visitors having to log in just check for new features, good idea Seekley :))

I’ve also fixed a bunch of other bugs on the server and client. In addition the toolset for building the world now also contains a tool for putting actors (NPCs) into the world and defining their movement and conversation.

I’m currently in the process of building a new area currently named “Riverside” which should be released in a week or two. However, I’m only building this at work lunch times at the moment so its moving along very slowly.

Thanks to everyone who have logged in in the few weeks, its been a great help both to development and my (well know lack of) enthusiasm to stick with it.

EDIT: Apologies for the state of the world, its been hacked out, will be replaced fairly promptly.

Kev

Kev,

One slightly annoying thing is that if you input an incorrect username/password combination, you have no option to go back to the main window to reattempt another variation of what you think your account is set to - you instead have to reload MiniAd from either the JNLP url or from within webstart.

32fps here
XP
Java 1.5.0 beta

Yep, this one is on the list (although I’ve been slightly sidetracked at the moment).

What graphics spec are you running on?
Have you tried turning on the OpenGL pipeline in 1.5?

Kev

Just some other thoughts as I play the game on my Apple:

One way of improving performance/gameplay could be to develop a single click and go method of movement whereby a user clicks on an area of the screen and the player will be seen to attempt to make its way to the designated coordinates. A simple A* algorithm.

Also,

  1. Cursor bug on Apple - cursor does not integrate well into the environment i.e cursor icon does not change and stays at default OS X state. Occasionally, I am amble to get the intended cursor to work, but it does not update properly with regard to the direction i wish the player to travel in.

  2. Have to click on interactive objects (i.e doors) a number of times before anything happens.

  3. Also, key-based movement did not work for me on my Apple.

Regards,

ribot

This one has been asked for several times now. I’ll go in soon.

Sounds like an OSX java bug. I’m going to have trouble in any attempt to fix it, not actually owning a Mac sucks.

Do you mean more than double click? Does right click work on a Mac to bring up the context menu?

Wierd and annoying. Maybe its a focus thing… hmm. Anyone want to send me a Mac :slight_smile:

Kev

Right click on a mac? Well, I’m on an iBook here with a single button track pad, so the nearest to a right click is a click with a shift button or something… I’ve tried these, but do not get a context menu.

Double clicking does work, but only when the player is near to the object, which is slightly confusing… but maybe that’s just little me.

Regards,

ribot