Author Topic: Opposing factions bug...  (Read 760 times)

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Opposing factions bug...
« on: September 16, 2010, 03:00:16 pm »


               In a few areas in my module I have two NPC factions (as set up in the toolset) that are both neutral to the player but hostile to each other. NPCs in the player's starting area are completely happy to attack each other the moment they spot each other, but for some strange reason if I come across any similarly set up NPCs in other areas, they just stand there ignoring each other. This applies no matter what area I set as the starting area.

Now I've already come up with a simple workaround to "fix" the issue with a selection and attack command in the OnPerception script. However I was wondering if this is just a bug in the game that never got fixed over the last decade, or if I must have done something stupid without realizing it (obviously if it's the latter then I'd quite like to rectify that).
               
               

               
            

Legacy_Tassle_Hof

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
Opposing factions bug...
« Reply #1 on: September 16, 2010, 04:39:38 pm »


               I had a similiar problem in one of my modules. If I started in the area everything worked fine but if I started somewhere else and just entered the area everyone stood around looking stupid. I was told it was a problem with the AI in the OnPerceive script being too low.

I was advised to make the AI higher and it worked fine but then, of course, they never stopped fighting whether the PC was in the area or not so I ended up spawning in and destroying all the parties involved on the OnEnter/OnExit scripts of the area.

Sounds like you found your own solution so I guess the answer to your question (sorry I took the long way around) is that, yes, it appears to be a bug and no, you didn't do anything stupid. Of course, someone with more knowledge may have a different answer.

Hope that helps.

Tassle:happy:
               
               

               
            

Legacy_Zelknolf

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Opposing factions bug...
« Reply #2 on: September 17, 2010, 04:09:54 am »


               I wouldn't call it a "bug" so much as "a knowing sacrifice made in the efforts of improving overall performance of the game." AI is a pretty intensive process on your computer, so the AI is set to turn itself down to a notch below Lenny from Mice and Men when you're not there. It can lead to some quirks, like when hostile NPCs are standing next to each other, but you're not in the area to make the computer think it's worth making them behave like they should. The OnPercieve event fires when they see each other, but the resource-saving AI says it's not worth fighting yet. When you show up, the AI is revved up, but they've already seen one another and thus call no new OnPerceived event. As they're not in combat (because they never started) they don't look for new targets at the end of the round and just stand there stupidly. Potentially scratching their posteriors.



The first fix works because it's a workaround of the script. That is, it never gets a chance to decide against fighting, because you've added a line to make them fight. The second script works because the AI setting variables take precedence over any AI-reducing schemes to save resources. If the plan is to just make them mindlessly beat each other (like NPCs sparring in an arena), I'd be inclined to wipe out their entire AIs and just order them to attack one another as part of the OnPerceived event, perhaps with a simple check in the heartbeat to see if they're out of combat (and to start if they are) in the case of a module that's expected to run a long time. It would give the benefits of saving the resources spent on the fight and still allowing players walking by to see the fellows pimpslapping one another with great vigor.
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Opposing factions bug...
« Reply #3 on: September 18, 2010, 04:49:13 pm »


               You might want to double check that the "Global Effect" button is ON for both the factions.