# Newbie guidance

This topic is 3107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi Im working on a turn-based management game where 2-6 players control a crime syndicate by managing gang-members, sending them on jobs/training, manage inventories, buy/sell drugs and other items. Object is to take over the city and push out the other players though sabotage, bribes, assassination and clever advertisement of your homemade coke and moonshine:) The game world consists of a city with several districts and each player can move his members around to different districts. The world-state is described through parameters in each district (like fear, police alert, drug interest etc) The game itself offer not a very hard task for me, the networking YES (im completely new to this rather big issue) So for network i looked into rakNet, it seems well used and fairly high-level (any other suggestions are welcomed, as high level as possible:). But im still not breaching the wall. There seem to be no precompiled examples that you could modify and play around with to understand whats going on. To just start it up seems to require the users to type pages and pages of code. I would prefer something as abstracted as the functions below
sendInteger(targetClient,value,packetID);   //send state/number. send -1001 means player has pushed "end turn" etc
sendString(targetClient,char[20],packetID);


But this might not exist in any library i have no idea. I dont need advanced functionality but i want it to be as automated as possible:) Any pointers? Cheers Erik H, Sweden

##### Share on other sites
Any library that does what you want will require some setup and a whole lot of code for laying down the ground work. Your example is a clue :

targetClient : What is this? Integer? Then you must have some form of session running, where each client registers with the host. That means creating a session context, advertising a session, clients connecting to session, then accepting clients.

packetId : What is that? in your abstracted API, it seems superfluous anyway. Is it for parsing the right datatype at the other end? Some sort of message Id?

Then there is the socket and system library setup (lightweight stuff though), the underlying transport protocol. Do you send each atomic value in its own packet? reliably? Unrealibly? In order?

There will be more work than you expect I'm afraid. I'd stick with Raknet, but you can look at alternative libraries, don't expect things to get that much neater though.

##### Share on other sites
i know i need setup and control of everything but i wanted to put down my wish of a clean interface.

targetClient would be something like "network pointer" or something that the server can use. packedID would be used by the reciever to know what to do with the data i guess.

Well COULD you send them each by one or better for speed to send a bundle (can you send a class/struct directly?)

Is there any rakNet tutorials that i can start with that send number back and forth or something similar?

Thanks for the input

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631435
• Total Posts
3000057
×