Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

9 Neutral

About TonyF

  • Rank
  1. I see this come up every now and then over the years with most engines and thought its a great idea. Im aware Panda3D is python based which was a bit of fun but it is also nice to have an editor such as leadwerks in the mix. I understand the choice for lua as a permanent commercial solution (Simpler, low interpreter overhead) but i could never let it catch on. Python on the other hand has a fair bit more overhead as you would imagine compared to lua but it also opens up plenty of added advantages (Simple & Complex, plenty of support libraries ie networking etc, 'smarter' code editors with auto complete, sometimes friendlier debugging) I will say that originally i absolutely hated python. I thought it looked ugly and the lack of braces made my head explode coming from predominantly a C++ and PHP background (amongst many others but these primarily). Eventually i started to properly try it and now i program with almost nothing BUT python these days. Personally i feel like its 'a lazy scripted c++' and although that sounds 'bad' its actually quite a compliment. I know previously i had several performance issues with Leadwerks last year that couldnt be explained (game coded completely in c++ and lag with only a few DLC zombies. The lua project was the same) although now that i have installed windows 10 and brought a new graphics card i thought it was time to play again. Now with that spiel i thought i would do a prototype instead of being another person asking for it. The project goal for me is to embed a python interpreter and create an interface wrapper to the leadwerks header and create a python interface api. (Major pain) The ultimate goal for me is to be able to quickly script ideas, tests, prototypes for my game together, test with a debugging environment better than visual studio (IMO), watch updates to the script run instantly without restarting the game. (Classes can be injected at runtime with some python magic added or do a quick reload) The added advantage of using python with the same API is that i can very easily convert the code to C++ for the final commercial product or for speed. (albeit with the additions of adding any supported libraries ie networking with twisted however the concept is proven) The end result is a minimum 2 python scripts that get called (Which matches the app.h) startup.py runtime.py Lua scripts still work as normal The C++ side profiles and outputs the python execution time into the python namespace as well which helps determine some bottlenecks
  2. So basically this dosnt exist yet? I would have thought alt-tabbing is a common need at some stage or another.
  3. Is it possible to check if the window is focused or not eg tabbed out? Some googling indicated in leadwerks 2 AppSuspended() was used however i cant seem to find a leadwerks 3 versions. Im basically trying to stop moving the mouse when the window isnt active
  4. Just writing this reply made me look at something i was overlooking the past 2 days. In the callback there is an 'if (entity->GetClass() == Object::ModelClass)" and my entity is a pivot so now i can find it. My problem was i created a mesh and parented to the pivot when i should of just attached the mesh as the base entity. So in my current setup i would have had to find the pivot and then check for child entities.
  5. I have been somewhat recreating the FPS player prefab into c++ class. It has gone quite well and the movement and actions work fine at this stage. I am currently working on my enemy class and noticed that i cant find my player in the "world->ForEachEntityInAABBDo". I have tried a few things but am really not having any luck. My enitity has a mass, i tried adding a blank lua script to it, i created a mesh and parented it to the entity but i just cant get it to show up in the AABBDo. Any advice on what i am doing wrong?
  6. I found a few old threads but nothing too informative. Is there anyone who has worked out a decent working method for exporting textures from substance painter? I have noticed that there was a somewhat 'recent' update to substance painter allowing us to configure our channels to some degree so a configuration for that would be nice if someones been playing around. I would love to hear some success stories and methods.
  7. TonyF

    C++ Lagging

    Thanks for the replies guys. I tried this 'Model* ent = Prefab::Load("Prefabs/Enemy/zombie1.pfb");' Although Prefab::Load returns an entity. 10 Zombies loaded the way i initially had is about 43 fps. If i load a single prefab entity and then call ->Instance() as suggested i get 15 fps If i load a single prefab entity and then call ->Copy() as suggested i get 15 fps AND i dont see the models ?? If i load the model (Not the prefab) and then call ->Instance() i get 43 fps If i load the model (Not the prefab) and then call ->Copy() i get 39 fps AND i dont see the models ?? Out of the above options loading the Prefab each time (is more efficient that instancing) or loading the model and then instancing it gives identical performance (which is interesting in my case).
  8. TonyF

    C++ Lagging

    I have a quad core i7 with hyperthreading enabled (8 cores). My map is a square base with a texture on it and a couple stock cubes. (I have also used the default 'start' map). I am currently doing a test with 10 zombies. The framerate has gone down to 10fps and camera movement is laggy. In regards to the CPU, the game process is running at 8% CPU capacity and the total CPU usage is 12%. There is also no single core that is remotely maxing out. Maybe i am running animations incorrectly? I just did an ultra simplified test using the default C++ project and a single ground floor cube. In the startup function i have Vec3 Pos = Vec3(0,0,0); for (int i = 0; i < 10; i++) { entity = Prefab::Load("Prefabs/Enemy/zombie1.pfb"); Pos.x += 1; entity->SetPosition(Pos); } And in the main loop i have float t = Time::GetCurrent() * 0.02; for (int i = 0; i < 10; i++) { entity->SetAnimationFrame(t, 1.0, 2, true); } This will give me an FPS of 50 and release mode then subsequent models will drop it lower. I also just did a test of commenting the above out and using the zombie prefab which uses the lua script and i get about 35fps on release mode. I am coming to a bit of a loss as to whats going on or what i can try.
  9. TonyF

    C++ Lagging

    Hi, I have started a c++ project and am using the zombie DLC as an initial placeholder. I have noticed that i can load in a maximum of about 5 zombie models (no animations or scripts running) and then the framerate goes down for every additional zombie i add to a max of 10. If i put the default prefab zombie into the map then i can put 10 in without lag. I have tried both debug and release modes. Oddly when i add in extra models and my framerate goes down so does my GPU usage which i have no idea why (Goes from 10% to more or less nothing / CPU sits on about 12%). I do suppress GL_Invalid_Operation as that prevents debug mode in both lua only and C++ debug modes. Any ideas why i am getting such poor performance? I have also tried publishing the game and running it on a separate computer and the performance was identical. The other PC was NVIDIA and this one is AMD.
  10. TonyF

    C++ Debug Issue

    The solution in the above post is: Since no one else can produce this error, I am just adding a global variable you can call to suppress OpenGL errors: IgnoreOpenGLErrors=true How can i use this in my project so i can work in debug mode?
  11. TonyF

    C++ Debug Issue

    I guess this is the same issue as: http://www.leadwerks.com/werkspace/topic/8681-opengl-error-gl-invalid-operation/ Im using an AMD card with the recommended 14.9 drivers.
  12. When creating a brand new c++ project in the project manager and then opening the solution and hitting debug that the debugging session ends almost straight away. Tracing the console and debugging the (Default) application i can see that i fail on the second call to "world->Render();" The console reports GL_INVALID_OPERATION Note that no changes have been made to the default startup project. I am using visual studio 2013 Professional
  • Create New...