My first Hollywood based network game
My first Hollywood based network game
Hi all,
Since nobody volunteered to write the first Hollywood based network game and release the sources...
I still need to write a proper user interface for the game before releasing it. Networking part and game logic section is allready working fine. Special thanks goes to Bugala for sponsoring me the Hollywood 5 update!
Connected to and playing against my Inferno based server program
Since nobody volunteered to write the first Hollywood based network game and release the sources...
I still need to write a proper user interface for the game before releasing it. Networking part and game logic section is allready working fine. Special thanks goes to Bugala for sponsoring me the Hollywood 5 update!
Connected to and playing against my Inferno based server program
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: My first Hollywood based network game
can you put some source code?
i´m sure that will be very useful why the network chapter in the hollywood guide is not very well explained, lack of examples.
i´m sure that will be very useful why the network chapter in the hollywood guide is not very well explained, lack of examples.
Re: My first Hollywood based network game
I will post the sources soon, when it's finished...xabierpayet wrote:can you put some source code?.
This game is quite simple to make, really:
Game board is stored in a two dimensional table. We make the table internally a little bit bigger than the real game board because we want to add extra border around the board edges. This is done, so we can save some comparisons when checking the winning position. There is no need to check if we are at the edge of the board. Extra border around the board will always terminate a search anyway.
Local player input is simply handled by building the game board grid as buttons and using event handler for handling the button presses. We simply use SendData() function to send the move as a line of text consisting button id to remote player. Remote player input is handled by using event handler for "OnReceiveData" event.
Synchronizing game turns is also simple. We use variable, which can have two states: 1 and -1. This variable is often called lambda and can have some clever uses. For an example we can use the same procedure for testing our own pieces and enemy's pieces in a game. If player1 plays on positive lambda with positive pieces and player2 plays on negative lambda with negative pieces, we can multiply value of the piece on board with lambda and result is always positive if the piece is owned by player whose turn it is.
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: My first Hollywood based network game
nice example, i will try it in my strategus game xD
Re: My first Hollywood based network game
Almost finished...
Now game server and client are both Hollywood based and working nicely. Just need to draw better user interface and add some status texts, like turn indicators and connection status for an example.
Current status of the Hollywood Tic-Tac-Toe
Now game server and client are both Hollywood based and working nicely. Just need to draw better user interface and add some status texts, like turn indicators and connection status for an example.
Current status of the Hollywood Tic-Tac-Toe
Re: My first Hollywood based network game
Perfect explaining. Thanks you! We need more!
Re: My first Hollywood based network game
I will try to add missing functionality later today and post the sources...
Meanwhile you can test these AmigaOS4 binaries and check, if you can break the networking stuff.
Note: uses port 2000 for networking.
Meanwhile you can test these AmigaOS4 binaries and check, if you can break the networking stuff.
Note: uses port 2000 for networking.
Re: My first Hollywood based network game
Sources available here
Written in a hurry... Code could use some comments, more structuring and procedures. I hope it helps someone...
Written in a hurry... Code could use some comments, more structuring and procedures. I hope it helps someone...
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: My first Hollywood based network game
hello jalih, i have a timeout error ever when i try to connect with the client to the server, i need put an special hostname or else?
Re: My first Hollywood based network game
There is a small typo error in Client:jalih wrote:Sources available here
On button_handler(), change:
Code: Select all
Repeat
Local str$, ok = StringRequest("Connect to host", "Enter hostname:")
If StrLen(str$) <> 0 Then Break
If ok = False Then Return
Forever
Code: Select all
Local str$, ok
Repeat
str$, ok = StringRequest("Connect to host", "Enter hostname:")
If StrLen(str$) <> 0 Then Break
If ok = False Then Return
Forever
I will fix sources later today and will probably add double buffering as well.