You are not logged in. login register
Game fighter
name fighter
creator stephan
number of roles 2
stylesheet streetfight/streetfight.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description Discretized and simplified GGP version of the well-known arcade game "Street Fighter".
GDL by Tim Federholzner (TZI, University of Bremen)

Game Description

(role ryu)
(role ken)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(position standing)
(position crouching)
(position lying)

(cell 1)
(cell 2)
(cell 3)
(cell 4)
(cell 5)
(cell 6)
(possibleLife 0)
(possibleLife 1)
(possibleLife 2)
(possibleLife 3)
(possibleLife 4)
(possibleLife 5)
(possibleLife 6)
(possibleLife 7)
(possibleLife 8)
(possibleLife 9)
(possibleLife 10)
(level low)
(level mid)
(level high)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(init (at ryu 3))
(init (at ken 4))

(init (pos ryu standing))
(init (pos ken standing))

(init (life ryu 10))
(init (life ken 10))

(init (energy ryu 3))
(init (energy ken 3))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; normale Zuege

(<= (legal ?r crouch)
	(role ?r)
	(true (pos ?r standing))
)

(blocks crouch low)
(range crouch 0)

(<= (legal ?r raise)
	(role ?r)
	(true (pos ?r crouching))
)

(blocks raise mid)
(blocks raise high)
(range raise 0)

(<= (legal ?r getUp)
	(role ?r)
	(true (pos ?r lying))
)

(blocks getUp mid)
(blocks getUp high)
(range getUp 0)

(<= (legal ?r (step ?to))
	(role ?r)
	(true (pos ?r standing))
	(true (at ?r ?from))
	(cellsucc ?from ?to)
	(role ?r2)
	(distinct ?r ?r2)
	(not (true (at ?r2 ?to)))
)

(<= (noRange ?r)
	(does ?r (step ?to))
)

(<= (blocks (step ?to) high)
	(cell ?to)
)

(<= (blocks (step ?to) mid)
	(cell ?to)
)

(<= (legal ?r (roll ?to))
	(role ?r)
	(true (pos ?r lying))
	(true (at ?r ?from))
	(cellsucc ?from ?to)
	(role ?r2)
	(distinct ?r ?r2)
	(not (true (at ?r2 ?to)))
)

(<= (noRange ?r)
	(does ?r (roll ?to))
)

(<= (blocks (roll ?to) high)
	(cell ?to)
)

(<= (legal ?r highPunch)
	(role ?r)
	(true (pos ?r standing))
)

(hits highPunch high)
(damage highPunch 1)
(range highPunch 1)
(counters highPunch jumpthrow)

(<= (legal ?r midPunch)
	(role ?r)
	(true (pos ?r crouching))
)

(hits midPunch mid)
(damage midPunch 1)
(range midPunch 1)
(counters midPunch midKick)

(<= (legal ?r midKick)
	(role ?r)
	(true (pos ?r standing))
)

(hits midKick mid)
(damage midKick 2)
(range midKick 1)

(<= (legal ?r lowKick)
	(role ?r)
	(true (pos ?r crouching))
)

(hits lowKick low)
(damage lowKick 3)
(range lowKick 1)
(counters lowKick lieKick)
(isCritical lowKick)

(<= (legal ?r lieKick)
	(role ?r)
	(true (pos ?r lying))
)

(hits lieKick low)
(damage lieKick 1)
(range lieKick 1)

(<= (legal ?r highBlock)
	(role ?r)
	(true (pos ?r standing))
)

(blocks highBlock high)
(blocks highBlock mid)
(range highBlock 0)

(<= (legal ?r lowBlock)
	(role ?r)
	(true (pos ?r crouching))
)

(blocks lowBlock low)
(range lowBlock 0)

;; Special Moves (benoetigen Energie)

; Reichweite 2, blockbar, nicht konterbar
(<= (legal ?r jumpkick)
	(role ?r)
	(true (pos ?r standing))
	(energyleft ?r)
)

(hits jumpkick high)
(damage jumpkick 3)
(range jumpkick 2)
(blocks jumpkick low)
(blocks jumpkick mid)
(counters jumpkick jumpthrow)
(isCritical jumpkick)

; Reichweite 2, nicht blockbar, konterbar
(<= (legal ?r jumpthrow)
	(role ?r)
	(true (pos ?r standing))
	(energyleft ?r)
)

(hits jumpthrow high)
(damage jumpthrow 3)
(range jumpthrow 2)
(blocks jumpthrow low)
(blocks jumpthrow mid)
(isCritical jumpthrow)
(guardbreaker jumpthrow)

