The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2014-02-18 06:13:22

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

New Server Idea : Bots / AI Robbers

This is an idea I got from another thread, which I have posted a little there but it was a bit off-topic.  So to reiterate, I wanted to make a real topic for it to gauge any interest level in doing this.

My idea is for a Bots/AI Robbing server.  I mean this just for the offensive side of game-play, actual human players could still play on it to build their own defenses, but it will be impossible for anything but a bot to rob people based on extra limitations.  This would be an expected "peek map" server, with very tight timing constraints enforced on robbing.  Essentially it would be your program against a short clock.  So just building a sufficiently complex house could easily kill AIs even if you have no threatening traps.  In fact complexity will be preferred because of the forced commit mechanic, all bots will be considered committed at entry.

Due to the odd constraints other variables could and would be tweaked such as extra starting money or increased bounties to give defenses more ability to "timeout kill" robbers.  It's expected that if your program can't solve in the required time it simply not even bother doing a check-in on the house (non-solution will be death) but just timeout die.

    Specific Additional Server Rules   

No tools allowed - The idea is you have to brute force or elegantly solve the map using a computer program within a small amount of time.  Tweaking other money sources would be arranged to keep the economy viable.

Wife & Kids removed - Without tools on the server it doesn't make any sense to have them in, and only vault robbing will be considered success.

Leaving not allowed (except by vault) - If a bot enters a house it is considered to be "fully committed" to doing a successful run.  This is necessary to enforce timing parameters and so the bot cannot do "offline" solving and come back later with a solution prepared.  Only a vault penetrating solution will keep a "player" alive after entry.

Extra length chills - Since this is a "peek map" server, players would need to re-layout their home after anyone has their chills run out.  A longer chill timer would allow extra buffer time for necessary house changes.  Due to the forced layout changing, additional money over time (salary) could be provided to players.

Very short robbing check-outs - Houses would only be allowed to checkout for a very small amount of time (possibly just several seconds).  No active pinging is accepted, just check-ins.  This is where ruling out human offense comes in, it will be some value unrealistic to actually play the game at on a keyboard and monitor.  Since it's a peek-map server any human player could work it out given even a minute to play, so the robbing time allowed will be much lower.  Once people have actually functioning bots this number could be adjusted more to allow actual AI competition based on real solve times, and provide additional risk for lower performing bots or even simply risk in very complex houses.

------

Like I mentioned on the other thread, if there are enough people actually interested in playing or collaborating, either as pure defensive players or as a mix of both defense and programming, then I would consider setting such a thing up or helping run it.

Unfortunately my guess is this would not generate enough interest to be an actual sustainable server, but maybe there are enough code enthusiast (& defense only) players to make it.

Offline

#2 2014-02-18 06:25:25

Pandamonium
Member
Registered: 2014-02-10
Posts: 123

Re: New Server Idea : Bots / AI Robbers

what do you mean by "peek map"?

Offline

#3 2014-02-18 06:26:37

colorfusion
Member
Registered: 2013-04-02
Posts: 537

Re: New Server Idea : Bots / AI Robbers

Nobody is going to be able to make an AI that can navigate most TCD houses. Anything much more than a wood wall maze with perhaps some dogs would be way too complicated for the bot to work a way through.

An interesting idea, but not really going to work.

Last edited by colorfusion (2014-02-18 10:29:33)

Offline

#4 2014-02-18 07:12:21

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

Re: New Server Idea : Bots / AI Robbers

I've got nothing to hold up as proof-of-concept so you might be right about it on the complexity side.  I've already got ideas for things way more than mazes though.

Last edited by PlasmaChroma (2014-02-18 07:16:05)

Offline

#5 2014-02-18 07:39:05

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

Re: New Server Idea : Bots / AI Robbers

Pandamonium wrote:

what do you mean by "peek map"?

I mean a non-restrictive policy on the complete house data, look at whatever you like.  Something that would give you a huge advantage if it was running a normal server.

Offline

#6 2014-02-18 10:00:37

Archonn
Member
Registered: 2014-02-02
Posts: 26

Re: New Server Idea : Bots / AI Robbers

Thats interesting. I do enjoy progamming, and im quite good at it (lol). But getting into something new like this is hard, so i'd like a bit of help knowing how to read the map data and send the robber around. After that, I could figure out the logic myself

Offline

#7 2014-02-18 10:04:09

jere
Member
Registered: 2013-05-31
Posts: 540

Re: New Server Idea : Bots / AI Robbers

Interesting idea. Someone would have to work up a guide to make the barriers to entry really low here.....


Golden Krone Hotel - a vampire roguelike

Offline

#8 2014-02-18 10:28:34

MMaster
Member
Registered: 2014-02-12
Posts: 325

Re: New Server Idea : Bots / AI Robbers

I would be interested, but I don't have time for it sad

However I can help with the game sources as I'm quite familiar with them already (I'm running my own modified server for testing) so if someone would be interested in how to parse house maps, how to build move list, how to simulate the move list on the map, etc. I will be happy to help. I can also provide the server if needed.
From my experience this has no future as there is very small group of people interested in and capable of implementing bots for games. And as others have said it is certainly not an easy task for this game. If you can get enough people interested I would suggest to make a team that will together try to build 1 bot program :-)


...

Offline

#9 2014-02-18 11:41:50

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

Re: New Server Idea : Bots / AI Robbers

