Home   Help Search Login Register  

Author Topic: FSM ?  (Read 3069 times)

0 Members and 1 Guest are viewing this topic.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
FSM ?
« on: 10 Jun 2007, 23:20:05 »
either im really st00pid or dis is really advanced  :dry: but i cant seem 2 find ny thread dat explains exactly what .FSM files r  ???

cuz i have dis command ? commandFSM nd it seems interesting ting ?

can anybody explains wat dese files r ?... nd how do we sue em ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: FSM ?
« Reply #1 on: 10 Jun 2007, 23:25:59 »
hmmm.....well, try reading here a bit, it might help......maybe.

http://community.bistudio.com/wiki/FSM


Planck
I know a little about a lot, and a lot about a little.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: FSM ?
« Reply #2 on: 10 Jun 2007, 23:37:37 »
ohh i know dat stuff... i learned it 4 month or so but only in theory (schools go figure  ::))

cud b interestin 2 play w/ if ill ever see an example 2 ho its exactly works :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: FSM ?
« Reply #3 on: 11 Jun 2007, 00:03:15 »
AFAIK there is not way to access FSM except through addons. CrashDome has written an FSM editor, so you could play around with that and see what comes out. You'll have to unpbo ArmA to get examples.  :blink:
urp!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: FSM ?
« Reply #4 on: 11 Jun 2007, 00:39:01 »
i guess ill look into da FSM edit then :D

LCD OUT

[edit] It seems nice... still need 2 see examples 2 get a general idea on how 2 work it  ::) so if ny1 can help w/ dat ill b gratefull
« Last Edit: 11 Jun 2007, 01:28:52 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: FSM ?
« Reply #5 on: 11 Jun 2007, 01:36:17 »
Search this bis forums for FSM. An example was posted there awhile back.
urp!

Offline CrashDome

  • Members
  • *
Re: FSM ?
« Reply #6 on: 11 Jun 2007, 18:21:15 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: FSM ?
« Reply #7 on: 11 Jun 2007, 18:56:47 »
AFAIK there is not way to access FSM except through addons.

Sure? Supposedly commandFSM accepts .fsm files, I assume these files are just like sqf or sqs ones placed in the mission folder, but of course I might be wrong  :whistle:

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: FSM ?
« Reply #8 on: 11 Jun 2007, 20:54:02 »
Thanks for the link CrashDome, that is an excellent tutorial. I guess my confusion arose from the threads on the BI forums discussing Civilian combat behaviour, and how it could not be over-ridden without addons. I now see that was all about native FSMs.

The problems with waypoints and FSM sound like the same old problem in OFP of not being able to over-ride waypoint  behaviour and combatmode. Any changes would last only a few seconds before then the AI would return to the waypoint settings.
urp!

Offline CrashDome

  • Members
  • *
Re: FSM ?
« Reply #9 on: 11 Jun 2007, 21:54:05 »
Actually, the problem is opposite with FSM! For some reason, waypoints would no longer continue after an FSM (according to Rune and based on preliminary tests). Example: AI on waypt 2 heading to waypt 3 and you call some "Evasive manuevar" FSM or similar... they finish evasive action and then either don't continue back to waypt 3 OR they get to waypt 3 and don't continue OR some go to waypt 3 but others stop...etc..etc.. :D

However, the preliminary testing of groups was done using the included mission by Rune on v1.05.

Since then, I have tested myself on 1.06 and 1.07beta WITHOUT using any moveTo commands and found that the AI behave better. Perhaps it was a bug? or maybe the way movement was scripted?

Another oddity is if you join a unit to a group while an FSM is executing for the whole group. The FSM has a _units parameter that does not change after the join (obviously it is passed in by value). Therefore, the new unit will suddenly run for the next waypoint (instead of formation) while the others are doing something else because he is not in the _units paramter. You can order a "HALT" command on the new unti I suppose, but not on the others during the FSM because it will kill it completely.. so it is advisable to not join units during a group-wide FSM. If the leader is not part of an FSM, than the new unit will simply follow the leader.

Anyways, we are getting closer to more useful FSMs, but also finding out that they are as limited as scripts - if not more so. (Note: They still might perform better than certain scripts though)

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: FSM ?
« Reply #10 on: 11 Jun 2007, 23:20:40 »
So moveTo is exclusively an FSM command?
urp!

Offline CrashDome

  • Members
  • *
Re: FSM ?
« Reply #11 on: 12 Jun 2007, 01:14:20 »
more like... moveTo was the only command that worked without causing the FSM to terminate! ::)

It would seem that moveTo and setDestination are both for scripted FSMs specifically although can be used in a script. The moveTo command initiates a "low-level" movement order... and I mean "order" in a very loose sense. See, FSMs are like orders themselves. Thus, if you doMove or commandMove you are changing the order for the unit(s) and thus the FSM kaputs. I think moveTo actively makes a unit move, but setDestination sets a target destination (like the yellow box you see in Cadet mode for the formation) and allows the engine to move the unit otherwise.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: FSM ?
« Reply #12 on: 12 Jun 2007, 03:00:21 »
I asked about moveTo because I used on a civ the other day and he didn't move, so I resorted to doMove. Oddly enough moveToCompleted and moveToFailed still worked.
urp!

Offline WhisperOFP

  • Members
  • *
  • I'm a llama!
Re: FSM ?
« Reply #13 on: 19 Jun 2007, 11:32:32 »
more like... moveTo was the only command that worked without causing the FSM to terminate! ::)

It would seem that moveTo and setDestination are both for scripted FSMs specifically although can be used in a script. The moveTo command initiates a "low-level" movement order... and I mean "order" in a very loose sense. See, FSMs are like orders themselves. Thus, if you doMove or commandMove you are changing the order for the unit(s) and thus the FSM kaputs. I think moveTo actively makes a unit move, but setDestination sets a target destination (like the yellow box you see in Cadet mode for the formation) and allows the engine to move the unit otherwise.
Sorry for the bump.
Thanks for this usefull piece of information, Crashdome!
It explains much of the issues I had yesterday.
I use FSMs for dynamic "mission" given to AI. The one I was building yesterday was a simple "go to objective X position" FSM ordered to a group. It is to check distance to objective, go on foot if close enough, otherwise try to find an available empty vehicle nearby, and if not, ask for transport.
I had issues with the second part of the FSM logic : when a free vehicle is found nearby, I set 1 driver, group leader as gunner if any, and the rest of the group as cargo, using AssignAs.... . When I used pseudo-FSM (sqf scripts) I could use the group move position command, and the units use their assigned vehicle for transport automatically, no need to order them to move, get in vehicle, etc... With .fsm, move command does not work, and moveTo is individual and engine doesn't take advantage of assigned vehicles for transport, they run away on foot.
I'll try with setDestination, perhaps it will use assignedVehicles, but the Wiki description seems to imply this command is to use for choppers (reference to pilot, obscure "planningMode" & "reforcePlan" parameters, etc...)
Otherwise I'm stuck with sqf pseudo-fsm, I'm afraid.
« Last Edit: 19 Jun 2007, 11:51:50 by WhisperOFP »

Offline CrashDome

  • Members
  • *
Re: FSM ?
« Reply #14 on: 19 Jun 2007, 17:51:30 »
Just a suggestion, try to break up your FSM into more managable chunks. Create one FSM to determine if you should use a vehicle or go on foot and then call a second FSM based on the result (if needed). I never found a way to get units to board a vehicle during an FSM, but I found I could create the orders and they would carry them out post-FSM.  So if you determine you want to use a vehicle, setup an order or waypoint for the units to get into the vehicle and go to the destination. Kill the FSM and the units will respond.