Ok, some people know I've been working away on a better synced AI system. And since I'm certainly not all knowing on the concerns of syncing and JKs muddy network code I thought I would see what others had to say.
Synced AI is a hog for the already mediocre JK network code. Synced AI are like doors and elevators in that they are not a static element of the game and are therefore bound to be victims of lag/dropped packets. Doors will appear open when they shouldn't be or closed because of dropped packets. AI's will warp.
Now, I can use some aggressive syncing methods to try and alleviate errors and keep warping down...but that of course creats even more network traffic. An idea that I came up with while trying to defeat the now irrelevant thing limit was simply to destroy AIs that were out of the players 'sphere of influence', recording their position and condition and then recreating them with those attributes when players got near to thier last position again.
This is an ok method and actually has real potential for simple AI that exists basically to get shot by the player, but it has some drawbacks when you want to do more complex things with the AI. What if I want the AI to go on fighting when they're a long ways away from me. Or track me down. Or do a patrol. They can't do this stuff when they get to far away, because they'll be destroyed.
Now, a good way around this would be to have everything always happening on the server and only give the clients 'sphere's of influence' type deals. But how the hell do you STOP syncing something in a cog? I don't want to destroy them because then they'll be destroyed on the server too.
Would changing the cog flags of the synced AI cog to 'no sync' when there are no players 'in range' of the AI work? I just thought of this...I might actually be able to strong arm that into working.
Synced AI is a hog for the already mediocre JK network code. Synced AI are like doors and elevators in that they are not a static element of the game and are therefore bound to be victims of lag/dropped packets. Doors will appear open when they shouldn't be or closed because of dropped packets. AI's will warp.
Now, I can use some aggressive syncing methods to try and alleviate errors and keep warping down...but that of course creats even more network traffic. An idea that I came up with while trying to defeat the now irrelevant thing limit was simply to destroy AIs that were out of the players 'sphere of influence', recording their position and condition and then recreating them with those attributes when players got near to thier last position again.
This is an ok method and actually has real potential for simple AI that exists basically to get shot by the player, but it has some drawbacks when you want to do more complex things with the AI. What if I want the AI to go on fighting when they're a long ways away from me. Or track me down. Or do a patrol. They can't do this stuff when they get to far away, because they'll be destroyed.
Now, a good way around this would be to have everything always happening on the server and only give the clients 'sphere's of influence' type deals. But how the hell do you STOP syncing something in a cog? I don't want to destroy them because then they'll be destroyed on the server too.
Would changing the cog flags of the synced AI cog to 'no sync' when there are no players 'in range' of the AI work? I just thought of this...I might actually be able to strong arm that into working.
-El Scorcho
"Its dodgeball time!" -Stormy Waters
"Its dodgeball time!" -Stormy Waters