progcomp2013.git
10 years agoMaking dedicated match making server
Sam Moore [Sat, 20 Apr 2013 02:20:45 +0000 (10:20 +0800)]
Making dedicated match making server

Start server with `./qchess.py --server`
Connect from clients with `./qchess --server=address`

11 years agoMade networking work hopefully
Sam Moore [Fri, 12 Apr 2013 09:07:52 +0000 (17:07 +0800)]
Made networking work hopefully

The code is getting really ugly, but it works

11 years agoChanges to Networking code
Sam Moore [Fri, 5 Apr 2013 06:17:56 +0000 (14:17 +0800)]
Changes to Networking code

Don't work

11 years agoDid something, apparently
Sam Moore [Fri, 5 Apr 2013 13:30:54 +0000 (21:30 +0800)]
Did something, apparently

11 years agoMake --blackout option turn off screen
Sam Moore [Tue, 2 Apr 2013 07:05:29 +0000 (15:05 +0800)]
Make --blackout option turn off screen

Because the SDL_ENABLE_SCREENSAVER flag wasn't working

11 years agoFixed networking!
Sam Moore [Fri, 29 Mar 2013 10:34:03 +0000 (18:34 +0800)]
Fixed networking!

*touches wood*

11 years agoMerge branch 'master' of git.ucc.asn.au:progcomp2013
Sam Moore [Fri, 29 Mar 2013 04:32:06 +0000 (12:32 +0800)]
Merge branch 'master' of git.ucc.asn.au:progcomp2013

How do git work?

11 years agotrivial: Fix links and errors
Sam Moore [Fri, 29 Mar 2013 04:30:07 +0000 (12:30 +0800)]
trivial: Fix links and errors

11 years agoMerge branch 'master' of git://git.ucc.asn.au/progcomp2013
Sam Moore [Thu, 28 Mar 2013 04:43:06 +0000 (12:43 +0800)]
Merge branch 'master' of git://git.ucc.asn.au/progcomp2013

I have no idea why this merge is necessary,
Presumably I did something.

11 years agoAdd dates to webspace
Sam Moore [Thu, 28 Mar 2013 04:42:47 +0000 (12:42 +0800)]
Add dates to webspace

11 years agoRemove types_revealed from network.py
Sam Moore [Wed, 27 Mar 2013 05:05:54 +0000 (13:05 +0800)]
Remove types_revealed from network.py

11 years agoFix bug with NetworkReceiver
Sam Moore [Wed, 27 Mar 2013 04:42:57 +0000 (12:42 +0800)]
Fix bug with NetworkReceiver

Player was getting None as a name string

11 years agoTrying to fix networking
Sam Moore [Wed, 27 Mar 2013 04:38:44 +0000 (12:38 +0800)]
Trying to fix networking

11 years agoEnable screensaver
Sam Moore [Sat, 23 Mar 2013 04:55:48 +0000 (12:55 +0800)]
Enable screensaver

Probably doesn't work

11 years agoImproving C++ API
Sam Moore [Fri, 22 Mar 2013 04:53:43 +0000 (12:53 +0800)]
Improving C++ API

Changed the Piece and Board classes slightly so that I can make an efficient C++ agent.

I plan to make SilverFish as good as I possibly can.
Rather than writing 6 different mediocre sample agents like I did last year, I will just focus on this one.

Technically I can't enter my own competition, so SilverFish is still just a sample agent.

Anyway it still just defaults to random moves at the moment.

11 years agoFixed bug with probabilities
Sam Moore [Thu, 21 Mar 2013 04:27:51 +0000 (12:27 +0800)]
Fixed bug with probabilities

Pretty terrible, introduced weeks ago when trying to improve efficiency.
Also fixed bug with --reveal switch.

Agent Bishop should play better as a result of this (the former not the latter).

11 years agoAdd screen blackout to qchess
Sam Moore [Mon, 18 Mar 2013 23:40:34 +0000 (07:40 +0800)]
Add screen blackout to qchess

Just because it bugged [BOB] that the screen never went to sleep when using qchess_login.sh
Aren't I nice?

