Jump to content

xtom

Members
  • Posts

    365
  • Joined

  • Last visited

Posts posted by xtom

  1. I set it to spawn 0 enemies (the level is set to have 12 as default) and I get another 10fps, so that's 30fps total with no map objects visible or enemies at all. Satisfactory fps but not really a playable game.

     

    I notice if I just leave everything as is, looking at the town I get 12-15fps, looking away from town it goes up to 20fps.

     

    I tried occlusion culling true/false before and it made not much difference so I opted to leave it set to false. Leaving it at true tends to make things flash or popup more, especially at lower fps. I think the view ranges give me more gains on the outdoor level anyway. Also tried removing shaders, 1024x768, lower antialiasing, lower lighting but these make little to no diff on the fps.

     

    I think it's really just lots of little things coming together to bring down fps, if I keep removing stuff it will gradually climb back up but I don't think there is any significant fix I can do. Tomorrow I'll continue to try and squeeze another few frames out of it.

  2. Ok so I tried a modified version of shadamars code below - thanks shadamar - I ran it once on a key press at the start and forced every entity in the level to be Near viewrange. This left pretty much nothing but the terrain visible and the fps went from about 10fps to 20 fps. I get 59fps on a blank map and I know there is still things going on in my map but changing down my manually set view ranges and introducing more popup is not going to make too much difference. I suppose I could possibly get +5fps if I make it a heavy fog level with shorter viewranges. I might do this yet but I'm checking out some other things too.

     

    for i=0,App.world:CountEntities()-1 do
    if App.world:GetEntity(i):GetClass()==Object.ModelClass then
    local aabb=App.world:GetEntity(i):GetAABB(Entity.GlobalAABB)
    App.world:GetEntity(i):SetViewRange(0)
    end
    end
    

  3. The benches are set to far - at medium setting the popup is too noticeable on them.

     

    From what I can tell, it appears everything is set to max culling distance.

     

    Definitely not, you're probably thinking this because you don't see obvious popup which is a good thing visually but not so good performance wise.

  4. Set as many objects as possible to "near" or "medium" culling range.

     

    I've already done this on every object in the map. Nearly all objects/furniture in buildings are mostly set to near, some medium. Big outdoor things like buildings and pylons are the only things set to max and other medium sized outdoor things like fences, cars are set to far. I have zombies set to far because medium gives too much popup on important outdoor things like the enemies.

     

    The only thing I can think of to address this then is to bring in a closer/denser fog in the game and then reduce the max/far things down to far/medium so there is no popup. It will change the look of the game but who knows maybe it will be better. I'll do a test copy of the map like this and see if this helps the performance.

     

    (Hopefully you are not turning on occlusion culling for each object, the default settings are best.)

     

    Nope not doing that. Thanks for the advice.

  5. I have the same (but not as bad) shadow gap at the bottom of my picket fences even though they are stuck well into the terrain. All other shadows are ok such as tree trunks, walls, solid fences but the picket fences for some reason have always given me this problem.

  6. My biggest problem is the massive fps drop that Leadwerks has. One more day runs at a good 4 - 15 fps on my computer, my game was RUTHLESSLY optimized so that the lights wouldn't kill the fps. Any time I want to add a light, I have to think do I really want that there. There can never be more than 4 lights on, and the Directional light will cripple my game play, YET I can run Dying Light at 60fps, all Source games except Cs:Go in excess of 100 FPS. There are some optimizations to be had. If we could work on the engines rendering above all else, I would be happy.

     

    -A Frustrated AMD R9 270x 4gb Crossfire user.

     

    I'm surprised (and disappointed), I get about the same fps and I'm on an APU not an AMD R9 270x 4gb which should be way more powerful. Believe me I've tried to optimise the heck out of it. Definitely would like to see some performance in the engine.

  7. I think some steam stuff was changed so if you originally uploaded on one of the earlier builds you might need to republish as a new workshop entry. I had similar problem where after updating my game it would download from steam but the launcher would still play an older version cached locally. I republished afresh the other day and so far it's all working no problem.

  8. Does anyone know how to increase range of melee attacks in FPSMeleeWeapon.lua - I don't understand the Transform:Normal in the code below, I thought increasing the 0.5 might work but it doesn't seem to make any difference.

     

    local pickinfo=PickInfo()
    local pos = self.player.camera:GetPosition(true)
    local dir = Transform:Normal(0,0,0.5,self.player.camera,nil)
    
    if self.entity.world:Pick(pos,pos+dir,pickinfo,0,true,Collision.Projectile) then
    

  9. I was thinking it might be handy for scripts to have it's own dedicated tab between Assets and Scene. It would make it much quicker to navigate to scripts and you could easily flick between what you were last looking at in assets and scripts.

    • Upvote 2
  10. This is my PauseMenu.lua script below that I'm using in my game - I put it on a pivot and make it a child of the player. It also has a restart map option if player is dead. Could probably be improved but it does the job and should be fairly portable.

     

     

    --[[
    Apply this script to a pivot and make it a child of the player entity
    This script uses the Esc key to pause - you will need to remove the Esc key check from App.lua
    In App.lua - App:Start() you need to have self.exitgame = false
    --]]
    Script.restartMap="start.map"--path "Restart Map" "Map (*.map):map|Maps"
    
    function Script:Start()
    self.screenWidth = App.context:GetWidth()
    self.screenHeight = App.context:GetHeight()
    self.fontsize = 24
    self.font = Font:Load("Fonts/arial.ttf",self.fontsize)
    App.context:SetFont(self.font)
    
    self.resumeTxt = "Resume"
    self.resumeTxtWidth = self.font:GetTextWidth(self.resumeTxt)
    self.resumeTxtPos = Vec2((self.screenWidth/2)-(self.resumeTxtWidth/2),(self.screenHeight/2)-60)
    
    self.restartTxt = "Restart"
    self.restartTxtWidth = self.font:GetTextWidth(self.restartTxt)
    self.restartTxtPos = Vec2((self.screenWidth/2)-(self.restartTxtWidth/2),(self.screenHeight/2)-60)
    
    self.exitTxt = "Exit"
    self.exitTxtWidth = self.font:GetTextWidth(self.exitTxt)
    self.exitTxtPos = Vec2((self.screenWidth/2)-(self.exitTxtWidth/2),self.resumeTxtPos.y+(self.fontsize*3))
    self.gamePaused = 0
    
    self.player = self.entity:GetParent()
    
    end
    function Script:UpdateWorld()
    
    if App.window:KeyHit(Key.Escape) then
    App.window:ShowMouse()
    self.gamePaused = 1
    end
    while self.gamePaused >0 do
    
    -- get key presses
    if App.window:KeyHit(Key.Escape) then
    App.window:HideMouse()
    self.gamePaused = 0
    end
    
    --Render the world
    App.world:Render()
    
    -- get mouse position and clicks
    local mousepos = App.window:GetMousePosition()
    local LeftMouseClick = App.window:MouseDown(Key.LButton)
    local RightMouseClick = App.window:MouseDown(Key.RButton)
    if self.player.script.health<=0 then
    App.context:SetBlendMode(Blend.Alpha)
    App.context:SetColor(0,0,0,0.7)
    App.context:DrawRect(0,0,self.screenWidth,self.screenHeight)
    App.context:SetFont(self.font)
    App.context:SetColor(1,1,1,1)
    -- check for mouseover resume
    if mousepos.y>=self.restartTxtPos.y and mousepos.y<=self.restartTxtPos.y+self.fontsize then
    if mousepos.x>=self.restartTxtPos.x and mousepos.x<=self.restartTxtPos.x+self.restartTxtWidth then
     App.context:SetColor(0,1,0,1)
     -- player leftclicks on item
     if LeftMouseClick==true then
     App.window:HideMouse()
     self.gamePaused = 0
     changemapname=self.restartMap
     end
    end
    end
    App.context:DrawText(self.restartTxt,self.restartTxtPos.x,self.restartTxtPos.y)
    else
    App.context:SetBlendMode(Blend.Alpha)
    App.context:SetColor(0,0,0,0.7)
    App.context:DrawRect(0,0,self.screenWidth,self.screenHeight)
    App.context:SetFont(self.font)
    App.context:SetColor(1,1,1,1)
    -- check for mouseover resume
    if mousepos.y>=self.resumeTxtPos.y and mousepos.y<=self.resumeTxtPos.y+self.fontsize then
    if mousepos.x>=self.resumeTxtPos.x and mousepos.x<=self.resumeTxtPos.x+self.resumeTxtWidth then
     App.context:SetColor(0,1,0,1)
     -- player leftclicks on item
     if LeftMouseClick==true then
     App.window:HideMouse()
     self.gamePaused = 0
     end
    end
    end
    App.context:DrawText(self.resumeTxt,self.resumeTxtPos.x,self.resumeTxtPos.y)
    end
    
    App.context:SetColor(1,1,1,1)
    -- check for mouseover exit
    if mousepos.y>=self.exitTxtPos.y and mousepos.y<=self.exitTxtPos.y+self.fontsize then
    if mousepos.x>=self.exitTxtPos.x and mousepos.x<=self.exitTxtPos.x+self.exitTxtWidth then
    App.context:SetColor(1,0,0,1)
    -- player leftclicks on item
    if LeftMouseClick==true then
     self.gamePaused = 0
     App.exitgame = true
    end
    end
    end
    App.context:DrawText(self.exitTxt,self.exitTxtPos.x,self.exitTxtPos.y)
    
    
    if App.window:Closed() then
    self.gamePaused = 0
    App.exitgame = true
    end
    
    --Refresh the screen
    App.context:Sync(true)
    
    end
    
    end
    

     

     

    You need to make some small changes in app.lua ..

     

    In app:start add

     

    self.exitgame = false

     

    In App:Loop() ..

     

    --If window has been closed, end the program
    if self.exitgame or self.window:Closed() then return false end
    
    --Handle map change
    if changemapname~=nil then
    
    --Clear all entities
    self.world:Clear()
    
    --Load the next map
    Time:Pause()
    if Map:Load(changemapname)==false then return false end
    Time:Resume()
    
    changemapname = nil
    end
    

    • Upvote 1
  11. Ok so I thought it would be a good idea to zip up my scripts and shaders folder as a backup while I change some stuff. So I did this and left the zip in project the folder. Now for the last day or so I am trying to figure out why none of my script changes are taking effect. I begin to think it's a bug and they must be being cached somewhere somehow. Then finally I remember that zip file I created. I guess I created my own cache without even knowing it. rolleyes.gif

    • Upvote 1
  12. OK I didn't think I would be able to reproduce this but it looks like I can..

     

    1) create a new project (advanced fps)

    2) create a new map

    3) create a terrain 1024

    4) On layer 3 for diffuse select Materials/Nature/terrain_savannah_rockwall.tex

    5) paint some on the terrain

    6) save as start.map

    7) delete all the other maps in the project

    8) publish to standalone

     

    if you look in data.zip there is no Materials/Nature/terrain_savannah_rockwall.tex

     

    This is using latest beta.

     

    Edit: looks like it's happening with any texture in layer3 diffuse

  13. I see I also set mapping for this layer to vertical so that would be one difference to the other layers, maybe this caused the problem. I've changed it back to flat but it still won't publish the tex file for that layer. Also I don't notice any change when I switch between the different mappings either.

  14. Scene panel :

    - In 3D view : double click a 3D model , the scene panel if displayed will jump to the selected model in the hierarchy. Or propose in the 3D view context menu a menu item "GOTO" that makes the same thing.

     

    +1 badly need something like this, scrolling through a long list trying to find selected item to move it into a filter is a pain. Think I would prefer context menu over double click

  15. For some reason one particular terrain texture I am using on layer3 diffuse in my map now refuses to publish to standalone for me - terrain_savannah_rockwall.tex

     

    The normal map "terrain_savannah_rockwalldot3.tex" goes into the zip fine and everything else too by the look of it. I've tried swapping the diffuse out and back in and resaving map but it still won't publish into the zip. I've tried changing the filename on the diffuse texture and adding it back in but even under the new filename it won't publish. I've tried changing layer3 diffuse to a completely different unused texture and it doesn't publish either so it looks like the publish process is for some reason skipping over layer3 diffuse. I did test this layer with displacement in previous beta so I'm thinking it might be to do with that. Although I have another layer I used with displacement and that's fine so not sure.

  16. I seem to be getting lower frame rates with the latest builds. For example on a new map with just 1024 terrain and fps player I'm only getting about 20fps looking ahead and 30fps looking at ground. I tried beta and stable and it's about the same. But if I launch the old build of my game on the steam launcher with more models, enemies etc. I get about double the fps.

  17. Instead of rolling back have you tried running game from the editor or publishing a fresh standalone? On my end this seems to be working ok - just games published prior to the driver update are giving me the problem which is strange. Is this the same for you guys? I'm not sure what the best thing to do is but we could be waiting weeks or months before amd release another driver and if you publish from the old driver maybe folk on the new driver won't be able to play it. wacko.png

×
×
  • Create New...