Jump to content

ProjectSky

Member
  • Posts

    339
  • Joined

  • Last visited

Posts posted by ProjectSky

  1. 12 hours ago, EnigmaGrey said:

    Say it takes 0.002 seconds to add a single Option.

     

    if I add 300 of them, I'll spend 0.6 seconds adding options.

     

    If I add 600 of them, I'll spend 1.2 seconds adding options.

     

    That's what you'd expect from a for loop: it'll scale linearly based on the number of statements and number of elements it has to process. 

     

    Instead of 300 menus and 300 submenus, it'd probably be better to use other gui elements that aren't created every time they're needed, like what's happening with the context menu.

     

    if use other gui implemented i need to rewrite all the base code which is equivalent to make a new mod. so i hope dev consider optimizing its performance.

  2. game loads 2x textures even when Double-sized Textures is turned off.

    this issues caused my mod to not display the 1x texture properly, looking at the logs I found that the game was still loading the 2x texture.

    delete 2x texture work for me.

     

    texturepack: loading morebuild2x

     

  3. 11 hours ago, EnigmaGrey said:


    Eh. People are going to have to exercise some common sense, I think. (Just because you can, doesn’t mean you should.)

     

     You can’t spawn 10k zombies and expect the game to handle it. Same thing for 50k items.

     

    Neither never happen during normal play.

    you are right, this test is too extreme

    i hope pz can standard base things of the engine, hope it can become better

  4. 44 minutes ago, EnigmaGrey said:

    At that point the game is going to crash if you even interact with them.

    Though I agree it's a bug, I don't think it makes much sense to try and program out of states that should never be reached in the normal play of the game. I mean the only defense against this would likely be putting a hard cap on the number of items in the inventory, for example. It's just an entirely unreasonable amount of items to expect the game to interact with well.

    i don't think set a limit is good thing, dev should try optimize it if possible

  5. local function SpawnInventoryItem(sq)
      local x, y, z = sq:getX(), sq:getY(), sq:getZ()
      if x == 6142 and y == 5399 and z == 0 then
        sq:AddWorldInventoryItem("Base.Axe", 0, 0, 0)
        Events.LoadGridsquare.Remove(SpawnInventoryItem) --once
      end
    end
    
    Events.LoadGridsquare.Add(SpawnInventoryItem)

     

  6. 4 hours ago, Blake81 said:

    Did something get updated just now? Game downloaded a small patch.

    no content update, just added ProjectZomboid64ShowConsole.bat modified ProjectZomboid64.bat file

  7. try load 300+ context menu

    every right click mouse game freeze ISContextMenu seems to have poor performance

    so i hope dev consider optimizing its performance

    local testFunc = {}
    
    testFunc.doTestMenu = function(player, context)
    	local starttime = os.time()
    	
    	for i=1,300 do
    		local firstMenu = context:addOption("test" .. i, nil, nil)
    		local secondMenu = ISContextMenu:getNew(context)
    		context:addSubMenu(firstMenu, secondMenu)
    	end
    	
    	local endtime = os.time()
    	print(string.format("cost time: %.4f", endtime - starttime)) -- cost time: 0.2440
    end
    	
    Events.OnFillWorldObjectContextMenu.Add(testFunc.doTestMenu)

     

×
×
  • Create New...