XML specification

Hi all,

Ive wrote up two classes to read XML files into a FiniteSM and into the CombinedSM:



FiniteSM:


<finiteMachine initialState="monster uncaring">
   <state name="monster uncaring">
      <pair input="player see" output="monster annoyed" />
      <pair input="player shoot" output="monster dead" />
   </state>
   <state name="monster annoyed">
      <pair input="player see" output="monster annoyed" />
      <pair input="player shoot" output="monster dead" />
   </state>
   <state name="monster dead"></state>
</finiteMachine>



CombinedSM


<CombinedMachine initialState="monster angreness">
   <state name="monster angreness">
      <innerstate name="uncaring" lowRange="0" highrange="50" />
      <innerstate name="angry" lowRange="30" highrange="55" />
      <innerstate name="enraged" lowRange="50" highrange="100" />
   </state>
   <state name="monster speed accuracy">
      <innerstate name="accuracy" lowRange="0" highrange="60" />
      <innerstate name="enraged" lowRange="40" highrange="100" />
   </state>
</combinedMachine>



Are those OK?

I could also create a class that would load an Entity with set attributes from an XML file if you want?

DP

Is the line

<pair input="player see" output="monster annoyed" />

necessary? Can you make it that if there are no options then there is no change in state? The repetitive lines can increase the size of the file.

yes.



Judging by the DP you are DarkProphet. If that is so then you forgot to log on.

sry, ://, that was me



DP

Looks fine to me, other than the ‘pair’ thing which I mentioned in a previous thread, but for which I couldn’t offer a better suggestion. :slight_smile:



Maybe ‘iopair’? Not great either, but at least it’s a little more explicit.



Not a big deal anyway.





–K

Hi there,



Looks fine to me, other than the 'pair' thing which I mentioned in a previous thread, but for which I couldn't offer a better suggestion.


Ok your entity was in a state, and for some reason ( stimula ) a transition happend from its state to another (output), so why don't you simply call transition.


   <state name="monster uncaring">
      <transition input="player see" output="monster annoyed" />
      <transition input="player shoot" output="monster dead" />
   </state>



Good job DP

everyone likes transition?



DP

I like. :slight_smile: I think it will help make the XML easier to read.



Sorry to have been a pain about it.





–K

thats fine, I work better under pressure anyway :stuck_out_tongue:



Ive just recreated VolatileZapper using the current codebase for the AISystem, and it has to be said that it is 10x if not 100x easier to do than before. :smiley:



Il be uploading volatileZapper (the new version with the AI) again soon to myjavaserver. So keep a look out for the URL in the usershowcase :wink:



DP