Jump to content
Eternal Lands Official Forums
nathanstenzel

Prefered database for a bot

Recommended Posts

These question is for those of you who have actually made a bot or attempted to make a bot that would use a database.

 

Do you prefer PostgreSQL, MySQL or another database?

 

Does it actually matter to you or does the programming language you use have a good enough of an interface for any database you might want to use?

 

Do you see any problems with using a specific database for a bot?

 

Personally, I started fiddling with bot code which would use Python to interface with MySQL. I find some of the commands to be a little bit clunky for interfacing with MySQL, but perhaps they are really just named different and have the same functionality as the Python functions for interfacing with PostgreSQL. We use PostgreSQL at work, so maybe that might have something to do with it. It is just hard sometimes trying to figure out something different.

Share this post


Link to post
Share on other sites

One other thing to consider...

 

The choice of database technology is as much about the availability, price (if any) and ease-of-installation on both windows and linux platforms as it is about the interface and feature-set.

 

It can be the greatest database engine ever created, but if people can't get it or make it work after installing, then it's worse than useless.

Share this post


Link to post
Share on other sites

My bots are quite fine without using a database.

 

Even EternalTrivia, which has thousands of questions, still uses plain text files, loads them all at startup and creates an index in memory for easier access.

 

Works fine, since it's only readonly access. :)

 

I am working with databases since more than 20 years, DB2, Oracle, Informix and such, and i am still not totally convinced, that using them is a big advantage instead of writing your own data handlers.

 

Of course, you have an advantage in a big company by using databases, because the backup/restore process is always the same, because you can use the tools which comes with the database.

 

But for a bot i prefer to write my own access methods/tools. :)

 

Piper

Share this post


Link to post
Share on other sites

I like mysql, but whatever works tbh.... "If it's for free, it's for me!"

 

I've used oracle, db2, progress, mysql, mssql, and some others I can't even remember the names of... Each has their advantages/drawbacks. I'd have to say orcale is on the top of the heap, but it ain't free and it ain't cheap...

 

I agree with piper, if you're only going to have a single bot (or two) then, a database probably isn't necessary... However, if you're going to host a large number of bots, it can be quite handy.

 

Databases can also be nice if they support triggers and stored procedures. These allow you to share the processing load with the database where it makes sense. Often you can do some work on the database and save a lot of I/O by providing the answer instead of the raw data.

 

Being able to do adhoc queries is also a nice advantage to using a database.

 

My rule of thumb is: "best tool for the job". Whatever is the best fit for what you're doing...

Share this post


Link to post
Share on other sites

I had actually once considered writing an entire bot in sql and having the interfaces be some python to connect it to the game and a webpage.

 

One thing is for sure, for me, alot of functions and data processing would be part of every bot. Price checks via ingreds, for example.

 

Thanks all for the feedback so far. I think I know what I want to do now. I figure I should have a wrapper for MySQL so that I can use the same python interface as what it has for PostgreSQL. This way, if anyone wants to play with my code, they will have 2 databases to choose from and won't have to worry about different interfaces when they do it.

Share this post


Link to post
Share on other sites
One thing is for sure, for me, alot of functions and data processing would be part of every bot. Price checks via ingreds, for example.

I have much of this written in php 5.3, along with price history, multiple price types (bots, players, NPC,) etc. It's a much more daunting task than you might think at first. Not only do you have to replicate the entire item database with ~1000 items many of which have NPC prices, you need all of the recipes - some items even have multiple recipes. And ofc, the big challenge is simply keeping it up-to-date.

 

I have all of the logic exposed through a web app presently running on a local apache instance and keep many of the prices updated manually since I constantly idle on 3 tho I have opened the app up to a small number of friends. In any case, this type of data can't realistically be disseminated to players via bot response - not if you intend to show anything substantial such as how you derived your ings-based prices etc. Also ings don't always determine price if there is more or less demand or an item is a drop, so you need to show other prices as well as those you derive.

 

This is slightly off-topic since this conversation is specifically about bots, I just had to chime in when I saw what you were considering doing. Good luck with it anyway. ;)

Share this post


Link to post
Share on other sites
One thing is for sure, for me, alot of functions and data processing would be part of every bot. Price checks via ingreds, for example.

I have much of this written in php 5.3, along with price history, multiple price types (bots, players, NPC,) etc. It's a much more daunting task than you might think at first. Not only do you have to replicate the entire item database with ~1000 items many of which have NPC prices, you need all of the recipes - some items even have multiple recipes. And ofc, the big challenge is simply keeping it up-to-date.

 

I have all of the logic exposed through a web app presently running on a local apache instance and keep many of the prices updated manually since I constantly idle on 3 tho I have opened the app up to a small number of friends. In any case, this type of data can't realistically be disseminated to players via bot response - not if you intend to show anything substantial such as how you derived your ings-based prices etc. Also ings don't always determine price if there is more or less demand or an item is a drop, so you need to show other prices as well as those you derive.

 

This is slightly off-topic since this conversation is specifically about bots, I just had to chime in when I saw what you were considering doing. Good luck with it anyway. :)

Yes. I know it is alot to tackle. I actually did it once before for only about 20 items. It was some years ago and I would need to see if I still have the code or not. Besides the actual computation, the bot would need to be able to let you override some of the base prices for the sake of the computation or to send a link to a website where that can be done. I am far less concerned with what the market thinks about prices than people wish I was. If market price is below the base cost of an item, I would rather receive another devalued thing for it. Matching up trades would be totally different though.

 

Of course, something useful for bots with heavy computation involved would be a VIEW which is essentially a saved search which can more easily be implemented as part of another search and therefore allowing rather complex and recursive lookups like would be needed for a price calculating system. Granted, you could do it in a simpler method, but it is not as much fun. ;)

 

Using databases for effort tracking based value calculation is another thing that interests me. The concept is not too different from the previous. Both can be done recursively or incrementally.

Share this post


Link to post
Share on other sites

:icon4:

These question is for those of you who have actually made a bot or attempted to make a bot that would use a database.

 

Do you prefer PostgreSQL, MySQL or another database?

 

Does it actually matter to you or does the programming language you use have a good enough of an interface for any database you might want to use?

 

Do you see any problems with using a specific database for a bot?

 

Personally, I started fiddling with bot code which would use Python to interface with MySQL. I find some of the commands to be a little bit clunky for interfacing with MySQL, but perhaps they are really just named different and have the same functionality as the Python functions for interfacing with PostgreSQL. We use PostgreSQL at work, so maybe that might have something to do with it. It is just hard sometimes trying to figure out something different.

 

I had a question on Bots but I just got the answer before I could even speak-up...

I guess Dad was right. You DO learn more with your ears than with your mouth.

Question: all this to run 3 Guild Map Guard Bots ?

Answer: Nope.

 

ty,

tokie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×