Register for your free account! | Forgot your password?

You last visited: Today at 21:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Respawn Issues

Discussion on Respawn Issues within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 908
Received Thanks: 390
Talking Respawn Issues

Hello guys,
Maybe some ppls will remember me from long ago, maybe not hahah, i never made something really useful, but some peoples consider me a good coder of "TQ Binaries".
After a loooooooooong time, i'm back, but not to use those old things, maybe the tables hahah.
Well, lets go for it, i take Fang as a example, i one of the things he always say, he doesnt give anything ready, he give the tips for you to make it, you need to learn by yourself, and im trying it...
Ive got Exodus Binary 5180 to work on, i like it because it has the cq_action system almost done, im fixing an issue that if you choose a 0 task, it keeps reloading the message... By the way, its a logic question already fixed..


Hah, i fixed some things, the character creation was the first thing ive done, i learned how to receive packets and get their data
Thanks to for the useful info.
And i successfuly done the character creation thing
Fixed the login that was freezing, i dont remember what ive done, but it was something with some packets... not sure, but something about the database, i guess it was because i tried to create the character on the database and any id werent set correctly...
but well, i made it... and the Clock system too xD
I learned how to send packets to the client...
My problem is the following, the NPCs when i jump, doesnt appear, i need to walk or jump a few times so they appear... and not all, sometimes i jump and theyre not even out of the screen and they disappear... and, i cant see the other character... i tried to make the chat system, the [Talk] one first... but the message duplicates on my screen and doesnt appear on the other account, the server read it , i even created a few commands, like /gmonline (list all GMs online) and /disconnect, so i dont need to reopen my client to relog xD
How can i make both chars see each other? There is any tuto showing this? The real question is, which packet i need to handle? And when i need to send it? Because ive made the Packet Logger to the received Packets, and it seems like, i have to send it lol because it doesnt receive nothing when i jump, except my jumping packet... And the talking issue? How to show them to the accounts next to me? And how to make it dont duplicate on my screen? I will try to work on Whisper right now...
*This is my first experience on working with C# servers... my C# skills arent soooo great, but im trying my best
** Im reading 3 different sources looking for things
*** Im scared about the fact that if i dont code it correctly, it may not be able to hold many users online... What can i do to avoid this?

Thanks in advance *-*
pintinho12 is offline  
Old 06/28/2014, 04:28   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Well, let's handle one problem at a time. First problem you mentioned was the screen system. Here's a post I made a while ago that describes how the screen system works in Conquer Online.
Original link:
Quote:
Conquer Online's screen system is quite easy actually. The first thing you should know is that the system doesn't check for entities in a radius of 18 units away from the character, it breaks it into x and y components. If the screen entity is 18 or less units in the x and y direction away from the character, then that entity can appear in the screen (otherwise, the client will ignore it or remove the entity from the screen if it exists). To recap, entities 18 or less units in the x and y direction away from the character will appear in the character's screen.

The next thing you asked about was with movements. As an entity (we'll call this the actor) is introduced to the screen, the spawn packet is sent (with the actor's new x & y coordinate). Then, as they move through the screen, their movements are sent to the observers of the action. If the actor's new position is out of the screen, do not send the entity removal packet (as you will see in Impulse's source). That's is completely incorrect and should only be used when characters teleport or disconnect. Send the movement of the player leaving the screen, and the client will show them jumping out of screen. To recap, entities coming into the screen send the spawn with their new location. Then after, each movement is sent to observers. When they leave the screen, simply send the movement of them leaving and they will disappear from the screen.

