Announcement

Collapse
No announcement yet.

FSM Discussion and Beta Releases

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FSM Discussion and Beta Releases

    A thread for discussion of Finite State Machines in ArmA2, and beta releases. (Editing thread).

  • #2
    Re: FSM Discussion and Beta Releases

    Good initiative

    What FSMs are then? I'll shamelessly rip off kju's links from BIS forums(Original post):
    new-to-arma-2-threads
    new-to-arma-2-fsm-an-introduction
    new-to-arma-2-fsm-scripted-fsm-by-xeno
    new-to-arma-2-fsm-a-sample

    I'm starting to really like them in some applications vs. running pure .sqf scripts because structuring is so much easier now. You can visually see things in front of you, which makes spotting things like deadlocks a lot easier than before. Not that it's still easy as witnessed by my first FSM. I also find myself working quite a bit faster due to not having to write lots of if's and switches :)

    How is the performance then? It is rumored that better than with .sqf, and at least Xeno strongly thinks this is the case. I ran a small test with my disposableAT FSM which suggests that at least there's not much performance hit:
    Code:
    FSM running for 90 AI:
    Average fps over 60 seconds 49.256
    
    No FSM:
    Average fps over 60 seconds 49.2759

    Comment


    • #3
      Re: FSM Discussion and Beta Releases

      Hey Fincuan, had enormous troubles using your AT script in MP, it just wouldn't work, I believe it has something to do with locality, so I'll be doing some testing for you.

      Comment


      • #4
        Re: FSM Discussion and Beta Releases

        Ok I'll be happy to hear if you find out anything. The only problem there should be is respawns, it just doesn't work at the moment and I now why, but it isn't an easy fix. Other than that I had no problem in MP, but I did use a version quite a bit away from the one currently downloadable.

        edit: Actually there's is a semi-easy fix for the respawn problem which would mean that respawn works only for players. I think I'll go with that because it's not very often that AI respawn! :)

        Other than this I LOOVE FSMs now. So much easier to do stuff than with normal scripts. Expect a mission relying on them pretty soon.

        Comment


        • #5
          Re: FSM Discussion and Beta Releases

          Thanks for the post. Will be looking forward in reading more about this when I have more free time. So far, sounds really interesting!


          IN GAME ARMA: |TG-Irr| Lq.Snake

          Comment


          • #6
            Re: FSM Discussion and Beta Releases

            Originally posted by Fincuan View Post
            Ok I'll be happy to hear if you find out anything. The only problem there should be is respawns, it just doesn't work at the moment and I now why, but it isn't an easy fix. Other than that I had no problem in MP, but I did use a version quite a bit away from the one currently downloadable.

            edit: Actually there's is a semi-easy fix for the respawn problem which would mean that respawn works only for players. I think I'll go with that because it's not very often that AI respawn! :)

            Other than this I LOOVE FSMs now. So much easier to do stuff than with normal scripts. Expect a mission relying on them pretty soon.
            It wasn't a bug with your script. It was an ArmA bug. SynchronisedObjects is not global, and synchronisations are only local to the server!!!!

            Comment


            • #7
              Re: FSM Discussion and Beta Releases

              Originally posted by Rommel View Post
              It wasn't a bug with your script. It was an ArmA bug. SynchronisedObjects is not global, and synchronisations are only local to the server!!!!
              Ah thanks for that. I guess that makes sense since gamelogics are local to the server. I'll update the gamelogic part to only run on where the gamelogic is local and the instructions to reflect that.

              edit: Or go the lag lag way and use setVehicleInit from the server to run the FSM whenever it encounters a unit not local to it :row__577: Don't the BIS modules use something like this?

              edit2: Yup, the BIS modules do it precisely that way. The "synced"-part runs on the server, and whenever it encounters a non-local object it tries to run a script where that object is local. Maybe as an alternative, but I'm still afraid of the lag impact...
              Last edited by Fincuan; 11-09-2009, 05:52 AM.

              Comment


              • #8
                Re: FSM Discussion and Beta Releases

                I updated the disposableAT-fsm. See link in first post here: http://www.ofpec.com/forum/index.php....msg236469#new

                Main changes:
                • Fixed deadlock conditions(and probably introduced a bunch more lol)
                • Made it MP and respawn-compatible and tested both on a dedicated server. Respawn only works for human players. If the unit is AI the FSM will just quit when the unit dies. Getting past the synchronization problem Rommel described above required some of CBA's capabilities, so it's now a requirement if certain modes of use. No worries, it's not mandatory.
                • Streamlined the init-script


                I consider this version a "working one" in the sense that the main mechanics are now fully functional, and only tweaks and "eye-candy" should remain.
                Before anyone asks, the performance hit is like this:
                Code:
                FSM running for 120 AI and one player
                Average fps over 60 seconds 36.9902
                
                No FSM(stock Arma2)
                Average fps over 60 seconds 37.2029
                Not too bad I guess :)

                Readme:
                Code:
                FNC_disposableAT - The FSM-way of getting disposable AT weapons
                ---------------------------------------------------------------
                v0.6
                
                Features:
                ---------
                Enables disposability for M136s and RPG18s. Custom AT weapons can be added by editing the two arrays at fnc_disposableAT\weaponlist.sqf
                The system works for both players and AI in singleplayer. Multiplayer is currently untested.
                
                Ingame usage:
                -------------
                Pick up a launcher and use it. You won't need any rockets and you won't see them in the inventory, 
                the scripts will add them automatically once the time is right. Once fired the unit will automatically
                throw away the tube if you switch to another weapon, or try to use the gear-menu.
                
                Incorporating the system in a mission:
                ------------------------------------- 
                First copy the folder "fnc_disposableAT" to your mission's folder, so that the structure is like this: "missionfolder/fnc_disposableAT/".
                See example mission.
                Next you'll have to start the scripts some way. There's four alternative ways to do it.
                Use only one for each unit, although you can mix different ways in the same mission for different units.
                -----
                a) The init.sqf-way, works only for players and completely client-side. Preferable for players in multiplayer.
                	1. Add this to your mission's init.sqf: player execVM "fnc_disposableAT\Init.sqf";
                -----
                b) The initline way, works for all players and AI:
                	1. Add this to the unit's initline in editor: yaddayadda = this execVM "fnc_disposableAT\Init.sqf";
                -----
                c) The gamelogic way, works for all players and AI. Causes slight desync at the start of the mission if used on players in multiplayer, or for AI in same group with players.
                	No desync problems if used for groups containing only AI.
                	
                	REQUIRES CBA(Community Base Addons)
                	1. Add a gamelogic to your mission
                	2. Add this to the gamelogic's init line: yaddayadda = this execVM "fnc_disposableAT\Init.sqf";
                	3. Synchronize the gamelogic with ONE UNIT IN EACH GROUP that you want to enable the functionality for.
                -----
                d)	The initline way for several units at once, works for all players and AI. Causes slight desync at the start of the mission if used on players in multiplayer, 
                	or for AI in same group with players. No desync problems if used for groups containing only AI.
                	
                	REQUIRES CBA(Community Base Addons)
                	1. Add this to a unit's initline in editor: yaddayadda = [unit1,unit2_unit3] execVM "fnc_disposableAT\Init.sqf";
                -----	
                On top of that you need to have some M136 or RPG18 launchers in the mission. There should not be any rockets, only launchers.
                The scripts take care of rockets. Don't worry though, even if there is extra rockets the players won't be able to use them.

                Comment


                • #9
                  Re: FSM Discussion and Beta Releases



                  I am still leaving base credits to you, but this is what I am using at the moment.

                  Fixes: AI could be shot after shooting to retrieve their rocket.
                  - A few extra deadlocks
                  - Locality fixes (introduced a time-out)
                  - Gear menu check unnecessary for AI
                  - Gear menu would remove AI rockets simultaneously
                  - AI exit the FSM if they do not have AT any more, instead of wasting CPU cycles.

                  Changes: Separated the localities
                  - Removed all global variables
                  - Simplified a few things

                  Known bugs (in previous versions and current): Standard AI and those who have executed can be told to equip a M136, fire it, then drop it for use by players. (Not fixable without mass coding).

                  Edit2: (Fixed a bug in the picture above : 'Gear Close' closed loop)
                  Last edited by Rommel; 11-12-2009, 08:05 PM.

                  Comment


                  • #10
                    Re: FSM Discussion and Beta Releases

                    All these disposable-scripts, that'll be redundant with ACE2 anyway. Why don't we just toss in either my INKO Disposable, or zGuba's disposable in the TG mod pack? :S

                    Edit: Aaand posted in the CAA forum. So no need to mention this in more places I guess ^^



                    Comment


                    • #11
                      Re: FSM Discussion and Beta Releases

                      I'll speak for myself only here, but the disposable at-stuff was good practice for FSM use: that fsm was my first functional fsm ever. It runs for the duration of the mission and has to account for a number of things to work properly. I also wanted to see how a simple fsm like this affects the performance ingame, primarily to see if the path is worth following for more complex stuff. That's why I did it, not because it's something new or strictly needed. You'll have to ask the guy from down-under for his reasons :)

                      Comment


                      • #12
                        Re: FSM Discussion and Beta Releases

                        exact same mate. This is my first FSM to learn from :). In any case, I won't be touching ACE2, seeing as all the features in it other than the add-ons I already have in my missions, so... no need?

                        Comment


                        • #13
                          Re: FSM Discussion and Beta Releases

                          In that case you haven't had any close look at the feature list, Rommel, or you are the scripting god of ArmA and should apply for a job at BIS immediately since you can do more with script than others can with configs :P (Or well, okay. Most of what is in ACE can be done by raw scripts, even though it'd be vastly much more inefficient, CPU-consuming and prone to break down due to the available script-cycles per frame)

                          But, aside from that. I do agree that it's good practice for FSMs. Quite confusing buggers to work with initially. I still have so much trouble with them I prefer plain SQF since I consider that easier to both read and write than FSMs. Guess I need more practice :P



                          Comment


                          • #14
                            Re: FSM Discussion and Beta Releases

                            Originally posted by Inkompetent View Post
                            ...you are the scripting god of ArmA...
                            Finally someone see's it. :P
                            Look, I enjoyed ACE1, it was just very CPU consuming, more so than any scripts I made (including those I made for ACE1), I look forward to ACE2 because it may save me a lot of work, but a lot of my core things will stay; and a lot of things (rolling M136s? Come on, waste the network usage will you) are completely unneeded; I probably won't be touching it in terms of using it in multiplayer, unless it completely contrasts the experiences in ArmA1 (lag, bugs, crashing, the game by default does that well enough).

                            My biggest hope is that it is as modular as it was in A1, so that I can remove about 67% of it addon wise, and just keep what's great for MP.

                            edit: Don't take this as an attack on ACE2, kudos to the work you guys do, it is truly the best collaboration to come to A1/A2. If you ever need any help, I'm happy too.

                            edit2: I see ACE2 as Windows 7, great in many ways, but sometimes the features are just to becoming, and useless (in terms of usability for every day mission play, ie air refuelling), that sometimes switching back to XP can be just as good, if with a few enhancements :).

                            edit3: Final clarification on my opinion, I play 120 hour games, so I need scripts mods that WON'T BREAK, ever, else the server will break, now its hard enough with A1/A2 by default, but I've done that, and to use something like ACE1, it would break within hours. So its great for maybe a coop here, a coop there, but for long standing ops, it was useless.
                            Last edited by Rommel; 11-13-2009, 07:32 PM.

                            Comment

                            Connect

                            Collapse

                            TeamSpeak 3 Server

                            Collapse

                            Advertisement

                            Collapse

                            Twitter Feed

                            Collapse

                            Working...
                            X