Author Topic: Multiplayer Link-Port Gameplay [Question]  (Read 4211 times)

0 Members and 1 Guest are viewing this topic.

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Multiplayer Link-Port Gameplay [Question]
« on: December 01, 2011, 10:26:29 am »
An Axe question: For Base 671 (among many other project ideas) I'm really wanting to get into implementing multiplayer support through the link port. What techniques and routines are out there for link-play?
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #1 on: December 01, 2011, 07:21:38 pm »
For routines, you have Get() and Send(), as for techniques, what do you mean?
« Last Edit: December 01, 2011, 07:21:45 pm by Builderboy »

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #2 on: December 01, 2011, 10:48:00 pm »
like, how would I go about implementing a system where you're playing a multiplayer calc game through the link port, and the gameplay is just like a regular platform game like Stick Ninja (meaning, 8*8) or something, but there's two characters, and you see your character, and the guy on the other end sees his?

I haven't really had the chance to experiment with the link port cause I don't have a link chord :P but I'm getting one for christmas, but at this point I'm just wondering what's out there, if there's much at all D:
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #3 on: December 01, 2011, 11:23:50 pm »
Youre gonna have to do it all yourself. One thing you can do is once per frame, synchronize the variables between the calcs.

The first byte sent should be a length of transmission. Then, send the data byte by byte (remember, variables are 2 bytes) until all has been sent and received/parsed, then have the calcs stop sending/listening once the previously set length of bytes have been sent.


Quick example:

24->X
6787->Y
Send(4)
Send({°X})
Send({°X+1})
Send({°Y})
Send({°Y+1})



Thats for the sending (duh). You can implement the other end of it.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #4 on: December 01, 2011, 11:28:31 pm »
Another method of doing link play is to only send your own keypresses.  So each calculator will be receiving input both from their own user, and key input from the other user from the linkport.  As long as both games treat the input in exactly the same way, both games will be carried out in the same fashion.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #5 on: December 02, 2011, 12:20:34 am »
Another method of doing link play is to only send your own keypresses.  So each calculator will be receiving input both from their own user, and key input from the other user from the linkport.  As long as both games treat the input in exactly the same way, both games will be carried out in the same fashion.
Yep, you just have to make sure not to use random numbers (at least not in ways that affect the gameplay; it would probably be fine for graphical effects though)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #6 on: December 02, 2011, 12:56:58 am »
Unless you use a deterministic RNG and seed it at the start :D

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #7 on: December 02, 2011, 12:59:49 am »
Unless you use a deterministic RNG and seed it at the start :D
True. But Axe's built-in RNG definitely isn't deterministic :P
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #8 on: December 02, 2011, 01:17:30 am »
Thats for sure O.O  Axiom Time! :P

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #9 on: December 02, 2011, 05:16:09 pm »
ok, thanks guys.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #10 on: December 02, 2011, 05:57:33 pm »
or just send the random number after it's generated.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #11 on: December 02, 2011, 07:59:51 pm »
make sure if you are only doing keypresses to do things like this in your code.

If getkey(4)
If Send(4,60000)
do blank that is affected by 4
end
end
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Multiplayer Link-Port Gameplay [Question]
« Reply #12 on: December 02, 2011, 11:02:15 pm »
I'm going to quote myself from another topic about this recently because I think this is the fastest and easiest technique to create multiplayer games:

Quote from: quigibo
Like I always say, linking is easy, but syncing is hard.  Puyo Puyo runs fast because it only needs to send data when a particular "event" occurs (combos).  Event driven programming style is a little different than what you're used to but basically you put the Get() in your main loop so its always ready to receive an event.  Don't forget, Get() doesn't delay or wait unless the other calc is sending something.

You send data by first sending an enumerated event type (1 bytes) followed by the event data (which may be different length depending on the event).  For instance you might need to send a character's position.  This can be done by sending a "X change" event followed by the x coordinate whenever that coordinate changes and a "Y change" event followed by a y coordinate.  The actual transfer speed is about 500 bytes per second maybe.  If your main loop is running at 30fps and don't mind reducing to 20fps that's about 8 bytes per frame of data you can send which is probably enough for a decent subsets of multiplayer games.
___Axe_Parser___
Today the calculator, tomorrow the world!