-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Critter combined tree #113
base: develop
Are you sure you want to change the base?
Changes from 4 commits
d630ada
187fd60
1fb7086
946eb0a
71a6de8
fa91279
9fe8cdf
82cddaf
1a2f0d0
29d6467
d9a52d6
18ce5d8
fa3bb6b
9244d46
79273fd
e3ff43b
882f865
64e3872
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,107 @@ | ||||||||||||||
{ | ||||||||||||||
selector: [ | ||||||||||||||
{ | ||||||||||||||
guard: { | ||||||||||||||
|
||||||||||||||
// Territory would to be implemented as Component | ||||||||||||||
// Implementation of territorial Critter | ||||||||||||||
componentPresent: "Behaviours:Territory", | ||||||||||||||
values: ["F Territory != null"], | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would try to make a lookup of a field (indicated by However, I believe you want to check against the value
Suggested change
Alternatively, you can use the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the comment above about the component, this should most likely be
Suggested change
|
||||||||||||||
"child": { | ||||||||||||||
"sequence": [ | ||||||||||||||
{ | ||||||||||||||
"lookup": { | ||||||||||||||
"tree": "territorialCritter.behavior" | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
] | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// First Guard fo Selector for Territory End. | ||||||||||||||
guard: { // Implementation of scared Critter | ||||||||||||||
componentPresent: "Behaviors:FindNearbyPlayers", | ||||||||||||||
values: ["N charactersWithinRange != null"], // Adjust for Nemesis / Scary Creatures | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We discussed this in the meeting today. The Technically, we could use Therefore, using the
Suggested change
|
||||||||||||||
|
||||||||||||||
child: { | ||||||||||||||
sequence: [ | ||||||||||||||
{ | ||||||||||||||
"lookup": { | ||||||||||||||
"tree": "scaredCritter.behavior" | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
] | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// Here would be Implementation for Base Needs | ||||||||||||||
guard: { | ||||||||||||||
componentPresent: "CitizenNeed:Water", | ||||||||||||||
value: ["F CitizenNeed:Water.value < CitizenNeed:goal"], | ||||||||||||||
lookup:{ | ||||||||||||||
"tree": "findWater.behavior" | ||||||||||||||
} | ||||||||||||||
} , | ||||||||||||||
// Implementation for Water Need | ||||||||||||||
guard: { | ||||||||||||||
componentPresent: "CitizenNeed:Water", | ||||||||||||||
value: ["F CitizenNeed:Water.value < CitizenNeed:goal"], | ||||||||||||||
lookup:{ | ||||||||||||||
"tree": "findWater.behavior" | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
// Implementation for Food Need | ||||||||||||||
guard: { | ||||||||||||||
componentPresent: "CitizenNeed:Food", | ||||||||||||||
value: ["F CitizenNeed:Food.value < CitizenNeed:goal"], | ||||||||||||||
needfood == true, | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// Implementation for Sleep Need | ||||||||||||||
guard: { | ||||||||||||||
componentPresent: "CitizenNeed:Sleep", | ||||||||||||||
value: ["F CitizenNeed:Sleep.value < CitizenNeed:goal"], | ||||||||||||||
lookup:{ | ||||||||||||||
"tree": "findRest.behavior" | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
guard:{ // From Deer Behavior | ||||||||||||||
componentPresent: "fleeingComponent", | ||||||||||||||
value:["N distance"], | ||||||||||||||
child:{ | ||||||||||||||
sequence:[ | ||||||||||||||
check_flee_continue, | ||||||||||||||
{lookup: {tree: "Behaviors:flee"}} | ||||||||||||||
] | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
guard: { | ||||||||||||||
componentPresent: "Behaviors:FindNearbyEntity", // Implementation ??? | ||||||||||||||
values: ["F hungerEntity < 25"], | ||||||||||||||
|
||||||||||||||
child: { | ||||||||||||||
"lookup": {"tree": "aggressiveCritter.behavior"} | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
guard: { // Implementation for Friendly Critter | ||||||||||||||
componentPresent: "Behaviours:FindNearbyPlayers", | ||||||||||||||
values: ["F itemInHand == nonEmpty"], | ||||||||||||||
|
||||||||||||||
child: { | ||||||||||||||
"lookup": {"tree": "friendlyCritter.behavior"} | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
{ | ||||||||||||||
lookup: { | ||||||||||||||
tree: "Behaviors:stray" | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
] | ||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<mxfile host="65bd71144e"> | ||
<diagram id="ajuhjo6TS9aHFvpaHqaE" name="Page-1"> | ||
<mxGraphModel dx="1953" dy="1436" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1600" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0"/> | ||
<mxCell id="1" parent="0"/> | ||
<mxCell id="25" value="" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=#F5F5F5;fontSize=15;fontColor=#ffffff;fillColor=#60a917;strokeColor=#2D7600;opacity=50;" parent="1" vertex="1"> | ||
<mxGeometry x="180" y="260" width="460" height="880" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="30" value="-&gt; get Health Nemesis<br>-&gt; Deal Damage<br>-&gt; animation.<br>return new Health value" style="shape=card;whiteSpace=wrap;html=1;" parent="1" vertex="1"> | ||
<mxGeometry x="190" y="910" width="140" height="170" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="29" value="-&gt; Get Position Nemesis<br>-&gt;Move_Toward Vector?<br>-&gt; return distance between?" style="shape=card;whiteSpace=wrap;html=1;" parent="1" vertex="1"> | ||
<mxGeometry x="430" y="920" width="140" height="150" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;fontSize=15;fillColor=#eeeeee;strokeColor=#36393d;" parent="1" vertex="1"> | ||
<mxGeometry x="370" y="510" width="100" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="3" value="<font style="font-size: 15px" color="#000000">?</font>" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;" parent="1" vertex="1"> | ||
<mxGeometry x="400" y="290" width="40" height="40" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="4" value="<span style="font-size: 15px">Nemesis Visibile?</span>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> | ||
<mxGeometry x="320" y="330" width="200" height="90" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="5" value="Chaser (Wolf)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#60a917;fontColor=#ffffff;strokeColor=#2D7600;" parent="1" vertex="1"> | ||
<mxGeometry x="500" y="200" width="140" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="6" value="" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#050505;gradientColor=#191919;strokeColor=#666666;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="390" y="539.7099999999999" as="sourcePoint"/> | ||
<mxPoint x="450" y="539.7099999999999" as="targetPoint"/> | ||
<Array as="points"> | ||
<mxPoint x="410" y="539.7099999999999"/> | ||
<mxPoint x="420" y="539.7099999999999"/> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="7" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="13" target="8" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="400" y="810" as="sourcePoint"/> | ||
<mxPoint x="540" y="597.9999999999998" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="8" value="Attack" style="ellipse;whiteSpace=wrap;html=1;fontSize=15;fillColor=#fa6800;strokeColor=#C73500;fontColor=#000000;" parent="1" vertex="1"> | ||
<mxGeometry x="240" y="900" width="100" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="9" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="5" target="3" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="420.0000000000002" y="410" as="sourcePoint"/> | ||
<mxPoint x="420.0000000000002" y="440" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="10" value="<span style="font-size: 15px">Nemesis in Range?</span>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> | ||
<mxGeometry x="320" y="620" width="200" height="90" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="11" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="13" target="12" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="410" y="810" as="sourcePoint"/> | ||
<mxPoint x="490" y="790" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="12" value="Chase" style="ellipse;whiteSpace=wrap;html=1;fontSize=15;fillColor=#fa6800;strokeColor=#C73500;fontColor=#000000;" parent="1" vertex="1"> | ||
<mxGeometry x="480" y="900" width="100" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="13" value="" style="rounded=0;whiteSpace=wrap;html=1;fontSize=15;fillColor=#eeeeee;strokeColor=#36393d;" parent="1" vertex="1"> | ||
<mxGeometry x="370" y="740" width="100" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="14" value="" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#050505;gradientColor=#191919;strokeColor=#666666;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="390" y="769.71" as="sourcePoint"/> | ||
<mxPoint x="450" y="769.71" as="targetPoint"/> | ||
<Array as="points"> | ||
<mxPoint x="410" y="769.71"/> | ||
<mxPoint x="420" y="769.71"/> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="15" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="4" target="2" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="590" y="330" as="sourcePoint"/> | ||
<mxPoint x="429.9999999999998" y="340" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="16" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="2" target="10" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="429.9999999999998" y="469.9999999999998" as="sourcePoint"/> | ||
<mxPoint x="429.9999999999998" y="519.9999999999998" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="17" value="" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="10" target="13" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="429.9999999999998" y="579.9999999999998" as="sourcePoint"/> | ||
<mxPoint x="429.9999999999998" y="629.9999999999998" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="19" value="" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=#F5F5F5;fontSize=15;fontColor=#333333;fillColor=#f5f5f5;strokeColor=#666666;opacity=50;" parent="1" vertex="1"> | ||
<mxGeometry x="640" y="260" width="210" height="110" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="20" value="Stray" style="rounded=0;whiteSpace=wrap;html=1;fontSize=15;" parent="1" vertex="1"> | ||
<mxGeometry x="680" y="280" width="120" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="21" value="Default" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=#F5F5F5;fontSize=15;fontColor=#000000;opacity=50;" parent="1" vertex="1"> | ||
<mxGeometry x="710" y="340" width="60" height="30" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="22" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.867;exitY=-0.002;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="25" target="20" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="570" y="300" as="sourcePoint"/> | ||
<mxPoint x="745" y="330" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="23" value="Confi<br>(Nemesis)" style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;" parent="1" vertex="1"> | ||
<mxGeometry x="210" y="470" width="60" height="90" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="24" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;fontSize=15;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="260" y="490" as="sourcePoint"/> | ||
<mxPoint x="420" y="490" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="27" value="Confi<br>(Range)" style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;" parent="1" vertex="1"> | ||
<mxGeometry x="210" y="700" width="60" height="90" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="28" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;fontSize=15;" parent="1" edge="1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="260" y="720" as="sourcePoint"/> | ||
<mxPoint x="420" y="720" as="targetPoint"/> | ||
</mxGeometry> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the
TerritoryComponent
exists in the Behaviors module.The closest thing we have is TerritoryDistance, a component with two fields
distance
andlocation
.Therefore, the referenced component should probably be
and the referenced field below cannot be
Territory
(as it does not exist) but eitherdistance
orlocation
. I suspect that we can check whether the location is set.