; Reichweite 5, blockbar, nicht konterbar
(<= (legal ryu hado_ken)
	(true (pos ryu standing))
	(energyleft ryu)
)

(hits hado_ken mid)
(damage hado_ken 2)
(range hado_ken 5)
(isCritical hado_ken)

; Reichweite 1, nicht blockbar, nicht konterbar
(<= (legal ken uppercut)
	(true (pos ken crouching))
	(energyleft ken)
)

(hits uppercut mid)
(damage uppercut 2)
(range uppercut 1)
(counters uppercut lowKick)
(isCritical uppercut)
(guardbreaker uppercut)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (next (life ?r ?n))
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(does ?r2 ?m)
	(range ?m ?d)
	(not (reaches ?d))
)

(<= (next (life ?r ?n))
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(noRange ?r2)
)

(<= (next (life ?r ?n))
	(role ?r)
	(true (life ?r ?n))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(true (pos ?r ?lvl))
	(hits ?m2 ?hitlvl)
	(not (doHit ?hitlvl ?lvl))
)

(<= (next (life ?r ?n))
	(role ?r)
	(true (life ?r ?n0))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(damage ?m2 ?dam)
	(loseLife ?dam ?n0 ?n)
	(range ?m2 ?dist)
	(reaches ?dist)
	(true (pos ?r ?lvl))
	(hits ?m2 ?hitlvl)
	(doHit ?hitlvl ?lvl)
	(not (counters ?m ?m2))
	(not (blocks ?m ?hitlvl))
)

(<= (next (life ?r ?n))
	(role ?r)
	(true (life ?r ?n))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(true (pos ?r ?lvl))
	(hits ?m2 ?hitlvl)
	(doHit ?hitlvl ?lvl)
	(counters ?m ?m2)
)

(<= (next (life ?r ?n))
	(role ?r)
	(true (life ?r ?n))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(true (pos ?r ?lvl))
	(hits ?m2 ?hitlvl)
	(doHit ?hitlvl ?lvl)
	(not (counters ?m ?m2))
	(blocks ?m ?hitlvl)
	(not (guardbreaker ?m2))
)

(<= (next (life ?r ?n))
	(role ?r)
	(true (life ?r ?n0))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(damage ?m2 ?dam)
	(loseLife ?dam ?n0 ?n)
	(range ?m2 ?dist)
	(reaches ?dist)
	(true (pos ?r ?lvl))
	(hits ?m2 ?hitlvl)
	(doHit ?hitlvl ?lvl)
	(not (counters ?m ?m2))
	(blocks ?m ?hitlvl)
	(guardbreaker ?m2)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(<= (nextPos ?r standing)
	(true (pos ?r standing))
	(not (does ?r crouch))
)

(<= (nextPos ?r crouching)
	(true (pos ?r crouching))
	(not (does ?r raise))
)

(<= (nextPos ?r standing)
	(does ?r raise)
)

(<= (nextPos ?r standing)
	(does ?r getUp)
)

(<= (nextPos ?r standing)
	(rolls ?r)
)

(<= (nextPos ?r crouching)
	(does ?r crouch)
)

(<= (nextPos ?r lying)
	(does ?r lieKick)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (hitByCritical ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(nextPos ?r ?nextlvl)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(hits ?m2 ?lvl)
	(doHit ?lvl ?nextlvl)
	(not (blocks ?m ?lvl))
	(not (counters ?m ?m2))
	(isCritical ?m2)
)

(<= (moves ?r)
	(cell ?to)
	(does ?r (step ?to))
)

(<= (rolls ?r)
	(cell ?to)
	(does ?r (roll ?to))
)

;(<= (next (moves ?r))
;	(cell ?to)
;	(does ?r (step ?to))
;)

;(<= (next (rolls ?r))
;	(cell ?to)
;	(does ?r (roll ?to))
;)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(not (moves ?r))
	(not (rolls ?r))
)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(does ?r (step ?p2))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r2 (step ?p2))
)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(does ?r (roll ?p2))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r2 (step ?p2))
)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(does ?r (step ?p2))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r2 (roll ?p2))
)

(<= (next (at ?r ?p))
	(role ?r)
	(true (at ?r ?p))
	(does ?r (roll ?p2))
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r2 (roll ?p2))
)

(<= (next (at ?r ?p))
	(role ?r)
	(cell ?p)
	(does ?r (step ?p))
	(role ?r2)
	(distinct ?r ?r2)
	(not (does ?r2 (step ?p)))
	(not (does ?r2 (roll ?p)))
)

