Closed warxander closed 1 year ago
Is it possible to alter existing NPCs behavior or create custom AI companions for example?
Yes, it is possible.
If you know - could you please give a short briefing about how AI works and its most important API. (I saw comments in ge_scriptprocessingunit.h, but it seems to be incomplete for me, I didn't figure out how it works in general)
Unfortunately I never came write more documentation for this. There would be many things to explain here, starting with how an NPC decides what he wants to do. How he then selects an interaction object and goes to it. How the interactions are scripted (this is what the comments in ge_scriptprocessingunit.h are aiming for). Do you have a specific goal in mind?
Also, if I want to sync players in multiplayer - is it even possible to do it with entities without ScriptRoutine property?
Mhm, I am wondering to what kind of entities you are referring here. Because all NPCs also have the gCScriptRoutine_PS property set. Moving entities like projectiles? Probably even easier than synchronising NPCs, since there is a lot of randomness involved in their routines.
Do you have a specific goal in mind?
Yes, I'm trying to replicate NPCs for multiplayer mod.
I tried to use both approaches.
NPCs are always trying to do their own tasks when I tried to override them through AIFullStop
/SetTask
.
While StartPlayAnim
stops working after removing gCScriptRoutine_PS
property.
I also noticed than if you spawn two or more PC_Hero
entities - they all will be controled by localhost.
Looks like it's hardcoded or I need to disable/modify property - do you know something about it?
Ping, I would appreciate for any bit of information.
NPCs are always trying to do their own tasks when I tried to override them through
AIFullStop
/SetTask
.
Yeah, the reason for this is that the selection of an activity / interaction point is partly dependent on randomness and what other NPCs do. Thus syncing at this layer is likely to be quite difficult.
While
StartPlayAnim
stops working after removinggCScriptRoutine_PS
property.
I can't say anything about it of the top of my head, after a cursory look into Entity::StartPlayAni
I don't see the immediate connection to gCScriptRoutine_PS
.
I also noticed than if you spawn two or more
PC_Hero
entities - they all will be controled by localhost. Looks like it's hardcoded or I need to disable/modify property - do you know something about it?
I haven't checked, but I expect that this is coupled to the property set gCCharacterControl_PS
. Remove that from your second PC_Hero
and the movements should no longer be controlled by your input.
Yeah, I tried to remove gCCharacterControl_PS
- my game crashed.
Anyway, thanks a lot, I will keep researching, my project is here - https://github.com/gorn-se/gorn - any contributions are welcome ;)
Hi,
Is it possible to alter existing NPCs behavior or create custom AI companions for example?
If you know - could you please give a short briefing about how AI works and its most important API. (I saw comments in
ge_scriptprocessingunit.h
, but it seems to be incomplete for me, I didn't figure out how it works in general)Also, if I want to sync players in multiplayer - is it even possible to do it with entities without
ScriptRoutine
property?