11 years agoActually commit stuff from ages ago
Sam Moore [Thu, 14 Mar 2013 14:37:19 +0000 (22:37 +0800)]
Actually commit stuff from ages ago

- Use regex in ExternalAgent to cope with Fortran agents
- Add "Q" to graphics (although somehow that did get committed?)
- Did something in src/board.py... no idea what

11 years agoForce people to play Qchess
Sam Moore [Sat, 9 Mar 2013 19:39:55 +0000 (03:39 +0800)]
Force people to play Qchess

11 years agoAdded Fortran sample Agent
Sam Moore [Tue, 5 Mar 2013 10:25:33 +0000 (18:25 +0800)]
Added Fortran sample Agent

It occasionally gets confused and breaks. Fixing is an excercise for any fools that decide to use FORTRAN.

11 years agoStuff happened
Sam Moore [Thu, 28 Feb 2013 15:53:04 +0000 (23:53 +0800)]
Stuff happened

- Fixed C++ agent (yay)
- Added Java agent (ew)
- Renamed some things (why?)

11 years agoAdd explanation of Board.pieces
Sam Moore [Thu, 28 Feb 2013 10:31:14 +0000 (18:31 +0800)]
Add explanation of Board.pieces

11 years agoFix bugs and documentate stuff
Sam Moore [Thu, 28 Feb 2013 10:13:42 +0000 (18:13 +0800)]
Fix bugs and documentate stuff

bug - qchess was allowing illegal moves... not good
documentate - agent_python.html was empty... not good

Thanks to rvvs89 for prettifying agent_python.html

11 years agoAdded C++ agent
Sam Moore [Mon, 25 Feb 2013 13:49:13 +0000 (21:49 +0800)]
Added C++ agent

As a result, found an issue where qchess was printing "-1" as the index whenever a King was selected.
I don't know why that didn't break the python agent, but it definitely breaks the C++ agent, so I fixed it.

11 years agoFix gt/lt signs in agent_text.html
Sam Moore [Tue, 19 Feb 2013 07:00:55 +0000 (15:00 +0800)]
Fix gt/lt signs in agent_text.html

11 years agoUpdate website a bit
Sam Moore [Mon, 18 Feb 2013 12:53:07 +0000 (20:53 +0800)]
Update website a bit

11 years agoGetting ready to run rounds
Sam Moore [Tue, 12 Feb 2013 09:08:39 +0000 (17:08 +0800)]
Getting ready to run rounds

Got sidetracked writing "swarm" to parallelise rounds.
It's not ready yet, but I wrote run.sh to run a round.
Which should work even if I never finish swarm.
It'll just be ridiculously slow.

Changed structure of agents directory (same as last year).

Minor changes to qchess. Added yet another wrapper class for replaying logs.
FileReplayer replaces the standard python file; if a game is still in progress you can use that.

I noticed the Http log replay was breaking a while ago, but I haven't investigated.

TODO: - Finish swarm
      - Generate pretty html pages from results
        (but hopefully make the script nicer than last years)
      - Handle errors/illegal moves properly. Enforce the timeouts.
      - Include draws/stalemate
      - events? prizes? profit?
      - BUG FIXING
      - Read TODO lists more often, because I usually just write them and then never read them

11 years agoMessing with log files
Sam Moore [Thu, 31 Jan 2013 05:37:27 +0000 (13:37 +0800)]
Messing with log files

- Fixed storing of whether pieces were revealed or not in log files
  - Just prepend '?' to the hidden types, removed the Piece.types_revealed list

- Implemented Agent resetting of board state from strings
  - ReplayPlayer will call the Agent.reset_board() function
  - run_agent() looks for lines between "BOARD" and "END BOARD"
  - This API will not be compulsory for entered agents
    - All games will start with the initial board state, it is not required

- Fixed other stuff with log files
  - Needed to work out whose turn it is when the game continues from a log
  - HttpLog -> ShortLog (since it just writes to a file)
  - To get a log from http, use --file=http://address
    - This works for either ShortLog or LogFile written logs
- But if the game hasn't ended there is a bug with the LogFile logs
  - Can now have multiple logs at the same time

