Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : DRODbot (A robot that plays DROD)
New Topic New Poll Post Reply
Poster Message
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged

File: DRODbot playground.hold (889 bytes)
Downloaded 50 times.
License: Public Domain
icon DRODbot (+9)  
Hi,

I recently got into DROD again, and decided that a reasonable thing to do was to try making a DROD-playing program. I've got the code on GitHub. I've only tried it on Linux, but I'm only using cross-platform dependencies so it should work on Mac and Windows too. If someone ends up trying it, let me know if you can get it to work. :) I've attached an example hold with a room it should be able to complete.

It's meant to be run with DROD in a separate window, and uses screenshots and simulated keypresses/clicks to interface with it. So far it can move Beethro to a victory token, as long as the room has the Foundation style, has default lighting and weather, and doesn't have anything more interesting than walls in it.

My ambition is that this will eventually be able to solve more classes of rooms than just mazes. It will probably never be able to solve an arbitrary room, but I'm thinking at least:
* Orb/door puzzles
* Trapdoor puzzles
* Some simple combat

I also want to make the image processing more robust, so it handles more themes and lighting conditions. Right now it only looks at the average color in a tile, which won't really work long-term.

Anyway, I just wanted to share in case it makes someone happy. :) If people are interested, I can post updates whenever I get it to do something impressive.
12-25-2020 at 07:37 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Illusionist
Level: Master Delver
Avatar
Rank Points: 165
Registered: 05-27-2020
IP: Logged
icon Re: DRODbot (+1)  
I'm going to try it. Not sure if it's the proper place for it, but whatever. I hope that you had some nice holidays. I was kinda busy working and will work next week hard, but it's always nice incredible to see good old DROD being used in new ways, albeit you should check what Skell did with DROD Touch
cheerios
12-27-2020 at 03:56 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+3)  
Thanks, I wasn't aware of DROD Touch but that's really cool!

I hope I got the right board, since "a robot that plays DROD" is in the description. ;) (Next on the list: post about Frank Lloyd Wright in 'Architecture'.)
12-27-2020 at 09:08 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: DRODbot (+1)  
This sounds amazing!

Not to derail your original approach which has its benefits. But if you want to have your bot run headlessly against DROD, the DRODLib library will give you a logical representation of the game that can be updated with issued commands.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
12-30-2020 at 05:09 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+1)  
Thanks!

While I'll keep the current approach for actually playing the game (since it looks cooler in action), the AI will need to simulate future moves at some point. DRODLib is sure to be useful there, to avoid re-implementing all of the game logic.
12-30-2020 at 08:33 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: DRODbot (+1)  
Svante wrote:
the AI will need to simulate future moves at some point. DRODLib is sure to be useful there, to avoid re-implementing all of the game logic.
Interesting. I see how you could construct your own version of a level with DRODLib that is probably going to match what is in the screenshot. Then there are lots of possibilities.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
12-30-2020 at 10:39 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+4)  
Yeah, that's what I'm thinking. It won't be trivial since it won't know the movement order, but that's part of the fun.

I made a short video demoing the state of DRODbot when i created this topic. (I've come farther since then, but that part isn't ready to show yet.)

Behold:

01-03-2021 at 12:05 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+4)  
(I assume double posts are fine in a thread like this?)

I improved the way DRODbot interprets the screenshots, so it can now handle things on top of other things. Still no support for different light levels, maybe sometime in the future. Image processing is hard...



To have some concrete goals, I'll have it play KDD 2.0 (with alpha blending turned off) until I encounter a room I can't make it solve. It should be able to handle the first level at least, but I don't remember how quickly the difficulty ramps up after that.
01-09-2021 at 01:58 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+6)  
Now DRODbot can walk around in a level, and even solve orb puzzles. Very slowly, but still.



So as I mentioned in the video, I will try using DRODLib to simulate the results of various actions when searching for a solution. Hopefully it will be faster since the heavy part will use C++ instead of Python. And I will be more motivated to optimize it when I'm not going to replace it immediately.
01-30-2021 at 11:56 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+3)  
I managed to partly compile DROD and call DRODLib from my code! That's not very visual, so here is a visualization (and possibly botched explanation) of A* search in DRDObot:



