A Pet Project

Hello!

First of all, I hope that I'm not stepping on anyones toes for doing this, however, if I do, I apologize.

I am enjoying Thud a lot, and it actually saddened me when I couldn't get the ThudChat to work. I was looking forward to playing the game online, but alas, it never worked. As a consequence of this I started to play around with a small petproject. My first attempt was to create a ThudGame using PHP-scripts, but I ran into problems because of the limitations of PHP and JavaScript. So I decided simply try and make a standalone application.

Thumbnail (click for larger picture:

It doesn't work as it should yet. I have a couple of things I need to fix before I can "release" it. This is what it is right now:

It's a easy to use GUI (graphical output/input) that allows you to create an account, chat with friends and play thud. The chat is very basic. The app has a system for handling challanges, and allows you to play several games at once. It's very easy to switch between the games, and it should be quite easy to keep track of which game is which. At the moment it only uses normal Thud-rules, but the possibility to toggle Koom Valley rules might be added if the first version of this turns out well, and if anyone actually asks for it.
Only allowed moves are allowed, so you wont be able to make any faulty moves at all, furthermore, the app can show the possible moves for the piece you've selected (look at the preview pic) (can be toggled on/off).
It's quite easy to change the graphics and the sound effects. It's simply a couple of wav and jpg files that needs to be edited.

But, as I said, it's not ready to be released yet.
- Right now it can only connect to a local database. It should be fairly easy to make it connect to an external database, however, I haven't been able to find any free MySQL servers that I can use. Perhaps Google will help me out.
- I want to add the possibility to save the settings between different sessions.
- I want to allow toggling between (x,y) coordinates and ThudBoard coordinates, so that it's easier for people to translate between them.
- I also have to fix some minor problems.
- I have to find out how to make a standalone executable from my class-files

===

Well, that should sum up the important parts of my Pet Project.
Unless I get surprisingly much to do the next week, it will probably be finished, or at least finished to the extent that I dare to show it to anyone.

--

thudgame creativity
Login or register to tag items

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: A Pet Project

I forgot to mention:
When you make a move, the move is stored in the database, and if the opponent has the application running, the board will be automatically updated, thus allowing real-time Thud. However, if the opponent isn't online, the move will still be stored, and the next time the opponent gets online he/she will be able to continue the game.
Which means; the application allows both real-time Thud, and SlowThud at the same time.


Re: A Pet Project

Founding PatronLibrarianDruidThudmeister

Sounds pretty nice, ophe Smile Let us know where to download it once you've got it to a stage you're happy with. Out of interest, you said you abandoned PHP/JS and instead went for a standalone app, but what language are you using for it now? (If I were taking bets, I'd say you'd probably go for python Wink).

I was gonna say that if you can't find a MySQL server to use I might be able to work something out for you with my server, but then I realised it's been so flakey recently I'm slightly embarassed by it, and it certainly wouldn't give you the level of service you really want...

MS


--

"LOOKS PERFECTLY LOGICAL TO ME"


Re: A Pet Project

The reason I abandoned PHP/JS was that I would be pretty much forced to reload the page to make new sql calls, since the calls cannot very easily be made from the JS-code, they have to be made from the PHP code. It would have been possible to solve it, but then I would have to rewrite most of it, and I thought it would be easier to simply make a java-application, instead of trying to rewrite everything in php.
I dislike php, because it usually doesn't display any error messages; it takes forever to find what might be wrong!!
PHP and JS also seemed to have strange limits in recursive functions. I had a quite simple one that checked if the path to the selected tile was empty, and it worked great as long as it didn't do more than about three iterations, then it simply aborted.

http://ophe.byethost14.com/thud.php

My first thought with the app was that I should create a client-server thing, but I realized it would only be a lot of extra work to write a server for it, since I would still have to use a database. It seemed like a much better solution to make it connect directly to the MySQL server, and because of that

I would actually be happy as long as at least someone thought it worked nicely and was usable!!

I've been kinda distracted the last week, but I think it will be finished quite soon. I promise that I will make a post here once it's done! And well, I would be happy if anyone wanted to help me test it as well! Afterall, it's often hard to find flaws in things you've worked with yourself.


Re: A Pet Project

Bronze MemberLibrarian

well, since there seems to be nothing done to get the original thud chat back to work i guess it's best to find a proper replacement. so i'd be happy to help you test Wink


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

There are two things I have to do before I can place the game on a homepage and provide people with a link:
1. Endgame
Right now the games doesn't finish. There should be two possibilities for this. If the pieces of one player are eredicated the game should end, and if both players presses an "end game"-button it should end.
2. MySQL
I have to explore google to find a place that can be used for testing the database. It works with a local DB, and in theory it should work on a remote DB, but I haven't tested that yet.

There are some other things I should look into as well, but they don't really have any effect on the actual functionality; they're mostly cosmetic changes.


Re: A Pet Project

The app can be tested at:
http://ophe.byethost14.com/ophethud.htm

The executable works on WinXP, that's about how much I know. I also know that Thudgame.jar compiled for me when I wrote:
java -jar Thudgame.jar, meaning, it will probably work for all that runs the jar file directly.

In order to run it you will need a JRE, but you will be provided with a link to it on the download page.

The game is already setup to find the proper DB, but if you want to edit it, or if you accidentally enters a different adress, this is what you should use:
s43.eatj.com:3307

I play as "Ophe" if you want to try challanges.

And well, I can't promise it will work for you; all I know is that it appears to work for me.


Re: A Pet Project

Bronze MemberLibrarian

umm, the download link redirects to google... i think you may want to change that Razz


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Ratdeath wrote:

umm, the download link redirects to google... i think you may want to change that Razz

Now why did it do that?

I hate when there are restrictions noone tells you about in advance!!

Okey, I switched site, to one that doesn't redirect you to google...

http://congri.50webs.com/ophethud.htm


Re: A Pet Project

Bronze MemberLibrarian

working now, will look into it tomorrow.
cheers


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Bronze MemberLibrarian

i just looked into it a bit (not much yet though) and i noticed a couple of things:
maybe you should name the txtboxes for the account info "Name" and "Password", because right now that's a bit confusing.
also, the password field doesn't show the entered password as little dots or stars but as actual letters. so everybody looking at the screen whenever i'm in the settings can see what my password is, because it stays there, too.
it would be nice if there was something listing the people in the chat, so you know if there is anyone. right now, if there's only one person and they are waiting for someone else to come they will never see if a new person arrives (or will they?) and the new person won't see that there's already someone there and so probably won't say hi. that way you could have dozens of people on and everybody thinks they are alone...
i think no one actually clicks a send button when they want to send a chat message. they just press enter. and that doesn't work for your chat.
is that clear button supposed to clear the chat window? because i can't see a reason why i would want to do that. however, i would quite like it if i could erase long unsent messages with just one click Wink
apart from that there's only two (well, three, but i forgot what the third was...) minor things i found: writing dwarf from right to left in the scores is a nice idea, but rather confusing (i was about to look frawd up in the dictionary). and there are some punctuation mistakes in the rules (possibly also others, but i haven't read them, only scanned over them, so i'm not sure).
but all in all i'm quite impressed. keep up the good work and thud will have a proper chat again soon Very Happy


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Founding PatronLibrarianDruidThudmeister

At the moment I don't have access to a windows system - I'll have to get back to you once I either get access to one or get WINE working again on my Linux box.

MS


--

"LOOKS PERFECTLY LOGICAL TO ME"


Re: A Pet Project

I read all the comments, and I will try to fix everything. Many of the suggestions are really good.

Mr Scrub wrote:

At the moment I don't have access to a windows system - I'll have to get back to you once I either get access to one or get WINE working again on my Linux box.

MS

You can do without Windows, I think. It should be enough to run "Thudgame.jar" with a java interpreter.
The exe is mainly for those who doesn't want to write "java -jar Thudgame.jar" in a command-window.


Re: A Pet Project

Ratdeath: I've added most of your suggestions to my todo-list on the homepage.

I tweaked the chat, it now shows who is online, and who logs on and off.

The new version is available on:
http://congri.50webs.com/ophethud.htm


Re: A Pet Project

Bronze MemberLibrarian

hm, suddenly none of the messages i post show up anymore... that's not a problem of the new version though, it's been there for at least some minutes before i updated :-S. do you want the error log?

edit: i think it would be easier if we did this over email or instant messenger. Razz is there any way i can contact you?


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Ratdeath wrote:

hm, suddenly none of the messages i post show up anymore... that's not a problem of the new version though, it's been there for at least some minutes before i updated :-S. do you want the error log?

edit: i think it would be easier if we did this over email or instant messenger. Razz is there any way i can contact you?

Ah, right! I know what's causing the error.

I wiped the chat in the database.
The position the chat looks at is stored in chatpos.ini, which means, if the chat-table is wiped, it will still have the old position in chatpos.ini, and untill you reach that position it wont display anything.
The solution is to either delete, or edit chatpos.ini

I will think of some fix to prevent this from happening in the future.

And yes, feel free to PM me for my email address.

EDIT by Mr Scrub: removed email address to stop the Spam bots Wink


Re: A Pet Project

Founding PatronLibrarianDruidThudmeister

Ah yeah - that's better Smile

A couple of things I noticed first up: the screen that came up initially is to short, at least on my computer. I can't see the bottom 2 lines. And it doesn't seem to be resizable, either.

The other problem is less of a killer, but will potentially become a bigger issue in the future and is harder to solve. It's running very slowly... Now admittedly I've got a pretty ancient computer (500Mhz, 256Mb RAM), so it may not be noticable on a modern rig, but you'll probably get a fairly large group of people trying to play who dont have modern computers, and obviously as you add complexity to the program it'll get slower. I'm afraid I don't have any practical suggestions on solving it, though Wink

MS


--

"LOOKS PERFECTLY LOGICAL TO ME"


Re: A Pet Project

Bronze MemberLibrarian
Mr Scrub wrote:

Ah yeah - that's better Smile

A couple of things I noticed first up: the screen that came up initially is to short, at least on my computer. I can't see the bottom 2 lines. And it doesn't seem to be resizable, either.

The other problem is less of a killer, but will potentially become a bigger issue in the future and is harder to solve. It's running very slowly... Now admittedly I've got a pretty ancient computer (500Mhz, 256Mb RAM), so it may not be noticable on a modern rig, but you'll probably get a fairly large group of people trying to play who dont have modern computers, and obviously as you add complexity to the program it'll get slower. I'm afraid I don't have any practical suggestions on solving it, though Wink

MS

both is working fine for me, but then i do have a higher resolution and upgraded my computer to eventually run tes: oblivion smoothly even with high graphics, so this little thing is no problem for me....

buuuut: i now deleted the chatpos thing and suddenly saw everything anybody wrote since the wipe yesterday (which is probably not the best thing since anybody can read any previous conversations, so there's no way you could talk about anything you don't want others to know about). but everything i would post after that remained invisible again....

edit: i tried again and it's been working for a while now...


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Hmm, I'll fix the resizeability, and the chat-thing right away. At the same time I will kill the use for "chatpos.ini". I'll start with that, and we'll see how much time I have left today!

Have anyone tried playing any games?


Re: A Pet Project

First of all: Kudos to RatDeath for helping with testing, coming up with ideas and for creating skins

Much work was done today. The most important bits were:
- Improvements to the chat
- - Sound
- - Post by pressing enter
- - Only display new messages
- - More clear when people log on/off
- - Removed the need for chatpos.ini
- Added skin-support
- Several minor tweaks and improvements

The pet project can be found at:
http://congri.50webs.com/ophethud.htm

Feel free to download, chat and play. It's not finished yet, but it's getting closer!!


Re: A Pet Project

Bronze MemberLibrarian

the skins are all fixed (the default and mine) and in our shared folder (the media folder) Wink *goes to relax her brain*


--

When we remember we are all mad, the mysteries disappear and life stands explained. – Mark Twain

Save the rats, eat a dwarf!


Re: A Pet Project

Founding PatronLibrarianDruidThudmeister

New (and hopefully easily fixed) problem - I'm getting 404s when I try to download the new version (for all 3 parts).

MS


--

"LOOKS PERFECTLY LOGICAL TO ME"


Re: A Pet Project

Mr Scrub wrote:

New (and hopefully easily fixed) problem - I'm getting 404s when I try to download the new version (for all 3 parts).

MS

My silly mistake. Sorry 'bout that!

It should be fixed now.


Re: A Pet Project

More testing and more work was done.
The chat is now quite nice. It works well, and it looks quite good. I'm quite content with it!

This is what was done today:
* Tweaked the appearance of the skins (Thanks to RatDeath for this)
* Tweaked the chat
o Added colors to the chat
o Added "List all" button to the chat
o Fixed the bug that prevented you from typing ' in the chat
* Minor appearance tweaks


Re: A Pet Project

I've done some more work; I've...
...added a limit to the size of chatmessages
...added a notification when opponent makes a move

Why not more, one might wonder, and the reason is, I've tried to explore the possiblities of an applet. The problem is, I can't get the database-handling to work at all. I'm not sure how to get around that, and I've spent many hours trying to find solutions. We'll see if a solution can be found.


Re: A Pet Project

I'm still working on this, I've been quite busy the last two weeks, but unless I'm mistaken I will be able to dedicate some time to this the next week.

My current big goals are:
1. Get applet to work
1.1. Solve the problems with the database
1.2. Solve the loading of graphics-problems
1.3. Solve the problem of saving settings in an ini-file
2. Make the app more user-friendly
2.1. Add floating text-comments to most buttons etc
2.2. Add "new version exists"-notifications
2.3. Make skin-selecting easier

When I get the applet to work, I also have to decide whether to focus on the applet version only, or if I should continue with both an applet and an application.


Re: A Pet Project

I've found the source of some problems with the applet. The database still doesn't work, but I think that's because of the host I'm currently trying to use. I have to continue my search for free hosts with mysql databases.
If anyone knows a free host that includes a mySQL-server; tell me and I'll be happy.

To clarify; There are a lot of free hosts, but almost all have some limitations that makes it difficult. 3 that I've tested prohibits files larger than 500 kb (the largest file I use is about 650 kb), 1 have limitions against onlinegames, another has limits to the database access, which makes it impossible for the app to connect (at least I think that is the reason it cannot connect).

Once I find a good free host I will make sure that the database works, and then the rest will be a walk in the park, I think and hope.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.