-
Posts
4,937 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by gamecreator
-
I would love to see this available as well. Well done!
-
I plan on writing my own collision detection so there's no need to solve these problems on my account but 1. When the character goes down the ramp, it is often still considered airborne so you can't jump (even if it looks like he's on the ground). A lower velocity might solve this. 2. When jumping on the ramp, sometimes the character falls straight through it now.
-
Thank you for the suggestion. It actually did what I was looking for, though it introduced some new problems. I'll keep at it. Thank you for everyone's help!
-
Gravity is already -80 (it's -20 in the Leadwerks example). It falls fast enough when you just walk off a ledge so I'd rather not increase that. And if I decrease the speed the character moves slowly. I'll start from scratch but this is pretty baffling. Thanks for the suggestions though.
-
I'm manually checking if the character can move forward, or up a hill, or down a hill or if it bumps into a wall. Let's say I need to move the character over 10 spaces this frame. I first check if it can move over 1 space. If it can, I move it. Then I check the next space. So on. I think it would be a waste to use EntityCollisionCallback because I would have to pass it dozens of possible situations, each through an individual (so dozens) of entities, if I understand its use correctly. I'm probably doing this the hard way though.
-
Thanks.
-
Is there a way to instantly know if two entities or two bodies are colliding without using EntityCollisionCallback? I'm trying to do something like this: // Move entity forward 2 spaces PositionEntity(entity1,Vec3(2,0,0),1); // If it collides with something if(EntitiesAreColliding(entity1,entity2)) { // Move entity forward 1 space PositionEntity(entity1,Vec3(1,0,0),1); // If it still collides with something if(EntitiesAreColliding(entity1,entity2)) { // Don't move entity PositionEntity(entity1,Vec3(0,0,0),1); } }
-
So we're agreed on Leadwerks 3D Multimedia SDK Engine Game Maker Studio then?
-
I think anyone who comes across Leadwerks already knows that they're looking for. They won't mistake Leadwerks Engine for an automobile company just as they won't mistake Leadwerks3D for a computer animation film studio. But strongly agreed that the shorter the better. The easier it is to say, the easier it is to talk about. There's a reason it's called GMail, not Google Mail.
-
As expected, setting everything to the tutorial values made the controller move incredibly slow. I had the move speed at 2 (the run speed in the tutorial). Setting it to 3 already made the controller bump off the ramp. (I even got rid of the side backwall and frontwall entities just in case there was friction there.)
-
Because at the default scale I need to move the character at a speed of 10 (like in the video) or it will seem too slow. And then it bumps on the hills.
-
I guess I'm out of options then except to write my own physics/collision detection and to add a few extra steps to my pipeline.
-
Yeah but apparently not with a move speed of 10.
-
Their move value is 1 while walking, 2 while running. Mine is 10. I guess one solution could be to scale down the world and player to a 10th of their size and then use smaller values. But I suspect this issue will still come up with steeper ramps. I wish Leadwerks handled this. I appreciate the help Metatron.
-
Tried MoveEntity(player,Vec3(0,-0.1*AppSpeed(),0),0); after UpdateController. No luck. It took control away completely and the Controller just slowly floated down, through the ground. Thanks for the suggestion though.
-
Do they both? Any idea what I did wrong here? Or just MoveEntity? I'll try the latter when I get home regardless. Would be awesome if it worked.
-
Thanks and I'll try that but if PositionEntity doesn't work on controllers, I suspect MoveEntity won't either.
-
True. Gravity doesn't pull it down fast enough. Now, since forces and positioning don't work on character controllers, what are my options? Some sort of hack with a negative jump? Imagine if the character was going even faster (something like Sonic the Hedgehog) but it still needed to stay on the ground. I'd love to get this to work as I really like that the sliding joints work with character controllers (for moving platforms and such) but I may have to code the physics and collision myself.
-
I don't know how the physics tie into the controller but slider joints seem to affect it properly. I was able to use them as moving platforms and the controller responded properly. That said, forces don't work and simply positioning the controller doesn't work (unless someone tells me otherwise).
-
Hello. How do you avoid the bounce of a character controller on a ramp? The problem is twofold: 1. It looks bad to have a character bounce down a ramp when they should be running 2. ControllerAirborne is usually 1 which means that if you use that to detect if you can jump, you're out of luck. Most of the time the character can't. Below is a quick video and the code: #include "engine.h" #pragma warning(disable:58) int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { if(!Initialize()) return 1; RegisterAbstractPath("D:/Programming/Leadwerks Engine SDK"); // Set graphics mode if(!Graphics(640,480)) { MessageBoxA( 0,"Failed to set graphics mode.","Error",0); return 1; } // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if(fw==NULL) { MessageBoxA(0,"Failed to initialize engine.","Error",0); return 1; } // Set Lua framework object SetGlobalObject("fw",fw); // Set Lua framework variable BP lua=GetLuaState(); lua_pushobject(lua,fw); lua_setglobal(lua,"fw"); lua_pop(lua,1); // Get framework main camera TCamera camera = GetLayerCamera(GetFrameworkLayer(0)); PositionEntity(camera,Vec3(13,5,-12)); RotateEntity(camera,Vec3(15,0,0)); TLight light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); SetWorldGravity(Vec3(0,-80,0)); TModel level=LoadModel("abstract::level.gmf"); if (!level) { MessageBoxA(0,"Error","Failed to load mesh.",0); goto exitapp; } EntityType(level,2); TController player=CreateController(1.8,0.4,0.5,45.01); EntityType(player,1); SetBodyMass(player,10); PositionEntity(player,Vec3(0,1,0)); float move=0.0; float strafe=0.0; TEntity backwall = CreateBodyBox(50,50,1,0); MoveEntity (backwall, Vec3(0,0,-1)); SetBodyMass (backwall, 0); EntityType (backwall, 2); TEntity frontwall = CreateBodyBox(50,50,1,0); MoveEntity (frontwall, Vec3(0,0,1)); SetBodyMass (frontwall, 0); EntityType (frontwall, 2); Collisions(1,2,true); Collisions(1,2,true); DebugPhysics(1); SetAntialias(1); while(!KeyHit(KEY_ESCAPE)) { TVec3 pos; TVec3 vel; move=KeyDown(KEY_RIGHT)-KeyDown(KEY_LEFT); pos=EntityPosition(player,1); PositionEntity(camera,Vec3(pos.X,pos.Y+4,-15)); PositionEntity(backwall, Vec3(pos.X,pos.Y,-1)); PositionEntity(frontwall, Vec3(pos.X,pos.Y,1)); move*=10; float jump=0.0; if (KeyHit(KEY_S)) { if (!ControllerAirborne(player)) { jump=30.0; } } UpdateController(player,270.0,move,0.0,jump,50); UpdateFramework(); RenderFramework(); DrawText(0,20,"move: %f",move); DrawText(0,40,"airborne: %d",ControllerAirborne(player)); Flip(0); } return Terminate(); } I really need to guarantee that the controller stays flat on the ground whenever it's moving downhill. Thanks for any help.
-
Hey, I just saw this thread from a separate search. paramecij, I think a lot of people would be in your debt if you made your trees and foliage (and rocks, if you have them) available. I suggest uploading them to the Asset Store. If they're decent, you could even charge something reasonable for them.
-
Body Forces on Character Controllers & 2D Constraint
gamecreator replied to gamecreator's topic in Suggestion Box
PositionEntity doesn't seem to work on the character controller. I originally posted a thread here but I thought I'd post my code here as well, in case you have any ideas. Very simple code. No assets needed. Copy it right into a new project if you'd like. #include "engine.h" #pragma warning(disable:58) int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { if(!Initialize()) return 1; RegisterAbstractPath("D:/Programming/Leadwerks Engine SDK"); // Set graphics mode if(!Graphics(640,480)) { MessageBoxA( 0,"Failed to set graphics mode.","Error",0); return 1; } // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if(fw==NULL) { MessageBoxA(0,"Failed to initialize engine.","Error",0); return 1; } // Set Lua framework object SetGlobalObject("fw",fw); // Set Lua framework variable BP lua=GetLuaState(); lua_pushobject(lua,fw); lua_setglobal(lua,"fw"); lua_pop(lua,1); // Get framework main camera TCamera camera = GetLayerCamera(GetFrameworkLayer(0)); PositionEntity(camera,Vec3(13,5,-12)); RotateEntity(camera,Vec3(15,0,0)); TLight light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); SetWorldGravity(Vec3(0,-80,0)); // PLAYER TController player=CreateController(1.8,0.4,0.5,45.01); EntityType(player,1); SetBodyMass(player,10); PositionEntity(player,Vec3(0,1,0)); float move=0.0; float strafe=0.0; // GROUND TEntity ground=CreateBodyBox(40,1,1,0); SetBodyMass(ground,0); EntityType(ground,2); Collisions(1,2,true); DebugPhysics(1); SetStats(2); while(!KeyHit(KEY_ESCAPE)) { TVec3 pos; move=KeyDown(KEY_RIGHT)-KeyDown(KEY_LEFT); pos=EntityPosition(player,1); PositionEntity(camera,Vec3(pos.X,pos.Y+4,-15)); float jump=0.0; if (KeyHit(KEY_SPACE)) { if (!ControllerAirborne(player)) { jump=30.0; } } move*=10; UpdateController(player,270.0,move,0.0,jump,50); pos=EntityPosition(player,1); // PositionEntity(player,Vec3(pos.X,pos.Y,0),1); UpdateFramework(); RenderFramework(); DrawText(0,300,"player.Z: %f",pos.Z); Flip(0); } return Terminate(); } With the PositionEntity line commented, the character controller works fine. With it uncommented, it seems to break (the character controller becomes almost entirely non-responsive). But please let me know if I'm doing something wrong. -
It looks like clay to me. It's actually a cool effect. Here's a search for metal textures if you need an idea of how others have done it.
-
Body Forces on Character Controllers & 2D Constraint
gamecreator replied to gamecreator's topic in Suggestion Box
Thanks YouGroove. I'm definitely not out of workaround options. Worst case scenario, if the walls around the player don't end up working out, I may simply remove the physics altogether and do them myself, using another library called PMask. It's much more of a pain but it also gives me full control. But yes, this really should be in the engine, in my opinion. -
I've come to the understanding that LE2 doesn't support body forces for character controllers. It would be really nice if LE3 supported this (even better if 2 did also!). It's useful for any type of game. Also, I'm making a platformer a little bit like Trine. It would be nice to limit body and character controller movement to a 2D plane with a single function, like RestrainBodyMovement(player1,Vec3(1,1,0)); Thanks! Bonus points if RestrainBodyMovement(player1,Vec3(.5,2,0)); makes movement half speed on the X axis, double speed on the Y axis and 0 on the Z axis.