Jump to content


Photo

Easysock - Version 1.0 Beta!


  • This topic is locked This topic is locked
141 replies to this topic

#41 Zelda4evr

Zelda4evr

    GMC Member

  • GMC Member
  • 615 posts
  • Version:Unknown

Posted 30 August 2006 - 10:49 PM

sorry for being so offtopic but, how can i make it send the x and y better? like you said? i am sending them just like they are player coords just with a different id.
  • 0

#42 FredFredrickson

FredFredrickson

    Artist

  • Global Moderators
  • 9196 posts
  • Version:GM8

Posted 30 August 2006 - 11:01 PM

If all you sent was x and y, it might get laggy, but it is impossible that it could get out of sync. The only other problem is that you need to turn off "freeze game when window loses focus."
  • 0

#43 abacus

abacus

    GMC Member

  • New Member
  • 1330 posts

Posted 30 August 2006 - 11:11 PM

Haven't downloaded yet, before i do, could you please tell me exactly how simple this is? I know Mplay, and I'd like to move to 39DLL, but it's very complicated. I'd love to be able to use mplay-like scripts on the faster 39DLL.
  • 0

#44 Dinsdale

Dinsdale

    GMC Member

  • New Member
  • 1389 posts

Posted 30 August 2006 - 11:18 PM

I really needed something like this for my two player game. It is really boring on yer own but with online. it could be great. I understand mplay but dlls are mind boggling maybe I will check this out thanks.
  • 0

#45 CyberTwister

CyberTwister

    GMC Member

  • New Member
  • 243 posts

Posted 31 August 2006 - 10:33 PM

This is a very good exemple...
That could be a good thing to also explain how to create an object wich could interact with the 2 players...
For exemple a ball in a pong game :)

(If you do it, do not delete or replace this exemple, juste add it to the zip )

Really good work...
(But need to be more develop to be really interesting :P )

Edited by CyberTwister, 31 August 2006 - 10:35 PM.

  • 0

#46 Zelda4evr

Zelda4evr

    GMC Member

  • GMC Member
  • 615 posts
  • Version:Unknown

Posted 01 September 2006 - 02:15 AM

@fredfredrickson

i send only x and y and it has no lag and i have freeze unchecked. but it doesn't send the x and y right....i just tried to send the x and y of a bullet, and it didn't send it, it didn't show up on the other screen...so something is going wrong here.
  • 0

#47 FredFredrickson

FredFredrickson

    Artist

  • Global Moderators
  • 9196 posts
  • Version:GM8

Posted 01 September 2006 - 03:02 AM

This is probably not eh best place for this type of discussion, but you are not thinking out your information sending properly.

Let's say you send the x,y for every bullet object you create. Now lets say you put a machine gun in the game which shoots 1 bullet every step. The game runs at 60 fps.

If you had 4 players fighting each other, each with a machine gun in hand, and they shot at each other for 1 second straight, you'd have:

(4 players) x (60 bullets) x (3 variables to send [index of bullet, x, and y, all as short (2 byte) values]) = 4320 bytes of data to send each step. That's 259k of data to send every second of play!

Now, lets say you had the same setup, but you're only sending the x, y, and direction of the bullets... but this is only the start point of the bullet, and only needs to be sent once for each bullet. Now you're looking at athe same equation, but it only need to be sent once a step, as the bullets can take care of themselves once they are created.

Using this method, you'd only be sending 96 bytes a step, which translates to 576 bytes a second. Now you've got plenty of bandwidth to use for the player movements, etc.

Of course, under normal circumstances, you wouldn't really want to send information around every step, but this is just an example. The bandwidth used would be the same if you waited every 6 steps to send the data, and it would not be very laggy at all.

In any case, multiplayer games require a fair amount of planning, so before you just start sending all kinds of packets back and forth, start working out what would be the best way to work things out.

Sorry about that long-winded and slightly OT post, Fox... Just had to clear that up. :D
  • 0

#48 Zelda4evr

Zelda4evr

    GMC Member

  • GMC Member
  • 615 posts
  • Version:Unknown

Posted 01 September 2006 - 04:10 AM

@fox, sorry for being so offtopic as i am stopping now.
  • 0

#49 irregular

irregular

    GMC Member

  • GMC Member
  • 1271 posts

Posted 01 September 2006 - 11:27 AM

This looks like a good start. I really might consider my multiplayer games if this goes to say 10 players on at a time (1 server). So please, if you can do it.
  • 0

#50 YopYop

YopYop

    GMC Member

  • New Member
  • 120 posts

Posted 01 September 2006 - 11:54 AM

Hi :D