When I was looking around for pointers I found my own posts from 2007, and apparently I already compiled DROD once half a lifetime ago (mine). I have no memory of this, but the Internet doesn't lie :D

As I mentioned, I'll play around with some other algorithms next. In particular, I'd like to try depth-first. That should play nicely with DROD's undo feature, so I don't have to recreate the room from scratch on every iteration.
05-01-2021 at 03:43 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+6)  
I think I'll stop making promises about what will happen next time, I never keep them. I didn't really do a deep-dive in different search algorithms, instead I kept going and now DRODbot can deal with monsters!



Click here to view the secret text


DRODLib is really well suited to this. Even when jumping back and forth between states on different "branches" in the search, being able to undo and redo actions helps a lot with performance.
06-22-2021 at 02:15 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+11)  
And now, the first level of KDD is completed!



The movement order issue was simpler than I thought. I discarded right-clicking initially, because I experimented early on with clicking every square which took ages. But only clicking the monsters is pretty okay, even in a room like 7N2W.
07-18-2021 at 02:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5058
Registered: 02-04-2003
IP: Logged
icon Re: DRODbot (+2)  
Congratulations on completing First Level!

Wow! This is such a fun proof of concept. Keep posting!

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
07-20-2021 at 10:51 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+2)  
Thanks :) I'll keep this up as long as I'm making some progress.
07-23-2021 at 05:48 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: DRODbot (+3)  
Svante wrote:
And now, the first level of KDD is completed!
Robots are taking all our jobs.

Seriously, this is amazing! Haven't followed the thread for a while, and then came back to find you had created life. Well done!

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-10-2021 at 05:00 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+2)  
ErikH2000 wrote:
Robots are taking all our jobs.

I think this robot helped me get a new job, in fact!

Yeah, so I've been too busy job searching to do much DRODbotting lately. But now that's done, so hopefully I'll manage to teach it roach queen manipulation soon. Should be fun!
09-21-2021 at 04:22 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: DRODbot (0)  
Svante wrote:
I think this robot helped me get a new job, in fact!
I don't know what particulars you can share, but it sounds awesome.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-23-2021 at 07:11 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+3)  
ErikH2000 wrote:
I don't know what particulars you can share, but it sounds awesome.

So I work as a software developer and decided it was time to change jobs. One company I applied to asked to see a personal project, to gauge code quality and such. I chose DRODbot, since it's my most recent project and the one I'm proudest of, and we ended up talking about it for a bit during the interviews.

They decided they wanted to hire me, I decided I wanted to work there, and now I'll be working with game streaming (in the "you're playing a game that is actually running on a server"-sense, not the "you're watching a streamer play a game"-sense).

I don't know if it was the deciding factor, but they seemed impressed and I didn't do any other sort of code assignment. So I like to think I got hired at least partly because of to DRODbot.

Not the most spectacular story, but still pretty cool :)
09-23-2021 at 03:54 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Spooty
Level: Goblin
Rank Points: 15
Registered: 05-17-2007
IP: Logged
icon Re: DRODbot (+5)  
Pretty cool stuff. I'm an ex-developer (Maxis/EA), and this kind of thing has always intrigued me. Long ago, I worked on a solver for a vaguely similar turn-based puzzle game (LaserTank), and built it into the game code (C source was released by the developer himself). I made a bit of headway, but once I left the industry, I haven't coded in many years.
I happen to be rediscovering DROD for the first time in 14 years (so the login tells me), so I'll check in on this to see how you're doing. Have fun and good luck!
09-25-2021 at 02:33 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Svante
Level: Master Delver
Avatar
Rank Points: 169
Registered: 04-23-2005
IP: Logged
icon Re: DRODbot (+1)  
Spooty wrote:
Pretty cool stuff. I'm an ex-developer (Maxis/EA), and this kind of thing has always intrigued me. Long ago, I worked on a solver for a vaguely similar turn-based puzzle game (LaserTank), and built it into the game code (C source was released by the developer himself). I made a bit of headway, but once I left the industry, I haven't coded in many years.
I happen to be rediscovering DROD for the first time in 14 years (so the login tells me), so I'll check in on this to see how you're doing. Have fun and good luck!

Neat! Gotta love open source games, so you can do stuff like this.
09-25-2021 at 05:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : DRODbot (A robot that plays DROD)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.