Forum > Networking and Web Programming

Tabletop Game Server/Client guidance needed.

(1/2) > >>

TomTom:
Hi. I have close to non knowledge about networking. I know that there are some protocols, ports, etc. but I have no idea what they are exactly. But... I would like to now.
I have this project on my mind, I don't know if its big or not.
So, I would like to create a client/server app for playing Four Against Darkness (Tabletop RPG, dungeon crawling game in form of book, I would paste a link but I dont know if Im allowed to do that here).
What I have in mind. There's this one app that is server and client app at the same time. User runs the app and can choose if he/she wants to host a game session or join session hosted by someone else. In case user wants to host a session he/she sets some properties (Game Rules, maybe password, set of image tiles which will be used to display dungeo, etc). If user decides to join a game session he/she enters the IP of the host (password if needed) and joins the session. Oh and The Host also can play the game he/she is hosting. Users/Players can send text messages visible to all in session and can send simple commands like changing position of character in dungeon, casting a spell or attacking, rolling a dice. So I'm guessing this would be just sending also text messages converted to integer when needed. When every player sends his/hers action, then the server calculates everything
- how dungeon looks - when rooms is empty/monsters are dead then player roll 2d6 dice and result of that roll is the number of room in the pool of rooms)
- fight results,
- events
- etc
When everything is calculated server sends all this to players (how many monsters the slayed, how much damage they recived etc).

So, How do I approach this? What should I use (what components, what protocols)? Where can I read about stuff that can help me in this project? I know I need to learn a lot but I don't know where to start.

What I think I need to now. How to connect to other PC in the network/internet. Send/Recive data (I don't know what kind of data it will be. Propably arrays containg information about action_type, some random integers).

Can You guide me where could I start learning all that could help me in this?

Thanks in advance



MarkMLl:
Gut feeling: don't start messing around with low-level network protocols unless you really have to. For that matter, do not automatically assume that you need to do any sort of conventional programming yourself.

Instead, research what is already available for distributed Multi-User Dungeons (MUDs). You might find that there is already generic higher-level software, to which you would need to describe your game in the same way that e.g. Zork was written in a descriptive language.

In any event, keep us updated :-)

MarkMLl

Xref to older thread: https://forum.lazarus.freepascal.org/index.php/topic,55335.0.html

TomTom:
As a total newbie what I think would be suffucient for my needs.
1. What protocol to use? My best guess TCP/IP
2. Know how to connect 2-4 users where one of them is host and player at the same time
3. Assuming I have done code for dungeon building, how to send information between users how this dungeon looks? Dungeon is build while game progress and consists of rooms (can be a corridor). After clearing a room (defeating monsters, solving a puzzle etc) one of the players roll 2d6 for a number of next room. Rooms (can be of corridor type) are stored in an array so rolled number is the index of that array. When shape/type of next room is determined  player can decide where to place it (entrance must be connected to exit of current room). Each room can be also an 2D array (1 for wall, 0 for floor).
4. How to send/recieve simple data such as strings/integers.


af0815:
For communication, look at first for chat programs written with Lazarus. This a good start, because it shows how the component works.

indy,lnet and synapse are some high level limbs for this

TomTom:
I'm looking at examples right now and one thing makes me worried. For example in this one https://stackoverflow.com/questions/26629513/how-to-set-up-a-simple-connection-between-tidtcpclient-and-tidtcpserver-to-send#26633619 there is TIDSync mentioned. I don't have it and I can't find it. There is also TidNotify (or sth like that) mentioned in other post. I don't have it either.  What I installed using Online Package Manager:
Indy 10
Synapse
LNet
And I cant(don't know how to) use IDSync/TidNotify ...


--- Quote from: af0815 on July 17, 2022, 08:21:30 am ---For communication, look at first for chat programs written with Lazarus. This a good start, because it shows how the component works.

indy,lnet and synapse are some high level limbs for this

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version