[ANet] Synchronise Skills

Posted By: Rasch

[ANet] Synchronise Skills - 01/09/11 00:49

hey it´s me again.

I just have a hopefully easy question. What do i have to do to "sychronise" flags and skills to every new connected player? because my player starts fighting and set some flags on the npc´s. Now these npc´s send their new skill to all and the fight starts on every client. If a new client joins all npc´s dont fight (only those who already connected and received) because there are no skills send from the other.

SO how to do it? or do you have some tips how to get all the flags and skills from every player and npc which are visible on the screen? (just the get) grin

Thanks

edit: ok i tried it out and i´m scanning with c_scan for entitys near my player. if i hit em they send a request to server and server send their correct skills. thats fine so far. but i need to send skill 50-99 its 250 bytes per entity. this is not a big problem, as long as the player isnt spawning in a very big populated area i think. but are there another solutions maybe?
Posted By: SchokoKeks

Re: [ANet] Synchronise Skills - 01/09/11 12:00

In my current redesign of survive, I'm just going through all entities with ent_next and sending their necessary skills if any.

in the end, you have to send the skills whatever way you program it. But do you really need all 50 skills? I bet there is a lot of redundant data in there that could be calculated on the client instead of being transfered.
In my old project I had around 10 skills that needed to be send per npc.
Posted By: Dark_samurai

Re: [ANet] Synchronise Skills - 01/09/11 12:09

After the EVENT_SYHNCHRONIZED is called, you can send all skills and flags you are using with enet_send_skills()/_flags(). You could use a variable that is set to 1 if the EVENT_SYNCHRONIZED was called. In the entities main loop you then send all skills and flags that should be synchronized.
Posted By: Rasch

Re: [ANet] Synchronise Skills - 01/09/11 17:53

@SchokoKeks

I also thought about ent_next but i think c_scan is working better for me this way. I dont really need all 50 skills at the moment. But i split them into 50 60 70 80 90 skills. So i need to send them all. I think it will be working i just need to send the skills not at the same time on every entity.

@ Dark_samurai

Thanks but the problem is, that i need to get the skills from the server. If i snychronise and send from the entitys i would just send the same skills because i difference the functions with "if(MY_CONNECTION == SERVER_MODE)else"

THanks anyways. This way its working good so far. I´ll see if i´ll get bigger problems but at the moment its fine. laugh
© 2023 lite-C Forums