Jump to content

Ready to Mod Red Dead?

Join us on our bold adventure into the West on our all-new website, Mod-RDR.com, dedicated to all things Red Dead Redemption II on PC.
Our very first mod for RDR2, a simple trainer allowing you to change your model and teleport, is now available on Mod-RDR.com.

PNWParksFan

Most problematic issues with LSPDFR 0.3.1 API that ought to be fixed in 0.4

Recommended Posts

I'm aware of Sam's post regarding plans for an API update after the main release of 0.4, and look forward to more discussion of that in the near future. In the meantime, with release fast-approaching, there are a handful of major issues that have caused headaches for many developers using the LSPDFR 0.3.1 API which I am really hoping will be fixed in 0.4: 

 

  • During pursuits, Cop and Suspect Ped tasks are reset every 2 seconds. Functions.SetCopAsBusy doesn't consistently prevent this from happening. This makes it nearly impossible to alter how suspects and cops behave in pursuits, e.g. if you want to make a suspect jack a new vehicle (their enter vehicle task will get terminated before they're even in it), or have a cop do something in particular. SetPursuitDisableAI turns off all AI for the entire pursuit, there needs to be a way to disable AI on individual peds (cop or suspect). 
     
  • Whenever LSPDFR is running, regardless of whether a pursuit is active, all law enforcement peds in the game (even add-on peds) can't change their secondary accessory/vest clothing component, because of LSPDFR's holster management. This makes it entirely impossible to give plugin-spawned peds specific vest clothing. 
     
  • SetPedAsArrested doesn't actually seem to do anything, leading to a bunch of mods doing their own "arrested" implementation involving animations and trying to clear tasks, which sometimes conflict. 
     
  • If pursuit suspects get far from the player, the pursuit goes inactive and if they're very far away terminates. This makes sense in default "bunch of cops chasing a car on a road" situation, but doesn't make sense in a lot of other scenarios. Constantly looping SetPursuitIsActiveForPlayer is super glitchy and doesn't really work anyways. 

 

Obviously there are many more things devs would like to see in the API once we get a sense for what new features LSPDFR will have to offer, these are just a few of the biggest issues IMO that have really hindered plugin development over the past couple years. 


[Coming soon!] Coastal Callouts: Upcoming action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Share this post


Link to post
Share on other sites

Thanks for the suggestions.

 

8 hours ago, PNWParksFan said:
  • During pursuits, Cop and Suspect Ped tasks are reset every 2 seconds. Functions.SetCopAsBusy doesn't consistently prevent this from happening. This makes it nearly impossible to alter how suspects and cops behave in pursuits, e.g. if you want to make a suspect jack a new vehicle (their enter vehicle task will get terminated before they're even in it), or have a cop do something in particular. SetPursuitDisableAI turns off all AI for the entire pursuit, there needs to be a way to disable AI on individual peds (cop or suspect). 

 

This is a consequence of how our AI works.  If a ped isn't doing what we think they are supposed to be doing, we will try to correct this.  In my opinion, that's perfectly logical.  Our API doesn't support changing the tasks of pursuit suspects, so I don't think anyone should be too surprised that when you forcibly change their tasks without LSPDFR knowing, that we change them back. 

 

I don't think we will be able to disable AI on an individual basis.  It's not practical for people to pick and choose like this.  The best we can potentially do is disable all police AI and/or all suspect AI, but even that isn't as simple as you might think and there's quite a few things we'd have to change first.  I think a better approach is the new pursuit scenarios that we are adding in 0.4 which we can look at further when we get into the API stuff following the initial release.

 

8 hours ago, PNWParksFan said:
  • Whenever LSPDFR is running, regardless of whether a pursuit is active, all law enforcement peds in the game (even add-on peds) can't change their secondary accessory/vest clothing component, because of LSPDFR's holster management. This makes it entirely impossible to give plugin-spawned peds specific vest clothing. 

 

This isn't an issue anymore in 0.4.

 

8 hours ago, PNWParksFan said:
  • SetPedAsArrested doesn't actually seem to do anything, leading to a bunch of mods doing their own "arrested" implementation involving animations and trying to clear tasks, which sometimes conflict.  

 

The doc says: "Sets the ped as arrested internally. Please use with caution as I didn't investigate any possible side effects yet."

It will cause IsPedArrested() to return true and will prevent the ped from being stopped by the player and should prevent them from being pursued by the AI.  I don't think it was ever intended as having anything to do with animations - it's simply a flag and is the same one which we set after a ped has been arrested either by the player or AI. 

 

