Toon-Master
Toon-Master
Posts

17

Following

10

Followers

19

Currently I\'m (current_year-1988) years old. I am in College now and doing IT stuff. I like Computers because they get fasinating everytime. I\'m Australian with an Asian background.

Joined on August 29, 2006, 1:15 PM Visited on August 5, 2008, 4:04 AM

Toon-Master posted on November 14, 2006 at 2:08 PM

Memory Match Online - Another Example...

Greetings all,

Again I did another Card Engine Experiment called Memory Match. Yes the game where you find the pair and it's yours. However it uses a new Card Engine this time with Multiple deck support. And best of all you can play it ONLINE with your friends.

And you can get this in Closing Words (it's source of course).

Heres a screenshot:
---------------------------
What did I do: ---------------------------
Well before I go there, I just had to say making a Memory Game was even more easier then Blackjack. Yeah I should of done that first <_< but oh well it's done.

Card Scripts: For the card scripts I just change the names of the scripts like deck_drawcard to card_drawcard. And I added deck_create which just creates a deck with choice of back design or just use the default one. There is two objects one your already from my previous one called __Cards_ID and now the new one __Deck_ID. The Deck ID is just for carrying the deck information around.

Single Player Memory For the memory card game I had to change 1 rule with the card engine. I had to change the __Deck_ID object with Persistent on because this deck is going to be created in a menu room and going to be around every room I go.

For a single player game it was the easiest part. Three scripts was needed. One to setup the deck and tell how much shots you made and pairs you got. The second was drawing all cards and placing it in 4 rows (13 cards each row). And the third was to check if the two cards are paired and does it's routine if so/not.

When the Player flips 2 cards it disables the clicking and waits 15 steps to give you the time to read what you picked up and if it is paired it destroys the instance else it is flipped face down. After that you can click again.

In the 3rd script I mentioned does the routines if all card instances are gone so it just shows message with the scores.

Online Parts: That was the hard part. I added 6 scripts, 3 are the same like while the others are not. One script receives the message to receive the server's deck so it follows the server rules. Also that script gives the turn the player starts. It is random (choose(0,1)) pick. Another is the win routine, to see if you lose or not. And lastly, another script that receives the message of player's choice.

I dunno but I assumed the instance ID was going to be different from both sides so I added a array system that stored the card id. So when the other player clicks a card it gets the Number and writes a byte instead of a unsigned short to the buffer.

Connecting or hosting is in the Left Release Mouse event on those buttons. If hosting you accept players in obj_ControlOnline. Simple 39dll stuff using TCP.

Rest is played by assumption through the picks and right deck and is treated like normal play.

--------------------------
Closing Words: --------------------------
Download Link: Memory Match Online Example
Ports you may need to forward if hosting: 13420 TCP

Simple Rules for Multiplayer:
Get a match and you get another shot. I think that's all you need to know.

Looking for a friend to play? Use IM and get someone.

There might be some bugs, so keep and eye if you want or play a game?

Other News: Tommorow I got college and have to do a write up on his computer removing parts and see how well Pheonix_L3S works on it. (From last blog too)

If you read the other blog with "yak". Well I don't have to do work as long as I help her so everytime she does something I pass a task (40 tasks I done 50% for helping other people :P).

Games in college? I'll play some more Game Maker Games that I could never play on this junk in college.

I'll probably put Card_engine in Examples later maybe.

Enjoy
- Toon-Master

EDIT: Shoot, I forgot the Tie Win part. Oh well...

Toon-Master posted on November 11, 2006 at 4:22 PM

More getting my GM on

-----------------------------------------------------
Get my Game Maker On - Card Engine -----------------------------------------------------
Hey, I had this crazy card game idea using plain cards. I wanted to see if I could actually make a card engine so I did an example of a Blackjack game (because it seemed easy to make).

Here's a screenshot:
As you can see, I was just using the sprites from the GM resources and simple graphics. And I won lol.

What did I do? To be honest I got lucky because I had no plan on it. I made a object that just hold the value of the card and used a bunch of variables to make this card unique. It'll probably slow down if I had all the card instances in a room, but then again whos going to use 52 cards at once? Maybe a 52 pick up lol.

And then I chucked in some global variables like how many cards were left or a array deck and such.

Yep that was the card engine. Of course I throw down some scripts too. This was such as flip card, shuffle, restore deck, draw card and move card.

And that was the easy part I thought. The programming the rules is the tough part. I programmed a blackjack one. Simple rules get 21, ace can be 1 or 11, etc etc. I even added a money system with betting which was just optional lol. And added a External Music changer, if you hated the Sonic Advance - Casino Paradise Act 1 music lol or better yet, no music. All these information were stored in a text file using 39dll's utility functions. I could of used GML, but I used 39dll incase I was going to do online?

To actually programmed the rules I had to add bunch of variables to tell this etc. And scripts that just used my card scripts.

Thanks to my friend Elite Pirate for the BG and card back design.

Anyway you can get all that in the Close Words in this blog.

--------------------------------
College Adventures --------------------------------
I want a new computer! I can't play many GM6 games with it or feel the need to try so many awsome stuff.

Friday my lecturer build a very good computer. He added too much powerful stuff so he could run a Game and a Movie at the same time (crazy).

I wanted to test it. The lecturer asked me for a Demo game that uses a lot of resources. Download speed was too slow ATM, so I just downloaded a Game Maker game I never got to try. So I just picked Hover Tank 3D and messed it around (suck at it) and had a movie up too (2 monitors connected together like a extended screen). Then he added another monitor to make three. I didn't know what to put there so I wanted to try the Pheonix_L3S (Create an EXE from home) on it. And I did :P it ran slow though because HT3D was there. But without it it was at 380 (Average) FPS. I also wanted to test it on another computer and it ran at 60 FPS (average). Big difference and then the lecturer called it a "Diagnostic Tool" (WTF). I said no but he said it still is, and he embarass me by testing the Pheonix_L3S on ever computer <_<. And then he invited the other classes to see me playing on the "super computer". And also invited the lecturers, and they took a picture of me playing HT3D with Pheonix_L3S and some Movie playing... They were talking about a new course where the project is to build a computer and I think I'm in some sort of advertisement on playing a computer...

If you think the test is over, I got to do a write up on some computers (some RAM slots out and in etc) using Pheonix_L3S lol. I think it's going to be funny, but at least you get to know if the computers handle surfaces and the GM speed I guess.

Oh yeah, some kids said Hovertank was bad (they never heard but didn't like it). I said, meh because it looked excellent for first play. And if I get myself in some TAFE college ad of this new course, at least you get to see Pheonix_L3S and Hovertank in it I guess (if you live in WA Perth Australia).

--------------------------
Closing words: --------------------------
Download: Card Engine Example - BJ
Short blog? Bugs, probably <_< I already took the ones I know and they are fixed heeheehee.

Enjoy,
- Toon-Master

EDIT: It seems SodaHertz wants my Blackjack game to be online and work with SodaHertz for points. I accept the challange :)

Heh, another bug... Well I intercepted it and fixed it. It's reuploaded :). The bug was when you start with 2 aces you get 22. I forgot to put a checker for the first two cards <_<.

Please check some bugs too ;)

