Oh no! Not another noob asking another noob question!eleven1

Come in here to talk about your sky-net style world-destroying super bots!

Moderator: Defcon moderators

User avatar
ChemicalRascal
level1
level1
Posts: 72
Joined: Fri Feb 19, 2010 12:55 pm

Oh no! Not another noob asking another noob question!eleven1

Postby ChemicalRascal » Tue Apr 13, 2010 10:43 am

Yeah, just playin' the stereotype there. Might as well make a poor attempt at humour.

Anyway, I've had a copy of the bot-version of DEFCON sitting dormant on my hard-drive for a while now. It had more or less left my mind completley, however, as I was sitting at my laptop, Radiohead playing in the background, a thought occurred to me.

That thought was that I was hungry. And hence, I went and acquired an apple, which triggered me to think of good old Sir Isaac Newton.

As I stood there, my apple un-bitten, thinking of the great man's achievements, when it suddenly occurred to me: Scientific progress would have been much more rapid, if they only had computers.

That, of course, got me thinking of things that would be much more rapid if computers were involved. Such as teeth-brushing. Quality control of cheap pencil erasers. Japanese calligraphy. Development of Paris' fashion trends.

This last thought, of course, got me thinking of something else: How to best rid the world of Paris' fashion industry. Eventually, I decided that world-wide nuclear warfare would be the most efficient method of doing so. And so I sat there for a few hours, thinking on how it would be best to start a world-wide nuclear war, when it dawned on me: World-wide nuclear warfare starting would be a lot more rapid if computers were involved.

[/totally fabricated anecdote]

Anyway, so, I've decided that I aught to have a crack at this bot development. Having a slight understanding of Python, I figured I'd use that for the coding.

Now, stop me at any point if I'm mixing things up, but my current understanding of the method of using the bot API with Python is to use Python's "ctypes" (15.15 in the Standard Library for 3.1.2) function library to call the functions from the API dll file. Whatever that means.

Hey, I'm a hacky-see-if-works-if-not-consult-help type of programmer. Bumbling through complicated stuff > Knowing what's going on. Any day.

Anyway, so I look through the files related to the API that I downloaded all those months ago. Version 1.57, which seems to be the most recent version available. Also seem to have 1.51 and 1.56, which may or may not have been installed under 1.57. Probably were.

