Universe Sandbox

General Category => Everything Else => Topic started by: vh on November 27, 2012, 08:07:13 PM

Title: Map War Bot
Post by: vh on November 27, 2012, 08:07:13 PM
Map War Bot Rules:

Rules:
Like all the other map wars mostly. Blockade works the same way, with the adjustment that a sea blockade will block 70% of trade income, a land blockade will block 30% of trade income, and both combined will block 100%.

Income: 5 + seazones + 2*landzones + 2*sqrt(income of all nations you're trading with)

Take a zone: 5 resources
Take an occupied zone: 10 resources
Take a sea zone: 3 resources
Take an occupied sea zone: 5 resources

Distance multipliers are in the form 2^(n) where n in the amount of zones between the one you want to conquer and the closest one you have no diagonals

Instructions:
The bot instructions must be exact and return the same result no matter who computes the turn. In addition, they should be clear and everyone should be able to understand them. You can have communication between bots as long as it's clear.

the map wraps sideways but not vertical
Title: Re: who would interested in a
Post by: FiahOwl on November 27, 2012, 08:15:58 PM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '92319'.

Title: Re: who would interested in a
Post by: atomic7732 on November 27, 2012, 08:41:39 PM
sure
Title: Re: who would interested in a
Post by: blotz on November 28, 2012, 05:06:40 AM
another game?
-_-
Title: Re: who would interested in a
Post by: Hellpotatoe on November 28, 2012, 06:29:05 AM
another game?
:D:D:D
YES :D
Title: Re: who would interested in a
Post by: atomic7732 on November 28, 2012, 06:31:33 AM
another game?
-_-
And you don't have to play any of them.
Title: Re: who would interested in a
Post by: vh on November 28, 2012, 03:55:48 PM
i thought we'd do a grid-like map which makes stuff a bit easier and simpler. *giggles at darvince because this took me 10 minutes to make*
Title: Re: Map War Bot
Post by: atomic7732 on November 28, 2012, 04:19:09 PM
Sovk.

nationK = spawn continent[grid.random()]
nationL = spawn continent[grid.random()]
nationM = spawn continent[grid.random()]

for all:
if peace: claim max land along coast

for nationL:
if bordering any:
if zones(nationL) > (zones(any) + 15):
attack with (all resources - 10)
develop existing land or claim more land

for nationM:
trade all
attack if attacked()
Title: Re: Map War Bot
Post by: vh on November 28, 2012, 04:37:10 PM
i was thinking of how we would label each square.

maybe we could do it like this:
each large square is 2 units x 2 units
each small square is 1 units x 1units
then, the bottom left corner is position 0,0
the position of each zone is x,y, where x is the amount of units horizontally from the bottom left point to the bottom left corner of specified zone. y is the amount of vertically from the bottom left point to the bottom left corner of the specified zone. If a position does not fall on the bottom left corner of any zone, but lands in a zone, then it designates that zone anyways
Title: Re: Map War Bot
Post by: vh on November 28, 2012, 04:43:57 PM
'things':

attacked(player) #returns a list of player's zones that have been attacked and conquered
borderzones(player) #returns a list of a player's border zones (corners do not count)
playerzones(player) #returns a list of a player's zones
income(player) #income of player
turn() #returns turn number
blockade() #returns bool value for blockade.
#(for all applicable functions), you can add a 'turn' argument to retrieve data from previous turns


yeah i should get started on the simplified mw instructions.
Title: Re: Map War Bot
Post by: vh on November 28, 2012, 04:45:19 PM
any basic python modules or builtins are allowed i guess, and anything basic from other programming languages. so you can have random numbers, time modules, etc.
Title: Re: Map War Bot
Post by: FiahOwl on November 28, 2012, 04:47:14 PM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '92370'.

Title: Re: Map War Bot
Post by: vh on November 28, 2012, 05:08:18 PM
added instructions
Title: Re: Map War Bot
Post by: vh on November 28, 2012, 05:08:42 PM
so does anyone have some functions() to suggest if not i guess we can start soon.
Title: Re: Map War Bot
Post by: vh on November 28, 2012, 05:12:43 PM
oh yeah
zonestatus(x,y) #returns [sea/land, occupationstatus]

also, how do people like the idea of only starting on a coast allowed, as if we'd arrived on boats and are now fighting over the small chain of islands
Title: Re: Map War Bot
Post by: atomic7732 on November 28, 2012, 06:06:59 PM
small chain of islands
archipelago

eh, it doesn't matter.
Title: Re: Map War Bot
Post by: vh on November 29, 2012, 03:12:16 PM
game will start in a week you can submit and edit your bots up until the game starts
Title: Re: Map War Bot
Post by: blotz on November 29, 2012, 07:24:12 PM
uhh,

loop(
if nothing adjacent
pass

if something adjacent
ATTACK WITH ALL YOU MIGHT, He, The Master of Bongatar, the greatest to Rise, defeater of All but the Creator of the Universe, Dan Dixion.
)
oh btw can we attack diagonals?
Title: Re: Map War Bot
Post by: FiahOwl on November 29, 2012, 07:28:00 PM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '92443'.

Title: Re: Map War Bot
Post by: vh on November 29, 2012, 07:33:54 PM
edit: i've changed my mind:
no randoms allowed because those are hard. if you want a random function, do something like sum(all incomes) mod (the number of zones you have)

the only rule for the bot directions now is that anyone following your code will come up with exactly the same result. in addition, it shouldn't take more than 20 minutes to execute your code
the coordinate system mentioned above is helpful but not required.
Title: Re: Map War Bot
Post by: blotz on November 29, 2012, 07:37:29 PM
Kip so will my thingy work?
Title: Re: Map War Bot
Post by: vh on November 29, 2012, 07:37:43 PM
wait so you set west to *W and north to *N what i don't get this completely@ darvince
Title: Re: Map War Bot
Post by: blotz on November 29, 2012, 07:38:17 PM
Kip so will my thingy work?
Title: Re: Map War Bot
Post by: Darvince on November 29, 2012, 07:47:05 PM
wait so you set west to *W and north to *N what i don't get this completely@ darvince
yes i set these:
*S to south
*N to north
*W to west
*E to east
Title: Re: Map War Bot
Post by: vh on November 29, 2012, 07:48:00 PM
wait yu deleted your code wtf
Title: Re: Map War Bot
Post by: vh on November 29, 2012, 07:48:13 PM
oh for secrets i c, ic
Title: Re: Map War Bot
Post by: vh on December 16, 2012, 03:36:18 PM
s
Title: Re: Map War Bot
Post by: Hellpotatoe on December 17, 2012, 03:36:18 AM
you mean 21/12/12
Title: Re: Map War Bot
Post by: atomic7732 on December 17, 2012, 06:21:11 AM
20121221
Title: Re: Map War Bot
Post by: Hellpotatoe on December 17, 2012, 11:01:26 AM
ok since everyone has probably forgotten this:

you have one week to instruct your bots and begin the game. The only restrictions on the instructions are:
-that they must take a resonable time to simulate
-anyone simulating will get the same result/turn
-you may have one two digit random number per day, determined by the decimal digits of the dji at noon, est
-the instructions must be understandable.
then, the order in which people take their first turns will be the order of the game.
HOWEVER; the first three turns are special: you will not reveal your bot code yet, but will follow the directions exactly. after three turns, you must reveal your code and everyone will be able to ensure that you have followed the rules of your bot and continue doing so.

game will start on 12/21/12, the end of the world. how fitting.
hey, can you give me a example?
Title: Re: Map War Bot
Post by: vh on December 17, 2012, 12:54:27 PM
yeah ok here's an example:

each turn(
for every nation(
hostility = hostility -1
)
request alliance with atomic or smjjames
accept alliance with anyone if they have asked
if someone has attacked me(
for every zone they have taken
hostility=hostility+5
)
if i have enough resources(
if the western most region is empty, then conquer it
)
if hostility against any nation> 20(
attack 3(hostilty-20) zones, or as many as i have resources left for
)
end turn
)
Title: Re: Map War Bot
Post by: Hellpotatoe on December 18, 2012, 03:45:45 AM
oh god, but thats not your code, yeah? :P

I'll make one

make'd :P
Title: Re: Map War Bot
Post by: Hellpotatoe on December 23, 2012, 04:07:50 AM
"the game will start on 12/21/12
they saied
Title: Re: Map War Bot
Post by: vh on December 23, 2012, 06:29:28 AM
yes, i cannot join right now but you can!
Title: Re: Map War Bot
Post by: Hellpotatoe on December 23, 2012, 06:47:14 AM
mapp pplease
Title: Re: Map War Bot
Post by: vh on December 23, 2012, 07:02:24 AM
on first page!
Title: Re: Map War Bot
Post by: Hellpotatoe on December 23, 2012, 11:29:13 AM
on first page!
OHKOL

*I, E and N spawned
*NIE alliance formed
*Colors:
I: 255,0,0 (FF0000)
E: 255,106,0 (FF6A00)
N: 255,216,0 (FFD800)
alliancerequest(fiah; vh)
traderequest(fiah; vh)
Title: Re: Map War Bot
Post by: vh on December 23, 2012, 02:32:52 PM
Hellpotaote: the term alliance is not an official term like trade is, so other bots may not have a alliance acceptance thing. For example, my bot will not attack you if you don't attack it, so it is kind of like an alliance, although I haven't used the word.

Also, we're only supposed to have one nation or bot each, but since no one seems to be playing, if no one else joins the game in the next two turns, I'll change the rules to every one controlling three bots
Title: Re: Map War Bot
Post by: Hellpotatoe on December 23, 2012, 05:31:18 PM
ok :(
Title: Re: Map War Bot
Post by: Darvince on December 23, 2012, 07:47:40 PM
i will join with a bot.

*D spawned at seazone x: -17 y: -4 from top-left corner
*D requests "alliance" with all players it is not touching
*D requests trade with all nations
*D expands, with these directions in priority, first to last
1. East
2. West
3. North
4. South
if more resources than required for 4 new zones(
1. Northeast
2. Southwest
3. Southeast
4. Northwest
)

for all nations(
hostility this turn = hostility last turn - number of non-touching zones/10
accept incoming alliances if non-touching
accept all incoming trades
)

if touching other nation(
hostility+1 for every other touching zone #equation is floor(number of touching zones/2)
hostility >= 10(
take over other nation's zones in this priority:
1. South
2. West
3. North
4. East
5. Southwest
6. Northeast
7. Southeast
8. Northwest
)
)
Title: Re: Map War Bot
Post by: tuto99 on December 23, 2012, 08:00:16 PM
How can I join this game?  :D
Title: Re: Map War Bot
Post by: Hellpotatoe on December 24, 2012, 03:56:05 AM
make your code and join! :D
but dont show it like darvince,
HOWEVER; the first three turns are special: you will not reveal your bot code yet, but will follow the directions exactly. after three turns, you must reveal your code and everyone will be able to ensure that you have followed the rules of your bot and continue doing so.
Title: Re: Map War Bot
Post by: FiahOwl on December 24, 2012, 05:19:19 AM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '94424'.

Title: Re: Map War Bot
Post by: Hellpotatoe on December 24, 2012, 05:43:40 AM
We lready started, but we can wait you :)
Title: Re: Map War Bot
Post by: FiahOwl on December 24, 2012, 05:58:41 AM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '94427'.

Title: Re: Map War Bot
Post by: vh on December 24, 2012, 06:45:53 AM
the point of not showing the code is so that someone else does not steal you ideas

And yes we can start later if someone is busy, no hurry
Title: Re: Map War Bot
Post by: vh on December 24, 2012, 06:50:21 AM
Darvince your code could do with these modifications:

first, instead of requesting "alliance" just minus 5 hostility to make sure you won't attack them or something. Alliance is not a recognized thing

Also, you should define northeast better. If my starting position is 0,0 and I own zones 2,3 and 3,2 which one is most NE zone?
Title: Re: Map War Bot
Post by: tuto99 on December 24, 2012, 01:59:56 PM
make your code and join! :D
but dont show it like darvince,
HOWEVER; the first three turns are special: you will not reveal your bot code yet, but will follow the directions exactly. after three turns, you must reveal your code and everyone will be able to ensure that you have followed the rules of your bot and continue doing so.
Code?
Title: Re: Map War Bot
Post by: vh on December 24, 2012, 02:12:31 PM
Tutu do you know how all the other map wars on this forum work?

Well this is an extreremely simplified version, but instead of playing the game, you give a set if instructions to a "bot" and the bot uses all the instructions to play the game

Of course because this bot doesn't exist, you'll be the bot and play according to the set of instructions you invented at the start of the game

This set of instructions is the code.
Title: Re: Map War Bot
Post by: Hellpotatoe on December 24, 2012, 02:17:19 PM
like steps of what your nation have to do
example:

each turn(
conquer zones)
conquer(
first north;
them south;
them east;
them west)
accept(
trades;
alliances;)
attack others if(
they're bordering me)

^
simple example
Title: Re: Map War Bot
Post by: tuto99 on December 24, 2012, 07:37:32 PM
Tutu do you know how all the other map wars on this forum work?

Well this is an extreremely simplified version, but instead of playing the game, you give a set if instructions to a "bot" and the bot uses all the instructions to play the game

Of course because this bot doesn't exist, you'll be the bot and play according to the set of instructions you invented at the start of the game

This set of instructions is the code.
Ehem, Tuto.
And no, I don't how the other map wars on the forum work. Mind you, I don't participate in any of the forum's activities/games.
Title: Re: Map War Bot
Post by: Darvince on December 24, 2012, 08:49:28 PM
you should participate in map war c
Title: Re: Map War Bot
Post by: tuto99 on December 24, 2012, 10:59:28 PM
A'ight.
Title: Re: Map War Bot
Post by: vh on May 10, 2013, 07:28:49 PM
bump



updated op

the game starts today and there will be one week for everyone to join.

you don't have to reveal your bot instructions for the first three turns if you're afraid that someone will steal it. after that you should make the code public.
Title: Re: Map War Bot
Post by: blotz on May 10, 2013, 07:30:53 PM
expand west
if something in the way
expand north
if something in the way
expand south
if something in the way
expand east

if attacked
attack
Title: Re: Map War Bot
Post by: vh on May 10, 2013, 07:32:13 PM
map is here edit on your own

http://universesandbox.com/forum/index.php?action=dlattach;topic=8412.0;attach=19778;image (http://universesandbox.com/forum/index.php?action=dlattach;topic=8412.0;attach=19778;image)


also bong that code is invalid because 'something in the way' and 'expand' is not clearly defined. also undefined is the definition of 'attacked' and who you 'attack'
Title: Re: Map War Bot
Post by: blotz on May 11, 2013, 03:52:13 AM
def expand
conqure square

def attack
attack square that was attacked
expand west
if something in the way
expand north
if something in the way
expand south
if something in the way
expand east

if attacked
attack
Title: Re: Map War Bot
Post by: Hellpotatoe on May 11, 2013, 04:56:52 AM
bump



updated op

the game starts today and there will be one week for everyone to join.

you don't have to reveal your bot instructions for the first three turns if you're afraid that someone will steal it. after that you should make the code public.

Oshi-
I was with a very good 'script' and stuff, but I deleted it cause this died :(
Title: Re: Map War Bot
Post by: vh on May 11, 2013, 08:53:21 PM
hehe sorry about that
Title: Re: Map War Bot
Post by: blotz on May 12, 2013, 08:41:04 AM
inb4 hellpotatoe makes a good script again and then this dies again
Title: Re: Map War Bot
Post by: Hellpotatoe on May 12, 2013, 11:34:17 AM
inb4 hellpotatoe makes a good script again and then this dies again
Title: Re: Map War Bot
Post by: FiahOwl on May 12, 2013, 12:27:03 PM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '105452'.

Title: Re: Map War Bot
Post by: vh on May 17, 2013, 07:34:41 PM
turn 1 ends at forum midnight



you can always join late
Title: Re: Map War Bot
Post by: tuto99 on May 18, 2013, 08:30:42 AM
I guess I'll join.
Title: Re: Map War Bot
Post by: vh on May 18, 2013, 08:46:42 AM
ok.

tuto gets into turn one because i was too lazy to update :P
Title: Re: Map War Bot
Post by: blotz on May 18, 2013, 09:12:00 AM
1,4 is like the round and turn
Title: Re: Map War Bot
Post by: blotz on May 18, 2013, 04:57:15 PM
everyone has 7 resources

blotzbot sends trade request to everyone

slow down i still have to make my code

P.S. ctrl+a
Title: Re: Map War Bot
Post by: vh on May 19, 2013, 05:35:15 AM
i've changed my mind about something. bots have to be in when you take turn two.

this may be worrying because the person who submits first might have his bot copied by the person who submits next.
however, i have a solution that you don't have to use
during turn two, instead of submitting your bot
1. you'll put your bot into a text file named 'bot.txt'
2. download the hashtxt.py program and put it in the same directory/folder as the bot
3. run hashtxt
4. take the hashed.txt and submit that

then later, when everyone is finished submitting either their bot or hashed txt you can upload your bot.txt
you then don't need to worry about anyone else copying because they all submitted their thing already.

you'll need python
also you won't be able to change your bot after submitting bot.txt or hashed.txt
Title: Re: Map War Bot
Post by: vh on May 19, 2013, 08:23:10 AM
and here's my bot

Code: [Select]
S'\xff\x1c\xe8\xb2\xf1j\x9d\x88\x10\x1c\x9a:%4\xf0!{U\x96\xcbbOO0\xc1\x8dFbF\x00;\xfd'
p0
.
Title: Re: Map War Bot
Post by: vh on May 19, 2013, 08:24:51 AM
turn 2 begins every has 7 resources
Title: Re: Map War Bot
Post by: blotz on May 19, 2013, 08:53:57 AM
the "folder" of the bot only has to have a text file with the bot right??
Title: Re: Map War Bot
Post by: vh on May 21, 2013, 12:17:07 PM
Code: [Select]
S'R\x14\xac\x8adQ*"\n!\xdb\x9a\x7f\x8f\xe3I\x9a@Z\x9c\x95x\xf6\xec\xe7X\xa8)\xba\xa4=\xb0'
p0
.

updated bot

and map

turn ends on friday
Title: Re: Map War Bot
Post by: blotz on May 21, 2013, 01:35:07 PM
Code: [Select]
S'R\x14\xac\x8adQ*"\n!\xdb\x9a\x7f\x8f\xe3I\x9a@Z\x9c\x95x\xf6\xec\xe7X\xa8)\xba\xa4=\xb0'
p0
.

updated bot

and map

turn ends on friday

wait so you can decode the code? because if you cant then how will you know if we change the code? but if you can decode the code then you will know it!!
Title: Re: Map War Bot
Post by: vh on May 21, 2013, 01:46:05 PM
read about hashes (http://en.wikipedia.org/wiki/Hash_function)
Title: Re: Map War Bot
Post by: atomic7732 on May 21, 2013, 03:22:26 PM
or if bong is too lazy, basically you just hash the code when you provide it and if it matches the hash you provided before then that means they match
Title: Re: Map War Bot
Post by: vh on May 23, 2013, 11:52:16 AM
this turn ends tommorow
Title: Re: Map War Bot
Post by: vh on May 24, 2013, 07:50:58 PM
turn ends in ~4 hours
Title: Re: Map War Bot
Post by: blotz on May 25, 2013, 05:01:41 AM
you never said which friday! muahahahaha
Title: Re: Map War Bot
Post by: vh on May 25, 2013, 09:59:24 AM
i don't need to
Title: Re: Map War Bot
Post by: blotz on May 25, 2013, 10:29:18 AM
so what's going to happen?
people can still play before you update the turn i guess
Title: Re: Map War Bot
Post by: vh on May 26, 2013, 01:46:42 PM
game ends because < 1 person active

restarting using the starting map, anyone can put down their area
Title: Re: Map War Bot
Post by: vh on June 03, 2013, 02:41:17 PM
bump
Title: Re: Map War Bot
Post by: vh on June 09, 2013, 09:07:29 AM
bump
Title: Re: Map War Bot
Post by: Darvince on June 09, 2013, 04:21:13 PM
nobody wants to play because nobody wants to spend time writing a bot
Title: Re: Map War Bot
Post by: vh on June 10, 2013, 11:57:24 AM
that's supposed to be the fun part of the game the rest is just simulating out what the bots do...
Title: Re: Map War Bot
Post by: FiahOwl on June 10, 2013, 12:12:53 PM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '106342'.

Title: Re: Map War Bot
Post by: vh on June 28, 2013, 03:13:54 AM
I wrote my bot but I'm not joining aga-nvm ill do it next week after done with finals

ok then, how's now?
Title: Re: Map War Bot
Post by: Darvince on June 28, 2013, 03:20:50 AM
he's going to summer camp jesus-was-not-a-commie-sugg-physics
Title: Re: Map War Bot
Post by: vh on June 28, 2013, 03:26:42 AM
ok you can replace him
Title: Re: Map War Bot
Post by: FiahOwl on June 28, 2013, 05:29:02 AM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '107307'.

Title: Re: Map War Bot
Post by: vh on June 30, 2013, 10:43:23 AM
bump
Title: Re: Map War Bot
Post by: FiahOwl on July 07, 2013, 06:53:27 AM

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '107839'.

Title: Re: Map War Bot
Post by: vh on July 07, 2013, 06:53:46 AM
well if you're ready i'll start the game
Title: Re: Map War Bot
Post by: blotz on July 07, 2013, 01:57:33 PM
WAIT i need to make my code