Code::WAR

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Code::WAR

Post by TheGameMaker »

Hi, today I'm releasing the first alpha version of my upcoming projekt Code::WAR
Its a small CoreWar clone.
That means its a game for programmers. Every player programms a small programm in an assembly like language called "cw" and then they will fight in an virtuell machine on life and dead. The Weapon: overwriting the other process memory! I hope there will be some ots, that will be able to kill my one, höllenOrgel ;)
Currently working:
-the parser
-the assembler
-the disassembler
-the interpreter / virtual machine
-a small visualisation
--a bright dot means that ther is the current executed command
--an arrow upwards means data are read from here
--an arrow downwards means data that are written
--an pale arrow to the right means in this cell there is code
--and pale box means there are datas in that cell.
-most of the language features.
-memory breakpoints in the debugger
-(most likely) the final interface for the debugger

still to come:
-different rulesets (fieldsize, multihtreading disallowed etc.)
-global variables for all threads
-random() as a variable
ok.. some pics:
Image
Image
Image
Image
and the DL with german and english doku
DL + source:http://rapidshare.de/files/38018036/CodeWarV20.rar.html
Last edited by TheGameMaker on Mon Dec 10, 2007 5:01 pm, edited 6 times in total.
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

That's a pretty funny game :D. I'm not very good at it, though :?. Would be nice if you could increase and reduce the speed during the simulation.
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

jop.. thats what I'm currently working at.. a better debuging interface..
open arbitrary files, setting speed at runtime, singlestep, and showing a disasm of every cell under the mousecursor, informations to the different threads etc (maybe even memorybreakpoints)
thats what the blank space at the lower end will be used for^^
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

ok guys.. another update.. nothing new about the gameplay, but the debugger now features:
-reset simulation
-singlestep mode
-various speed
a close button^^
-pause
-show the content of a cell (value/the command)
-show thread informations (all registers and flags. player etc)
-some more code examples
Last edited by TheGameMaker on Tue Dec 04, 2007 2:28 pm, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This is awesome, I feel like Im learning alot about assembly (And the problems you encounter when assembly programming) just by playing it! :oops:

It would be nice if we can step-back after running it at full speed in order to observe more closely how a program died. Right now I have to pause it just before something happens and tediusly step forward. That, and have a breakpoint instruction for debugging somewhere. (That shouldnt be too hard to implement, right?).

Also, it would be more convenient if the cell info changed whenever the mouse was hovered over a cell rather than clicked, it gave my index finger a workout whilst trying to figure out what several of the cells were equal to.

Cheers, and thanks for this game.

PS: How do you get a red bot like in the screenshot?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

I'm glad you like it!
the red one.. well, internaly there are 4 players.. the current version just loads two of em.. so I'm afraid, there is jet no way to gain the red color.. (later) The breakpoint thingy would be cool, and should be possible within a few lines.. and the hover-to-dissasm will be changed in no time..
an other new feature for the next version:
thread number limitation to 64 or 128 threads.. this will take away some power from the ueber-powerfull splitbombs If you want to get some harder opponents.. have a look in this thread:
http://www.irrlicht3d.de/forum2/viewtop ... 3306#p3306
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

One thing that is starting to bug me is that the draw happens too soon. There should be a configurable value for how long until the game is considered tied.

Some of the more complex programs take a while to kill each other :P

EDIT:

hehe, I just finished making a bot, the results against stormWind are:

Bot1 Wins: 10
Bot1 Ties: 1508
Bot1 Lost: 1

Wooo, clearly mine is the winner, here it is:

[Removed: See improved version]

EDIT2:

That one could not beat snake hunter (They kept tieing), so I made another:

[Removed: See improved version]

Against snakehunter this did:
Bot1 Wins: 34
Bot1 Ties: 118
Bot1 Lost: 0

Im moving on to mousetrap :D

EDIT3:

Ok, I couldnt make the snake one beat the mousetrap, so I had to make a new one:

Code: Select all

.autor BlindSide
.name Shitloads of Bombers
.description Lots and lots of bombers
.begin

mov 500 eax
add 200 eax
mov [7] [eax]
mov [7] [eax]
mov [7] [eax]
mov [7] [eax]
sub 5 eax
create eax
jmp -7
mov 1050 eax
mov 0 [eax]
add 3 eax	
jmp -2
And this got:

Bot1 Wins: 30
Bot1 Ties: 43
Bot1 Lost: 3

:D

EDIT4:

I improved SnakesOnAPlane alot:

Code: Select all

.autor BlindSide
.name SnakesOnAPlane
.description The true snakes on a plane.
.begin

mov 500 eax
add 500 eax
mov [4] [eax]
sub 2 eax
create eax
jmp -4
mov [0] [1]
Doesnt stop making them :D
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

the new version now runs 5 times longer..(50K cycles)
I'm going to have a look on this bots.. (try to kill bloodSucker btw..) :lol:

so, here it ist.. the new version(source included):
http://rapidshare.de/files/37971740/CodeWar01.rar.html
features:
-better doku
-thread limit 128
-breakpoints
-one big fat ugly bug with negativ pointers was fixed..
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

My "Shitloads of bombers" one can beat bloodSucker 10-30ish.

I finally found something that can beat "snake"! (It kills it almost every time too):

Code: Select all

.autor BlindSide
.name Sentinal
.description Finds the heart and destroys it.
.begin

mov 666 [0]
mov 200 eax
inc eax
test [eax]
jne -2

// Make sure we are not killing ourselves:
sub 4 eax
cmp 666 [eax]
add 20 eax
jie -6

