[WIP] Multiplayer Tic Tac Toe Tutorials 1-26-15

The Partridge Family were neither partridges nor a family. Discuss.
Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

[WIP] Multiplayer Tic Tac Toe Tutorials 1-26-15

Post by Pindrought » August 24th, 2014, 9:21 pm

Note: The following is a Work in Progress. As more updates are made, the thread title will change according to the date of the last update.

Please refer to attachments for the download links. Edit: Can only attach 3 files per post, FML. I'll have to use freewebs links for the rest.

This is a series covering how to make a multiplayer TicTacToe game using a modified version of Bshivam's uploaded Chili DirectX Advanced Framework and a server solution starting from the attached solution for Tutorial 1.

Tutorial 1:
https://www.youtube.com/watch?v=PTd44IJ ... e=youtu.be
=Contents=
Loading up necessary sprite for buttons used in game.
Creating Main Screen
Creating Login Screen
Connecting to Server
Tutorial 2:
https://www.youtube.com/watch?v=zECDpwX ... e=youtu.be

Server End Tutorial Link
http://www.freewebs.com/smurf-job/TicTa ... 0Final.rar
Client End Tutorial Link
http://www.freewebs.com/smurf-job/TicTa ... 0Final.rar
=Contents=
What the ClientThread/ServerThread are for and how they work
How tasks in each thread are updated
How to send a data struct that contains no strings
How to send a data struct that contains strings
How to receive a data struct that contains no strings
How to receive a data struct that contains strings
How the connection objects are handled
Add game lobby screen
Add create game screen
Add creating a game request
Fix PindroughtNetwork::DisconnectUser function
Tutorial 3:
https://www.youtube.com/watch?v=QjnW2oR ... e=youtu.be

Server End Tutorial Link
http://www.freewebs.com/smurf-job/TicTa ... 0Final.rar
Client End Tutorial Link
http://www.freewebs.com/smurf-job/TicTa ... 0Final.rar
Note: I forgot to mention to add the following code in the Client Thread where a game lobby is being updated. It has been added in the uploaded source.

Code: Select all

if (MyGamePtr->SelectedServer == GameLobbyToUpdate.LobbyID) //If game being removed is selected server
{
	MyGamePtr->SelectedServer = -1; //Set selected server back to -1
}
=Contents=
Create game lobby struct server side
Add accepting & processing Create game Request from server
Add DeclineCreateGame // AcceptedCreatedGame packets to be accepted in the client thread
Add In game screen to client
Add Game list being sent from server to client
Add game browser being populated in client
Add joining games on both server/client
Add leaving games/disconnecting from game
Add cleanup of game lobby code
Tutorial 4:
Part [1/2]
https://www.youtube.com/watch?v=5h8lrm7kY70

Part [2/]2
[Video In Progress]

Server End Project Download Link
http://www.freewebs.com/smurf-job/TicTa ... ut4End.rar
Client End Project Download Link
http://www.freewebs.com/smurf-job/TicTa ... ut4End.rar
=Contents=
[1/2]
Add chat
Add message when player joins/leaves your game

[2/2]
Add sending X/O packets from client to server and server to client
Add checking if someone won and send message if a player won
Add start new game if a game has ended
Tutorial 5:
[In Progress]
=Contents=
Overview of how this is all working
Review of SendData functions
Review of ReceiveData functions
Review of GetIntPacket function
Creating more complicated packets to send between the server and client
Manually sending a receiving a string - How it works
Review of the ReceiveDataWithStrings func
Review of the SendDataWithStrings func
Attachments
Chili Advanced Fin Tut1End.rar
The framework solution for the END of tutorial 1.
(86.63 KiB) Downloaded 267 times
Chili Advanced Fin Tut1Start.rar
The framework solution for the BEGINNING of Tutorial 1.
(85.79 KiB) Downloaded 249 times
ServerClientFramework Tut1Start.rar
Server Solution for Tutorial 1 - Remains unedited throughout this tutorial. Also used for beginning of Tutorial 2.
(23.58 KiB) Downloaded 234 times
Last edited by Pindrought on January 28th, 2015, 5:53 pm, edited 18 times in total.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by albinopapa » August 25th, 2014, 4:22 am

Text is too tiny to follow along, for me any way. Good luck with the tuts.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by Pindrought » August 25th, 2014, 4:26 am

albinopapa wrote:Text is too tiny to follow along, for me any way. Good luck with the tuts.
Did you put it in 1080p and full screen?
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by albinopapa » August 25th, 2014, 4:35 am

It's not the font clarity, it's the font size. It was in full screen. You probably have your font size around 10, try bumping it up to 13-14. That's where I have to have mine to be able to prevent eye strain...though I'm visually impaired so I'm probably a special case.

BTW that's with my res at 1280 x 720

I have to bump up the font to 18 at 1920 x 1080, to get the same size font
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by Pindrought » August 25th, 2014, 4:57 am

albinopapa wrote:It's not the font clarity, it's the font size. It was in full screen. You probably have your font size around 10, try bumping it up to 13-14. That's where I have to have mine to be able to prevent eye strain...though I'm visually impaired so I'm probably a special case.

BTW that's with my res at 1280 x 720

I have to bump up the font to 18 at 1920 x 1080, to get the same size font
I'll re-render it more zoomed in for you. Hopefully this will help.
For the future tutorials, i'll bump up my font size. Thanks for the feedback.

Edit:Video is currently processing, but should be live at
http://youtu.be/eFK8XPZX7EI
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by albinopapa » August 25th, 2014, 6:11 am

Hey appreciate it.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

FinalL
Posts: 53
Joined: February 6th, 2014, 3:44 pm
Location: Slovakia

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by FinalL » August 25th, 2014, 12:18 pm

Nice, so far so good... Keep going man ;) No problem for me, just use busy mode on skype :lol:
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by chili » August 25th, 2014, 1:45 pm

Lookin' good Pindrought! I think people will be more interested in this than in a basic client-server chat tutorial. It's a little more interesting.
Chili

User avatar
BurakCanik
Posts: 250
Joined: February 8th, 2014, 9:16 pm
Location: Istanbul, Turkey

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by BurakCanik » August 25th, 2014, 6:27 pm

Nice tutorial pindrought, font size 13-14 would be better though. Keep up the good work dude :)
If real is what you can feel, smell, taste and see, then 'real' is simply electrical signals interpreted by your brain" - Morpheus

DeitusPrime
Posts: 97
Joined: June 9th, 2014, 11:14 pm

Re: [WIP] Multiplayer Tic Tac Toe Tutorials 8-24-14

Post by DeitusPrime » August 27th, 2014, 4:52 pm

Cool. 8-)

Quite informative (and you haven't even gone 'into the networking stuff' yet).

I like the GUI tutorial included (an added bonus!!), ...perhaps a bit of formatting is in order. ;)
(how bout making that a small class) maybe, a "little" gui_button_(size) dimensions formatting, then we can also just add something like gui_button_string (and then a scale_to_size bool...for having "large buttons\text").

gui_window_(vec posxy, vec size xy, string caption, bool scale_to_size)
gui_button_(vec posxy, vec size xy, string caption, bool scale_to_size)

(<--- /note to self, do THIS.)

I love you, (heterosexually speaking)...Can't wait to see what else you have in store for us.

...and yes, lol. IF I get around too it I'll make those sound tutorials I was talking about a month or so ago. Though I SHOULD do my homework from Adv. Lesson 10. xD. :lol:

Keep 'em coming.
Choose not to go to destruction with a taco-sauce that is bland...
Go to construction with a taco-sauce that is flavorful!!
Mwa ha ha!!

Post Reply