Anyway, I couldn't find this mysterious dll file. Seems the standard API download on Robin's (Robins'? Robins?) API Page doesn't come with the "iv ai" bot either, which, of course, I found and quickly installed. Sadly, I still see no dll file for the API - only the appropriate dll for the bot. Somewhere down, down deep inside my very soul, I died a little.

And so I searched. For what seemed like a thousand aeons, I sifted through Robin's API-related pages, read the stickied topic, and did a search of the DEFCON root folder. But, alas, it seemed that all my efforts were in vain, because...

tl;dr: I can't seem find the API dll file/shared library thing. Could someone point me to it? Extra points if you've got it working with Python?
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Re: Oh no! Not another noob asking another noob question!ele

Postby Ace Rimmer » Tue Apr 13, 2010 3:45 pm

ChemicalRascal wrote:tl;dr: I can't seem find the API dll file/shared library thing. Could someone point me to it? Extra points if you've got it working with Python?

I can't answer that question at all, cause honestly I have no idea what you're talking about. However, I'd like to say welcome to the bot forum. There are currently three pseudo-active bot makers; martin, roflamingo, and myself.

I've been on a small hiatus, but will be diving in again in the next week or so.
Smoke me a kipper, I'll be back for breakfast...
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Tue Apr 13, 2010 9:28 pm

Man, You dont need to rewrite War and Piece to ask a simple question. Didnt entertain me at all.

Defcon will call the bot.dll , run it and export functions to it. Have a look at the import_from_defcon.h headerfiles in the bot sources.
I guess one would need to write a warpper dll in C to use python.

You can try joining the mailing list and ask for it.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Tue Apr 13, 2010 11:24 pm

trickser wrote:Man, You dont need to rewrite War and Piece to ask a simple question. Didnt entertain me at all.

Wait... there was a question in there? I must have missed it.

xander
User avatar
roflamingo
level3
level3
Posts: 404
Joined: Fri Jan 19, 2007 10:25 am

Postby roflamingo » Wed Apr 14, 2010 12:58 am

Ace Rimmer and I had started to write in LUA.

Sorry if someone pointed that out already.

Is LUA like Python?
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Wed Apr 14, 2010 1:22 am

btw, get your bots working till summer and safe for a trip to copenhagen
http://www.doc.ic.ac.uk/~rb1006/project ... ompetition
http://www.ieee-cig.org/
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Wed Apr 14, 2010 1:42 am

roflamingo wrote:Ace Rimmer and I had started to write in LUA.

Sorry if someone pointed that out already.

Is LUA like Python?


My bot is in Lua too, all the active bots are in Lua (not LUA, Lua).

Lua and Python are both scripting languages. That's about their only similarity, they're quite different. I think I prefer Lua.

trickser wrote:I guess one would need to write a wrpper dll in C to use python.


I saw it mentioned somewhere, possibly on the todo list of the guy who made the API, that there was a Python version. I remember asking about it and getting a load of blank looks, so I gave up and used Lua instead.
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Postby Ace Rimmer » Wed Apr 14, 2010 5:44 am

trickser wrote:btw, get your bots working till summer and safe for a trip to copenhagen
http://www.doc.ic.ac.uk/~rb1006/project ... ompetition
http://www.ieee-cig.org/

:shock: I mistakenly thought all competitions were 2009 and earlier! I need to do some serious work before August it appears, although I can't be there.
Smoke me a kipper, I'll be back for breakfast...
User avatar
ChemicalRascal
level1
level1
Posts: 72
Joined: Fri Feb 19, 2010 12:55 pm

Postby ChemicalRascal » Wed Apr 14, 2010 12:06 pm

trickser wrote:Man, You dont need to rewrite War and Piece to ask a simple question. Didnt entertain me at all.


Ah, but it was not meant to merely entertain. The post had an additional purpose: To gather data on how the general forum reacts when a newcomer bursts in and does something stupid, though not harmful, like writing half a page for a one-line question.

trickser wrote:Have a look at the import_from_defcon.h headerfiles in the bot sources.
I guess one would need to write a warpper dll in C to use python.

You can try joining the mailing list and ask for it.


Thanks for the idea, I've shot off an e-mail.
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Postby Ace Rimmer » Wed Apr 14, 2010 3:39 pm

ChemicalRascal wrote:
trickser wrote:Man, You dont need to rewrite War and Piece to ask a simple question. Didnt entertain me at all.


Ah, but it was not meant to merely entertain. The post had an additional purpose: To gather data on how the general forum reacts when a newcomer bursts in and does something stupid, though not harmful, like writing half a page for a one-line question.

Hehe, my sole purpose of posting was to parse your post and pull out the question for those that didn't want to read the rest of it. :P
Smoke me a kipper, I'll be back for breakfast...
User avatar
ChemicalRascal
level1
level1
Posts: 72
Joined: Fri Feb 19, 2010 12:55 pm

Postby ChemicalRascal » Fri Apr 23, 2010 5:12 am

Sadly, it doesn't seem that anyone on the mailing list heard my plea. So, I suppose, these forums are the only lifeline I've got for this.

trickster, could you elaborate on what you meant by a wrapper dll? I've done a little looking, and found something called SWIG, but it seems that I'll need a good knowledge of C or C++ or something, and as I have no knowlege of how C- or C++-related files even work, I doubt that I'll just be able to bumblingly fluke my way through this.
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Fri Apr 23, 2010 9:06 am

Unfortunately I dont have much clue either.

I meant, you need a little C program that hands the calls from Defcon to your python program and visa versa.
The Lua Bot or Lua API is just this. Except it will run a Lua program.

The source code is just there. Maybe you can figure how to hack it into a python bot.

I myself cant even compile it, so cant help you any further.


Or decide to learn Lua. Beeing a scripting language, it shouldnt be very complicated to handle. And the differences are..., well, its a programing language: loops, branches, variables and syntax, right?
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Postby Ace Rimmer » Fri Apr 23, 2010 3:07 pm

Surely if I can throw enough code on the wall to stick and produce a bot that can place units in an intelligent manner, move fleets in formation, launch timed silos at cities that meet certain criteria, alter the flight path of bombers and fighters in response to enemy units, and at least in one instance toss a naval nuke at enemy ships (before hanging the game), (all having almost zero knowledge about programming) then you can too! (in Lua).
Smoke me a kipper, I'll be back for breakfast...
User avatar
ChemicalRascal
level1
level1
Posts: 72
Joined: Fri Feb 19, 2010 12:55 pm

Postby ChemicalRascal » Sat Apr 24, 2010 6:18 am

Ah, but Python is what I know! Furthermore, it actually has a good name!

Above that, of course, is that by creating a bot in Python I'll be ensuring that my bot is:
- Has that more-unique gimmick of being coded in Python
- Is quickly prototypable
- Adding to my ability to program in Python while it... gets programmed?

And above that again is that I feel that, in some way, coding this bot will, somehow, better the language of Python, even if only by raising public awareness of the language.

Thanks again though, trickster, because you've given me an idea. I'll see if I can't get onto Peter and have a chat regarding this with him.
EvilRaptor
level0
Posts: 2
Joined: Mon Apr 26, 2010 8:04 am

Postby EvilRaptor » Mon Apr 26, 2010 8:10 am

Hi, I'm new to the forums and would like to know a couple of things about programming Defcon bots;
1. What languages/scripts can this be done in and how?
2. Is Introversions bot released publically, so I could perhaps get a gist of how the bots
3. Is there anywhere/who? who can help me in my quest?

Thanks, from a Introversion forum newbie. :|

Return to “AI Bots”

Who is online

Users browsing this forum: No registered users and 2 guests