It is currently Tue Jul 17, 2018 11:31 am Advanced search

PROPOSAL: Game debugging network protocol

Random stuff about the contest, posts that don't fit in the other forums.

PROPOSAL: Game debugging network protocol

Postby temp_dummy » Sat Sep 18, 2010 1:13 pm

SO, does anybody feel like writing a service/application with the following options?

1) List of Ip's wiling to do battle.
2) Mutually agreed total insane time outs.
3) P2p connecting, no central server.
4) Infinite replay of map against opponent.

So this is the use case:
------------------------------------
I want to debug my bot, I register on the central service that I am looking for "debug" matches.
This registration allows for other users to find my bot.
I select the opponent that I wish play against.
The opponent receives a debug request.

If the opponent agrees an instance of the "server-engine" is started on the (Choose: Opponent/My) machine,
On the Opponents machine an instance of his bot is created that will connect this server.
(This instance is subjected to the competitions time out rules)
I can then play against his bot as long or as slow as I like.

Meanwhile, if the opponent likes, he can reverse the connection too,
in which case and instance of the server is created on the oppose machine (of chosen above).
and an instance of my bot will be supplying the moves to this server.
(This instance is subjected to the competitions time out rules)

Which means both parties can be running two instances of their own bot,
one in a debugger and one supplying the moves to the other player.

A player can tell the central service how many debug matches he is willing to host.
Possibly, he can set his bot to auto-accept incoming requests.
When this limit is reached, the player can no longer be selected for debugging until one if the active "debug matches" is terminated,
and both parties agree that they no longer 'need each other'.

------------------------------------
The point behind this idea is that the central service has only the minor task of 'enabling' the matches,
not hosting them, which in theory should allow for many matches being played.
There is also a fair play thing going on where you must (allow to) host at least one game in order to connect to another player.
If you are purposely sabotaging your incoming connections, your ip will be banned.

I also think it would not be too difficult to implement this 'protocol' and a clever (group of) individual(s) will be able to cobble this up over a weekend or so.

If there is a need to see this idea implemented, I would consider doing so (hopefully with some help) but if no one will ever use it, I think my time will be better spend doing something else.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: PROPOSAL: Game debugging network protocol

Postby DanielVonFange » Sat Sep 18, 2010 3:13 pm

Hosting games (but not bots) on a central server is only a tiny bit of load. Seems like this would be much better as a central server.
DanielVonFange
Brigadier-General
 
Posts: 149
Joined: Wed Sep 08, 2010 1:15 pm

Re: PROPOSAL: Game debugging network protocol

Postby temp_dummy » Sat Sep 18, 2010 3:30 pm

Since I am proposing infinite time-outs, the question is, would you want it on a central server?

Hosting it on central server would require the following:
1) A server.
2) Though on how to limit the resource usage on the server.
Because it will need to keep the processes/games alive for possibly hours.

If Google is feeling frisky, then item 1 is taken care of.
Item two imposes some design questions.
a) Should a game be a process?
The current game engine is running using three processes, since the two bots will run remotely, this will leave only one.
However, how many processes can you spawn on the server before it 'breaks' ?
b) If it is not a process, then what is the alternative? A Database driven single process server?
(*) let me work that out.
How much games could this handle before it breaks?

(*) Database that holds the following:
Ip_debugger_bot,
ip_opponent,
game_state,
opponentMoves,
turn_number

When a game is started, a new record is inserted, IP's are logged and the GameWorld is dumped.
(start) Depending on who goes first, the game state is send to a client,
If it is the 'opponent' he has 2 seconds to respond (1 second official gametime + slack for lag)
The moves are stored in the db and the original gamestate is send to the debugger_bot.

debugger_bot may take as long as he wants, determines his moves and submits these to the server.
The server retrieves the original game state and opponent movelist, performs the battle fase.
Go back to (start).

A few columns should be added for'management overhead' but I think this is the jest of it all.

Still sounds like more work than having clients host their own server.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: PROPOSAL: Game debugging network protocol

Postby DanielVonFange » Sat Sep 18, 2010 5:19 pm