9 hours ago, PNWParksFan said:
  • If pursuit suspects get far from the player, the pursuit goes inactive and if they're very far away terminates. This makes sense in default "bunch of cops chasing a car on a road" situation, but doesn't make sense in a lot of other scenarios. Constantly looping SetPursuitIsActiveForPlayer is super glitchy and doesn't really work anyways. 

 

Everything regarding pursuits in 0.4 is entirely different.  Not sure if this will still be relevant or not, and not sure what sort of scenarios it makes sense for.  This is something that would need to wait until the API update.


"You tell me exactly what you want, and I will very carefully explain to you why it cannot be."

Share this post


Link to post
Share on other sites

In regards to:

 

2 hours ago, Sam said:

Thanks for the suggestions.

 

The doc says: "Sets the ped as arrested internally. Please use with caution as I didn't investigate any possible side effects yet."

It will cause IsPedArrested() to return true and will prevent the ped from being stopped by the player and should prevent them from being pursued by the AI.  I don't think it was ever intended as having anything to do with animations - it's simply a flag and is the same one which we set after a ped has been arrested either by the player or AI. 

I think another function, such as SetPedAsHandcuffed (with a toggle boolean to remove this state) would be a good addition, in reference to this issue. No animations need to be involved in my opinion, just sets the hands behind the pedestrians back and invoke whatever else (such as an object) would occur if handcuffed through LSPDFR natively. To supplement this, there could also be IsPedHandcuffed which just returns false and true respectively.

Edited by liverlande

Share this post


Link to post
Share on other sites

Thanks for your quick responses Sam. Glad to hear that most of these will already have been resolved. 

 

7 hours ago, Sam said:

This is a consequence of how our AI works.  If a ped isn't doing what we think they are supposed to be doing, we will try to correct this.  In my opinion, that's perfectly logical.  Our API doesn't support changing the tasks of pursuit suspects, so I don't think anyone should be too surprised that when you forcibly change their tasks without LSPDFR knowing, that we change them back. 

 

I don't think we will be able to disable AI on an individual basis.  It's not practical for people to pick and choose like this.  The best we can potentially do is disable all police AI and/or all suspect AI, but even that isn't as simple as you might think and there's quite a few things we'd have to change first.  I think a better approach is the new pursuit scenarios that we are adding in 0.4 which we can look at further when we get into the API stuff following the initial release.

 

This one I have to disagree with a bit. I understand the idea behind what you're saying, and I see why it makes sense to do that. But this severely limits how much callout creators can add variety in their pursuits. The new pursuit scenarios may address this, we'll have to see when it comes out. But there will always be edge case situations where you want to do something custom that doesn't fit into the existing paradigm, but don't want to lose all the other AI. Being able to separately disable it for suspects and cops would be a huge step in the right direction; my biggest issue is wanting to give suspects custom tasks but not lose all of the effort that LSPDFR has put into the pursuits AI. 

 

Obviously I don't know exactly what your code looks like, but it seems like it shouldn't be that difficult to disable the AI on a single ped. Keep a List<Ped> of peds which are exempted from the pursuit AI. Whatever method is checking for and reassigning tasks, just check if the ped is in that list before assigning a task. If something is constantly checking whether the ped is still doing what you think it should be doing, that same code can be constantly checking if that ped is exempt.   

 

Do the Scenarios affect how the police behave too, or is it just for suspect AI? It would be nice to be able to set scenarios on pursuing police to set e.g. how aggressive they are, what type of force they use, whether they pursue on foot or by vehicle, etc. 

 

 


[Coming soon!] Coastal Callouts: Upcoming action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Share this post


Link to post
Share on other sites
On 1/18/2019 at 3:12 AM, PNWParksFan said:

Do the Scenarios affect how the police behave too, or is it just for suspect AI? It would be nice to be able to set scenarios on pursuing police to set e.g. how aggressive they are, what type of force they use, whether they pursue on foot or by vehicle, etc. 

I think it would be amazing if you could take control of the suspect, e.g. alter the path he might take. Could have semi-scripted pursuits. For example, you could have the suspect flee into an ambush or into his hood where he leaves the car and flees on foot. Or have him flee with his car but stick to a certain area because he knows it.

Or have him stop to pick up an armed buddy and take off again.

Could also have single cops go ahead of the suspect and stop a few hundred meters in front and get out, a bit like a roadblock. Lots of potential.


Logging in...

Launching game...

Error launching game: Cannot load while loading. Please log out and retry.

Logging out...

Error logging out. You are not logged in. You need to be logged in to log out. Please log in to log out.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...