sub 30 eax
inc eax
mov 0 [eax]
jmp -2
Infact, against snake this does:

Bot1 Wins: 1004
Bot1 Ties: 0
Bot2 Wins: 0 :D

EDIT: Oh no, your snake is bugged,

Change the line that says "create [2]" to "create 2", else it will just sit there and do nothing! (When I changed this it was hard to beat again) :P

EDIT2:
Ok I made one that actually beats the real snake, and it looks like this:

Code: Select all

.autor BlindSide
.name Sentinal
.description Finds the heart and destroys it.
.begin

mov 666 [0]
mov 200 eax
add 4 eax
test [eax]
jne -2

// Make sure we are not killing ourselves:
sub 4 eax
cmp 666 [eax]
add 20 eax
jie -6

sub 25 eax
mov 0 [eax]
mov 0 [eax]
mov 0 [eax]
mov 0 [eax]
mov 0 [eax]
add 150 eax
mov eax ebx
dec ebx
mov ebx ecx
dec ecx
mov ecx edx
dec edx

mov 0 [eax]
mov 0 [ebx]
mov 0 [ecx]
mov 0 [edx]
jmp -4
This did:
Bot1 Wins: 100
Bot1 Ties: 134
Bot2 Wins: 0

Its not amazing but its better than a tie! :D
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

shitload of bombers is great.. I don't know any bot, who realy can beat shitload... my newest one gets an advatage of 20 or something on a thousand.. :roll: that ones to good^^
snakes is kind of easy.. did you ever hear of splittbombs??
my newest bot:
against Zwergenwerfer 3/2
against armysOfUndead1 öhmm.. poop^^ 2/3 lost
against BloodSuckers 2/3 lost
against höllenorgel 10/2
against cheater 10/1
against dwarf 1/10 aua^^ wirklich zu klein das teil^^
against minelayer 5/1 (nen bissle besser)
against mouseTrap 3/1
against stormwind 6/1
against snake 1000/0^^ hähähä geht nichts über splibombs^^
against SnakesOnAPlane 10/1
against Shitloads of Bombers 1/1,02

Code: Select all

.autor TGM

.name armysOfUndead v2.0

.description 4 stage bomber: 15lines of pure poison

.level 6
mov [10] [EAX]
mov [10] [EAX]
add EBX EAX
jne -3      //stage currently running?
div 2 EBX   //modefy for stage two
cmp EBX 1   //stage two->jump to [6]?? or three??   
jne 7      //three??->modify all that poop
mov 666 [3] //modefy for last stage   
mov 666 [3] //modefy for last stage   
jmp 4          //datas used for bombing
create 0      //datas used for bombing   
jmp -1
   .begin
mov 10 EBX
mov -6300 EAX
jmp -14
OK... new Bot: easyier than everything else..
just 8 lines, and a few of em are just space fillers..
based on two runner threads.. but nearly unbeatable.. no available bot won against this MONSTER

Code: Select all

.autor TGM
.name IMPerialFist
.description an two thread imp which has the ability to kill and avoid anti-imp traps
.begin
mov 1000 eax
create 3
mov 101 edx
jmp 4
mov 1 edx
mov 1 edx
mov 1 edx
mov [eax] [edx]
Stats:

Code: Select all


IMP:bloodSucker				3:1
IMP:cheater					2:1
IMP:dwarf					2:1
IMP:FlySwat					0:0
IMP:hoellenOrgel		   10:1
IMP:mineLayer				5:1
IMP:mousetrap				2:1
IMP:powerfly			  200:1
IMP:Shitloads of Bombers	2:1
IMP:snake			 	  200:0
IMP:snakehunter			  200:0
IMP:SnakesOnAPlane			0:0
IMP:stormWind			  1,1:1
IMP:Zwergenschleuder		3:1
IMP:Zwergenschleuderv1.1	5:1
IMP:ArmysOfUndead 1			2:1
IMP:ArmysOfUndead 2			2:1
so I guess there is still work to do for you guys..
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

IMPerialFist doesnt work, it dies right away.

PS: I love the matrix theme! Kind of hard to see what the hell is going on though.

For anyone thats interested, replace the image in the gfx folder with this Image
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

sry dude.. the currently available version got a bug the edx register doesn't work, I already fixed it.. all you have to do is to replace the edx with ecx..
sry again.. .my fault I think I'm going to release a new version today (just very few changes..) that will get rid of this bug.. My next planes are a total rewaork (with some reuse of code ofcourse) that features some advantage features that will massivly increase the tactical options (well.. the ability to writte small code at all, so more clever bots will become more interisting)

and of course there will be a lossles quallity matrix skin in it ;)
greetz

so, here we go:
http://rapidshare.de/files/38018036/CodeWarV20.rar.html
newest version fixed edx bug, and the unoptimised MAtrix skin.. simply replace the cells.bmp by the cellsM.bmp in the gfx folder.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It would be interesting to see some SIMD style instructions. Eg: (Multiply all registers and give result, Sum of all registers, shift registers to the right or left, etc). Maybe make it so that some instructions take longer than others? But I guess that will get a bit complicated. (I am under the assumption that most CPU instructions, with the exception of the FPU etc, run at exactly the same speed?)

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

no.. most of the CPU commands take different times (compare XOR with DIV)
I was thinking about such stuff to, and maybe SIMD could be usefull (having multiple pointers being increased in just one command) but I doubt this..
wait till the next version (if it will come one time) it will feature preincrement
up to 4. so you can say

Code: Select all

mov 0 [>>>>EAX] 
jmp -1 
which will result in the smalest possible bomber..
but, hey good Idea.. I keep that in mind ;)
Post Reply