And I inadvertently suggested this sort of plugin in the Platforming AI topic, haha.
Anyway. The RTS movement is based on A*, stick an obstacle with the 'solid' attribute in the middle of the "RTS Basics" template and the units will automatically move around it, as well as any other RTS units. However, I think this might be difficult to utilise for a platformer, since it's an RTS Behaviour, so, someone could well possibly use the code on the SVN as a base for a platformer pathfinding behaviour.
Make it compatible with the Custom Movement as well, plz.
Edit: Ah, what the heck. I might as well set up a 'design' for how such a plugin could work and what it could do.[u:fsefuh94]Needed Functions[/u:fsefuh94]
[list:fsefuh94][*:fsefuh94] Identifying solids and platforms that the AI can land on, and working out routes to take to a destination based on the environment using nodes. The AI should also be able to drop through platforms, if it can't do this, it will find another route.[/*:m:fsefuh94]
[*:fsefuh94] Using objects, families and attributes to identify objects that the AI should actively avoid, which creates nodes with each tick. Of course, the event should also be able to set the 'margin for error' to allow the AI to 'make mistakes', since it would be no fun if the AI, say, could perfectly avoided every attack you throw at them.[/*:m:fsefuh94]
[*:fsefuh94] Being able to set a 'target' to chase after, and how much distance to stay from said target (for example, you could set the current position of the mouse as the target resulting in fun times for all
). Or set a destination via events.[/*:m:fsefuh94]
[*:fsefuh94] In general, being able to set the 'behaviour' of the AI in how it gets to a destination. The AI can try and get to its destination as fast as possible either while being as careful as possible or being downright suicidal about it, or the AI can take it slowly and more carefully. Or just as suicidally. Your choice.
[*:fsefuh94] The AI could be given a certain 'task' if there is no active destination or target. For example, the AI can wander within a certain range, or just wander aimlessly.[/*:m:fsefuh94][/list:u:fsefuh94]
[u:fsefuh94]With Platform Behaviour[/u:fsefuh94]
[list:fsefuh94][*:fsefuh94] If the same object has the Platformer Behaviour, the AI will use the behaviour's variables, eg, speed, jumping strength, etc.[/*:m:fsefuh94]
[*:fsefuh94] Not much else here, really, the AI uses the behaviour to move around.[/*:m:fsefuh94][/list:u:fsefuh94]
[u:fsefuh94]With Custom Movement Behaviour[/u:fsefuh94]
[list:fsefuh94][*:fsefuh94] Since, obviously, the Custom Movement's stuff is done in events, if the object has the behaviour, the AI will take values defined by events (variables are recommended) in place of the variables used by the Platformer Behaviour.[/*:m:fsefuh94]
[*:fsefuh94] The controls, such as moving around, jump, etc. Are also handed by events. In order for this to work, the Function plugin is required. The developer just needs to identify to the AI what the controls are, and what Functions are tied to them, and if a function is not being called while the AI is holding a 'virtual key' down, the AI will stop hold the 'virtual key', and try pressing it again.[/*:m:fsefuh94][/list:u:fsefuh94][u:fsefuh94]Optional Functions[/u:fsefuh94]
[list:fsefuh94][*:fsefuh94] The AI can be 'made aware' of additional abilities that it can perform in order to gain greater speed or horizontal/vertical distance, using functions and controls. These additional abilities would need:
** Maximum Distance/Speed gained
** A 'Priority' value, as to how often the ability should be used in certain situations.[/*:m:fsefuh94]
[*:fsefuh94] The AI can use certain functions/controls to identify attacks that it can perform, similar to additional abilities, but in a certain distance from an identified target, and if certain conditions are met. Such events would require:
** Minimum recommended distance from the target (the AI will either ignore or note this value depending on its behaviour)
** Maximum distance from the target
** A 'Priority' value, as to how often the attack should be used over other attacks.[/*:m:fsefuh94][/list:u:fsefuh94]
Well, that's all I've got for now, but I might update this later.