Jump to content

gamecreator

Members
  • Posts

    4,937
  • Joined

  • Last visited

Posts posted by gamecreator

  1. In reply to the original problem, I would make a strict top-down render of the level in question in Max. I would then go into Photoshop and quickly paint over it in different solid colors, depending on the area being painted over, like yellow for sand, gray for concrete, blue for water and so on (essentially creating sound zones by drawing them).

     

    Then, in-game, I would get the character's x/y position, get the color on the drawing at that location and play a sound depending on what color was picked up. It gets just a touch more complex if you have an area with multiple heights.

     

    This is my preference mostly because I know how to do each step and is easy for me, not because it's the simplest.

  2. Ok. Physics is definitely wrong. I put in a second directional light (which I guess is wrong because it glitched the graphics up) and now the ball won't even go up the first small ramp. What am I doing wrong??

     

    (Sorry about the triple post.)

  3. Ok. I just solved two of my three problems. For some reason, Leadwerks uses the global position from Max as the pivot point, not the pivot point itself (even though the exporter exports it correctly, as seen in the Model Viewer). This explains the camera wobble. This also explains the misplacing of the ball at 0,0. When the ball was told to go to 0,0, it placed the ball based on where its bottom was. If the bottom was tilted out because the ball moved/rotated a little, it offset the ball and so it was offset that much from 0,0. Follow?

     

    Now I hope maybe my physics quirk is fixed too.

     

    Thanks everyone for the help!!

     

     

    I guess a related follow-up question: is the timing on the physics correct in the code? I mean, will the ball move at the same speed for everyone?

  4. If you mean the pivot point then yes, in both Max and the Model Viewer, it's centered in the middle of the ball.

     

    I just tested replacing the sphere's .phy file with a box .phy file and the camera bouncing goes away, until the ball falls off the edge. Then it wobbles again.

     

    Also, unfortunately, after I replaced the ball's .phy file with the correct one, I was able to go up a ramp I was never able to go up before. :)

  5. I'm experimenting with a ball game and I have a few problems I'm really hoping there are solutions to.

     

    post-368-12673919374501_thumb.jpg

     

    First, whenever the ball falls off the edge, I put it back to its starting point but it doesn't quite work. It's always a bit above or below or to the side of where it should land. Is my position code wrong?

     

    Second, the camera follow code doesn't work. While it generally does follow the ball, it wobbles up and down and side to side as the ball moves. The slower the ball moves, the slower the camera wobbles.

    EDIT: Is it possible that the camera is positioned not on the pivot point of the ball (which is at the center) but rather the bottom of it (which is at 0,0)? I should test this. That would certainly explain the wobble. EDIT2: Tested. No change.

     

    Finally, I can't swear on it now because I can't reproduce it, but I think the physics may have changed depending on the program run. I don't yet alter any friction or anything but sometimes the ball made it up some ramps, even if barely, sometimes it only makes it half way. Sometimes it can stay half way up the ramp if I hold the button down, other times it starts rolling back anyway. Anyone ever have this issue and know what causes it?

     

    Here's the simple code I'm currently working with (I removed the initialization & loading code for this post):

     

    int main()
    {
    // ...
    
    while(!KeyHit(KEY_ESCAPE))
    {
    
    	if(KeyDown(KEY_LEFT)) AddBodyForce(ball,Vec3(-2,0,0));
    	if(KeyDown(KEY_RIGHT)) AddBodyForce(ball,Vec3(2,0,0));
    	if(KeyDown(KEY_UP)) AddBodyForce(ball,Vec3(0,0,2));
    	if(KeyDown(KEY_DOWN)) AddBodyForce(ball,Vec3(0,0,-2));
    
    	//  If the ball fell far enough, restart it from checkpoint
    	pos=EntityPosition(ball,1);
    	if(pos.Y<-5)
    	{
    		PositionEntity(ball,Vec3(0.0,1.0,0.0));
    		SetBodyVelocity(ball,Vec3(0.0,0.0,0.0),1);
    		SetBodyOmega(ball,Vec3(0.0,0.0,0.0),1);
    	}
    
    	//  Follow ball with camera
    	PositionEntity(camera,Vec3(pos.X,pos.Y+6,pos.Z-5));
    
    	UpdateFramework();
    	RenderFramework();
    
    	DrawText(400,400,"X = %f, Y = %f, Z = %f",pos.X,pos.Y,pos.Z);
    
    	Flip(0);
    }
    
    exitapp:
    return Terminate();
    }
    

     

    Any help would be much appreciated!

  6. The visuals look good so far but I am much more interested in the gameplay concept you laid out. I know you have a lot of work ahead of you but despite that, I'm hoping you'll have something playable out soon.

  7. Thank you for the earlier help. I just tried to do a search for +alpha +shadow and it found no results yet this page should have come up, I think:

    http://leadwerks.com/werkspace/index.php?/topic/1018-i-did-something-artistic/page__hl__alpha%20shadow__fromsearch__1

    Also, a search for +alpha +shadows (s at the end of shadow) only comes up with one result (again, the above page should have been part of the results).

    Nothing urgent. Just thought I should mention it but it would be helpful to have.

  8. Does anyone know under what condition the assets may be used in your own projects? I was wondering, for example, if I may release a game using materials and models available in Leadwerks (like the sand texture in the editor). I suspect this question may have been asked already and that leads me to my next question:

     

    How do you search for threads that contain ALL words that are searched for. For example, if I search for blue box, it would return threads with both words in them, not just either one (as it does now).

     

    Thanks!

  9. Thank you. From macklebee's post, it looks like I'll need to investigate 2d joints, as I'm very likely not a good enough programmer to modify the newton code. Lumooja, believe it or not, I've thought of Little Big Planet before this but that just seems a step more difficult, as in something to implement after one figures out how to do single-plane 2D with a 3D engine.

     

    In addition to all this, I've used the wonderful pmask collision library before. It's strictly 2D but I can see the possibility of not using Newton and implementing it instead. It would be some extra work, somehow analyzing the 3D world and creating a 2D collision array from it, but it could be done.

  10. I know it may be counter-intuitive but one of my thoughts is to use Leadwerks for a 2D game. I'm thinking either a platformer or a game like

    . The question is, how do you implement a 2D game in Leadwerks?

     

    My first thought was to create two massive planes, one on each side of the characters, which prevents them from moving in the Z plane. That, combined with resetting all rotations to face the correct way each frame should solve most problems. But what if some characters are wider than others? Do I put down multiple planes? This seems a bit awkward.

     

    The second thought was that maybe Newtown's already thought of this. I didn't see this in the Bodies wiki but perhaps there's a way to set it to ignore Z movement. Or, is there a way to detect Z movement and apply a negative force to counter it?

     

    Any thoughts and suggestions are appreciated. This is also my first post on the forums so hello all!

     

    Oh, finally: how do you access the two locked tutorials on the wiki? I sent Josh an email a few days ago but I guess he's busy.

     

    Thanks!

×
×
  • Create New...