SpiderPig Posted June 15, 2024 Posted June 15, 2024 @Yue and I have been discussing on discord about why my game does not load packages on his PC. On my PC and several others who have run my game it works as it should. The game states that it is loading the package then it will crash. This occurs for both password protected and non password protected zip files. Writing an example for this is extremely hard as It's only happening on his PC. The only thing that we can see what is different is that his Windows PC is in Spanish. Could that be effecting something? @Yue Can you please post your system specs here for Josh? 1 Quote
Yue Posted June 15, 2024 Author Posted June 15, 2024 Windows 10. GTX 1070 8 Gigas VRAM. CPU I7 2600 24 Ram. 1 Quote
Dreikblack Posted June 15, 2024 Posted June 15, 2024 1 hour ago, SpiderPig said: Windows PC is in Spanish Or user name uses non-latin symbols Quote
Josh Posted June 21, 2024 Posted June 21, 2024 Perhaps zip_open() does not support UTF8 strings... Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted June 21, 2024 Posted June 21, 2024 I tried this and it worked with no issues: Assert(FileType(GetPath(PATH_DESKTOP) + L"/Пожалуйста.zip") == 1); auto p = LoadPackage(GetPath(PATH_DESKTOP) + L"/Пожалуйста.zip"); If you are storing a path in a string and not a WString you could lose information. Please upload a zip file for me to test, or tell me what the path that is causing the problem is. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted June 21, 2024 Posted June 21, 2024 Please upload the zip file so I can test it. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
SpiderPig Posted June 21, 2024 Posted June 21, 2024 This is my code for loading all packages within the game directory. Yue has uploaded a zip on the thread he created. vector<shared_ptr<Engine::Package>> packages; void LoadPackages(Engine::WString path = "") { auto directories = LoadDir(path); for (auto dir : directories) { auto ext = ExtractExt(dir); if (ext != "") { if (ext == "zip" || ext == "pak") { auto package = LoadPackage((path != "" ? path + "\\" : "") + dir); if (package != nullptr) { package->SetPassword("password"); packages.emplace_back(package); #ifdef ENABLE_LOG Log("SUCCESS : Loaded Package : " + path + "\\" + dir); #endif } else { #ifdef ENABLE_LOG Log("ERROR : Failed to Load Package : " + path + "\\" + dir + "!"); #endif } } } else { LoadPackages((path != "" ? path + "\\" : "") + dir); } } } Quote
Josh Posted June 21, 2024 Posted June 21, 2024 This code works without any problem: auto p = LoadPackage("maps.zip"); p->SetPassword("1500"); auto stream = p->ReadFile("Test.ultra"); Quote My job is to make tools you love, with the features you want, and performance you can't live without.
SpiderPig Posted June 21, 2024 Posted June 21, 2024 I think you will need to do a remote debug. Its only happening on his PC. Quote
Yue Posted June 21, 2024 Author Posted June 21, 2024 Video on Discord. https://discord.com/channels/1175951843118031049/1175951843612954786/1253806372634755124 Quote
Yue Posted June 21, 2024 Author Posted June 21, 2024 I've created a new project, and I'm still the same, installing on another hard drive and the application close Quote
Yue Posted June 21, 2024 Author Posted June 21, 2024 Proyect Test, Press key R for load zip. https://www.mediafire.com/file/f4qmp77zneigfku/Test.zip/file Quote
Yue Posted June 21, 2024 Author Posted June 21, 2024 Update main, herror continue. --Initialze Steam (optional) --if not Steamworks.Initialize() then return 1 end --Load FreeImage plugin (optional) local fiplugin = LoadPlugin("Plugins/FITextureLoader") --Get the displays local displays = GetDisplays() --Create a window local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR) --Create a framebuffer local framebuffer = CreateFramebuffer(window) --Create a world local world = CreateWorld() --Load a map local mapname = "Maps/start.ultra" local cl = CommandLine() if type(cl["map"]) == "string" then mapname = cl["map"] end local scene = LoadMap(world, mapname) while window:KeyDown(KEY_ESCAPE) == false and window:Closed() == false do --Garbage collection step collectgarbage() --Update the world world:Update() Steamworks.Update() if window:KeyDown(KEY_R) then local p = LoadPackage("Maps.zip") p:SetPassword("1500") end --Render the world to the framebuffer world:Render(framebuffer) end Steamworks.Shutdown() main.lua Quote
Josh Posted June 21, 2024 Posted June 21, 2024 Your code says this: p:SetPasworld("1500") It should be this: p:SetPassword("1500") Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Yue Posted June 21, 2024 Author Posted June 21, 2024 Sorry, that's why I updated the main file. It doesn't work anywa Quote
Josh Posted June 21, 2024 Posted June 21, 2024 What is the full path to your project directory? Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Yue Posted June 21, 2024 Author Posted June 21, 2024 C:\Users\Yue\Documents\Ultra Engine\Projects\Test Quote
Josh Posted June 21, 2024 Posted June 21, 2024 I do not know what the problem is. Your example runs perfectly, even if I put it in a folder with non-English characters. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Yue Posted June 21, 2024 Author Posted June 21, 2024 I'll try another hard drive, maybe that's it. Quote
Josh Posted June 21, 2024 Posted June 21, 2024 You should check to make sure LoadPackage is returning a value. Right now we don't know what command is causing the problem: local p = LoadPackage("Maps.zip") if p == nil then Print("Failed to load package") else p:SetPassword("1500") end Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Yue Posted June 22, 2024 Author Posted June 22, 2024 I have this, but it still doesn't go past loading the package, I don't get any information in the debugger before closing, just that it's loading the package. If for example I put a zip that doesn't exist, I get this back. Quote
Yue Posted June 22, 2024 Author Posted June 22, 2024 What I perceive is that it stays inside the command to load the package and the automatic closing happens, it is very strange Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.