Help - How to increase view range

05/18/2020 00:11 martoon#1
Hello everyone,

I have been trying to increase the view range - radius of the screen, which is probably limited to 18.
I hope I can get an explanation how to do it.

Thank you
05/18/2020 16:13 pintinho12#2
If you find out please share >_<
05/18/2020 20:29 Santa#3
Don't we know that the client removes objects from the screen when they are further than 18?
[Only registered and activated users can see links. Click Here To Register...]

This looks a lot like their "OutOf9Block" function, have you guys tried modifying this function? This is what I would start with. I found this by using ghidra and searching for a scalar of 0x12. With ghidra, it will show you a preview of how that scalar is being used, so I simply started stepping through all of the ones that are using 0x12 in a CMP instruction.

Now that I think about it, don't ground items disappear at a different range than a player, for example? I would still follow the same steps.
05/18/2020 21:17 pintinho12#4
Quote:
Originally Posted by StarBucks View Post
Don't we know that the client removes objects from the screen when they are further than 18?
[Only registered and activated users can see links. Click Here To Register...]

This looks a lot like their "OutOf9Block" function, have you guys tried modifying this function? This is what I would start with. I found this by using ghidra and searching for a scalar of 0x12. With ghidra, it will show you a preview of how that scalar is being used, so I simply started stepping through all of the ones that are using 0x12 in a CMP instruction.

Now that I think about it, don't ground items disappear at a different range than a player, for example? I would still follow the same steps.

Thinking about the Demons source, it'd be difficult to increase the range because it would mean that we need to increase the blocks range.
If you're in one edge of the block, the closest "view range" edge will be 18 coords away from you but the fartest will be 18*2.
05/18/2020 21:30 martoon#5
Quote:
Originally Posted by pintinho12 View Post
If you find out please share >_<
We need someone who knows how to edit Conquer.exe :D
I know that it is possible because I saw that on one of the servers, which is really nice.

Quote:
Originally Posted by StarBucks View Post
Don't we know that the client removes objects from the screen when they are further than 18?
[Only registered and activated users can see links. Click Here To Register...]

This looks a lot like their "OutOf9Block" function, have you guys tried modifying this function? This is what I would start with. I found this by using ghidra and searching for a scalar of 0x12. With ghidra, it will show you a preview of how that scalar is being used, so I simply started stepping through all of the ones that are using 0x12 in a CMP instruction.

Now that I think about it, don't ground items disappear at a different range than a player, for example? I would still follow the same steps.
The client visually removes any object from the screen that are 18 coords away, npc, monster, item, player.

Although it is possible to remove the object (visually) from the source, I remove the object from the general list of objects to allow spawning (visually) again when you are inside this range.

I'm thankful for any support.
05/18/2020 21:52 Latyos#6
Are you guys sure it's set to exactly 18? Not really sure what's causing this:
05/18/2020 21:53 Santa#7
Quote:
Originally Posted by martoon View Post
We need someone who knows how to edit Conquer.exe :D

The client remove the objects without even sending a packetwhen they are 18 coords away, the source is responsible for removing the entity object to make sure the respawn when you are back to the area.
To be honest, playing with the packets somehow allowed me to increase the range, it is not working well and is not a solution.
I saw that on one of the servers, which is really nice, it is probably something with the client and I'm not really good with editing this.
If anyone can help with it I will be really thankful.
If you don't know how to make edits to the conquer.exe you aren't going to be able to achieve what you are wanting to achieve. The server has nothing to do with the client removing objects that are out of range. Yes, you can remove objects, and your source may very well be sending a packet to remove an object that is out of range but that isn't correct, the client does it automatically.

I can't even point you to any sort of tutorial about editing an executable because I learned at the university of google and just clicking stuff in x96dbg and ghidra, or ollydbg before that.

Quote:
Originally Posted by pintinho12 View Post
Thinking about the Demons source, it'd be difficult to increase the range because it would mean that we need to increase the blocks range.
If you're in one edge of the block, the closest "view range" edge will be 18 coords away from you but the fartest will be 18*2.
That function i posted above doesn't calculate distance, it just checks that both delta X and delta Y are less than, or equal to, _BLOCK_SIZE (soul reference), which happens to be 18.

Quote:
Originally Posted by Latyos View Post
Are you guys sure it's set to exactly 18? Not really sure what's causing this
Manually calculated delta X and delta Y. I would think that the NPC disappears when either dX or dY = 19. I would also guess that the NPC respawns when your dX or dY is 17, which is because your source is improperly checking for in screen.

