Marcus Posted February 4, 2010 Share Posted February 4, 2010 I decided to look past the syntax of Lua and give the tutorials a go. I was actually pleasantly surprised at the quickness of putting together a script. The only problem I have with scripting now is the first script in the tutorial pdf when run seems very choppy. The two example scripts in the SDK also ran very choppy. My framerate was jumping every where from 70fps on the low end to 310fps on the high end. Is this normal? If I can't even turn a single cube and have it look good, could I really make a game with Lua? Any advice would be appreciated. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted February 4, 2010 Share Posted February 4, 2010 all work fine for me. whats your system spec? Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Marcus Posted February 4, 2010 Author Share Posted February 4, 2010 Updated my signature. It works flawlessly in C++. To be honest, my CPU is the thing that could be holding me back. But, I think LE is more dependent upon the GPU than the CPU. Of course, my GPU could be getting bottle necked by may CPU. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted February 4, 2010 Share Posted February 4, 2010 could you post the code you are using just incase you missed something? Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Marcus Posted February 4, 2010 Author Share Posted February 4, 2010 require("Scripts/constants/keycodes") -- Register abstract path RegisterAbstractPath("") -- Set graphics mode if Graphics(1680, 1050, 32) == 0 then Notify("Failed to set graphics mode.", 1) return end world = CreateWorld() if world == nil then Notify("Failed to initialize engine.", 1) return end gbuffer = CreateBuffer(GraphicsWidth(), GraphicsHeight(), 1+2+4+8) camera = CreateCamera() camera:SetPosition(Vec3(0, 0, -2)) light = CreateSpotLight(10) light:SetRotation(Vec3(45, 55, 0)) light:SetPosition(Vec3(5, 5, -5)) material = LoadMaterial("abstract::cobblestones.mat") mesh = CreateCube() mesh:Paint(material) ground = CreateCube() ground:SetScale(Vec3(10.0, 1.0, 10.)) ground:SetPosition(Vec3(0.0, -2.0, 0.0)) ground:Paint(material) light = CreateDirectionalLight() light:SetRotation(Vec3(45, 45, 45)) while AppTerminate() == 0 do if KeyHit(KEY_ESCAPE) == 1 then break end mesh:Turn(Vec3(AppSpeed() * 0.5, AppSpeed() * 0.5, AppSpeed() * 0.5)) UpdateAppTime() world:Update(AppSpeed()) SetBuffer(gbuffer) world:Render() SetBuffer(BackBuffer()) world:RenderLights(gbuffer) DrawText(UPS(), 0, 0) Flip(0) end Quote Link to comment Share on other sites More sharing options...
Canardia Posted February 4, 2010 Share Posted February 4, 2010 Graphics(1680, 1050, 32) I think this will make graphics window which is covered by the upper part of the Vista Start button. That will cause random behaviour in 3D apps, some may be depending on idle timers, and it might mess them up. Try to make a smaller window, or use fullscreen, so that the Vista Start button does not overlap on your graphics window. You could also use Windows 2000 theme to get some additional FPS in 3D games, and to avoid this Vista bug too. They "fixed" this Vista bug in Win 7 by making the start button not come over the task bar. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Marcus Posted February 4, 2010 Author Share Posted February 4, 2010 Graphics(1680, 1050, 32) I think this will make graphics window which is covered by the upper part of the Vista Start button. That will cause random behaviour in 3D apps, some may be depending on idle timers, and it might mess them up. Try to make a smaller window, or use fullscreen, so that the Vista Start button does not overlap on your graphics window. You could also use Windows 2000 theme to get some additional FPS in 3D games, and to avoid this Vista bug too. They "fixed" this Vista bug in Win 7 by making the start button not come over the task bar. That actually was full screen. But just for fun I set it to windowed mode at 1024x768 with the same issues. I wondered if it was Aero, but after disabling it, still the same problems. Everything in the editor seems to run fine though. Odd. Quote Link to comment Share on other sites More sharing options...
Marcus Posted February 4, 2010 Author Share Posted February 4, 2010 Okay I figured out the problem. I only get the choppiness when I run the script in the editor. If I compile the file into a .luac and then drag-and-drop that onto engine.exe, I don't get the choppiness. Odd, but I feel better now that I can get it to work. Quote Link to comment Share on other sites More sharing options...
Canardia Posted February 4, 2010 Share Posted February 4, 2010 What happens if you don't compile the file, but drag the .lua onto the engine.exe? Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Marcus Posted February 4, 2010 Author Share Posted February 4, 2010 What happens if you don't compile the file, but drag the .lua onto the engine.exe? Runs equally as well. It seems that it is just a problem with having the script editor open at the same time. When I open the task manager with the script editor open and the script running, the script editor is taking 45 percent of my CPU. When I run it from engine.exe, it allows the script to have 85 percent of my CPU time. Quote Link to comment Share on other sites More sharing options...
Canardia Posted February 4, 2010 Share Posted February 4, 2010 Yeah, something wrong with the script editor, it's the only part of LE which fails to run on Linux also, because of some riched20.dll. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
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.