Jump to content

Genebris

Members
  • Posts

    517
  • Joined

  • Last visited

Posts posted by Genebris

  1. 1 hour ago, Josh said:

    Ah, that makes sense.

    Do this once after your map is loaded to get the terrain entity:

    
    local n
    for n=0,world:CountEntities()-1 do
    	local entity = world:GetEntity(n)
    	if entity:GetClassName()=="Terrain" then
    		terrain = entity
    		break
    	end
    end

    terrain:Hide() removes collision from terrain, but it remains visible.

  2. I'm getting 60 FPS on a decent computer with pretty much empty scene and 30 characters moving on navmesh. I don't think it's a good result. After adding level geometry and lighting it will become 30 if not less.

     

    I can reduce draw distance and shadow distance but it doesn't help, FPS is low even when characters aren't rendered. And this scene is even without animations.

     

    Good idea about switching to non rigged models, I'll try that.

  3. I have a huge FPS drop when moving rigged characters with simple Entity:Move method. The same mesh but collapsed in model settings causes no FPS drop.

     

     

    100 characters on the top have bones. 100 characters on the bottom were collapsed. When moving bottom characters performance stays the same, when moving upper characters FPS drops from 500 to 100.

     

    There is no lighting in the scene and character material uses not animated shader. So I think that the only difference is extra entities that are moving with rigged characters.

     

    code:

    
    

    function Script:Start()

    chars = {}

    for i=1,100 do

    local e = Model:Load("models/crawler.mdl")

    table.insert(chars, e)

    e:SetPosition(math.random(0,10),0,math.random(0,10))

    end

     

     

    objects = {}

    for i=1,100 do

    local e = Model:Load("models/collapsed.mdl")

    table.insert(objects, e)

    e:SetPosition(math.random(0,10),0,math.random(-10,-20))

    end

    end

     

    function Script:UpdatePhysics()

    if window:KeyDown(Key.E) then

    for k,v in pairs(chars) do

    v:Move(-0.1,0,0)

    end

    end

     

     

    if window:KeyDown(Key.R) then

    for k,v in pairs(objects) do

    v:Move(-0.1,0,0)

    end

    end

    end

     

    Can Anything be done about it? I don't need 100 characters, but when I tried 30 characters moving on the navmesh performance was very low compared to when they are standing still.

     

     

    Project if you want to try: https://drive.google.com/open?id=0B5h7P9bq9NmIQmRDdGp1Y29LdFE

  4. For general physics collisions, you could parent a box to a creature. Check out the code examples in the Entity docs, specifically SetShape and SetParent. However, the navigation system will ignore it so you might not get the effect you're hoping for.

    You can't attach collider as a child, this will break physics.

  5. My main question concerns how I get two games running at the same time? Do I have to export each time and create a standealone?

    You don't need to compile your Lua code, you can simply launch your exe file from project folder. I was using google drive to automatically send changes to my second pc.

×
×
  • Create New...