Blitzplay AckInUse command

Blitz3D Forums/Blitz3D Programming/Blitzplay AckInUse command

Farflame(Posted 2005) [#1]
This is obviously directed at Blitzplay users.

Can someone give me a code example of the AckInUse command in action? It's just that I've followed instructions but can't get it to work.

My problem is that Blitzplay can only take 256 reliable messages at once, after which it just loses them. I need alot more, so I think the only solution is to add my messages to a queue, send them and then recheck every few (10?) seconds or so - if they haven't been sent, try again. I'm not sure if this will cause multiple receipts at the far end but I guess I could get around that.

I know that's what Blitzplay itself is basically doing but I have no choice because of the 255 messages limit. Surreal the programmer said he'd increase it to 65,000 messages, but it doesn't look like that will happen.

Alternatively, does anyone know how much work would be involved to change the BP library myself to handle 65k messages instead of 255? Or has anyone done it already?


KuRiX(Posted 2005) [#2]
Hello Farflame. I am sorry you are still having this problem. Basically, to change this limit, you will need to use more than one byte in the packet header. two bytes and you will have 65536 ack's.

I think i have answered this before. You will need to change more less those functions:

- Function to calculate next free ack
- Function to insert the ack in the header.
- Move all the content of the message one byte to the right due to the new byte for the header.

But this can be hard if there is some trick about ack's in Blitzplay.

Sorry to be repetitive, but you should change to other library, like my free raknet wrapper, as i have done, and is amazing! And i have done the wrapper so you can change from blitzplay to raknet easily.

Good Luck friend!


Farflame(Posted 2005) [#3]
Thanks Kurix. I was hoping for something a bit easier, but I guess I'm running out of options.

How ease is it to change from BP to Raknet? Will I have to change every BP command in my program?

Where can I find Raknet? Is there a demo or anything for me to look at?


KuRiX(Posted 2005) [#4]
My wrapper is in the userlibs forum. Unfortunately you will need to change every BP command in your code.

Anyway download my wrapper (it is a full version, free!) and try the .bb included. To check for the full manual:

www.rakkarsoft.com

Raknet is free for non commercial uses, and it is free for commercial with permission.

Cheers, KuRiX.


Farflame(Posted 2005) [#5]
Thanks Kurix. I have to say, this looks excellent, and I'll be trying it out ASAP. I don't suppose switching from BP to Raknet will kill me - I've only really use a few BP commands so I can just go through the program and change them 1 by 1.

Looking at Raknet, I assume it's not designed specifically for Blitz Basic? But it does work with Blitz right?


KuRiX(Posted 2005) [#6]
Yep, my wrapper is working perfectly for me. And i must say that i have added extra functionality to the raknet library, so you can use the an inbuilt index for the player numbers.


Farflame(Posted 2005) [#7]
I can forsee some problems because of the way I had to workaround some BP issues. For example, when my players log in, BP issues them automatically with an ID, which I then wanted them to change by putting in their own name. So there's a sort of double log-in procedure. Anyway, if it basically does what BP does, I'm sure I'll find a way around it.

Out of interest, do you know if there's a limit to the number of players in Blitz or Raknet that can be connected at any one time? Someone said Blitz was limited to 64?


KuRiX(Posted 2005) [#8]
Raknet Has no limit (at least 65536 players can connect for sure i think)...

Raknet does not use Blitz Sockets. It is a multithreaded library and you can select the priority of the threads!


Farflame(Posted 2005) [#9]
I have no idea what that means :) Truth is, I'm a fairly 'basic' programmer - it took me about 3 years to understand internet programming at all. Still, I know BP well, so hopefully the transition won't be too painful.

Having a look at Raknet now, will let ya know how I get on. Is there somewhere I can ask for help, or should I just do it on here?


Farflame(Posted 2005) [#10]
So far so good, I got your basic test running fairly easily and some of it makes sense. Is there an even simpler one to look at, with comments perhaps? And documentation?


KuRiX(Posted 2005) [#11]
The full documentation is on the raknet website at:

www.rakkarsoft.com

but the original library is in pure c++ so i have wrapped every command to plain c

The name of the function in my wrapper is the name of the class and the name of the method together!

I can help you here with the wrapper and there is a forum in the raknet web where you can ask too!

Good Luck!


Farflame(Posted 2005) [#12]
I do understand it fairly well as it's similar in function to Blitzplay. The only problems I think I'll have is getting used to the new syntax. Unfortunately I don't know C at all (I always hated it) and just looking at C code makes my brain ache. I'll only need a few commands though so once I have the syntax for those I should be fine.

Did you say somewhere that some of the functionality is missing from your library? Or is it fully functional now?


KuRiX(Posted 2005) [#13]
If you use the client/server method, it is fully functional and tested. Of course you won't be able to use Distributed Objects or Syncrhonized memory because you would need function pointers, but those two functionalities are not necessary at all for game programming.

If you want to use the peer2peer functions not all functions have been wrapped.

Anyway, i am a good person, and i will wrap every function you need that is not wrapped and you have seen in the raknet docs that you need it...

:D

P.D: I think it is better to keep the discussion in the userlibs forum in the official raknet 0.5 wrapper post.


Farflame(Posted 2005) [#14]
The good news is, although my program is very large, it's fairly straightforward and I don't require any advanced features. All I really need is a server/client which is able to send lots of reliable messages. Speed isn't important, nor is timing.

If it's ok with you, can I PM you some questions just to help me pick up the basics?


KuRiX(Posted 2005) [#15]
Of course, send it me now!