Tank Game - Tech Demo

Showcase your libraries, tools and other projects that help your fellow love users.
Grassi
Prole
Posts: 8
Joined: Wed Jul 13, 2011 2:23 am

Re: Tank Game - Tech Demo

Post by Grassi » Sun Jul 17, 2011 8:13 am

To clarify, what I mean is if you grapple on both the left and right corners of a plartform at an angle of 30 degrees for example when you hit the wall you bounce back to the exact same spot as you started from if you tried to make it that if you shot yourself into the platform at a 30 degree angle you should bounce off at another angle 150 degrees for example and another one that I just thought of is that you should make the grappling hooks able to grapple onto a platform without the cursor being inline with the platform but use physics and inertia to allow it to carry on to the wall yet another thing I noticed is that the grappling hook can wedge itself high up in the wall instead of stopping at the edge or a smal way in from the edge, That is all have to say.

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Sun Jul 17, 2011 8:42 am

Lafolie wrote:I would add a check to prevent clicking on the same spot twice so that the grapple hooks are attached to the same point. I played around just doing that which has got to take some fun/point out of the grapple mechanic. Basically, I didn't move the mouse after setting the first one, just 3 clicks send you flying in the specific direction which seems to me against the idea of the slingshot system thing you have going.
Whoops, I didn't ignore you! I think it's something I want to leave in, to allow the players to do it in certain areas based on how I construct the game world.
Grassi wrote:To clarify, what I mean is if you grapple on both the left and right corners of a plartform at an angle of 30 degrees for example when you hit the wall you bounce back to the exact same spot as you started from if you tried to make it that if you shot yourself into the platform at a 30 degree angle you should bounce off at another angle 150 degrees for example and another one that I just thought of is that you should make the grappling hooks able to grapple onto a platform without the cursor being inline with the platform but use physics and inertia to allow it to carry on to the wall yet another thing I noticed is that the grappling hook can wedge itself high up in the wall instead of stopping at the edge or a smal way in from the edge, That is all have to say.
I figured out what you were talking about. Say I'm on the left platform and I grapple the center platform and 'bounce' off of the bottom of it I will bounce back to the left platform instead of 'reflecting' and landing on the right platform instead. It's an interesting issue and it may cause me to rethink how I do my collision system if I decide to fix it. I'm not going for super realism so I will have to decide what ultimately feels best in gameplay.

Also, through physics tweaking I discovered that I can still get myself jammed in platforms if I try hard enough. This is especially easy where two platforms overlap each other. I might have to overhaul my player collision code anyway...

User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Tank Game - Tech Demo

Post by TechnoCat » Sun Jul 17, 2011 4:15 pm

Ensayia wrote:
Grassi wrote:When you grapple yourself into a wall you lose momentum and bounce back into the exact same spot as you started from, if you kept the momentum but changed the angle to represent a bounce it might add more realism and also if the bullets stopped when they hit one of the walls instead of continuing through them, giving the impression of solidity.
I'm not 100% sure what you are trying to say. Perhaps you or someone else can clarify?
Currently what happens when you hit a vertical wall is you flip the y-velocity and x-velocity. This isn't what actually happens in real life. Conserve momentum (elastic collision) and bounce it in the normal of the collision.

So if a tank's velocity is (1,1) and moving up and to the right and hits the right wall, I expect the resulting velocity to be (-1,1), not (-1,-1).

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Sun Jul 17, 2011 4:39 pm

TechnoCat wrote: Currently what happens when you hit a vertical wall is you flip the y-velocity and x-velocity. This isn't what actually happens in real life. Conserve momentum (elastic collision) and bounce it in the normal of the collision.

So if a tank's velocity is (1,1) and moving up and to the right and hits the right wall, I expect the resulting velocity to be (-1,1), not (-1,-1).
My solution works to an extent, but I agree that it is not the best solution. I need to come up with a way to get more unique results depending on which side of the platform the player hits. I'll probably end up overhauling the collision system, Taehl has already given me a few ideas similar to his Fizz library.

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Tue Jul 19, 2011 2:39 am

Sorry for the double post, but I have significant updates.

After much frustration, tweaking, and help from multiple people on the LOVE IRC channel, I have finally ironed out the physics so the player will no longer get stuck in platforms. Physics have now been tweaked so they are a lot less bouncy when colliding with the side of a platform. Reworking the collision calculations fixed the incorrect physics issues that Grassi and TechnoCat pointed out when the player collides with the bottom of a platform. Also as planned the player now has a limited grapple distance and can only grapple to specific structures and not just any platform.

I've put more work into this project than anything else thus far. I am really excited to see how far I can take it.

Zaphio
Prole
Posts: 2
Joined: Thu Jun 02, 2011 1:49 pm

Re: Tank Game - Tech Demo

Post by Zaphio » Wed Jul 20, 2011 12:14 pm

Grappling is fun! :awesome:
But I prefer the earlier versions which have more grapple freedom. In the newest version I can't even manage to jump to the platforms.
The physics have vastly improved since the first version, now it feels much more realistic. Keep up the good work!

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Sat Jul 23, 2011 8:14 pm

Update 6 is now out.

I once again reworked the entire collision check code, let's hope it doesn't stick anymore. I also implemented a camera, although this will matter more once the player has a bigger level to explore. Bullets now fire from the end of the gun instead of from the player, it looks better and removes the visual quirk of bullets shooting through the gun when moving.

A proof of concept enemy has been added, a turret that pops out of the floor when the player gets too close. I am aware the player can kill it while it's still in the ground, it's a purely visual movement change right now so the coordinates do not move when the turret 'moves'.

I hope everyone has fun testing, you are all doing an excellent job providing feedback for this project!

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Mon Jul 25, 2011 5:51 pm

Update 7 is now out.

I'm having issues with framerate independent calculations. I've set a maximum dt in an attempt to control and issue I'm having with physics. I am getting wildly different results on different computers based on several people testing the demo for me on IRC. Every time I get one issue fixed it breaks something else, but I hope the recent fixes are bringing me closer to making the physics and collision play nice.

On a positive note, after Kraftman gave me a few more ideas, I think I finally have collision detection nailed. I have been testing with the current collision method for several hours now and I have absolutely not managed to break it. I'm not sure if it will play nice with physics on other machines, but I have to recruit more testers to figure that out.

Enjoy.

User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Tank Game - Tech Demo

Post by GijsB » Mon Jul 25, 2011 6:08 pm

when i try to launch myself when grapling it doesn't really work 3:?

User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Tank Game - Tech Demo

Post by Ensayia » Mon Jul 25, 2011 6:34 pm

GijsB wrote:when i try to launch myself when grapling it doesn't really work 3:?
Is it broken sometimes or always? Can you repeat the issue?

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests