SFML community forums

General => SFML projects => Topic started by: kralo9 on February 17, 2013, 12:25:04 pm

Title: TankTank Mutliplayer Project
Post by: kralo9 on February 17, 2013, 12:25:04 pm
Here is my action-mutliplayer-awesome project "TankTank". Of course only in beginning phase. Would like to hear what you think about it. Maybe some ideas for new features :)

Using sfml and sfgui.

Already implemented:
-Shop (Ammo, Upgrades etc.)
-Bots (AI)


Here a link to Youtube video: http://www.youtube.com/watch?v=8qTOjnihqPU&list=UUBU2CUSksklBQj-zIOtQvHg&index=1


Looking forward
Title: Re: TankTank Mutliplayer Project
Post by: eXpl0it3r on February 17, 2013, 03:43:02 pm
Looks really good!
Would be interesting to hear some more technical details.

Btw. your main menu most probably uses SFGUI wrong, that is you're not using layouters.

Keep it up!
Title: Re: TankTank Mutliplayer Project
Post by: kralo9 on February 17, 2013, 08:44:24 pm
Would be interesting to hear some more technical details.

Well, logic is performed serverside. Where the movement gets extrapolated to avoid unsmooth movements. Actions to server and player data to client is send by UDP socket where shop, chat and heartbeat are send by tcp socket.
Could tell more but that would be too much detail.
Title: Re: TankTank Mutliplayer Project
Post by: lolz123 on February 17, 2013, 10:36:57 pm
Do you do any client-side input prediction or lag compensation? If so, I would like to know more about how you accomplished it  :)
Title: Re: TankTank Mutliplayer Project
Post by: kralo9 on February 17, 2013, 11:07:16 pm
No. There is no lag compensation right now. I have looked for some implementations but I did t find out how I can move the tank to its serverside position smoothly. I only predict further movement in case a packet gets lost or is corrupt etc. If you look closely in the video you see a green rect just behind the tank. That represents the serverside tank/hitbox.
If someone could help me with lag compensation I will be very happy.

Title: Re: TankTank Mutliplayer Project
Post by: FRex on February 18, 2013, 01:13:27 am
Did you read source engine networking?
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
Title: Re: TankTank Mutliplayer Project
Post by: kralo9 on February 18, 2013, 08:47:06 pm
Ok I understood how the movement prediction should work. But how do I compare the predicted position with the serverside position. With lag they cant be equal...
Title: Re: TankTank Mutliplayer Project
Post by: greeniekin on February 21, 2013, 08:47:06 am
I have read a couple of ways. One way I read was keeping a log of all turns and movements ect. with their time client side. Then run the commands stepping forward in time since the last state information was received from the server(accounting for lag). This way your character can not continue to get further and further out of sync.

I do not know how this will perform with different pings. Maybe you can have interp between the last estimation and new estimation to smooth it out a little bit. Though the way some games behave when I get some lag I do not think they use Interp.

Edit:

by turns and movements I mean the commands that cause them like "+foward" and "-foward" in quakeworld.  This way it is relative to the latest updated position state, or whatever other states that are important.
Title: Re: TankTank Mutliplayer Project
Post by: kralo9 on February 23, 2013, 09:05:12 pm
With time you mean that tickcount? And what happens if the tickcount is larger than its limit. Like int has.
Title: Re: TankTank Mutliplayer Project
Post by: exafi on March 24, 2013, 02:49:45 pm
This game with a mode online should it be fun =D with fog for it doesnt see the enemy