HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Character Visible problem  (Read 2073 times)

__BVS__

  • Developers
  • *
  • Posts: 15
    • View Profile
Character Visible problem
« on: May 29, 14, 06:16:13 AM »

Hello all!
I have such problem:
When my opponent connect to my instance and he is far away from me, then his HBNode in not visible for me, but i can see his nickname label,  and only when i come closer to him (10-15points), suddenly, his HBNode become visible for me. Then if i go far away from him - he still visible .

I checked these things (when opponnent is far away, and i can see only his nickname-label):
1) My player and opponent are in one visible room (on my instance i have only one room :) )
2) Via scripts i checked opponent HBNode and it's all right with such parametrs like: pisition, reder - true, hidden - false...
 Like that:
Code: [Select]
println("render - " + hbNode["Render"] + ", pos - " + hbNode["Position"] + ", hidden - " + hbNode["Hidden"])
3) Spatial Awareness - work fine ( if he go far then 40points - he dissapear from my client, and closer then 30 - he replicated to me)


My problem : how to make opponent HBNode visible when he connected  far away from me?

P.S: also when a go far away from him, sometimes i see like some of his animation is freezing, but when i come closer -> all become fine -_-
« Last Edit: May 29, 14, 06:21:19 AM by __BVS__ »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Character Visible problem
« Reply #1 on: May 29, 14, 12:11:43 PM »

I am not certain if this is the best approach, but what we currently do is modify the server script _ACCControllerOwnerClassMethods at line 53:
Code: [Select]
    // Use the range of 70 meters as the awareness range
    e._SAS_EI_awareness = 7.0
Increasing the _SAS_EI_awareness (which is measured in world units, and 1 world unit is considered 10 meters) will increase the range at which characters become aware of each other and thus replicate to clients.



As to your second question, the rate of updating a character's animation is throttled down as they get farther away from the camera.  By default this only applies to characters not controlled by the player.

You can see this adjustment done in method _onPreAnimUpdate() on the client side.  If you maintained the same classes for _ACCController, then the E_ACCController class is lowest in hierarchy, so its version of that method is the one used.  You can see there that it calls _HE_SetPreAnimInterval() with different values based on the distance from the camera.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

__BVS__

  • Developers
  • *
  • Posts: 15
    • View Profile
Re: Character Visible problem
« Reply #2 on: May 29, 14, 06:12:41 PM »

thank you for your reply)

But maybe i explained my problem not very clear, so i will try to explaine one more...

On server:
Code: [Select]
e._SAS_EI_awareness = 100.0When opponent in "awarance range", he replicated to my client and during this replication his _characterAppearence are replicated to the client too. Then in _characterAppearence (client class) called method _makeCharacter().
When _makeCharacter is done, then on a client i have a opponent HBNode, but this HBNode is far away from me (for example - 15-20p) and it's invisible for me for some reason, but i can see a label with opponent nickname, that are moving when opponent is moving... When i come closer -> opponent HBNode become visible and if i then go far away from him - he stay visible (if he don't go away on 100 points and unreplicated from my client)

So i can't understand, why I don't see opponent model, when he replicated on a client far from my player pos, but when i check it (check if HBNode exist for this opponnent) in scripts, it's all ok : HBNode is exist for my opponent, hbNode["Rendering"] is true, hbNode["Hidden"] is also true, and hbNode["Position"] is changing, when oppopent is moving...
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Character Visible problem
« Reply #3 on: May 29, 14, 07:19:53 PM »

The server checks the distance to draw the character at, and lets the client side know if they are to far to be drawn on screen. The reason for this is because it can have a massive amount of players in the area, and if it were not making some (far range characters) invisible, then the computer could slow to a crawl trying to render all those other players out there on your screen. If would not slow down if everyone were the exact same shape and texture, but most players might want some kind of choice to look different from others. This will increase the amount of texture data the computer has draw each frame. Then adding in backgrounds, there are lots of textures to slow the game down.
Logged

__BVS__

  • Developers
  • *
  • Posts: 15
    • View Profile
Re: Character Visible problem
« Reply #4 on: Jun 13, 14, 12:40:10 PM »

Quote
The server checks the distance to draw the character at, and lets the client side know if they are to far to be drawn on screen
I agree with you. When player "Ralf" location is far then some radius A from me -> then server remove this player "Ralf" from me. When "Ralf" location is less then some radius B -> then server replicate "Ralf" to me. That's like a "spatial awareness system" work.

When server replicate "Ralf" to me, i receive his (Ralf) _PlayerAccount, _PlayerCharacter, _CharacterAppearence objects. Then _CharacterAppearence will request server to send a character specification (this is information about character visual appearence : model name and so on...). When _CharacterAppearence will get character specification for player Ralf -> it will create visual model with the same ID as id of Ralf's _PlayerAccount.

So when all initialisation will be finished, i will see "Ralf". But my probles is at the final stage : Ralf is replicated to me, via scripts i can get all information about his _PlayerCharacter, _PlayerCharacter, _CharacterAppearence, i can get even reference to Ralf's HBNode. But while he is steel far then radius C (C less then A, and C less then B), i can't see Ralf's model!!! I can get any information about his Position, Rotation, Visibility, NickName....

So my problem : Why i can't see ralf model at distance that far then C radius and less then B.
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Character Visible problem
« Reply #5 on: Jun 13, 14, 06:30:23 PM »

I believe it has to do with the setting of the clip plane, both the near clip and the far clip. I have not yet come across this if it is in the script, so I would not be able to tell you where to look for it. I have seen the "monkeytoks" disappear when they reach a certain range, and so far have not found a way to change that range. While I am not able to check source code, the answer might be there.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Character Visible problem
« Reply #6 on: Jun 15, 14, 07:08:24 PM »

I had noticed strange behavior in this vein with some NPCs which we have getting created some distance from the player at the moment a player loads into a new area instance.  Even though their nodes were being replicated to the client, and I could see their properties via the CLI commands, the models would not actually appear until I put the camera into fly mode and flew the camera close enough to them.  At that point they appeared and then would continue to render even as I backed the camera out beyond that distance.

I figured they needed to be within a certain distance from the camera.  What I ended up doing was putting in a hack that hides the NPCs and initially positions them in front of the camera, then moving them to their proper location and unhiding them, which has worked.

That was a long time ago and I never thought of it again till this thread.  And just recently I got a new error message in the console which I had not seen before:
Quote
18:57:05: !ERROR!System:LOAD STATE:
+ SPEC 9223372055860791503
  - CONTROLLED_CHARACTER

18:57:05: !ERROR!System:Character 1000009029 is not ready.
Character 9223372056078793096 is not close enough to the camera to be composited.
The compositing distance in this area is 8.
Character 1000009029 is at location (-0.059999999,-1.100000024,-2.599999905) distance from camera is 2.823756218.
Character 9223372056078793096 is at location (-100,-100,-100) distance from camera is 173.205078125.
I got this in a world we use for our testers after I removed the old LRC and was having it rebuild it.


For the Idea Fabrik engineers, could this "compositing" be was is going on?  And the distance it mentions of 8 I do not see in the scripts, so I wonder if it is locked in the source code somewhere.
« Last Edit: Jun 15, 14, 07:12:18 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

__BVS__

  • Developers
  • *
  • Posts: 15
    • View Profile
Re: Character Visible problem
« Reply #7 on: Jun 16, 14, 07:33:01 AM »

Thank all !)

ScottZarnke :
Quote
Character 9223372056078793096 is not close enough to the camera to be composited.
The compositing distance in this area is 8.

I checked in "Area" property (Edit -> Area) "Rooms" tab and found "Compositing start distance" parameter, it's default value was 8.0. When i changed value to 100, all my troubles with char visibility go away)


My problem is solved!)


Logged

JoshHalls

  • Founding Professional
  • *****
  • Posts: 335
    • View Profile
    • The Repopulation
Re: Character Visible problem
« Reply #8 on: Jan 05, 15, 07:07:56 PM »

Thank all !)

ScottZarnke :
Quote
Character 9223372056078793096 is not close enough to the camera to be composited.
The compositing distance in this area is 8.

I checked in "Area" property (Edit -> Area) "Rooms" tab and found "Compositing start distance" parameter, it's default value was 8.0. When i changed value to 100, all my troubles with char visibility go away)


My problem is solved!)

Man been searching for that for awhile, thanks nocake for linking to this thread :-).

https://community.heroengine.com/forums/index.php/topic,5653.0.html

Just as a side note, the spatial and this value are not linked to my knowledge and only impacts dynamic characters.
Logged
Co-Owner/Programmer - The Repopulation