Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Ok I give up, I have looked all over the forum cant find an answer. I need an example of multiplayer memblocks.

Author
Message
wild doogy
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: In a Cybersuit.
Posted: 8th Dec 2007 18:07 Edited at: 8th Dec 2007 21:10
I am making my first game in DBpro. I have programmed before in a different game studio but I just switched to DBpro. My game for now is two turrets. (a cube with a cylinder sticking out.) and I am trying to make a LAN computer control one of them. What I don’t know how to do is send my variables, xangle1 and zangle1 across the network. I found a forum post on how to create a memblock but I don’t know how to put in a second variable.
Also, what happens if I want to put in strings? It seems to me that usinf net send integer you can only send one variable a sync. But I know that is not right. There must be way to stack or combine multiple integers to a memblock.
I had an idea: I would have to have the memblock broken into five byte chunks.(leaving room for large numbers)

I could use the first chunk an my xangle1
second for zangle1
third for x(if I get that far)
and so on.

it would be easy (sort of) to split it into fives and then decode whatever was in the five asigned to that variable.

Anyhow I cant figure out how to make a two digit number take up 5 places. (23 = 00023 or ###23). There is probably a much better way of doing this that is right in front of my head but I don’t see it. Help would be appreciated.

Wild_Doogy, thanks in advance.
Gaara
16
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: In your wet dreams
Posted: 9th Dec 2007 22:59
I think this is how its done. I used word instead of intiger because your degrees will go over 255 up to 360.
Sorry if it's a bit messy.



there must be a better way of diong it though like making it 1 byte instead of 2... I dunno
wild doogy
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: In a Cybersuit.
Posted: 10th Dec 2007 04:00 Edited at: 11th Dec 2007 01:56
OH THANKYOUTHANKYOUTHANKYOU.

*ahem* lets scrape the mud off my dignity and try that again,
thanks. that is just what i needed. I havent tryed it out but i (almost) inderstand all of it now and I will at the first avalible time (tomarow afer school???) will impliment it. also I am happy to see that it would be easy for me to add another variable if I needed to.

what i dont understand is why you have the variables set to take up two bits of the memblock. my guess is so that I can have a number over 255 but why TWO bits and what is my number cap now? (still alittle froggy on that point.)


EDIT: nope I get memblock index out of range when after I join and

2ND EDIT: the problem is the negitive numbers. I now add 32767 befor i send it and then take it away before I write it to the variable. HOWEVER!! somthing is wrong and the xangle1 is -21000 to -18000 jumping around like crazy.


host code:


and joiner code:


just replace the file loading to be "make object cube" with a size of like 5 to 20


thanks for the reply
Wild_Doogy
Gaara
16
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: In your wet dreams
Posted: 11th Dec 2007 14:24
Glad I could help a bit =D.

I just started on a multiplayer along with some difficulty

I remember something like this happened to me when I used memblock and I think it might be because of make memblock size near the end of joiner code.

I think making the size 2 will fix it.

Then again I might just be looking at the end of the code just cause Im too darn sleepy to read the rest atm.

ps
oops! I used WORD in my last example cause my game didn't use any negative positions xP ~ and cause Im new to this whole multiplayer thig

pps
more like .05 to .2! xD

ppps
joking! Im not sleepy! Gaara never sleeps! X-3

final thought
isn't the host's playernumber 1 not 2? (when sending net message memblock 2,1,1 to the host)... must be because I used PlayerNumber = default net game(etc)
wild doogy
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: In a Cybersuit.
Posted: 12th Dec 2007 21:06 Edited at: 13th Dec 2007 02:30
actualy i just switched to tempest.
it seems to be easyer and it (suposedly) has a better connection.

Login to post a reply

Server time is: 2024-09-27 08:17:34
Your offset time is: 2024-09-27 08:17:34