Looking at A LOT of public sources they don't correctly determine if an object is "in screen". Seems like a lot of sources use euclidean distance for determining if something is "in screen", which is incorrect. The image below illustrates what the issue is. The client would keep track of the objects in the yellow while the server would not continue to send updates for those objects.
[Only registered and activated users can see links. Click Here To Register...]
05/18/2020 22:54 martoon#8
Quote:
Originally Posted by Latyos View Post
Are you guys sure it's set to exactly 18? Not really sure what's causing this: [Only registered and activated users can see links. Click Here To Register...]
You have to think of it this way, visually and not visually.
The client removes any object in a distance of 18 (Visually)
You have to remove this object on the server exactly on the same distance (Not Visually)
Jumping/Moving in the distance of 18, the server send the object (Visually and not Visually)

Quote:
Originally Posted by StarBucks View Post
...
Dude, I said that the client is visually removing these objects not the source.
I'm happy that you've learned this and you are pro with it, can you help with it?
05/19/2020 00:15 Santa#9
Quote:
Originally Posted by martoon View Post
You have to think of it this way, visually and not visually.
The client removes any object in a distance of 18 (Visually)
You have to remove this object on the server exactly on the same distance (Not Visually)
Jumping/Moving in the distance of 18, the server send the object (Visually and not Visually)
His issue is that he is probably using the euclidean distance to determine if something is in range instead of the approximate distance that is used in the client. Either that or he is using a "less than" and he needs to use a "less than or equal"

If his server wasn't removing it from the collection properly, as you indicate, the server would never tell the client the respawn the NPC because as far as it is aware, the client knows about it.

Quote:
Originally Posted by martoon View Post

Dude, I said that the client is visually removing these objects not the source.
I'm happy that you've learned this and you are pro with it, can you help with it?
I gave you the process I used to find the function in the client that you would need to edit in order to see objects that are further away. Might be multiple things you need to edit, but it is a start.
05/19/2020 00:29 Yupmoh#10
This is fairly easy, All you need to do is to find the address to the function that removes out of range entities on the client side, change that render distance to whatever value you want, and match it on the server side.

Notice that most public sources actually send an entity remove packet when entities get out of range (which isn't needed) but it gives the illusion that the server controls that part when it doesn't.

Keep in mind that there are drawbacks to having an increased render distance, for starters the amount of packets will multiply which can cause lag/spikes if your server isn't fast enough to process them as the client might not be able to handle the traffic fast enough, think of BIG fights where you have tons of action on screen there will be hundreds of packets being broadcast from and to each player.
05/19/2020 13:16 martoon#11
Quote:
Originally Posted by StarBucks View Post
His issue is that he is probably using the euclidean distance to determine if something is in range instead of the approximate distance that is used in the client. Either that or he is using a "less than" and he needs to use a "less than or equal"

If his server wasn't removing it from the collection properly, as you indicate, the server would never tell the client the respawn the NPC because as far as it is aware, the client knows about it.

I gave you the process I used to find the function in the client that you would need to edit in order to see objects that are further away. Might be multiple things you need to edit, but it is a start.
Alright, I understand your point. So far I've downloaded Ghidra and started to search around, after analyzing Conquer.exe I have found many functions and things that I would have to carefully go through.

There is something with the GDI32.DLL..
[Only registered and activated users can see links. Click Here To Register...]

Any chance you can explain to me shortly, what process or a method you use to search and locate a number/string/function that could be relevant.

Thank you.

Quote:
Originally Posted by Execution! View Post
This is fairly easy, All you need to do is to find the address to the function that removes out of range entities on the client side, change that render distance to whatever value you want, and match it on the server side.

Notice that most public sources actually send an entity remove packet when entities get out of range (which isn't needed) but it gives the illusion that the server controls that part when it doesn't.

Keep in mind that there are drawbacks to having an increased render distance, for starters the amount of packets will multiply which can cause lag/spikes if your server isn't fast enough to process them as the client might not be able to handle the traffic fast enough, think of BIG fights where you have tons of action on screen there will be hundreds of packets being broadcast from and to each player.
I guess I'm not that good, so it is not that easy for me, I'm trying to get some help over here. The moment I find the way to do edit the distance on the client side.. I will have to do some testings and make sure to increase the distance on the source side to remove and spawn the objects again without sending packets of removing the objects visually since the client is doing that.
05/19/2020 16:36 Santa#12
In ghidra if you go up to the search drop down and click "For Scalars" you can search for a specific scalar. I searched for 18, then in the results window sorted by the "Preview" column and only looked at the CMP instructions. When you clicked it it will take you to the address of that CMP instruction, if you look at the "Decompile" window on the right you will see some C-like pseudo code.
06/04/2020 18:30 martoon#13
It is not a simple thing to be done, I tried. Anyone here is willing to help me with it?