- Hopefully nothing is borked

11 years agoIt works!
Sam Moore [Wed, 30 Jan 2013 13:00:50 +0000 (21:00 +0800)]
It works!

Need to tidy things up. Differ between 'short' log and full log. Make HttpGetter work for either.

"short" log has the entire board state and most recent selection/move.
"full" log has the original board state and all moves up to the current point.

I started the "short" log so I could make it easy to watch games played on the server, but I think it might be useful
for testing now. But I need to work on it first.

Since short log prints the board state rather than all moves, agents don't know what is going on when short log is read back.
If I implement an API for that, then people can write their own starting game states.

Also need to indicate whether pieces are revealed or not in their string, and interpret correctly in reading the short logs

Or not...
perhaps this is getting too complicated?

NEVER

11 years agoI think I just borked things...
Sam Moore [Wed, 30 Jan 2013 11:58:58 +0000 (19:58 +0800)]
I think I just borked things...

And then rewrote what I originally had anyway

11 years agoThere's probably a better way of doing this...
Sam Moore [Wed, 30 Jan 2013 11:46:33 +0000 (19:46 +0800)]
There's probably a better way of doing this...

Get log to show last selection and movement
So that the "client" doesn't get confused if it misses a selection/move

Client has to rebuild the board every time, yuck

11 years agoTry again
Sam Moore [Wed, 30 Jan 2013 10:08:45 +0000 (18:08 +0800)]
Try again

11 years agoMake sure the board reflects the state BEFORE the move is made
Sam Moore [Wed, 30 Jan 2013 09:20:45 +0000 (17:20 +0800)]
Make sure the board reflects the state BEFORE the move is made

Whoops

Probably going to get a lot of really small commits for a while...

11 years agoFeature creep in log files
Sam Moore [Wed, 30 Jan 2013 09:03:57 +0000 (17:03 +0800)]
Feature creep in log files

I want to be able to watch a game that's playing on the server!
Without having to actually use sockets and shit!
I've used enough sockets already!

11 years agoStarted work on website
Sam Moore [Wed, 30 Jan 2013 06:50:22 +0000 (14:50 +0800)]
Started work on website

I forgot how terrible web design is.

11 years agoAdded sample agent + log file writing/parsing
Sam Moore [Tue, 29 Jan 2013 16:47:24 +0000 (00:47 +0800)]
Added sample agent + log file writing/parsing

I figured no one wants to sift through the qchess internal agent stuff,
So I wrote a python external agent agents/sample.py

I ended up implementing the cool idea about log files.
You can replay a log file up to an arbitrary point, and then continue play.

I also fixed a bug with external agents calling run_agent.
Removed the reading of the colour line from there, since the external agent should do it.
Added reading of the colour line to the ExternalWrapper class, to avoid breaking that.

Added --reveal so that all states can be seen in the GUI (but they are not communicated to Agents).

Added handling of SIGINT to main.py

Probably did something else I forgot.

qchess will probably be ready soon (famous last words), I should start on a scoring/entry system...
And a webpage.

11 years agoProgress?
Sam Moore [Tue, 29 Jan 2013 10:12:05 +0000 (18:12 +0800)]
Progress?

- Fixed .dll files that were the wrong ones for cx_freeze win32
- Created "internal" agents, and made AgentBishop one of them
- Implemented terrible wrapper class that runs an internal agent in a seperate python process
  - This is for when timeouts are used
  - select == better than threads
  - TimeoutPlayer appears to not work properly anyway
- Tested win32 version (script and frozen binary)
  - ExternalAgent seems to break
  - TimeoutPlayer seems to break (even more than normal)
  - Pretty much everything breaks actually
    - More things seem to break with the frozen binary than with the script
    - Amazingly the pygame interface doesn't break, just the fancy threading/subprocess/socket/file related stuff
  - Somehow, the InternalAgents, ie: AgentBishop were working
  - So windows users can play the python sample agents, but otherwise the program is pretty useless

- Implemented the --log and --file arguments
  - Get an error if the game hasn't actually finished when using --file, should probably fix
    - It might be cool to let people use --file for a set number of moves, and then continue play from that position
      - Would need more work...

