Tron... online!
- joelyboy94
- Posts: 67
- Joined: October 11th, 2012, 7:34 pm
Tron... online!
Hello all!
I have created a online Tron game, which is my greatest greatest creation to date by a considerable margin and has taken a lot of effort to make. Unfortunately is not quite finished yet: it breaks with more than 4 players, I haven't finished commenting it, and is quite buggy, but I have run out of time. I leave for university in two days and I doubt I will have time to complete it there, so I thought I'd share my progress. I shall return at Christmas and hopefully finish it then.
Game info:
When you host a game details of your game are sent to the master server which runs on my raspberry pi, which is then passed to the clients who want to see the list of hosts. I haven't tested hosting a game from a computer not on my local network yet so If someone could do that it would be greatly appreciated.
To host a game, you need to forward port 33333 to your IP address.
If you don't know what that means, this site has a pretty good explanation for port forwarding and guides for every router.
To learn more about network programming, this site is a great guide for network programming. It is written in linux, but socket programming between linux and windows is almost identical, and it goes into detail about TCP which is generally dis advised for game network programming. Nevertheless it is still an excellent introductory tutorial. To apply network programming to game network programming in windows, this link is good.
Any feedback is greatly appreciated, as I would love to know how well it works across the internet as I have mostly done testing from my machine.
Should my pi server stop working (i.e. every time you try and view the server list it says no response) someone shout at me on the forum and I'll try and reset it.
I've added the server code in the downloads in case anyone is interested. I made the Networking class cross platform so I could develop and test the server code in windows, and once it was ready copy it across the pi and build and run it there.
I have created a online Tron game, which is my greatest greatest creation to date by a considerable margin and has taken a lot of effort to make. Unfortunately is not quite finished yet: it breaks with more than 4 players, I haven't finished commenting it, and is quite buggy, but I have run out of time. I leave for university in two days and I doubt I will have time to complete it there, so I thought I'd share my progress. I shall return at Christmas and hopefully finish it then.
Game info:
When you host a game details of your game are sent to the master server which runs on my raspberry pi, which is then passed to the clients who want to see the list of hosts. I haven't tested hosting a game from a computer not on my local network yet so If someone could do that it would be greatly appreciated.
To host a game, you need to forward port 33333 to your IP address.
If you don't know what that means, this site has a pretty good explanation for port forwarding and guides for every router.
To learn more about network programming, this site is a great guide for network programming. It is written in linux, but socket programming between linux and windows is almost identical, and it goes into detail about TCP which is generally dis advised for game network programming. Nevertheless it is still an excellent introductory tutorial. To apply network programming to game network programming in windows, this link is good.
Any feedback is greatly appreciated, as I would love to know how well it works across the internet as I have mostly done testing from my machine.
Should my pi server stop working (i.e. every time you try and view the server list it says no response) someone shout at me on the forum and I'll try and reset it.
I've added the server code in the downloads in case anyone is interested. I made the Networking class cross platform so I could develop and test the server code in windows, and once it was ready copy it across the pi and build and run it there.
- Attachments
-
- tron_release_0.2.zip
- tron game (download this one!)
- (1.42 MiB) Downloaded 309 times
-
- Server_code.zip
- pi server code (if anyone is interested)
- (16.33 KiB) Downloaded 306 times
Last edited by joelyboy94 on September 27th, 2013, 1:45 pm, edited 1 time in total.
Re: Tron... online!
Cool, I'm gonna check it out later. I wanna get back to online stuff soon as my last attempts have failed.
ʕ •ᴥ•ʔ
- bshivam2001
- Posts: 214
- Joined: July 27th, 2013, 6:57 am
- Location: India
Re: Tron... online!
WOW!!!
Its time I played a game like this!!!!!
I saw a lot of source files
You worked hard on this one, didn't you
Its time I played a game like this!!!!!
I saw a lot of source files
You worked hard on this one, didn't you
'If you can't make it good, at least make it look good'
- joelyboy94
- Posts: 67
- Joined: October 11th, 2012, 7:34 pm
Re: Tron... online!
Indeed I did! The networking was particularly difficult to get right, but I got there in the end
- thetoddfather
- Posts: 338
- Joined: October 1st, 2012, 9:53 pm
- Location: Canada
Re: Tron... online!
Damn, wouldn't run for me. Build worked no problem but crashed on run. Something to do with an access violation/backbuffer.
- joelyboy94
- Posts: 67
- Joined: October 11th, 2012, 7:34 pm
Re: Tron... online!
It doesn't work in release for some reason. Try debug mode?
- joelyboy94
- Posts: 67
- Joined: October 11th, 2012, 7:34 pm
Re: Tron... online!
I stepped through and the application window isn't actually created in release mode, which is why it fails. I still haven't worked out why yet.
-
- Posts: 27
- Joined: July 23rd, 2013, 11:27 pm
- Location: United States
Re: Tron... online!
Thanks a million for this man! Always nice to have some source code to learn and inspire from. I grabbed this as kind of a side project to try and finish. In respects to all your work: I will attach the following the the top of each page. I urge others to do the same or similar.
//************************************************************
//
// TRON ONLINE
//
// A Project From: http://www.planetchili.net/forum/
// Original Creator: joelyboy94
// Extended By: Ninjavision
//
//************************************************************
//************************************************************
//
// TRON ONLINE
//
// A Project From: http://www.planetchili.net/forum/
// Original Creator: joelyboy94
// Extended By: Ninjavision
//
//************************************************************
- thetoddfather
- Posts: 338
- Joined: October 1st, 2012, 9:53 pm
- Location: Canada
Re: Tron... online!
Yep, that worked. Unfortunately I can't seem to get it to recognize my port triggering so I can't host. Not sure if I can join, haven't seen ya on there haha. But wow man, if you got this working multiplayer, props.
- joelyboy94
- Posts: 67
- Joined: October 11th, 2012, 7:34 pm
Re: Tron... online!
Yeah I only just posted it so if it does work no one will be hosting haha. What does it say when you try and host? Port forwarding is not configured correctly?
If you are competent at networking stuff would you mind installing Wireshark and running a test for me?
Open Wireshark, click on your adapter, click start and type: "udp.port == 33333" into the filter and hit enter. Then try and host a game. Wireshark will show a test packet sent to your external IP, and it SHOULD come up with the packet coming back to you from your router if the routing is done properly.
If you are competent at networking stuff would you mind installing Wireshark and running a test for me?
Open Wireshark, click on your adapter, click start and type: "udp.port == 33333" into the filter and hit enter. Then try and host a game. Wireshark will show a test packet sent to your external IP, and it SHOULD come up with the packet coming back to you from your router if the routing is done properly.