Welcome to Open Carnage

A resource for gamers and technology enthusiasts, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

IceCrow14

A Pair of Projects (Universal AI sync & MP map with PvE elements)

This looks very nice, to bad only position and state is synchronized, it would be awesome to also synchronize and update the bones and animations.

 

Theres no chimera stuff for that?

Share this post


Link to post
Share on other sites
On 29/8/2018 at 11:44 AM, EmmanuelCD said:

This looks very nice, to bad only position and state is synchronized, it would be awesome to also synchronize and update the bones and animations.

 

Theres no chimera stuff for that?

Fortunately there are memory addresses for the object's rotations and animations, actually, I've already managed to update them too in a previous test but it was very resource consuming because the server had to send a message for every piece of data on every tick (For example, one for the biped's X, another one for the Y, for the Z, for the animation state, etc...) and as the amount of bipeds increased, the amount of messages did as well and at some point the server wouldn't be able to send all those messages to the client (about 7 per biped, multiply that by the amount of bipeds and then by the amount of players) or the client wouldn't receive all the messages it should, honestly I don't know but the result was that the client was disconnected from the server after a few seconds if you had about a dozen of bipeds. So what I'm doing currently is pure optimization, I made some changes to reduce the amount of messages per biped to 1 (That's why in the video you can see all the coordinates' data sent into one message. Much of the client's job is based on reading sub-strings). About the bones... I think there are offsets for their location and rotations too, but I'm only focused on the main object's properties to make this script somehow "universal" for every type of biped you include in the map. Finally, the animations... I've found very weird glitches that cause the bipeds to suddenly disappear when they play specific animations and I suspect it's something related with the "frame info type" setting of such animations.

 

Currently I'm not able to upload a video, but in a few hours I will so you can see the advances I've made.

Share this post


Link to post
Share on other sites

During animation playback there has to be a variable somewhere in memory that contains the current frame of the animation being processed. You could send only the value of that variable and probably even just write it into the client variable. Theoretically you could use that to sync animations without sending all the data for every node and bone.

 

My reasoning is that if you know the location and rotation of the root bone, and the current frame of animation playback, the client has all the information it needs to display everything correctly.


Kavawuvi: one of these days these glutes are gonna squawk all over you

Share this post


Link to post
Share on other sites
23 hours ago, Sunstriker7 said:

During animation playback there has to be a variable somewhere in memory that contains the current frame of the animation being processed. You could send only the value of that variable and probably even just write it into the client variable. Theoretically you could use that to sync animations without sending all the data for every node and bone.

 

My reasoning is that if you know the location and rotation of the root bone, and the current frame of animation playback, the client has all the information it needs to display everything correctly.

 

As far as I know, there isn't a known offset/address for such variable, it probably exists in the engine, but I don't know its location and unfortunately I don't know how to find memory addresses on my own (yet), I've been working only with the ones that are on the memory addresses and offsets document. The addresses I've used are for the object's X, Y, Z, Pitch, Yaw and Animation state (I haven't messed with the ones for the biped's body parts' data because that would mean sending a lot of information to the client, that should be read as substrings and consequently end up reducing the performance of the game) and I've achieved nice results, like this:

 

Spoiler

 

 

At the ending of the video you can see the glitch I mentioned before, some bipeds disappear when they play certain animations and still I haven't figured out what causes them to do such thing, it's almost senseless that they just go away like that because their coordinates are supposed to be updated on every tick, but strangely, if I erase/deactivate the code that updates the animations everything runs fine, just like it should... I'm actually thinking on using another method that involves using some client-side stuff instead of this, but I'm not sure if it would work.

Edited by IceCrow14

Share this post


Link to post
Share on other sites

It's time for another update on the AI synchronization stuff, and I'm glad to say that I'm close to release a first public version of the scripts I've been using for this, because having the whole thing there just getting older... Well, it would be better if people would start making new content with it because it's stable now that I've fixed a lot of glitches for both the server and the client's scripts, and added a bunch of functions that do most of the scripting job that was needed automatically. Currently the only thing one has to do to sync AI for a new map is declare the path of the scenario tag inside a specific function in the scripts to get everything running, which makes the process a lot quicker and less susceptible to glitches because unlike in the previous version, you had to declare the bipeds used by the AI manually and you could accidentally forget to declare one biped type and everything would be messed up. The next step is making a function that retrieves the path of the scenario path and declares it automatically so having to edit the scripts won't be needed anymore. Just dragging the file to your map scripts folder and that's all. This is how everything has been going:

 

 

I am going to write the main changes here, but will edit the main post aswell to have a full log of the progress that I've made since the beginning.

 

Improvements

 

- Now only the path of the scenario tag has to be declared and a bunch of functions do the rest.

- The client's script only runs on dedicated servers, so you can test the map in single player or in a local multiplayer match if you want.

- The limit of simultaneously existing AI has been increased to 300, however, I wouldn't recommend you to have more than 150 at the same time (seriously, don't do that).

- The server's script runs a function that sets the projectiles of the weapons used by the AI not to be client-side only, so you will be able to see the fired projectiles.

- Velocity synchronization: The bipeds' current velocity is sent to the clients, this means that you will be able to see their movement on 60 FPS (if you have Chimera's interpolation enabled).

- Now the dead/alive state of the bipeds is updated automatically, this is a fix to a bug I had found in previous versions, which kept your crosshair flashing if you aimed at a biped with it's health empy unless you hit it one more time.

 

Known glitches

 

- Neither the bipeds' weapons or their firing effects show up for the clients, however, the weapons appear right after the biped holding them is killed.

- I haven't set the "shields drained" effect to show up right (you can notice this in the video).

- AI spawned by default when the map loads can't be synchronized yet (this is something that should only affect the server).

- AI still doesn't sync inside of vehicles.

 

I know how to get rid of the first three bugs right now, about the last one, currently I don't know but I'll set up a function that disables vehicle combat for the AI at least until I find a fix for it.

Tucker933 and JadeMcLain like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.