Cross-platform game made with B+

Community Forums/Showcase/Cross-platform game made with B+

Andres(Posted 2006) [#1]
This is an early example of a cross-platform game made with BlitzPlus.
Use telnet as the client. Currently there aren't any objects or AI. At the moment you can just move around in the maze.



Download (No Source)
Download (Source only)


jfk EO-11110(Posted 2006) [#2]
Cross platform BlitzPlus?? Probably I missed something - is there a BlitzPlus compiler other than the win32 one?

Or are you maybe talking about BMax?


Zenith(Posted 2006) [#3]
Haha, he wrote the server in Blitzplus I'm guessing, and you use Telnet to connect to it. :)


Andres(Posted 2006) [#4]
Zenith is correct. BlitzPlus's TCP seams to be too slow for an MMORPG so I was curious if there is a library for faster performance though i'll create my tcp code a little faster, but it will still be too slow.


jfk EO-11110(Posted 2006) [#5]
ok I see. What's so slow with Blitz's TCP? Are you sure it's not only the connection-close handling?


Zenith(Posted 2006) [#6]
Blitz's TCP blocks the process until the full TCP packet has arrived, called "Blocking-mode" TCP, I think?

So when you are sending a bunch of data, it'll halt the program until all packets are sent and recieved, instead of an asynchronous interupt method. :/


Andres(Posted 2006) [#7]
Again Zenith is correct.
Currently in some cases I'm sending many packages to client, but I'll try to put the messages into one package and send them as one.
I tried the "game" with about 5 connections around the world and sometimes the response from the server made to me in maby seconds.


jfk EO-11110(Posted 2006) [#8]
I handled this problem by using "shot and forget" requests. that's when you call a php-script using a http request, but you don't read the answer of the server, but close the stream right after the request. Additionally the close-connection tag in the header of the request must be "close", if I recall correctly.

Of course this only works when you don't have to read the servers answer.


Andres(Posted 2006) [#9]
It's not possible to do this with PHP script either because when i send the HTTP request it will still wait for the response from the HTTP server.
Telnet doesn't send to the server nothing, but pure user-typed messages.
As far as i know there is no other way than to use a library that has an option or just doesn't listen for the response.


jfk EO-11110(Posted 2006) [#10]
Not sure what's going on at the lower layers of the protocol, but compared to a call to a php script that will read the servers answer until EOF, the speed diffrence is huge. But of course the connection first has to be established and Blitz may at least pause for this time. The shot and forget tcp call as I described it may be most useful in LANs or when you have client and server on one machine, where the diffrence may be 500ms versus 1 ms.


Andres(Posted 2006) [#11]
Blitz's TCP stream writing commands return either true or the amount of data that was sent so it has to listen for a reponse.


jfk EO-11110(Posted 2006) [#12]
I don't take a return value from them, so maybe that made it? Only:
Writeline stream,a$

In theory it should be possible to write to a stream that is established without to wait for a handshake (at least not on the blitz level).


Andres(Posted 2006) [#13]
As you can see from the source code, I made it exactly the same, but still people are complaining that the network is slow.
It doesn't make any difference if you are saving the value, returned from a function, in a variable (result% = Writeline stream,a$) or not (Writeline stream,a$). If I understood you correctly.

Edit:
I uploaded a new version of the game. Many commands have been added and the networking speed has been slightly increased.

Download


jfk EO-11110(Posted 2006) [#14]
Ok, I see. The lack of multithreading will force a blitz app to wait at least until a connection is established, and even only this may take a while. A solution is to use a dll that is doing the tcp traffic job as a parallel process. There are several solutions floating around (I think "etna" and RakNet ).

I use TCP only for the http part of a multiplayer game, the game data is sent with UDP. MOstly critical is the livesign signal the game host has to send to the http host frequently. The clients of the game have no connection to the http server.

But I see, you're after MMORPG that requires a diffrent architecture.