Just program the sever in the eventd/asynchronous style of programing. I'd use node.js.

On process, basically unlimited connections.
DanielVonFange
Brigadier-General
 
Posts: 149
Joined: Wed Sep 08, 2010 1:15 pm

Re: PROPOSAL: Game debugging network protocol

Postby temp_dummy » Sun Sep 19, 2010 12:37 am

So anyone volunteering on setting this up/ helping me to do so?

There are several things needed before serious development can start:
1) Enough user requests,
say like 75 people requesting this software to be build.
2) Hardware to run it on?
Can hardware of the competition administration be used or should this be a private endeavour.
3) If so, what are the restrictions on Database / Os / Programming language to be used?
4) Is there any architecture that can be reused/ someone willing to donate?
5) Does anyone feel like working out / validating this design find any caveats?

Things like that, and besides, I do not know how to write java.
It looks like C#, but different, so learning to use Node.js would be an additional challenge.

But Like I said before, I'm not starting this until I know people willa ctually use it.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: PROPOSAL: Game debugging network protocol

Postby DanielVonFange » Sun Sep 19, 2010 2:22 am

You could just take the existing TCP server's code, and run it with a long timeout.

2) Not on our hardware - it would be a private thing.
DanielVonFange
Brigadier-General
 
Posts: 149
Joined: Wed Sep 08, 2010 1:15 pm

Re: PROPOSAL: Game debugging network protocol

Postby dhartmei » Sun Sep 19, 2010 3:18 pm

I guess I'm missing something or misunderstood you, but I don't see what problem this would solve.

Let's say I run my bot against the TCP server, and in a particular game, at a particular turn, it does
something unexpected (strange order, timeout, or crash), and I'd like to debug why it did that.

The bot writes a log file for each game it plays, which includes the input (planets, fleets) it
receives on each turn. So I dig out the right log file, extract the right turn's input, and can then
re-run the bot locally with that input.

If the bot is deterministic (does the same thing every time it receives the same input), the problem will
re-occur. If I use random numbers, I'll have to use PRNG and note the seed in the the log to reproduce.
If the bot stores state between turns, I'll use a local engine (several are availabe in the forum) to replay
the game based on the logged game states, disabling any timeout restrictions.

When I re-run the bot like that, there are not timeouts, I can even attach a debugger and step through the
code line by line. And I can do so as many times as I like.

So, how would a debugging server help in this case? You do want to debug your bot, for one particular game, right?
Or do you want to probe the OTHER bot to see how it would react to different orders you make at progressing turns?
If the latter, I doubt most people would want to allow that :)
User avatar
dhartmei
Colonel
 
Posts: 65
Joined: Sun Feb 07, 2010 3:58 pm
Location: Basel, Switzerland

Re: PROPOSAL: Game debugging network protocol

Postby temp_dummy » Sun Sep 19, 2010 3:28 pm

See it as playing chess against a stronger opponent,
and you are really enjoying the game until you do a unbelievable stupid move (like crash).
There is no way of knowing of what the outcome would have been if you were able to continue playing or undo your move.

I think in the end the better bots will in no way be deterministic and respond to your moves as well as having a gameplan of their own.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: PROPOSAL: Game debugging network protocol

Postby dhartmei » Sun Sep 19, 2010 3:48 pm

Can you really ask a chess opponent, after a game, "what would you have done next had
my n-th move been X instead of Y"?

And he volunteers to answer as many such questions as you want?

I think that's giving away too much information to an opponent. He can deduce your strategy, implementation aspects, and bugs in your code. Which you can then use to beat him in the finals.

Also, there is simply no way for you to trust his information: he could answer the questions wrongly or misleadingly,
just to get the information from you in return. In reverse, there's no guarantee that you won't be running a different
version of the bot to answer reverse questions misleadingly.

I don't think this will work, sorry.
User avatar
dhartmei
Colonel
 
Posts: 65
Joined: Sun Feb 07, 2010 3:58 pm
Location: Basel, Switzerland


Return to Misc

Who is online

Users browsing this forum: No registered users and 2 guests