Finally, as the player (actor) moves through their own screen, the client needs to update the area that they're in. First, you send back the movement packet (that confirms that the movement was successful and the client's screen will update to the new position - to allow new observers in that new region). Then, the new observers are sent to the actor. That's how Conquer Online's screen system works in a nutshell. There's more to it (like how you're going to exchange spawn packets and so on, but that's entirely up to you). Cheers.
Spirited is offline  
Old 06/28/2014, 05:07   #3
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 908
Received Thanks: 390
Well fang, i was looking for this topic, i read it a few days ago before starting, couldnt find it, thanks
I observed that while it stands still, the client sends packets every a few seconds...
Firstly it says that its missing the packet 1130 and 1134, right when i login... ive found out its ElitePK and Quest system, btw, not important packets.. it sends packet 1009 with lenght 36 if i stand still..
and 10010 with 44 if i move... 10010:137 is the jump packet... 10010:74 is the SetLocation
Quote:
case 74://SetLocation
Client.Entity.Online = true;
Client.Screen.ThreadSafeSort(18);
Client.Entity.SendSpawn(Client);
Client.Send(new DataPacket(Client.Entity.UID, Client.Entity.X, Client.Entity.Y, Client.Entity.MapID, DataPacket.SetLocation));
break;
case 137:
Client.Screen.ThreadSafeSort(18);
Client.Entity.Jump(BitConverter.ToUInt16(Args, 24), BitConverter.ToUInt16(Args, 26));
Client.Screen.Transmit(Args, 15);
break;
Been reading it here, found ScreenDistance class which calculates the distance between things and its look correct..
Quote:
public static short ScreenDistance(ushort X, ushort Y, ushort X2, ushort Y2)
{
return (short)Math.Max(Math.Abs(X - X2), Math.Abs(Y - Y2));
}
and this
Quote:
public void ThreadSafeSort(int withinrange)
{
foreach (NPC Item in Exodus.NpcPool.Values)
if (Item.MapID == Client.Entity.MapID)
if (!(this.ThreadSafeContains(Item)) && Calculations.ScreenDistance(Client.Entity.X, Client.Entity.Y, Item.X, Item.Y) <= withinrange)
{
ThreadSafeAdd(Item);
}
else if ((this.ThreadSafeContains(Item)) && Calculations.ScreenDistance(Client.Entity.X, Client.Entity.Y, Item.X, Item.Y) <= 15)
ThreadSafeRemove(Item);

foreach (SocketClient Target in Exodus.ClientPool.Values)
if ((Target.Entity.UID != this.Client.Entity.UID) && Calculations.ScreenDistance(this.Client.Entity.X, this.Client.Entity.Y, Target.Entity.X, Target.Entity.Y) <= withinrange)
{
Target.Entity.SendSpawn(Client);

if (Target.Entity.Flag == RecognizitionType.Player)
Client.Entity.SendSpawn(Target);
}
}
Im trying to figure out whats wrong on it so the NPCs or Players doesnt appear..
the NPCs appear if i keep walking or jumping, but other accounts does not..
I will try to change anything...
Which packet should i work with to receive or send the respawn things?
10014? Should i send it every character jump? , well
let me keep trying..
pintinho12 is offline  
Old 06/28/2014, 06:03   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
It's a bit difficult to debug from here. Have you desk-checked your screen show algorithm? Have you tried stepping through the function to see what the expected and actual output is?
Spirited is offline  
Old 06/28/2014, 06:48   #5
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 908
Received Thanks: 390
Quote:
Originally Posted by Spirited View Post
It's a bit difficult to debug from here. Have you desk-checked your screen show algorithm? Have you tried stepping through the function to see what the expected and actual output is?
Well, i am trying to re-do the ScreenDistance calculation, it was like...
i made it read only 1 NPC...
Then made it send the following...
"Storekeeper distance: number"
so it made...
Quote:
Storekeeper distance: 4
Storekeeper distance: 5
Storekeeper distance: 6
Storekeeper distance: 7
Storekeeper distance: 8
even when i was going on its direction...
So i guess ill need to calc it again..
i saw once that u posted that calc...
ill see if its on your signature, ive been searching for it but couldnt find..
need that calcs, u already released it

Edit:
Well, ive found out that when i jump, i receive my old coordinates, ive fixed half.. it now shows all npcs around lol after a second jump...
Before jumping

After jumping
...
just figured out something...
gonna try it...
just noticed i am only sending data, a few hours ago i tried to receive that packet.. but couldnt figure out some of its content...
lol just gonna take a look at it

Quote:
Originally Posted by InsomniacPro View Post
"TQ Binaries" ...
i meant a good events creator, making good use of the action types and client part

================================================== ====
#Bump
Well, ive fixed the Jump and Walk issue...
it was getting the wrong bytes on the packets, so the walk was going only to 1 direction and the jump were getting the old position only...
Its fixed now and i can walk or jump knowing the new coords
The issue now is... The NPCs are not spawning... Ill double check the spawn packets
pintinho12 is offline  
Reply


Similar Threads Similar Threads
Respawn mod
03/03/2014 - Elsword - 0 Replies
how can i do a respawn mod??? with which program can i open the .lua file?i wait your notice
Respawn Bot
02/02/2014 - Metin2 Private Server - 2 Replies
Hey suche ienen Respawn bot für p-server hat jmd zufällig ein oder könnte jemand einenn scripeten?? sollt nicht alszu schwer sein für fähige könner ;) Wäre echt cool :D
Respawn
06/18/2012 - Rappelz Private Server - 2 Replies
hello how can i make a new spawn mob wich appear every 1 hour for ex PS :i know i should work on the "df26b8de23d54dab0fceedacc447c5dc".lua
Best respawn for a war lvl 110
04/13/2012 - Conquer Online 2 - 3 Replies
Hi guys, wheres the best respawn for a 110 warrior full dual, soul phase 4 on ring and wand, soul phase 6 on armor and 3 in the cap, i know 2 places, (where comes the pic) http://img1.91huo.com/fan.co/img/jteam/img/120320 /frozen.jpg I need to know others places, please help me :handsdown:
[HELP]ABOUT SA RESPAWN!
11/05/2009 - Soldier Front Philippines - 0 Replies
UY HELP NAMAN ABOUT DUN SA RESPAWN! Una pO nakipAG 1v1 akO dEN akUh unG uNAnG nAMaTay Then Di nA pO naGrereSpawN unG chAr kO,. pAnGaLawa nAG jOiN akO.. Di nA riN pO naGrereSpawN unG chAr kO!!.



All times are GMT +2. The time now is 21:49.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.