News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Network Multiplayer in playbasic?

Started by wilcrump, February 29, 2008, 11:44:58 PM

Previous topic - Next topic

wilcrump

Hi, I'm new to playbasic, I've loaded up some examples, and it looks stunning and simple, can't wait to make games with it.
I think more people will play retro-style games if they have good gameplay, good graphics, and online multiplayer.

I've working on a project in VB6, a multiplayer asteroids game. I'm using winsock for online multiplayer, but have been drawn to playbasic after realising my flickery line drawings aren't up to scratch.

Has anyone found a way in playbasic for implementing online multiplayer?
I haven't found anything, so I assume not, is there any way of passing data to an from playbasic from an external app?
(& Maybe use my existing VB winsock code to pass updates to the game running in playbasic)

I've used an API (I forget the name) in VB to send messages to a running Winamp process for remote control, can playbasic interpret these?
If not, maybe the clipboard?

I think multiplayer is the way forward, everyone's got broadband, multiplayer games last the test of time!
I still play micro machines for the megadrive with mates most weekends!
will

wilcrump

btw: I'm currently making my dogfighting multiplayer air combat game in VB, with capture the flag/death match/last man standing modes to appeal to FPS players. I want fast arcadey action, plenty of bright coloured weapons and debris like the shape confetti demo to reward players hits. It works at with at least 10 players at once, sending update packets to and from all players every 100ms, on a lan its not laggy at all.

I also want to make a multiplayer RTS, with same arcadey style, but ideally with Strategic Zoom like supreme commander. Like the DrawSceneDepth Demo but zooming on mousewheel. It may stretch my maths skills to do the path-finding...

Any ideas/comments will be gratefully recieved,
will

Adaz

Hi will,

I already made a fatiguing research in this subject, and i've finally found a dll that PB can handle. http://www.ostrosoft.com/oswinsck.asp. You can use this dll with the ActiveX library.
I did not run the following example, only typed it by head, but it should work:

#include "ActiveX"

;init
success=RegisterAxDll("oswinsck.dll")
objSocket=NewAx("OSWINSCK.Winsock")

;connect to your server
AddAxStringParam(objSocket,"ip-or-hostname-of-your-server")
AddAxIntParam(objSocket,port-of-your-server)
CallAxFunc(objSocket,"Connect")
ClearAxParams(objSocket)

;send data
string$="hello server"
AddAxStringParam(objSocket,string$)
CallAxFunc(objSocket,"SendData")
ClearAxParams(objSocket)

print "Sent: "+string$

;receive data
string$=CallAxStringFunc(objSocket,"GetDataBuffer")
ClearAxParams(objSocket)

print "Received: "+string$

sync
waitkey


Try it with PB1.63t2 or below because ActiveX crashes in PB1.71g http://www.underwaredesign.com/forums/index.php?topic=2305.msg15544#msg15544

Ádáz

Hungary

wilcrump

thank you so much!
I'll try it out now!

Adaz


Ádáz

Hungary

kevin


Adaz

I've tried K-Netlib and wrote a little client and server with it before I decided not to use it. It's too complicated, has many inexplicable weirdness and anyway I only need the basic asynchron string sending/receiving.
Use K-Netlib if you want to write a mmorpg or other real time network game.

Ádáz

Hungary

wilcrump

I'll take a look at both, I'm still new to playbasic, I think I was trying to bite off more than I can chew!
I'm going to re-make a couple of arcade style games to get a feel for it before I try porting my VB game into it.
Thanks for the help though!