Rev 1407 and Combat Testing
Moderators: Community Managers, Developers
Re: Rev 1407 and Combat Testing
Just had a second this morning to look. Added a check in the loot packet code to never try to send an empty packet (though we should not have gotten to that point anyway), which will eliminate that crash.
Found a source of the crazy coin amount issue. I had a check in place if that the random number for coin was 0, it did not set the coin value. Later, I check the coin value to see if it is 0 before sending, and don't send if it is not. Since there was no initialization for coin=0, whatever garbage was in memory would pass the value check and be sent. That should end that problem.
Performance-wise, I will soon try 2 things. First, there are distance checks for movement and aggro going on consistently. The aggro checks can be moved onto a timer and not run every chunk process cycle, as they are not that time-crucial. Secondly, the distance check is a cpu-heavy formula right now, using actual 3-axis math to get the distance (think in 2-dimensions that the distance is the square root of A squared plus B squared and do that for every npc to pc in the area over and over again). We should be much better off with a simple box-type comparison of each dimension's actual distance rather than the calculation. Both of these things should dramatically decrease the cpu load.
Also, the face target formula does not take into effect the Z-axis (yet). So if an npc is following you up a slope, it is not going up the slope location-wise even if it looks like it from client behavior. It's a simple addition that I haven't gotten to. When an npc is following you, it consistently faces you before making the next move, so it can't travel up and down at all.
Minor points:
I think the default run speed is now way faster than what it was before, which is throwing off my npcs' ability to follow players and make it a fair fight. I would consider slowing people down a bit.
The autoattack ability should probably be on everyone's hotbar when they make a new character. It might be easy to overlook for players who haven't been around for a while.
Keep hammering away and feel free to alter the code however you see fit. I know everyone is clamoring to get some real character stats in there and I have no problem asking for assistance with that. I am going to be very time-constrained until school starts in about 3 weeks and the little details are probably out of my reach for the time-being.
Found a source of the crazy coin amount issue. I had a check in place if that the random number for coin was 0, it did not set the coin value. Later, I check the coin value to see if it is 0 before sending, and don't send if it is not. Since there was no initialization for coin=0, whatever garbage was in memory would pass the value check and be sent. That should end that problem.
Performance-wise, I will soon try 2 things. First, there are distance checks for movement and aggro going on consistently. The aggro checks can be moved onto a timer and not run every chunk process cycle, as they are not that time-crucial. Secondly, the distance check is a cpu-heavy formula right now, using actual 3-axis math to get the distance (think in 2-dimensions that the distance is the square root of A squared plus B squared and do that for every npc to pc in the area over and over again). We should be much better off with a simple box-type comparison of each dimension's actual distance rather than the calculation. Both of these things should dramatically decrease the cpu load.
Also, the face target formula does not take into effect the Z-axis (yet). So if an npc is following you up a slope, it is not going up the slope location-wise even if it looks like it from client behavior. It's a simple addition that I haven't gotten to. When an npc is following you, it consistently faces you before making the next move, so it can't travel up and down at all.
Minor points:
I think the default run speed is now way faster than what it was before, which is throwing off my npcs' ability to follow players and make it a fair fight. I would consider slowing people down a bit.
The autoattack ability should probably be on everyone's hotbar when they make a new character. It might be easy to overlook for players who haven't been around for a while.
Keep hammering away and feel free to alter the code however you see fit. I know everyone is clamoring to get some real character stats in there and I have no problem asking for assistance with that. I am going to be very time-constrained until school starts in about 3 weeks and the little details are probably out of my reach for the time-being.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Rev 1407 and Combat Testing
Thanks for having a look. 2 things:
[quote="zippyzee"]I think the default run speed is now way faster than what it was before, which is throwing off my npcs' ability to follow players and make it a fair fight. I would consider slowing people down a bit.[/quote]
.speed has always been offered on NT for people just wishing to run through the world. If it affects combat, I wouldn't worry about it much - no bugs about movement will be valid if movement speed > 750 is in use.
[quote="zippyzee"]The autoattack ability should probably be on everyone's hotbar when they make a new character. It might be easy to overlook for players who haven't been around for a while.[/quote]
Xinux made the default hotbars (I believe) and I asked this question myself, unsure of why Melee and Ranged were not on the hotbars. I am not sure I ever got an answer that satisfied me But I believe he pulled the default hotbar values directly from the packets of new characters created, so I didn't abuse him too much. Definitely something we should do, regardless.
[quote="zippyzee"]I think the default run speed is now way faster than what it was before, which is throwing off my npcs' ability to follow players and make it a fair fight. I would consider slowing people down a bit.[/quote]
.speed has always been offered on NT for people just wishing to run through the world. If it affects combat, I wouldn't worry about it much - no bugs about movement will be valid if movement speed > 750 is in use.
[quote="zippyzee"]The autoattack ability should probably be on everyone's hotbar when they make a new character. It might be easy to overlook for players who haven't been around for a while.[/quote]
Xinux made the default hotbars (I believe) and I asked this question myself, unsure of why Melee and Ranged were not on the hotbars. I am not sure I ever got an answer that satisfied me But I believe he pulled the default hotbar values directly from the packets of new characters created, so I didn't abuse him too much. Definitely something we should do, regardless.
Re: Rev 1407 and Combat Testing
Yes the starting hotbar i pulled directly from the packet collects of new characters.
Re: Rev 1407 and Combat Testing
[quote="John Adams"]
.speed has always been offered on NT for people just wishing to run through the world. If it affects combat, I wouldn't worry about it much - no bugs about movement will be valid if movement speed > 750 is in use.
[/quote]
Right now in the database ruleset the default movement speed is set at 1500, which is quite a bit higher than before, I think? With the last vgo_world sql update my new characters started moving way faster than my previous ones. It's fine to leave it, but a bit jarring when I create a new character and I'm moving faster than I am used to or what I remembered from the game. I understand that for testing most players would like to be able to get around faster, though.
.speed has always been offered on NT for people just wishing to run through the world. If it affects combat, I wouldn't worry about it much - no bugs about movement will be valid if movement speed > 750 is in use.
[/quote]
Right now in the database ruleset the default movement speed is set at 1500, which is quite a bit higher than before, I think? With the last vgo_world sql update my new characters started moving way faster than my previous ones. It's fine to leave it, but a bit jarring when I create a new character and I'm moving faster than I am used to or what I remembered from the game. I understand that for testing most players would like to be able to get around faster, though.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Rev 1407 and Combat Testing
oh oops. I usually sync NT db from Targ, where the DefaultMovementSpeed is indeed 1500. I'll have to avoid syncing that rule in the future.
Re: Rev 1407 and Combat Testing
[quote="zippyzee"]Performance-wise, I will soon try 2 things. First, there are distance checks for movement and aggro going on consistently. The aggro checks can be moved onto a timer and not run every chunk process cycle, as they are not that time-crucial. Secondly, the distance check is a cpu-heavy formula right now, using actual 3-axis math to get the distance (think in 2-dimensions that the distance is the square root of A squared plus B squared and do that for every npc to pc in the area over and over again). We should be much better off with a simple box-type comparison of each dimension's actual distance rather than the calculation. Both of these things should dramatically decrease the cpu load.
[/quote]
A very old trick is to check if x²+y²+z² is less then r² and not do the square root, since multiplications are really fast and square root really slow on most cpu.
[/quote]
A very old trick is to check if x²+y²+z² is less then r² and not do the square root, since multiplications are really fast and square root really slow on most cpu.