WLAN Multiplayer?
Moderators: Shine, Insert_witty_name
WLAN Multiplayer?
I made a little game, with multiplayer, by using irda,
but if I could use WLAN it would be much better...
so, if anyone could tell how the WLAN works, or even better, make something like the irda sample but WLAN based, I would be really happy.
Does anyone have enough sparetime to help me out?
thanx, Kakolukia
but if I could use WLAN it would be much better...
so, if anyone could tell how the WLAN works, or even better, make something like the irda sample but WLAN based, I would be really happy.
Does anyone have enough sparetime to help me out?
thanx, Kakolukia
well, i read this thread:
http://forums.ps2dev.org/viewtopic.php?t=2471
but i don't fully understand how to get 2 psps connecting to eachother.
what do I need te set as settings in the infrastructuremode?
and how can i get lua to send codes like the irda codes using wifi?
maybe i totally misunderstood it, and is it impossible, but if anyone could help me out...
http://forums.ps2dev.org/viewtopic.php?t=2471
but i don't fully understand how to get 2 psps connecting to eachother.
what do I need te set as settings in the infrastructuremode?
and how can i get lua to send codes like the irda codes using wifi?
maybe i totally misunderstood it, and is it impossible, but if anyone could help me out...
Re: WLAN Multiplayer?
i started making what you are talking about, but it is very hard to do without adhoc support. so i am making a makeshift adhoc sample for you.Kakolukia wrote:I made a little game, with multiplayer, by using irda,
but if I could use WLAN it would be much better...
so, if anyone could tell how the WLAN works, or even better, make something like the irda sample but WLAN based, I would be really happy.
Does anyone have enough sparetime to help me out?
thanx, Kakolukia
so far it is looking kind of good, um, it uses irda and wifi.
It's weird when you start the app you connect to a to a router(sorry had to use it) then you continue on to get your ip address and the ip address is sent to the other psp using irda(this is only done at the beginning of the app so that each psp knows the others ip). so this sample sets up a server and client at the same time. it is based off of the irda sample, you press x to send the "X" character to the other psp using a server/client method and vice-versa, sorry i can't post it today, but it will be up tomorrow, it's been hard sorting out the bugs and such... it should be useful to someone.
- be2003
blog
blog
I know that, but be2003 said:Altair wrote:Yes you can set the ip manually. You can do that in the network settings menu. The part where you make a new connection (or edit one). Instead of automatic use Manual i think.
But if the ip can be set manually (for example by using the manual settings option you mentioned), it doesnt have to use a router...It's weird when you start the app you connect to a to a router(sorry had to use it) then you continue on to get your ip address and the ip address is sent to the other psp
good point, but look at it this way, in network settings you can provide the information to give to the router. for example the ip i give to the router is 192.168.0.105, now that is different depending on how you set it up. another psp cant just send something directly to my psp without adhoc. it must be redirected through a router because only the router knows who 192.168.0.105 is, not the psp, because that number is used specifically for the router and nothing else. in my sample, a router is needed but not the internet so i suggest getting a car adapter for your router
- be2003
blog
blog
havn't tested it yet, i'm going to do this within a few mins (if everything goes right), thanx a lot!
edit: It hangs at stage 3, don't no why, i'm going to test my Wlan.getIPAddress() to see if thats the problem...
I'll tell you later...
btw, which program do you use to edit/make the lua programs ons your psp on the go?
edit: It hangs at stage 3, don't no why, i'm going to test my Wlan.getIPAddress() to see if thats the problem...
I'll tell you later...
btw, which program do you use to edit/make the lua programs ons your psp on the go?
psp pda(used to be psp notepad i think). with it i can write my lua apps while listening to music. edit: god i wish that danzeff had a return key, anyway psp-pda v1.2 is here. it has onscreen keyboard cuz psprint sucks.
Last edited by be2003 on Wed Jun 14, 2006 6:23 am, edited 1 time in total.
- be2003
blog
blog
i'm using that too, but as far as I know there is no way to directly test the lua from there.be2003 wrote:psp pda(used to be psp notepad i think). with it i can write my lua apps while listening to music. edit: god i wish that danzeff had a return key, anyway psp-pda v1.2 is here. it has onscreen keyboard cuz psprint sucks.
I'm not that stupid, it just freezes, only the home button still works. which is more then in the WLAN app that comes with the luaplayer, I need the 10sec hard shutdown for that one...be2003 wrote:if you set up a static connection and defined your ip in network settings then it should only take a second. what version of luaplayer do you have? god i hope u are pressing x like the onscreen command tells u to
I'm using luaplayer 0.20
It does work (w0000000t)!
thanx for your help, I'm going to play woth this the rest of the day, and post my findings.
But 1 question:
why does the other cross/circle only blink? If I keep my cross pressed at psp1, the othercross at psp 2 doesnt stay white, it blits, so it works, but only for a milisec. (It does this also on the 1 psp echo way)
aaah, another question (it doesnt stay at 1, sorry):
If I want to send coördinates, what would be the best way to do this, cause it sends strings, but numbers would be easyer to use...
Thanx for your help, time and effort, its really helpfull to me!
p.s. I have a 1.50 and a 2.50 with GTA: LCS, both with luaplayer 0.20.
thanx for your help, I'm going to play woth this the rest of the day, and post my findings.
But 1 question:
why does the other cross/circle only blink? If I keep my cross pressed at psp1, the othercross at psp 2 doesnt stay white, it blits, so it works, but only for a milisec. (It does this also on the 1 psp echo way)
aaah, another question (it doesnt stay at 1, sorry):
If I want to send coördinates, what would be the best way to do this, cause it sends strings, but numbers would be easyer to use...
Thanx for your help, time and effort, its really helpfull to me!
p.s. I have a 1.50 and a 2.50 with GTA: LCS, both with luaplayer 0.20.
Cant you just use the strings as numbers with lua?
I have made something (which I cant test because it uses netlib and thats offline :( ) and that sends stuff from a table as strings and when it receives I use substrings to put it all back in a table. I think it should work, because Im not copying apprentices ("s) with the substrings.
I have made something (which I cant test because it uses netlib and thats offline :( ) and that sends stuff from a table as strings and when it receives I use substrings to put it all back in a table. I think it should work, because Im not copying apprentices ("s) with the substrings.
Well, ive been working around a bit with irda before a started this thread, and if I sended a number, the other psp received it as a string. If I used that string as a number luaplayer gave me an error...Altair wrote:Cant you just use the strings as numbers with lua?
I have made something (which I cant test because it uses netlib and thats offline :( ) and that sends stuff from a table as strings and when it receives I use substrings to put it all back in a table. I think it should work, because Im not copying apprentices ("s) with the substrings.
so i translated all seperate numbers of the string to a new number, which isnt fun to do...
I do not fully understand what u mentioned, maybe it is the same as I did, maybe it is something different...
I'll post my piece of code soon, to show you how I solved it...
Code: Select all
-- irda write:
irdax = Player.x
System.irdaWrite(irdax)
Code: Select all
-- irda read
x = 0
command = System.irdaRead()
if string.len(command) >= 1 then
for i = 1, 1 do
char = string.sub(command, i, i)
if char == "0" then
x = x + 000
end
if char == "1" then
x = x + 100
end
if char == "2" then
x = x + 200
end
if char == "3" then
x = x + 300
end
if char == "4" then
x = x + 400
end
end
for i = 2, 2 do
char = string.sub(command, i, i)
if char == "0" then
x = x + 00
end
if char == "1" then
x = x + 10
end
if char == "2" then
x = x + 20
end
if char == "3" then
x = x + 30
end
if char == "4" then
x = x + 40
end
if char == "5" then
x = x + 50
end
if char == "6" then
x = x + 60
end
if char == "7" then
x = x + 70
end
if char == "8" then
x = x + 80
end
if char == "9" then
x = x + 90
end
end
for i = 3, 3 do
char = string.sub(command, i, i)
if char == "0" then
x = x + 0
end
if char == "1" then
x = x + 1
end
if char == "2" then
x = x + 2
end
if char == "3" then
x = x + 3
end
if char == "4" then
x = x + 4
end
if char == "5" then
x = x + 5
end
if char == "6" then
x = x + 6
end
if char == "7" then
x = x + 7
end
if char == "8" then
x = x + 8
end
if char == "9" then
x = x + 9
end
end
x is the opponent's x position.
Now I want to know how you did it, what that table stuff...
Have you tried this?
Code: Select all
command = System.irdaRead()
x = tonumber(command)
nope, I don't know the existance of that...SSpeare wrote:Have you tried this?
Code: Select all
command = System.irdaRead() x = tonumber(command)
I'll try it.
thanx!
this is how u should set it up
first define the x
x = 5
then make it a string
sx = tostring(x)
then send it as string
System.irdaWrite(sx)
when other psp receives it, it should be...
command = System.irdaRead()
if string.len(command) > 0 then
opponentx = tonumber(command)
end
first define the x
x = 5
then make it a string
sx = tostring(x)
then send it as string
System.irdaWrite(sx)
when other psp receives it, it should be...
command = System.irdaRead()
if string.len(command) > 0 then
opponentx = tonumber(command)
end
- be2003
blog
blog