Could someone explain us/me how to create an instance with a motion pleaze ?
(That means for exemple a bullet wich will be seen by the 2 players...)

Thanx a lot for any help...
  • 0

#51 Dinsdale

Dinsdale

    GMC Member

  • New Member
  • 1389 posts

Posted 02 September 2006 - 11:26 PM

Iam having one problem, I made a multiplayer game with example. But have noone to test it with.
  • 0

#52 KidMD

KidMD

    GMC Member

  • New Member
  • 9 posts

Posted 03 September 2006 - 12:39 AM

Dinsdale,

You should be able to open your game in two windows (save it and open a second gamemaker window with your program) and test it that way.
  • 0

#53 YopYop

YopYop

    GMC Member

  • New Member
  • 120 posts

Posted 03 September 2006 - 01:51 PM

Hi :GM066:

Can't someone explain us how to shoot pleaze ?
(that means create a bullet wich will be seen by the 2 players)

Thanx a lot for any help...

Edited by YopYop, 03 September 2006 - 01:51 PM.

  • 0

#54 Dinsdale

Dinsdale

    GMC Member

  • New Member
  • 1389 posts

Posted 03 September 2006 - 03:53 PM

hey yes I see what you mean connect to myself. Yes Yes it works yet I have a problem. I am sure I am doing everything right but I cannot see a bullet on the other screen when I create it. Basically I can see the other person and when they move it moves on the other screen.

So my problem is movement of players works but I cannot see the bullet I shoot on both screens only one. Yet I send the x and y of the bullet to the other player.
If anyone is really trustworthy I will let you take a look at the gm6 :GM066:
okay heres my topic with my problem:
problem with easysock

Edited by Dinsdale, 03 September 2006 - 04:09 PM.

  • 0

#55 Fox-NL

Fox-NL

    I wanna fly high

  • New Member
  • 620 posts

Posted 03 September 2006 - 04:16 PM

Again, everyone, thanks for all the feedback!


About the bullet thing, try using the following codes:

Send a message when a bullet gets launched
PRE
i = instance_create(x,y,obj_bullet);
i.direction = direction;

packetstart();
packetwrite(2); //2 = bullet message id
packetwrite(i.x); //bullet x
packetwrite(i.y); //bullet y
packetwrite(i.direction); //bullet direction
packetsend(false);

Then receive the message like how the location packets are received (obj_controller, step event)
PRE
m_id = packetread();
if(m_id == 1) {
obj_player_client.x = packetread();
obj_player_client.y = packetread();
} else if(m_id == 2) {
i = instance_create(0,0,obj_bullet);
i.x = packetread();
i.y = packetread();
i.direction = packetread();
}

  • 0

#56 Dinsdale

Dinsdale

    GMC Member

  • New Member
  • 1389 posts

Posted 03 September 2006 - 04:39 PM

Thankyou!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • 0

#57 YopYop

YopYop

    GMC Member

  • New Member
  • 120 posts

Posted 03 September 2006 - 05:20 PM

That doesn't work for me...
Can u (or someone) put a gm6 file pleaze ?
That would be so nice....
Thanx a lot for this work :GM066:

Edited by YopYop, 03 September 2006 - 05:27 PM.

  • 0

#58 life_games

life_games

    GMC Member

  • New Member
  • 181 posts

Posted 03 September 2006 - 11:25 PM

oooh this might be perfic for my dungeon and dragons online program i was going to make if only it suported more then just 2 ppl ....

keep working i'd like to use it some day :GM066:
  • 0

#59 SirMixAlot

SirMixAlot

    Punkster

  • New Member
  • 216 posts

Posted 04 September 2006 - 03:03 AM

I havent looked through all the scripts yet, but why wouldnt it support more then 2 players? Can't we add more clients to connect? Or are you talking about the example that came with the game?
  • 0

#60 Toon-Master

Toon-Master

    Half-Toon Hero!

  • New Member
  • 340 posts

Posted 04 September 2006 - 04:50 AM

No the scripts made can't go then More then one player.

This would require a map system that holds the sockets. This uses something along 1 socket in a global variable. Making 2 player games are easy to do. But more then 2 can get hard.

Using another client for EasySock example will not work, once it accepts the player it closes the listening socket. And even if you did connect to the server. The sending and receiving only goes to the other socket.

Meh I confused myself on explaining but I have a engine called PK_Engine that supports more the one player that is like EasySock except different. Comparing my scripts with his are very different. Mine has a lot more coding to handle the other players.

Hope you understand.
- Toon-Master

EDIT: Ok I relised you didn't read the scripts, sorry about that.

Edited by Toon-Master, 04 September 2006 - 05:24 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users