Jump to content

martyj

Members
  • Posts

    544
  • Joined

  • Last visited

Posts posted by martyj

  1. 11 hours ago, gamecreator said:

    While this won't help with debugging or why it's crashing, I thought you were supposed to use physics commands for physics objects, like SetOmega.

    That very well could be the case, but how do we know which functions to use?

    Is Entity::AlignToVector a physics function?

  2. I was wondering if anyone has any tips for debugging newton dynamics?

    My game is crashing when I call Entity::Turn on a Model that has Rigid Phsyics, box shape, and a mass of 60.

    Vec3 posit = this->GetEntity()->GetPosition(true);
    Vec3 navPoint = this->nextNavPathPoint;
    
    posit.y = 0;
    navPoint.y = 0;
    double angle = Math::ACos(posit.Dot(navPoint)/posit.Length());
    this->GetEntity()->Turn(0, angle, 0, true);

     

    See attachment for my stack trace. I'll try workup a demo tomorrow which has the same problem.

    newtoncrash.png

  3. I'm having CPU problems with Leadwerks in that when I use a bunch of Character Controllers for AI (Around 130) the game lags really bad.

    What can I do performance wise to allow me to have a few thousand Character Controllers at once?

    My render time is about 19-21.
    Update time is around 520
    Batch Size: Around 580

    Running through a profiler NewtonDynamicsSimulation::Update uses majority of the processing time. CharacterController::AlignToGround is what looks to be like it is using a ton of CPU.

    My batch size is about the same with and without the extra Character Controllers.

  4. With the new released version of Leadwerks Enterprise targeted towards simulation and VR, I think it would be beneficial for the expansion of this if Leadwerks supported Python.

    It would be similar to how LE does Lua.

    You could use Swig to generate the python classes.

    http://www.swig.org/Doc1.3/Python.html#Python_nn10

    I know from experience that Python is heavily used in the physics world. It's the only language they teach in my Computational Physics degree. If it's as easy as swig looks, would be a good way to produce more sales IMO.

    • Upvote 3
  5. 7 hours ago, AggrorJorn said:

    Anything special about this entity? CSG brush, camera, model?

    Reminder: CSG brushes are collapsed if they don't have a script or mass.  Makes finding the entity impossible if that hasn't happened.

    The entity that cannot be found is a Box.

    The entity that can b e found is a Pivot
     

    4 hours ago, macklebee said:
    
    App:FindEntity("EndAsdfgwg")

    why are you doing App:FindEntity()? shouldn't it be 'world:FindEntity()' since you went to the trouble of finding the current world and thats the title of your topic? And are you for some reason still using the very depreciated app.lua scripting?

    I've updated my sample to reflect the topic.

    I wrote my own FindEntity function to try to see if there is a bug in the World's FindEntity. It just loops through the world entities calling World::GetEntity(n) and compares the name.

    Both my version and the LE version have the same problem, I'd imagine they are along the same lines of code.

  6. Here is the list of entities in my world

    https://imgur.com/a/tPRa6

    When I run the following code in Lua, it returns NULL

    local world = World:GetCurrent()
    CaveIn2_ATrappedMiner.boundingBox = world:FindEntity("EndAsdfgwg")
    
    if CaveIn2_ATrappedMiner.boundingBox == nil then
    	System:Print("Null bounding box")
    	return
    end

    When I run the following code it returns the Entity as expected

    CaveIn2_ATrappedMiner.rubble = world:FindEntity("Rubble")

    When I loop through all the entities and print their name, EndAsdfgwg isn't listed in the World

    Any ideas as to what I am doing wrong?

  7. On 10/2/2017 at 1:39 PM, gamecreator said:

    Since this would all be client to client, except for the special world items, we have to assume that no one will hack/cheat (which I know is a bad assumption but this would be for the tournament so nothing serious).

    One thing to take note is that libcurl implementation with Leadwerks does not support HTTPS at the moment.

    Which means anyone running wireshark can see your traffic.

    • Like 1
  8. 18 hours ago, Josh said:

    Regular Lua is slower than LuaJIT but the LuaJIT project is no longer being developed and You will get more time in the game loop in Leadwerks 5 for your code to execute, since rendering and physics are performed in separate threads.  LuaJIT is stuck at Lua 5.14 which does not support unicode.

    Does this mean we can have an animated loading screen now?

  9. 22 hours ago, Rick said:

    Have you tried the following? Does it give an error?

    I've updated the lua code to the actual Lua code, not just psudocode.

    The code "Runs" but nothing is printed to the console.

    If I run

    Interpreter::EvaluateString(std::string("System:Print(\"Test\")"));

     

    This will print to the console.

    I haven't ran it through a Lua debugger to see if ARudeAwakening::Main() gets called or not.

  10. I'm working on customizing quests with Lua to be more dynamic.

    I'd like to be able to define a lua program via a lua file, load it via Interpreter::EvaluateFile.

    After loading the file, I'd like to be able to call a "Main" function inside the file.

    Something similar to the following:

     

    ----- Scripts/Quests/ARudeAwakening.lua
    
    ARudeAwakening = {}
    function ARudeAwakening:Main()
    	System:Print("Main loaded")
    	App.Quests.ARudeAwakening = self
    end
    
    function ARudeAwakening:UpdateWorld()
    	System:Print("Logic Stuff")
    end
    
    ---- C++
    Interpreter::EvaluateFile(std::string("Scripts/Quests/ARudeAwakening.lua"));
    Interpreter::EvaluateString(std::string("ARudeAwakening:Main()"));

    How can I get something like this to work?

×
×
  • Create New...