23 May 2023, 08:10 | #1 |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 36
|
Best Practise: Network game
I would like to occasionally access the network in my game. I know that this is not possible in BLITZ mode. Therefore I have to move in AMIGA/QAMIGA mode if I want to access the TCP commands. Or not?
My idea is to use the request/response method. The initial request always comes from my Amiga game in the direction of a game server, which then sends a response with the data. Since some time can pass between request and response, I would still like to keep the game "playable" - i.e. asynchronous? Time is not a criterion. The data can be on the way for a second. I am familiar with the basics of network communication. However, how would you roughly do that on the Amiga in a game? |
23 May 2023, 10:14 | #2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,379
|
That sounds like a reasonable approach. You're correct, you need multitasking to run the network stack unless you use either external hardware like a virtual null modem cable or similar.
Keeping it asynchronous within a single body of code just means managing it as part of your main loop. Send your request, then on each iteration or each heartbeat or whatever, check if you got a response. You could also start a counter when you send the request, so that you're able to give timeout errors after x number of seconds / heartbeats and act appropriately. AmiBlitz 3 includes a network Include file. I can't remember if it comes with a demo program but it's worth checking that out, as well as the documentation for it. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Printing over a network | TronPlayer | support.Hardware | 28 | 18 February 2022 23:02 |
Many data sections - bad practise? | thyslo | Coders. Asm / Hardware | 6 | 12 May 2020 01:33 |
Network 2 amigas | rare_j | support.Apps | 1 | 23 August 2006 12:09 |
Network trouble | Mr Creosote | support.Apps | 2 | 14 August 2004 19:04 |
Network Amiga | LaundroMat | Retrogaming General Discussion | 2 | 25 January 2002 06:13 |
|
|