@MMaster: You are probably right, even getting a half functional bot that could solve even a few simple houses would be quite an achievement.  Until anyone can show that type of progress I don't think people would get very exited about even trying it.  Jumping onto a full out multi-player concept is probably the totally wrong angle to take on it, even a research project to prove out a simple solver and share some ideas would be a big goal.

@jere: That might be possible in terms of structuring some framework where users could focus on just one area rather than hunting all over (I'm not even to this point).

@Archonn: The map data is relatively simple, it's basically just an array of "ID:State", separated by index with # tags.  Playing around with CastleDraft.com for a couple minutes you can get a pretty quick picture of what the formatting is like.  Once this comes it'll get split out into separate things, but at some point it's all just clumped together in there.


Right now, what I'm most strongly considering is a totally offline solver that would take a string like seen @ castledraft.com and operate on that independently.

Offline

#10 2014-02-18 12:30:12

booper
Member
Registered: 2014-02-15
Posts: 35

Re: New Server Idea : Bots / AI Robbers

1) if you give the bot the full map, what is to stop the bot from simulating the environment and brute forcing the house offline (inside a castle doctrine simulation or on a separate server) without any risk of death on the bot server? chills would not be as relevant, either.

this is a cool idea, and i would write a bot to do it, but 2) the code for solving these types of problems is usually a mix of logic, heuristics (fuzzy logic with guessing) and brute force (which is guaranteed death). maybe the goal should be to see which bot can solve the puzzle in the shortest number of steps?

Offline

#11 2014-02-18 12:34:48

colorfusion
Member
Registered: 2013-04-02
Posts: 537

Re: New Server Idea : Bots / AI Robbers

booper wrote:

1) if you give the bot the full map, what is to stop the bot from simulating the environment and brute forcing the house offline (inside a castle doctrine simulation or on a separate server) without any risk of death on the bot server? chills would not be as relevant, either.

this is a cool idea, and i would write a bot to do it, but 2) the code for solving these types of problems is usually a mix of logic, heuristics (fuzzy logic with guessing) and brute force (which is guaranteed death). maybe the goal should be to see which bot can solve the puzzle in the shortest number of steps?

His idea is that once you enter the house to get the map, you have to solve it really fast. Exiting via the door kills you, so you can't exit, brute force, then come back.

There'd also be way too many step patterns to check via pure brute force.

Last edited by colorfusion (2014-02-18 12:35:27)

Offline

#12 2014-02-18 12:48:32

Archonn
Member
Registered: 2014-02-02
Posts: 26

Re: New Server Idea : Bots / AI Robbers

PlasmaChroma wrote:

Right now, what I'm most strongly considering is a totally offline solver that would take a string like seen @ castledraft.com and operate on that independently.

Dont forget, you'd have to write all the electricity stuff

Offline

#13 2014-02-18 12:57:07

MMaster
Member
Registered: 2014-02-12
Posts: 325

Re: New Server Idea : Bots / AI Robbers

booper wrote:

1) if you give the bot the full map, what is to stop the bot from simulating the environment and brute forcing the house offline (inside a castle doctrine simulation or on a separate server) without any risk of death on the bot server? chills would not be as relevant, either.

The idea is that the bot will simulate the environment locally and execute only the final solution. That by itself would be great achievement. When we talked about it in other thread  the complexity of all the traps/electronics/animals in house together is really really high. We were talking about brute force solution and even though the problem is certainly solvable, jere was right with his calculations:

jere wrote:

4^2000 is a decimal number with 1200+ digits

That was very basic calculation of number of possible steps that need to be evaluated by bot in house where maximum number of steps from start to vault is 2000. Of course the numbers are not exact :-D, but you get an idea why it is difficult to do it in short time.


...

Offline

#14 2014-02-18 13:16:03

booper
Member
Registered: 2014-02-15
Posts: 35

Re: New Server Idea : Bots / AI Robbers

i  agree that simulating the environment is complex. the writing a bot is very complex, too, and i haven't seen how the number 4^2000 was arrived at, but i guess it is if the bot were to look at every single possible path in an empty house (2000 tiles with 4 directions to move in?). there are ways of pruning that number significantly. (i haven't read the mentioned thread, but i would like to :-)


1) once you visit a tile, you don't need to figure out all the other possible paths to that tile, necessarily. (if you have 'sequences' of events, then you do need to figure out the order to visit tiles, though)
2) only passable squares need to be considered in the brute force (since there are no tools for moving past walls)
3) this problem should scale horizontally, by spinning up multiple processes across multiple machines, as long as you give each process a different seed (and determine an idempotent strategy) to brute force the house with.

re: peek map: i didn't realize it was only given once you enter a house (i didn't see that mentioned in the original rules - 'peek map' is/was pretty vaguely defined).

Offline

#15 2014-02-18 13:31:14

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

Re: New Server Idea : Bots / AI Robbers

What I'm considering mapping out for electricity is a large table that contains every switch state combination as input and generates a separate map.  I think this data would be something like 2^(switches) possible maps.

Then identifying which of those states create conflicts with a vault path line (this is the first step to compute) and identifying which map states allow passage vs which create conflict.

Those two data sets would be pretty close to solving a basic combo lock if you had paths established to switches (or at least the minimum diff state from entry state).  This is still somewhat far from doing magic dance.

I think an ideal solution would be a combo of heuristics and some minimal brute mixed in when that fails.

Offline

Board footer

Powered by FluxBB 1.5.8