Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #166  
Old 06-26-2016, 07:13 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

Slots done, time for op_moveitem

__________________
Browser based EQ project
Reply With Quote
  #167  
Old 06-27-2016, 06:31 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

moveitem, first pass

https://youtu.be/f2hjaJlJ6Zc
__________________
Browser based EQ project
Reply With Quote
  #168  
Old 06-27-2016, 08:26 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

moveitem, second pass

https://youtu.be/V1M0RJUs4Rw
__________________
Browser based EQ project
Reply With Quote
  #169  
Old 06-28-2016, 05:12 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

moveitem, third pass

https://youtu.be/986EFhB0O9g
__________________
Browser based EQ project
Reply With Quote
  #170  
Old 06-29-2016, 06:30 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

draggable windows

https://youtu.be/ShEI1PasP_g
__________________
Browser based EQ project
Reply With Quote
  #171  
Old 06-30-2016, 05:52 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

something for increasing FPS.

Need to change a list to a dictionary so instead of the array going "Element 0, element 1, etc" i can change the element name to spawnId in objectpool.cs

Using "Where" or "Find" hurts performance. I'm trying to find a way to just define a gameobject without having to search for it first. I use this a lot in handleworldmessages.cs. Biggest thing is op_clientupdate uses this 100% of the time, and it is sent from the server to the client every 30milliseconds.


in a script other than objectpool.cs, i use the below line to define a gameobject thats in a list array:
GameObject temp = ObjectPool.instance.spawnlist.Where(obj => obj.name == spawn_id.ToString()).SingleOrDefault();

Id like to do something like below in a dict array, cutting out the search using the spawnId as the element# in the array, so I don't have to search by name:
GameObject temp = ObjectPool.instance.spawndict[spawn_id];


In the pc editor, it's np @ 60 fps. in firefox it's 30fps. In chrome, it's like 17-23 fps. (from what i've noticed). Pretty sure this is causing it.


__________________
Browser based EQ project
Reply With Quote
  #172  
Old 06-30-2016, 07:07 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

The "where" wasnt killing my fps, but changed it to below and kept the spawnlist array a list instead of switching to a dictionary:
GameObject temp = ObjectPool.instance.spawnlist.FirstOrDefault(obj => obj.name == spawn_id.ToString());


This line in npccontroller.cs was taking FPS down by half.
grounded = ((controller.Move(moveDirection * Time.deltaTime)) & CollisionFlags.Below) != 0;
__________________
Browser based EQ project
Reply With Quote
  #173  
Old 07-01-2016, 01:33 AM
Charles082986
Sarnak
 
Join Date: Dec 2010
Posts: 46
Default

https://docs.unity3d.com/ScriptRefer...ller.Move.html
https://docs.unity3d.com/ScriptRefer...sGrounded.html

This says that CharacterController already has a property called "isGrounded" which checks if the characterController was touching the ground during the last move.

You might separate the .Move command onto a different line as the bitwise operator function.

Also, do you have a range limit set for what objects are rendered? Game clients have an adjustable clip plane (I think that's what it was called in EQ) that only renders terrain and game objects out to a certain distance. It might help if you're only rendering what's in the immediate area instead of every NPC in Qeynos. It's late, so I could be horribly wrong, but since I don't see a good way around having to call the .Move command, the only thing I can guess at is minimizing its usage.
Reply With Quote
  #174  
Old 07-02-2016, 05:06 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

doing real good on fps now with a bunch of changes.

Clip plane is set to 1200, thats the value in the DB in zone table. Anything past that, the client doesn't render by default. I just added to the NPC script for gameobjects not to render when the camera isnt looking at it. I did this with NPCs only, for now.

Code:
Vector3 screenPoint = Camera.main.WorldToViewportPoint(transform.position);
bool onScreen = screenPoint.z > 0 && screenPoint.x > 0 && screenPoint.x < 1 && screenPoint.y > 0 && screenPoint.y < 1;
if(onScreen == true & screenBool != true){transform.GetChild(0).gameObject.SetActive(true);screenBool = true;}
if(onScreen == false & screenBool != false){transform.GetChild(0).gameObject.SetActive(false);screenBool = false;}
cool video:
https://youtu.be/FSQ7I1EcA08
__________________
Browser based EQ project
Reply With Quote
  #175  
Old 07-02-2016, 06:54 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

That technique seems to only raise fps by a little bit, trying out another method.

Unity's built in Occlusion Culling: https://docs.unity3d.com/Manual/OcclusionCulling.html
__________________
Browser based EQ project
Reply With Quote
  #176  
Old 07-04-2016, 08:14 PM
fzzzty
Fire Beetle
 
Join Date: Aug 2010
Posts: 23
Default

Quote:
Originally Posted by Tyen05 View Post
The "where" wasnt killing my fps, but changed it to below and kept the spawnlist array a list instead of switching to a dictionary:
GameObject temp = ObjectPool.instance.spawnlist.FirstOrDefault(obj => obj.name == spawn_id.ToString());
Forgive me if you know this already, but FirstOrDefault will return null if it doesn't find anything, so you might have to handle that (probably the same path as if the Where returned no entries). Where passes through the whole list even if it finds something, of course, so this should be faster if you're guaranteed to have the thing in the lsit. Alternatively, First will throw if it finds nothing. ToLookup might be useful in some situations in case you haven't heard of it. No offense if you already know all this.
Reply With Quote
  #177  
Old 07-04-2016, 08:50 PM
Charles082986
Sarnak
 
Join Date: Dec 2010
Posts: 46
Default

FirstOrDefault only returns null if the default is null. The default value can be configured so it works quicker than .FirstOrDefault(obj => obj.name == spawn_id.ToString()) ?? new GameObject();
Reply With Quote
  #178  
Old 07-05-2016, 04:18 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

Messing with Analytics and eventually back to bag/equip slots.

Google Analytics Plugin for Unity - API Reference
__________________
Browser based EQ project
Reply With Quote
  #179  
Old 07-06-2016, 05:58 AM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default

Analytics

https://www.twitch.tv/eqbrowser/v/76522914
https://youtu.be/WyVL92ftkTI
__________________
Browser based EQ project
Reply With Quote
  #180  
Old 07-06-2016, 06:11 PM
Tyen05
Discordant
 
Join Date: Mar 2009
Location: eqbrowser.com
Posts: 309
Default



__________________
Browser based EQ project
Reply With Quote
Reply

Tags
pras eqbrowser.com, unity3d

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:48 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3