Adding a stopwatch

I have been working on a new module, http://www.vassalengine.org/wiki/Module:Bananagrams, and I wanted to know if there is a way to add a game stopwatch, that can be started when the user hits a button, and stopped when he/she hits another.

Thanks for your help, Ian

Thus spake IanSan5653:

I have been working on a new module,
vassalengine.org/wiki/Module:Bananagrams, and I wanted to
know if there is a way to add a game stopwatch, that can be started when
the user hits a button, and stopped when he/she hits another.

Thanks for your help, Ian

You could add a stopwatch by writing a custom class for it.


J.

How would I go about doing that? I am fairly new to this.

Thus spake IanSan5653:

How would I go about doing that? I am fairly new to this.

It would involve writing some Java. You’d need to extend
AbstractConfigurable. There are some tricky synchronization issues
with writing something that’s essentially a chess clock. Brent, one
of the other developers, looked into this some time ago, so if you’re
serious about writing one, you might ask him about it.


J.

OK, how can I contact him? By the way, I have absolutely no experience writing Java or Javascript. Are there any modules that already have this that I can use? It wouldn’t be a chess clock, because a chess clock counts down and a stopwatch counts up, but basicly the same principle.

Oh, I see. Brent Easton?

Thus spake IanSan5653:

Oh, I see. Brent Easton?

Yes.

If you have no experience programming in Java, then you’re probably not
going to be able to do this yourself; it’s something Brent shelved some
time ago because it was very difficult, and Brent’s quite experienced.
I don’t know how far he got with it, however—maybe he nearly finished
it?—so it’s worth trying to get his attention on this, if for no other
reason than to find out where things stand.


J.

Alright, Thanks. I’ll contact him. It will be interesting to look into. If not, it’s fine; it isn’t a necessary part of the game.

Ian

Maybe I don’t understand exactly the request but… wouldn’t it be possible or even, actually, reccomended to use an external time service for this? In a future version of Vassal, that is.

No synchronization issues… some hotkey like CTRL-A to start/stop it (and maybe poll time to do some math)…

In other words, let the external site take care of accuracy/display/configurability/auto-refreshing etc…

An “Internet clock” similar to the “Internet dice” of some versions of Vassal ago… (whatever happened to it?)

Hmm, interesting idea. You should suggest it.

Thus spake barbanera:

Maybe I don’t understand exactly the request but… wouldn’t it be
possible or even, actually, reccomended to use an external time service
for this? In a future version of Vassal, that is.

No synchronization issues… some hotkey like CTRL-A to start/stop it
(and maybe poll time to do some math)…

In other words, let the external site take care of
accuracy/display/configurability/auto-refreshing etc…

An “Internet clock” similar to the “Internet dice” of some versions of
Vassal ago… (whatever happened to it?)

“whatever happened to it?” is precisely the reason why I’d rather not
use an external time service if we can avoid it.

The old dice server was run by a third party. It doesn’t exist anymore.
I wrote a replacement dice server which has been in a state of near-
completion for something like five years now, but this has its own
problems, namely that we have to host and maintain it if we’re going to
use it.

The same story applies to any external time service we might use.


J.

I see. I just can’t believe there isn’t some kind of a timer feature built into the Java code itself that could be easily implemented. I guess I really don’t understand how that works. It just sounds so simple.

Thus spake IanSan5653:

I see. I just can’t believe there isn’t some kind of a timer feature
built into the Java code itself that could be easily implemented. I
guess I really don’t understand how that works. It just sounds so
simple.

Java is certainly capable of keeping time. That’s not the problem. The
difficult part, as I understand it, is keeping the displays shown to
everyone synchronized.


J.

That, and the need to avoid cheating, is exactly the problem Internet chess servers resolved via the use of external dedicated services like Timeseal.

hmm, I see

So basically the problem is having EVERYONE show the same time. Two things. First, is it possible to just have a personal timer? That would help for my game, and technically, it would even make a solitaire version of the game. If so, please give me step-by-step detailed instructions, or even make an extension for the module. If you could, that would be awesome. Also, is it possible to use a service like Timeseal for just one module? I’m sorry if that sounds dumb, I just really don’t understand the inner workings of VASSAL or Java. :stuck_out_tongue:

I am afraid Timeseal might be specifically designed for Internet chess servers. I was mentioning it as an example of some sort of Internet based utility (which probably runs on the chess server itself) dedicated to keeping time in synch. Something some interested Vassal developer might want to look at for ideas.

OK, thanks for explaining. I wish I could help, but I just don’t know Java at all.