abraker95 / tanks

2D arcade top-view shooting game
1 stars 0 forks source link

Net Play #64

Open ghost opened 9 years ago

ghost commented 9 years ago

I wish a could play against you when this is done.

ghost commented 9 years ago

Yeah me too.

If we you ask me, we need to have this in the final version. It would make this game 10x better. Maybe we can add this to the beta milestone.

ghost commented 9 years ago

Why not alpha? I consider this of greater importance than items, eye candy, and other things that would then be part of beta.

On Thu, Jan 15, 2015 at 1:39 PM, Sherushe notifications@github.com wrote:

Yeah me too.

If we you ask me, we need to have this in the final version. It would make this game 10x better. Maybe we can add this to the beta milestone.

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/64#issuecomment-70137088.

ghost commented 9 years ago

Right. We can put that in the alpha milestone. It will put off the alpha release quite a bit then.

ghost commented 9 years ago

I think the implementation would take no longer than my experimenting with the Environment last week. That actually delayed a bit of progress. o_o

ghost commented 9 years ago

It's a good thing that you experiment.

ghost commented 9 years ago

Good news: I ran 2 instances of the game and managed to establish a connection. Next up is sending/receiving player info. Also tell me when you will be on because I definitely want to see if this works outside of LAN.

ghost commented 9 years ago

That's great.

We could try at 6pm ( your time ). I will connect myself on Skype.

ghost commented 9 years ago

Or now if you are awake.

ghost commented 9 years ago

I will be Skype when I'm on my computer. Sorry for the spam.

ghost commented 9 years ago

I just tested at my place near the university but it doesn't work either. Maybe there is a way to bypass the problem

ghost commented 9 years ago

I'll get a chance to test it in my college's computers next week. I'll work on having the game exchange info meanwhile. This is really weird.

On Wed, Jan 28, 2015 at 10:00 AM, Sherushe notifications@github.com wrote:

I just tested at my place near the university but it doesn't work either. Maybe there is a way to bypass the problem

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/64#issuecomment-71848160.

ghost commented 9 years ago

So I had my sister test the Online mode (I had to have it running outside my colleges network) and the results are as I expected. When I created the server, she was able to connect. When she created the server, I wasn't able to connect. This is due to port forwarding, such that all the routers at my college are port forwarded (nice I guess), while the router at home isn't. The problem regarding you not connecting to my server still stumps me. Either figure out a way to port forward to verify that's the issue, or give me ideas on how I can replicate it.

ghost commented 9 years ago

I don't know but the main issue is if it's possible to play without port forwarding. I can try to port forward again.

ghost commented 9 years ago

I just looked up and it seems that it's not possible to connect two private computers without port forwarding, I will see what I can do.

ghost commented 9 years ago

Without port forwarding one of them. Only the the router to which the computer is checking for new connections has to be port forwarded to be able to let those connections through. Computers that just connect to another computer do not. That said, since my colleges' 'routers are port forwarded, you should be able to connect to me. We might want to try this again since I changed how the connection is being accepted a bit.

ghost commented 9 years ago

Good idea. We could try again today.

ghost commented 9 years ago

So I finally got packets to be sent! This is also the glitchiest commit so far. Fire up net play with 2 instances and try controlling the tanks. It's too funny. My main concern right now is the latency lag. If you get the tank into view on both screen (good luck with that), you will see that there is a considerable delay. You might need to have one window or the other focused for the game to send/recieve packets I think.

ghost commented 9 years ago

I managed to receive/send packets but it's strange like you say. My server program is freaking out and I can't do anything. My client program is normal but it looks like both tanks are following each other, with a bit of delay.

ghost commented 9 years ago

Yea, i'll make a fix sometime this week. Then we will finally be able to play against each other.

On Mon, Feb 2, 2015 at 2:04 AM, Sherushe notifications@github.com wrote:

I managed to receive/send packets but it's strange like you say. My server program is freaking out and I can't do anything. My client program is normal but it looks like both tanks are following each other, with a bit of delay.

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/64#issuecomment-72414258.

ghost commented 9 years ago

I confused myself in the process of getting players to exchange data. I'm just going to put this here for reference:

1) Host creates server (player 1), Let i=0 2) Client attempts to connect 3) Host sees client wants to connect 4) Host sends client its player num (player 2+i) 5) Client accepts data 6) Client maps its tank to be player 2+i 7) Client sends tank info (x pos, y pos, angle rot) 8) Host checks for connection attempts * goto 3 if true, i++ 9) Host recieves clients' info 10) Host sends clients' info to each client 11) Host updates tanks locally, except it own player num 12) Clients recieve host data 13) Clients update tanks locally, except its own player num 14) goto 7

ghost commented 9 years ago

I am getting closer, but I am still having packets being sent to limbo, the players not mapped correctly, and some buggy detection of whether the client is connected or not. Overall, this is still too unstable. If you want, you can take a look at it. I do require assistance.

ghost commented 9 years ago

I'll see what I can do.

ghost commented 9 years ago

I looked a little bit tonight and I saw a lot of strange behaviours. I need to go though the program step-by-step to understand what's going on- I'll do it tomorrow.

Also I would separate a bit more the client and the server code, it's more clear when the code is in seperate files.