- When graphics are disabled, the game still works
  - But I need to test it on a server that doesn't have pygame at all

TODO: Finish the qchess program and actually work on setting up the competition.

11 years agoProbably important...
Sam Moore [Mon, 28 Jan 2013 15:21:32 +0000 (23:21 +0800)]
Probably important...

11 years agoSelf inflicted wounds using cx_freeze
Sam Moore [Mon, 28 Jan 2013 14:54:56 +0000 (22:54 +0800)]
Self inflicted wounds using cx_freeze

The pain is freezing me.

I've been trying to freeze the qchess.py script into a win32 binary, so that windows people don't need to install python.
Except I've realised that they will probably install python to enter anyway, since it is the easiest language.
HER DURP.

I mostly got cx_freeze to work.

Fun tip: Unicode strings cause segmentation faults

So wrote hacky script to save unicode characters to png files, then use png files in frozen versions.

cx_freeze in linux worked amazingly well.

For windows... I installed python and cx_freeze in wine... this was probably a mistake,
because all the dll files were missing. But I found all the dll files, so that's fixed.

qchess.exe works in wine, but can't load python agent programs... because windows doesn't understand #!
Well, fuck. Also annoying bug with Tk open file dialog mouse which I cannot be bothered chasing.

Tried hacky batch file, but it doesn't work in wine. Will try in Windows 7 soon.

PS:
Also changed directory structure somewhat.

Ironically, using cx_freeze doesn't result in freezing programs!

11 years agoLots of stuff happened
Sam Moore [Thu, 24 Jan 2013 09:05:09 +0000 (17:05 +0800)]
Lots of stuff happened

1. Argument parsing. We have it

2. GUI. We have it

3. Networking. We have it.

4. Timeouts. We have those. Sort of. Not for Windows.

5. Help page. We have that too.
I think you'll find it quite... helpful

We still don't have log files. Most of previous TODOs still apply.

11 years agoMostly networking
Sam Moore [Wed, 23 Jan 2013 19:07:26 +0000 (03:07 +0800)]
Mostly networking

It is pretty much a hack

Fixed dodgy symlinks from agents directory, thanks [SLX]

Need to fix argument parsing for qchess program, but can't be bothered right now.

11 years agoFix qchess/update.sh
Sam Moore [Wed, 23 Jan 2013 14:02:36 +0000 (22:02 +0800)]
Fix qchess/update.sh

Accidentally bashed self in foot

11 years agoInitial Commit
Sam Moore [Wed, 23 Jan 2013 13:21:09 +0000 (21:21 +0800)]
Initial Commit

Now is probably a good time to start using git

1. Implemented quantum chess as described here:
        http://research.cs.queensu.ca/Parallel/QuantumChess/QuantumChess.html
- Except I have "white on the right"

2. Wrote sample agent "agent_bishop.py" which is already better at the game than I am

3. Sort of got sidetracked trying to split my original quantum chess python file into multiple files.
        - Difficulties because there are circular dependencies with the graphics / game stuff
        - eg: HumanPlayer needs to know about GraphicsThread to get its move
                and GraphicsThread needs to know about HumanPlayer to draw stuff and give it a move

4. Ended up writing a bash script to combine multiple python files into single qchess.py file.
        - It was easier than working out how __init__.py and __main__.py work / do not work
        - "from . import *" doesn't work and apparently is "bad practice" or something
        - Bash scripts are the best practice
        - It will probably backfire horribly. Hence, git

TODO:
        - Either borrow sigma from [DJA] again, or setup a new progcomp server at UCC
- Make website for results / information
- Depending upon how adventurous I feel it might be django
- Or a .html file created by a bash script
- Make judging / scoring system
- Need to implement move timeouts for AI players (remember to use select this time)
- Organise some sort of event for people to come to
- Should probably talk to #committee at some point
- Get people interested? Bribe them? Threaten them with account locking if they don't enter?
- If I get 4 entrants it will be a doubling in entries since 2010!

UCC git Repository :: git.ucc.asn.au