Toon-Master posted on November 07, 2006 at 2:13 PM

Get my Game Maker On

Heh as you notice, "Get your game on" is still in my head. I think I'm starting to like that line too. Also "Throw Down" is in my head...

---------------------------------------------------------
Get my Game Maker on - UDP Broadcast ---------------------------------------------------------
Well today and a bit of yesterday I started trying to learn how broadcasting works. I said to myself, "I don't have a network anyway...". But then I relise I could just use local host (hopefully)... I'm sure sending a UDP message with a broadcast address would send it to myself.

I only started this because my last blog had a comment from Evilish to tell me to make a UDP broadcast tutorial as a suggestion. And I said broadcasting was evil because it creates a load on the computers. Although he already made one, his had problems. So I just went to learn a bit of broadcasting (to find his problem) from Google and Winsock FAQs and found lots of interesting stuff.

So I decided to make an example of it (time to throw down GML). You can get the example at the bottom of my blog. Firstly I was WTF on how to get the subnet broadcast address. I was so close to saying, "Stuff it, use 255.255.255.255". Lucky I saw Winsock FAQs about broadcasting. It was somewhat using an internal IP address. You could use mplay_ipaddress(); or in 39dll hostip(myhost()); to get the address. And you needed the subnet mask (well in FAQs it was lan netmask). I was stuck and still am, so I just assume it was subnet mask. I didn't know how to get such a address... So I knew one way, which was the ipconfig in the command prompt. I guess I needed that Slient Dos DLL (DLL made by TGMG), so it gets the contents. There was probably a better way to do it, if I had the brains. And then it uses those 2 address with some bit wise AND, NOT and OR to get the broadcast address.

Well I think that was the hard part. So I just placed all the stuff to do with broadcast. It isn't had to send a UDP message, just needed the address. The 39dll function lastip() is very handy because it returns the IP address of the last received UDP message or last accepted socket with tcpaccept();

And the list of IP addresses were just stored in a Data Structure lists, because I wanted to clear the list incase the server did not exist or just refreshing.

To finish off the example, I just throw down a 2 player TCP walk example. And I must say, I need to start working on more experiments and games (that esspecially).

Anyway, Evilish's tutorial was errored. I should point out to you for anyone's learning purposes (no offending here). Actually I'll just say the main one. The reason why he received the message twice was when he broadcast, he got the message twice. It happened by sending the UDP message with the actual IP address and send the same message with the broadcast address (send a message to all addresses).

------------------
Closing: ------------------
Download: UDP Broadcast Example
You probably wonder why I'm telling this. Well I need to get my facts right. Also I don't have a network going about, so I need some people to test it to trace errors. I'm going to try tommorow in college though.

I tested myself with success, because I can not run the server and run the client to detect if a server is availible. And if I run the server I can hit refresh and see my Internal IP address there.

Oh if you heard about Bullnet, I never followed it that way... Why because the x.255.255.255 wasn't a good idea. I wanted it to be in 1 subnet area or network area(I think that's what it's called).

That's all
- Toon-Master

EDIT: Hmm netmask in college is 255.255.255.0 too. Now testing...

Alright did a test, I got to fix the way it tries to get the subnet mask. I should add the default subnet. Incase it didn't work. Such as now... (changes temp_directory to nothing).

Yay it works.