Jump to content

Yue

Members
  • Posts

    2,449
  • Joined

  • Last visited

Everything posted by Yue

  1. I hope this gives you an idea. CMove={ -- Constructor. Create = function(self,player,camera) local this={} setmetatable(this,self) self.__index = self function this:Init() self.camera = camera self.player = player self.vel = 0 self.angle = 0 end function this:Update(startEngine) self.vel = 0 if startEngine == false then self.player:SetPhysicsMode(Entity.CharacterPhysics) self.player:SetCollisionType(Collision.Character) self.player:SetMass(200) if win:GetKeyDown(Key.Shift) == false then if win:GetKeyDown(Key.W) then self.vel = -1.2 self.angle = self.camera:GetRotation(true).y - 180 elseif win:GetKeyDown(Key.S) then self.vel = -1.2 self.angle = self.camera:GetRotation(true).y end else if win:GetKeyDown(Key.W) then self.vel = -3.0 self.angle = self.camera:GetRotation(true).y - 180 elseif win:GetKeyDown(Key.S) then self.vel = -3.0 self.angle = self.camera:GetRotation(true).y end end self.rotCamera = self.camera:GetRotation(true).y self.player:SetInput(self.angle, self.vel, 0, 0,false) else self.player:SetPhysicsMode(Entity.RigidBodyPhysics) self.player:SetMass(0) self.player:SetCollisionType(Collision.None) self.player:StopAnimation() end end this:Init() return(this) end }
  2. Fix Camera distance 0.01 1000 Ok. Error Camera distance 0.001 1000 Fail.
  3. if (World::GetCurrent()->Pick(0, 0, 0, 0, 0, 0, pickinfo, true)) { } The pick for the world is not working. Any suggestions, in c++ it underlines something in red and I don't understand.
  4. Yue

    C++ vs Lua

    You're absolutely right, I think for me it's a breakthrough, I'm taking a leap that initially I never thought to do it, moving to C++ is a milestone. And everything I have learned in lua, is not in the trash can. The weird thing in C++ is the compile times, but this is more because in Lua this was flying. On the other hand, it is necessary to go slower in the coding, in my case, because I am learning things like -> or to put a semicolon if not everything does not compile. But it's really fun.
  5. Yue

    C++ vs Lua

    This is encouraging, the performance if I am looking at it. In this scene in Lua the performance was down to 150 frames per second. It is a character controller, and I have to assume because I manage it from C++ code and not from the map editor and lua script.
  6. Yue

    C++ vs Lua

    An open world full of rocks on mars I think would be a good approach to move to C++, however I will do some more testing in C++ to see how this goes. But it is really exciting for me to understand c++ with the basics I have learned while programming in Lua.
  7. Yue

    C++ vs Lua

    I think you are absolutely right, since I know this I have focused more on learning things and the strange thing is that with what I have learned in Lua, I feel that the step to C++ is not so complicated and I find it epic to program in C++. In the end the project is not very advanced, it is like a pre-alpha. And if the compilation times are tedious especially when I come from environments like Lua, or blitzbasic products, but for me it is still something exciting to learn new things.
  8. Yue

    C++ vs Lua

    I have a better load of frames per second, going from 220 to almost 300, and a better render time in a simple scene. This makes me feel like a programmer, everything I learned with Lua is here. #include "App.h" #include "CWindow.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { CWindow window(800, 600); Context* context = Context::Create(window.Get()); World* menu = World::Create(); Camera* camera = Camera::Create(); Model* cube = Model::Box(); Light* sun = DirectionalLight::Create(); cube->SetPosition(0, 0, 3); while (!window.Get()->Closed()) { cube->Turn(0, 1 * Time::GetSpeed(), 0); Time::Update(); menu->Update(); menu->Render(); context->DrawStats(0, 0); context->Sync(false); } return 0; }
  9. Yue

    C++ vs Lua

    A motivation to learn C++-
  10. Thinking about my project, it seems that I am evaluating to try it in C++, because of the performance. Do you really advise me to do that?
  11. I will make a video and show you.
  12. I think from trying so hard to do something with Leadwerks and many tools, I'm on the right track. The new thing I'm learning is Optimize, terrain, sunlight, fog, skybox and vehicle update don't exist when inside the base.
  13. I have a drawback with the shadow, if I move away from the middle of the world the directional light shadow starts to jump, and does not update correctly, any idea what might be going on?
  14. By entering structures I can remove the terrain, fog and sky box along with the outlying lights and other elements. This solves the problem of disappearing walls, and I can create subway structures, where the player can climb down a ladder into the interior of the planet
  15. The first vehicle was based on these unsupported commands, a good result on a visual level, and above all the productivity in creating a vehicle was encouraging. But, I have many problems of Render Time, and unexpected shutdowns of the game. Now I'm creating my own vehicle system based on Hinge joints, without suspension, more rigid, like a horse's fetlock but the performance is nice. Possibly I will improve it with time.
  16. Josh, a question, do you think the models attached to the character's back, in his backpack, affect performance? The system is as follows: all those meshes are attached, they're just not visible. The same goes for the models in his hand, they're all there, but not visible. The game is that when he picks up an object, it becomes visible in his backpack, and then if he moves it to his hand, the object in his hand becomes visible while the one in the backpack becomes invisible ChatGPT translate.
  17. New Position SkyBox.
  18. By optimizing the vehicle system, I have a very good rate of frames per second. Everything points to the fact that the code should be fully optimized. This is an art as porcupine spider said.
×
×
  • Create New...