Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411604 Posts in 69388 Topics- by 58445 Members - Latest Member: gravitygat

May 08, 2024, 03:26:21 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsPlayerGeneralCore War
Pages: 1 2 [3] 4
Print
Author Topic: Core War  (Read 10613 times)
Dacke
Level 10
*****



View Profile
« Reply #40 on: November 30, 2009, 02:18:48 PM »

Hm, I guess we have to up it from 800. But not all the way to 8000, hopefully. 4000 rounds takes about 10 minutes on my computer:

Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
Twoosh                    Core Xii             0,68543    133,5   111,1    26,0    18,5    55,4
The 7-10 Split            Dacke                0,74474    131,4   102,0    21,6    11,8    66,6
Upstream                  Core Xii             0,77790    126,5   102,5    18,5    10,5    71,0
Toothy 1.5                Daniel Rivas         0,81225    100,4   126,2     9,0    17,6    73,5
Indie                     Core Xii             0,80461     89,0   139,1     5,7    22,4    71,9
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #41 on: November 30, 2009, 02:57:19 PM »

If we limit the hill to 10 warriors, 3200 rounds per matchup, that gives a total of 144,000 rounds or some half an hour to run by your estimate.

Here's a comparison with 3200 and 4000 rounds:

Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
Twoosh                    Core Xii             0,68045    134,8   109,9    26,5    18,2    55,3
Twoosh                    Core Xii             0,68543    133,5   111,1    26,0    18,5    55,4
The 7-10 Split            Dacke                0,74878    129,4   103,3    20,7    12,0    67,4
The 7-10 Split            Dacke                0,74474    131,4   102,0    21,6    11,8    66,6
Upstream                  Core Xii             0,77444    127,8   101,5    19,0    10,3    70,8
Upstream                  Core Xii             0,77790    126,5   102,5    18,5    10,5    71,0
Toothy 1.5                Daniel Rivas         0,81134     99,5   126,9     8,6    17,8    73,6
Toothy 1.5                Daniel Rivas         0,81225    100,4   126,2     9,0    17,6    73,5
Indie                     Core Xii             0,80040     89,1   139,0     5,7    22,4    71,9
Indie                     Core Xii             0,80461     89,0   139,1     5,7    22,4    71,9


We find the largest difference is 2 points. Since Twoosh and The 7-10 Split contend on the fine margin, I vote we sacrifice speed for accuracy, and limit the size of the hill instead. There's the three of us now playing; I'd say 2 warriors each, for a hill size of 6 (plus the 7th warrior contesting the hill). If other people join in we can reconsider. Opinions?
Logged
Dacke
Level 10
*****



View Profile
« Reply #42 on: November 30, 2009, 04:04:59 PM »

Hm, those are some interesting results. I agree on having a limited hill size and to go for accuracy over speed. But I really don't mind that you have more than two warriors on the hill. Perhaps we can have it so that each player is guaranteed to have one warrior on the hill at all times (for interesting comparisons) but the rest of the spaces have to be fought over? Or something like that Durr...?

Two minor changes on the Split. I realized I could use modifiers! Learning the battlefield is half the fun. Just swapping DJN for DJN.I puts it in a pretty firm lead (even though Twoosh actually wins more!)