(<= (next (at ?r ?p))
	(role ?r)
	(cell ?p)
	(does ?r (roll ?p))
	(role ?r2)
	(distinct ?r ?r2)
	(not (does ?r2 (step ?p)))
	(not (does ?r2 (roll ?p)))
)

(<= (next (pos ?r standing))
	(true (pos ?r standing))
	(not (does ?r crouch))
	(not (hitByCritical ?r))
)

(<= (next (pos ?r crouching))
	(true (pos ?r crouching))
	(not (does ?r raise))
	(not (hitByCritical ?r))
)

(<= (next (pos ?r lying))
	(true (pos ?r lying))
	(not (does ?r getUp))
	(not (rolls ?r))
)

(<= (next (pos ?r standing))
	(does ?r raise)
	(not (hitByCritical ?r))
)

(<= (next (pos ?r standing))
	(does ?r getUp)
	(not (hitByCritical ?r))
)

(<= (next (pos ?r standing))
	(rolls ?r)
	(not (hitByCritical ?r))
)

(<= (next (pos ?r crouching))
	(does ?r crouch)
	(not (hitByCritical ?r))
)

(<= (next (pos ?r lying))
	(hitByCritical ?r)
)

(<= (next (pos ?r lying))
	(does ?r lieKick)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(special jumpkick)
(special jumpthrow)
(special hado_ken)
(special uppercut)

(<= (doesSpecial ?r)
	(role ?r)
	(does ?r ?m)
	(special ?m)
)

(<= (next (energy ?r ?n))
	(true (energy ?r ?n))
	(not (doesSpecial ?r))
)

(<= (next (energy ?r ?n))
	(true (energy ?r ?n0))
	(doesSpecial ?r)
	(energysucc ?n0 ?n)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; fuer die Visualisierung:

(<= (doesMove ?r ?m)
	(role ?r)
	(does ?r ?m)
	(not (noRange ?r))
)

(<= (doesMove ryu roll_forth)
	(true (at ryu ?c))
	(does ryu (roll ?c2))
	(cellsucc+ ?c ?c2)
)

(<= (doesMove ryu roll_back)
	(true (at ryu ?c))
	(does ryu (roll ?c2))
	(cellsucc- ?c ?c2)
)

(<= (doesMove ken roll_forth)
	(true (at ken ?c))
	(does ken (roll ?c2))
	(cellsucc- ?c ?c2)
)

(<= (doesMove ken roll_back)
	(true (at ken ?c))
	(does ken (roll ?c2))
	(cellsucc+ ?c ?c2)
)

(<= (doesMove ryu step_forth)
	(true (at ryu ?c))
	(does ryu (step ?c2))
	(cellsucc+ ?c ?c2)
)

(<= (doesMove ryu step_back)
	(true (at ryu ?c))
	(does ryu (step ?c2))
	(cellsucc- ?c ?c2)
)

(<= (doesMove ken step_forth)
	(true (at ken ?c))
	(does ken (step ?c2))
	(cellsucc- ?c ?c2)
)

(<= (doesMove ken step_back)
	(true (at ken ?c))
	(does ken (step ?c2))
	(cellsucc+ ?c ?c2)
)

(init (combinedAction ryu 3 highblock nothit))
(init (combinedAction ken 4 highblock nothit))

(<= (next (combinedAction ?role ?cell ?move crit))
	(role ?role)
	(true (at ?role ?cell))
	(doesMove ?role ?move)
	(hitByCritical ?role)
)

(<= (next (combinedAction ?role ?cell ?move crit))
	(role ?role)
	(true (at ?role ?cell))
	(doesMove ?role ?move)
	(ko ?role)
)

(<= (next (combinedAction ?role ?cell ?move hit))
	(role ?role)
	(true (at ?role ?cell))
	(doesMove ?role ?move)
	(hit ?role)
)

(<= (next (combinedAction ?role ?cell ?move nothit))
	(role ?role)
	(true (at ?role ?cell))
	(doesMove ?role ?move)
	(nothit ?role)
)

(<= (ko ?r)
	(hit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r2 ?m2)
	(damage ?m2 ?n)
	(true (life ?r ?l1))
	(loseLife ?n ?l1 0)
)

(<= (hit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(hits ?m2 ?lvl)
	(nextPos ?r ?nextlvl)
	(doHit ?lvl ?nextlvl)
	(not (blocks ?m ?lvl))
	(not (counters ?m ?m2))
	(not (isCritical ?m2))
)

(<= (nothit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(hits ?m2 ?lvl)
	(not (blocks ?m ?lvl))
	(counters ?m ?m2)
)

(<= (nothit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(reaches ?dist)
	(hits ?m2 ?lvl)
	(blocks ?m ?lvl)
)

(<= (nothit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(hits ?m2 ?lvl)
	(range ?m2 ?dist)
	(reaches ?dist)
	(nextPos ?r ?nextlvl)
	(not (doHit ?lvl ?nextlvl))
)

(<= (nothit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(does ?r2 ?m2)
	(range ?m2 ?dist)
	(not (reaches ?dist))
)

(<= (nothit ?r)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(does ?r ?m)
	(noRange ?r2)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(cellsucc+ 1 2)
(cellsucc+ 2 3)
(cellsucc+ 3 4)
(cellsucc+ 4 5)
(cellsucc+ 5 6)
(cellsucc- 6 5)
(cellsucc- 5 4)
(cellsucc- 4 3)
(cellsucc- 3 2)
(cellsucc- 2 1)

(<= (cellsucc ?n0 ?n1)
	(cellsucc+ ?n0 ?n1)
)
(<= (cellsucc ?n0 ?n1)
	(cellsucc- ?n0 ?n1)
)

(reaches 5)

(<= (reaches 2)
	(true (at ryu ?n1))
	(true (at ken ?n2))
	(cellsucc ?n1 ?n2)
)

(<= (reaches 2)
	(true (at ryu ?n1))
	(true (at ken ?n2))
	(cellsucc ?n1 ?t)
	(cellsucc ?t ?n2)
)

(<= (reaches 1)
	(true (at ryu ?n1))
	(true (at ken ?n2))
	(cellsucc ?n1 ?n2)
)

(doHit high standing)
(doHit mid standing)
(doHit mid crouching)
(doHit low standing)
(doHit low crouching)
(doHit low lying)

(lifesucc 10 9)
(lifesucc 9 8)
(lifesucc 8 7)
(lifesucc 7 6)
(lifesucc 6 5)
(lifesucc 5 4)
(lifesucc 4 3)
(lifesucc 3 2)
(lifesucc 2 1)
(lifesucc 1 0)

(<= (moreLife ?l1 ?l2)
	(lifesucc ?l1 ?l2)
)
(<= (moreLife ?l1 ?l2)
	(lifesucc ?l1 ?t)
	(moreLife ?t ?l2)
)

(<= (loseLife 0 ?n ?n)
	(possibleLife ?n)
)

(<= (loseLife 1 ?n1 ?n2)
	(lifesucc ?n1 ?n2)
)

(<= (loseLife 2 ?n1 ?n2)
	(lifesucc ?n1 ?t)
	(lifesucc ?t ?n2)
)

(<= (loseLife 3 ?n1 ?n2)
	(lifesucc ?n1 ?t)
	(lifesucc ?t ?t2)
	(lifesucc ?t2 ?n2)
)

(loseLife 2 1 0)
(loseLife 3 1 0)
(loseLife 3 2 0)

(energysucc 3 2)
(energysucc 2 1)
(energysucc 1 0)

(<= (energyleft ?r)
	(role ?r)
	(not (true (energy ?r 0)))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(init (step 0))
(<= (next (step ?n2))
	(true (step ?n))
	(step++ ?n ?n2)
)

(step++ 0 1)
(step++ 1 2)
(step++ 2 3)
(step++ 3 4)
(step++ 4 5)
(step++ 5 6)
(step++ 6 7)
(step++ 7 8)
(step++ 8 9)
(step++ 9 10)
(step++ 10 11)
(step++ 11 12)
(step++ 12 13)
(step++ 13 14)
(step++ 14 15)
(step++ 15 16)
(step++ 16 17)
(step++ 17 18)
(step++ 18 19)
(step++ 19 20)
(step++ 20 21)
(step++ 21 22)
(step++ 22 23)
(step++ 23 24)
(step++ 24 25)

(<= terminal
	(true (step 25))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= terminal
	(role ?r)
	(true (life ?r 0))
)

(<= (goal ?r 100)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(true (life ?r2 0))
	(distinct ?n 0)
)

(<= (goal ?r2 0)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(true (life ?r2 0))
	(distinct ?n 0)
)

(<= (goal ?r 75)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(true (life ?r2 ?n2))
	(distinct ?n 0)
	(distinct ?n2 0)
	(moreLife ?n ?n2)
)

(<= (goal ?r2 25)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(true (life ?r2 ?n2))
	(distinct ?n 0)
	(distinct ?n2 0)
	(moreLife ?n ?n2)
)

(<= (goal ?r 25)
	(role ?r)
	(role ?r2)
	(distinct ?r ?r2)
	(true (life ?r ?n))
	(true (life ?r2 ?n))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sees_XML(...) rules

(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))