Code:
;redcode-94
;name The 7-11 Split
;author Dacke
;strategy Quick bombing run, followed by dual DJN streams
space EQU 75
ORG Bombrun
Upstream
DJN.I #-100, {0
Bombrun
FOR 97
mov {(100+space/2+space*(-1*Bombrun)), {(100+space+space*(-1*Bombrun))
ROF
SPL Upstream, <4000
DJN.I #102, }0
END

4000 rounds:

Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
The 7-11 Split            Dacke                0,70358    143,5    92,4    26,5     9,4    64,1
Twoosh                    Core Xii             0,63534    132,3   118,2    27,6    22,9    49,5
Upstream                  Core Xii             0,77669    126,4   102,8    18,5    10,7    70,8
Indie                     Core Xii             0,79016     91,4   137,6     6,8    22,2    70,9
Toothy 1.5                Daniel Rivas         0,83194     89,9   132,5     4,1    18,3    77,6
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #43 on: December 01, 2009, 12:40:58 PM »

Since you snagged first place I had to design a new scanner, one that locks onto The 7-11 Split efficiently. I have a feeling there's more potential in the DJN.F #x, }0 instruction, but you'll definitely need to bootstrap your code to escape my scan now.

Code: (Chocolate milk.red)
;redcode-94
;name Chocolate milk
;author Core Xii
;strategy .67c mod-8 B-field CMP scanner + SPL/DAT carpet
;assert CORESIZE == 8000 && MAXPROCESSES > 1

INTV equ 2936

org Scan

Pass dat Bomb, Bomb+1

Aim add.ab #INTV+1, Scan
Scan sne.b <0, Hit+INTV
djn.b Aim, #703 ;hardcoded for INTV 2936

mov.b Scan, Pass
Hit spl Aim, 1+Pass

Fire mov.i *Pass, >Pass
jmp Fire, >Pass-2666

Bomb spl #1-Pass, 1-Pass

end

Tournament Results
==================

Conditions
==========
Round robin with 6 warriors, 4000 rounds per matchup
Score formula: (W*W-1)/S
Core size  Max processes  Max cycles  Max length  Min distance
---------  -------------  ----------  ----------  ------------
     8000           8000       80000         100           100

Summary
=======
Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
Chocolate milk            Core Xii             0,55343    206,7    63,6    59,0    11,3    29,7
The 7-11 Split            Dacke                0,65080    124,5   122,2    23,7    23,0    53,3
Twoosh                    Core Xii             0,59943    122,5   134,4    26,4    30,4    43,2
Upstream                  Core Xii             0,78109    113,2   118,1    14,8    16,4    68,8
Indie                     Core Xii             0,78352     92,9   137,6     7,8    22,7    69,6
Toothy 1.5                Daniel Rivas         0,74584     76,3   160,2     4,3    32,2    63,5


Damn, 80 points difference to nearest competitor, color me impressed.

What are your opinions on hill size? That's 6 warriors now, and it took 19 minutes to simulate. Think we should start dropping them off the hill from here?
Logged
Poor Lazlo
Guest
« Reply #44 on: December 03, 2009, 04:59:36 AM »

Back... Being ill is no fun. Hey, toothy is last, so that's no good. I'll come up with something to change that, I think.

What are your opinions on hill size? That's 6 warriors now, and it took 19 minutes to simulate. Think we should start dropping them off the hill from here?

I think 6 is probably a decent size, seeing as it looks like there are only three combatants right now.
Logged
Dacke
Level 10
*****



View Profile
« Reply #45 on: December 03, 2009, 06:37:33 AM »

Yup, sounds good to me too Smiley
So we use 7 warriors per tournament, but the bottom one is kicked out for the next tournament?

I have been trying a few things with the split. I think it has no chance to beat Chocolate. But I can make it bridge the gap a bit. I'll post an updated version later, and then move on to a different strategy Smiley

Edit: Oh, and nice to see you well and back Lazlo! Grin
« Last Edit: December 03, 2009, 06:58:39 AM by Dacke » Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Poor Lazlo
Guest
« Reply #46 on: December 03, 2009, 11:57:23 AM »

Okay, I have a new warrior. Meet Glasses Glasses:

Code:
;corewar-94
;name Glasses Glasses
;author Daniel Rivas
;strategy 0.8c CMP Scanner + immediate Core-Clear.

step EQU 2930
hop EQU 30
start EQU 10

scanD   ADD     incD, ptrD
ptrD    SNE     start+hop, start 
        ADD     incD, ptrD
        SNE     *ptrD, @ptrD
        DJN     scanD, #800
attack MOV incD, @ptrD
incD    SPL     #step, #step
MOV.I clr, <scanD
DJN.I -1, <scanD
clr DAT #0, #0

end ptrD

It's a CMP-Scanner, and it could do with some better attack code. Oh well. It does okay on the hill, jumping to number 2. Chocolate Milk retains its crown. My next warrior will be stone, I think, to try and drop Core Xii's warrior down a few ranks Smiley.

Conditions
==========
Round robin with 7 warriors, 4000 rounds per matchup
Score formula: (W*W-1)/S
Core size  Max processes  Max cycles  Max length  Min distance
---------  -------------  ----------  ----------  ------------
     8000           8000       80000         100           100

Summary
=======
Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
Chocolate milk            Core Xii             0.52235    213.6    61.0    62.8    11.9    25.4
Glasses Glasses           Daniel Rivas         0.60736    135.3   112.5    27.7    20.1    52.2
The 7-11 Split            Dacke                0.64793    119.2   126.6    21.6    24.1    54.2
Twoosh                    Core Xii             0.58147    115.7   141.1    24.2    32.6    43.2
Upstream                  Core Xii             0.81336    111.1   115.6    12.6    14.1    73.3
Indie                     Core Xii             0.75940     89.7   142.5     7.3    24.9    67.7
Logged
Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #47 on: December 03, 2009, 12:10:49 PM »

I love this little war we have going on here.

You should post the full 7-warrior table from the tournament so we can see how the warrior that fell off the hill did.
Logged
Poor Lazlo
Guest
« Reply #48 on: December 03, 2009, 12:48:36 PM »

You should post the full 7-warrior table from the tournament so we can see how the warrior that fell off the hill did.

Oh, okay:

Results
==================

Conditions
==========
Round robin with 7 warriors, 4000 rounds per matchup
Score formula: (W*W-1)/S
Core size  Max processes  Max cycles  Max length  Min distance
---------  -------------  ----------  ----------  ------------
     8000           8000       80000         100           100

Summary
=======
Warrior                   Author                Length    Score   Given      W%      L%      T%
-------                   ------                ------    -----   -----  ------  ------  ------
Chocolate milk            Core Xii             0.52235    213.6    61.0    62.8    11.9    25.4
Glasses Glasses           Daniel Rivas         0.60736    135.3   112.5    27.7    20.1    52.2
The 7-11 Split            Dacke                0.64793    119.2   126.6    21.6    24.1    54.2
Twoosh                    Core Xii             0.58147    115.7   141.1    24.2    32.6    43.2
Upstream                  Core Xii             0.81336    111.1   115.6    12.6    14.1    73.3
Indie                     Core Xii             0.75940     89.7   142.5     7.3    24.9    67.7
Toothy 1.5                Daniel Rivas         0.71330     76.5   161.8     4.9    33.4    61.7


Badly. Hmm. It gave a lot. Toothy's results are as follows:


vs. Toothy 1.5            Author                Length    Score   Given      W%      L%      T%
--------------            ------                ------    -----   -----  ------  ------  ------
Chocolate milk            Core Xii             0.39365    270.0    23.6    87.8     5.7     6.4
Twoosh                    Core Xii             0.48271    227.4    40.2    65.0     2.6    32.4
Glasses Glasses           Daniel Rivas         0.55964    172.5    73.7    39.6     6.7    53.8
The 7-11 Split            Dacke                0.96318    105.8    98.6     3.4     1.0    95.6
Upstream                  Core Xii             0.96908     98.7   104.7     0.7     2.7    96.6
Indie                     Core Xii             0.91156     96.5   118.2     3.8    11.0    85.2

Perhaps without toothy feeding your warriors wins, Chocolate Milk won't have quite such a lead. Perhaps! Either way, I need to up my game.
Logged
Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #49 on: December 08, 2009, 03:47:21 AM »

Although we are nowhere near that point, I thought I'd share something: I wrote a PHP P^3 table generator as described in the Core Warrior issue 70.

It's not perfect; In particular I couldn't figure out how to parameterize the table columns layout (it's fixed at Loss, Win, Tie), and the last state cannot loop back to itself on a win. If anyone understands this crazy shit, please do that. Roll Eyes

It's a PHP script with hard-coded input, so you need your own PHP-enabled host to use it. Too lazy to implement an HTML form for editing the states table.

Edit: Oh yea, and I didn't actually test the randomization of the P-space address that stores the state, I just assumed it works. Replace the variable P shit with a static address if it doesn't.
« Last Edit: December 08, 2009, 03:55:33 AM by Core Xii » Logged
Epitaph64
Level 1
*



View Profile WWW
« Reply #50 on: December 08, 2009, 10:51:34 PM »

Ah man, if I didn't have finals coming up in two days I'd try and join you guys, but I have never played nor used the language. However, if you guys want to have a tournament and set a data sometime at least 2 weeks from now, I may be interested Cheesy This is just the kind of geeky thing that I love haha.

EDIT: Out of curiosity, what exactly randomizes the results? Is it a scripted randomness of some sort, or just a random starting memory location, or a combination, or what?
« Last Edit: December 08, 2009, 11:05:43 PM by Epitaph64 » Logged

Dacke
Level 10
*****



View Profile
« Reply #51 on: December 08, 2009, 11:25:54 PM »

Ah man, if I didn't have finals coming up in two days I'd try and join you guys, but I have never played nor used the language. However, if you guys want to have a tournament and set a data sometime at least 2 weeks from now, I may be interested Cheesy This is just the kind of geeky thing that I love haha.

EDIT: Out of curiosity, what exactly randomizes the results? Is it a scripted randomness of some sort, or just a random starting memory location, or a combination, or what?

I knew nothing about the game when this started, so I'm sure you'll be able to join in just fine! And no hurry either. This is the kind of thing we can keep going indefinitely, so we'll be right here where you left us Smiley

The random part is indeed the starting positions. Each warrior can be max 100 rows long and the minimum distance between two warriors is 100 rows. Apart from that, the warrior opposing you can be anywhere in the 8000-row-core.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Epitaph64
Level 1
*



View Profile WWW
« Reply #52 on: December 08, 2009, 11:56:19 PM »

Am I doing something wrong, or do those battle times seem exceptionally long. I can easily do 4,000 1v1 battles in around 30 seconds?

Hmm, was experimenting a little bit. I'm confused as to why MOV 0,1 fills the core and results in a draw, whereas MOV 0,2 kills itself?
« Last Edit: December 09, 2009, 12:49:17 AM by Epitaph64 » Logged

Dacke
Level 10
*****



View Profile
« Reply #53 on: December 09, 2009, 09:48:05 AM »

Am I doing something wrong, or do those battle times seem exceptionally long. I can easily do 4,000 1v1 battles in around 30 seconds?

We are doing a round robin tournament. Every warrior fights every other warrior 4000 times. And with many of our warriors, the game won't come to an early end. The game ends if someone wins or if the CoreWin program can identify an early draw (which is why MOV 0,1 vs. MOV 0,1 can be ended early). Otherwise every round ends after 80000 cycles.

With seven warriors, each fighting each other you get 21 matchups. If each round takes 30 seconds, the whole thing would take 10.5 minutes. But as I mentioned, the warriors currently on the hill have a tendency to drag thing out to the very end (as opposed to making fast kills).

Hmm, was experimenting a little bit. I'm confused as to why MOV 0,1 fills the core and results in a draw, whereas MOV 0,2 kills itself?

I will try to show you what happens when the two programs execute. I will user a '>' to mark where the program currently "is" (the next row to be executed). The program executes a row, then it moves on to the next row.

To begin with the core is filled with DAT 0, 0. If the program executes such a row it dies. Every row that has not been changed by a program looks like this. I put down only a few of them here, but they continue for hundreds or thousands of rows in both directions.


The Imp (MOV 0,1) program:

Code:
DAT 0, 0      ;empty-core-row.
DAT 0, 0
> MOV 0, 1    ;this is the only row in the program, it is the first to be executed.
DAT 0, 0
DAT 0, 0
DAT 0, 0
DAT 0, 0

When executing the row the program copies (MOV) "the current row" (0) to "the next row" (1). Then it moves on, to execute the next row in the program.
Code:
DAT 0, 0
DAT 0, 0
MOV 0, 1      ; this was just executed. It copied itself to the next row.
> MOV 0, 1    ; this row was just "created". It is now the next instruction to be executed
DAT 0, 0
DAT 0, 0
DAT 0, 0

The program then contiues like this. Copying a row and then moving to the newly created row.
Code:
DAT 0, 0
DAT 0, 0
MOV 0, 1      ; the starting row
MOV 0, 1      ; this was just executed. It copied itself to the next row.
> MOV 0, 1    ; this row was just "created". It is now the next instruction to be executed
DAT 0, 0
DAT 0, 0


The (MOV 0, 2) program:
Code:
DAT 0, 0      ;empty-core-row.
DAT 0, 0
> MOV 0, 2    ;this is the only row in the program, it is the first to be executed.
DAT 0, 0
DAT 0, 0
DAT 0, 0
DAT 0, 0

The program copies (MOV) itself (0) to the second-next row (2). The program then moves on to execute the next row.
Code:
DAT 0, 0      
DAT 0, 0
MOV 0, 2      ; this was just executed. It copied itself two rows down
> DAT 0, 0    ; this is the next row to be executed
MOV 0, 2      ; this row was just "created"
DAT 0, 0
DAT 0, 0

And now the program dies, as it executes a DAT 0, 0



If you feel like it, see if you can figure out how this program would work:
Code:
> MOV 0, 2
MOV 0, 2
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Epitaph64
Level 1
*



View Profile WWW
« Reply #54 on: December 09, 2009, 11:51:59 AM »

Ah that makes sense. So does the program's execution always go one forward unless told to jmp? That's probably why I could never make anything that worked, because I thought that by telling something to move or add that the next instruction would execute at that point Tongue

My other new question is, for the jmp command, does it only use field A? If so, is the only reason to declare a field B for the jmp command to use it as a reference data number in your core? I read a few of the tutorials briefly, but I still have no idea what all the opcodes do (haven't found a nice listing) and it seems like the field A and B of certain commands are hard to locate their functions for the instruction.
Logged

Dacke
Level 10
*****



View Profile
« Reply #55 on: December 09, 2009, 12:18:38 PM »

Good! Smiley
Just like in ordinary programming, the program/warrior is executed one line at a time. If you want some code to be repeated, skipped or jumped to you can use JMP, JMZ, JMN, DJN, CMP/SEQ, SNE or SLT

JMP only cares about the A field. But the B field can be used for other stuff. You can use the extra field to store values. Or use it with special addressing modes. For example JMP -3, {-50 does: jump to -3 AND subtract one from the A-field of the row at -50.

The tutorial I recommend reading thoroughly (at least to begin with) is http://vyznev.net/corewar/guide.html

In that guide you can find descriptions of all OpCodes and details about all the OpCodes (but to understand them, you may need to read the rest of the document).

How the A and B fields are used by different OpCodes can be changed by the use of modifiers, too. But you'll learn all that if you read that guide!
« Last Edit: December 09, 2009, 06:11:56 PM by Dacke » Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Epitaph64
Level 1
*



View Profile WWW
« Reply #56 on: December 09, 2009, 08:31:08 PM »

Ah, I find that the symbols used are quite confusing. It says "{ -- A-field indirect with predecrement" which makes no sense to me at all haha.
Logged

Poor Lazlo
Guest
« Reply #57 on: December 10, 2009, 06:43:00 AM »

Ah, I find that the symbols used are quite confusing. It says "{ -- A-field indirect with predecrement" which makes no sense to me at all haha.

That means that it will go and use the value of the A-Field of the instruction referenced, but first it will decrement the A-field of that instruction. So, for example:

Code:
MOV 37, 28
JMP {-1

If the JMP {-1 instruction is executed, it will decrement the MOV instruction, and then JMP to the value stored in the MOV's A-field. That is to say, 36 instructions after.

Hope that helps. Smiley
Logged
Dacke
Level 10
*****



View Profile
« Reply #58 on: December 10, 2009, 10:39:28 AM »

I found (and still find) much of that stuff confusing too, so no worries. If you have time to experiment later, I'm sure you'll be able to find out how to make things work.

A way to make experimenting easy in CoreWin:
  • Go to Setup.
  • Set Core Size to 800 (or 2048). If the size is 2048 or smaller, the graphical representation of the core gets much bigger and easier to read. But be warned, some (most?) warriors will only work perfectly in core size 8000. But when trying things out, a small core makes things much easier. Just make sure to switch to size 8000 before choosing constants for your warrior.
  • Make sure you have only added a single warrior.
  • Set Tournament Options to Melee.
  • Press OK.
  • Experimenting
  • Press New Battle.
  • Use Single Step to let the warrior execute a single line.
  • Use the graphical representation on top to see all the changes. The red dot is "where the program currently is" and the coloured (yellow?) changes show where something is changed.
  • By clicking in the graphical representation, you can see exactly what is going on in that place.
  • Making changes
  • Press the button with the warrior's name to the right. This opens up an editor for the warrior.
  • Make changes in the warrior and then press OK.
  • Press New Battle (I'm not sure if this is needed) and use Single Step to see how the changes work out.
  • Make another change and try it out. Keep trying new changes.
« Last Edit: December 10, 2009, 03:21:07 PM by Dacke » Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Brother Android
Level 10
*****


View Profile
« Reply #59 on: December 10, 2009, 02:48:09 PM »

Cool. I thought this would be way out of my league but I'm actually starting to get a handle on it, and it sounds pretty interesting.
Logged

Pages: 1 2 [3] 4
Print
Jump to:  

Theme orange-lt created by panic