Jump to content


Photo

[blaxun] Online Engine/examples And Documentation


  • Please log in to reply
1484 replies to this topic

#1361 Universal_X

Universal_X

    GMC Member

  • New Member
  • 126 posts

Posted 02 March 2010 - 05:43 PM

oh thanks guys ^^ heh

so many )]]}][ i could'nt see that one :angry:

Edited by Universal_X, 02 March 2010 - 05:47 PM.

  • 0

#1362 mrcool1997

mrcool1997

    GMC Member

  • New Member
  • 104 posts

Posted 02 March 2010 - 06:44 PM

So here we start:
if !instance_exists(obj_player) exit;
sx = obj_player.x;
sy = obj_player.y;
atkx =obj_atk.x;
atky =obj_atk.y;
if (server >= 0) && ((dx != sx) || (dy != sy))
{
dx = sx;
dy = sy;
clearbuffer();
writeint(1);
writeint(dx);
writeint(dy);
writeint(atkx);
writeint(atky);
sendmessage(server);
}
is it right???
Now the server:
//obj_client
if (client != -1)
{
clearbuffer();
size = receivemessage(client);
if (size == 0) instance_destroy();
if (size > 0)
{
code = readint();
switch (code)
{
case 1:
x = readint();
y = readint();
break;
}
}
}
and!?How to make obj_bullet read x/y?
  • 0

#1363 Adr3nalin3

Adr3nalin3

    GMC Member

  • GMC Member
  • 357 posts

Posted 03 March 2010 - 03:54 PM

First, indent your code properly so we can read it right.
Second, where did you put it? How are we supposed to know if it's in the Step or Create event? And of what object?
  • 0

#1364 mrcool1997

mrcool1997

    GMC Member

  • New Member
  • 104 posts

Posted 04 March 2010 - 03:48 PM

Succsess...But with another engine.chapter14_client.gmk and chapter14_server.gmk.rofl rofl rofl.And in the end of course there is a problem:I send the bullet .x and .y only when i move.Why?Idk!!!I just cant find any ifs in the code to delete it.
code...
s
//step with obj_players
if !instance_exists(obj_player) exit;
sx = obj_player.x;
sy = obj_player.y;
if instance_exists(obj_bullet)
{
bx = obj_bullet.x;
by = obj_bullet.y;
};
if (server >= 0) && ((dx != sx) || (dy != sy))
{
dx = sx;
dy = sy;
clearbuffer();
writeint(1);
writeint(dx);
writeint(dy);
writeint(bx);
writeint(by)
sendmessage(server);
}
  • 0

#1365 theg721

theg721

    G Dawg

  • GMC Member
  • 1959 posts
  • Version:GM8

Posted 05 March 2010 - 03:53 PM

How do I log off on V 1.0? I wish I had added a log off button..
EDIT: nvm, I guess I just close the server.

Edited by theg721, 05 March 2010 - 04:06 PM.

  • 0

#1366 theg721

theg721

    G Dawg

  • GMC Member
  • 1959 posts
  • Version:GM8

Posted 05 March 2010 - 04:31 PM

I added the following to the tcpconnect script:

/*
  creates a socket and connects to the ip and port
  Argument0 = Ip to connect to.
  Argument1 = Port to connect to.
  Argument2 = Blocking(0)/Non-blocking(1)/Non-blocking++(2) mode.
  
  Set argument2 to 2 if you want it to be non-blocking and also not freeze
  the game while it is connecting. Use tcpconnected() to find out when it has
  connected
*/
ini_open('server.ini')
serverip=ini_read_string('ip','srvrip',argument3)
ini_close()
return external_call(global._SokA,serverip, 1337, argument2);

However the game is unplayable. I have an ini with all the right stuff in, so why isn't it working?
  • 0

#1367 sabriath

sabriath

    12013

  • GMC Member
  • 3147 posts

Posted 05 March 2010 - 05:27 PM

Succsess...But with another engine.chapter14_client.gmk and chapter14_server.gmk.rofl rofl rofl.And in the end of course there is a problem:I send the bullet .x and .y only when i move.Why?Idk!!!I just cant find any ifs in the code to delete it.
code...


first of all, you need to learn to use code tags:

like this
  because it
	allows
	  indent

You do that by putting this in your post:

PRE
[$code]like this
because it
allows
indent[/$code]


Just remove the '$'

second of all, you shouldn't ask someone like blaxun about someone ELSEs engines, like mine. chapter_14 is *my* tutorial file on multiplayer programming, therefore you should ask *me* in my thread for any help.

Thirdly...your code DOES have an 'if' structure:

if (server >= 0) && ((dx != sx) || (dy != sy))
^-- right there, and you can see the dx/dy/sx/sy checks for movement
  • 0

#1368 CloudWolf

CloudWolf

    GMC Member

  • New Member
  • 228 posts

Posted 06 March 2010 - 11:00 AM

Does anyone know if/when BlaXun is releasing V1.0 with keyboard movement? Mouse movement is fancy and all, but I would like to use keyboard!
  • 0

#1369 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2616 posts
  • Version:GM:Studio

Posted 07 March 2010 - 04:29 PM

Would do it, but no time atm, busy with job n stuff ^^,

Sry sry...take a look at previous keybord examples and you'll know how its done
  • 0

#1370 human_aft3r_all

human_aft3r_all

    GMC Member

  • New Member
  • 62 posts

Posted 09 March 2010 - 12:32 AM

Does anyone know if/when BlaXun is releasing V1.0 with keyboard movement? Mouse movement is fancy and all, but I would like to use keyboard!

mouse movement uses drastically less bandwidth, you only have to send the desired x,y every time the user clicks. Keyboard movement needs to either send updated x,y constantly, or send keyboard input every time a button is pressed to the server. It takes an enormous amount of bandwidth comparatively.
  • 0

#1371 True Valhalla

True Valhalla

    ಠ_ಠ

  • Retired Staff
  • 4900 posts
  • Version:GM:Studio

Posted 10 March 2010 - 10:56 PM

Does anyone know if/when BlaXun is releasing V1.0 with keyboard movement? Mouse movement is fancy and all, but I would like to use keyboard!

mouse movement uses drastically less bandwidth, you only have to send the desired x,y every time the user clicks. Keyboard movement needs to either send updated x,y constantly, or send keyboard input every time a button is pressed to the server. It takes an enormous amount of bandwidth comparatively.


And I thought not sending x,y constantly was the first noob lesson you learnt studying online coding...sending on key press, key release really doesn't send all that much data, and in some cases is even more accurate.

-Tv
  • 0

#1372 Rassym

Rassym

    GMC Member

  • New Member
  • 286 posts
  • Version:Unknown

Posted 12 March 2010 - 03:53 PM

This may sound nooby but is it possible to use the same method as in chat example to create a new object so other players can see it?
the way the obj_controller creates obj_chat_bubble at players position and sends that too.
  • 0

#1373 Adr3nalin3

Adr3nalin3

    GMC Member

  • GMC Member
  • 357 posts

Posted 12 March 2010 - 06:56 PM

Hey, if it works with one object, it should work with another one! :medieval:
  • 0

#1374 Rassym

Rassym

    GMC Member

  • New Member
  • 286 posts
  • Version:Unknown

Posted 16 March 2010 - 08:24 AM

Hey, if it works with one object, it should work with another one! :)


yeah you're right! Thanks!
  • 0

#1375 Universal_X

Universal_X

    GMC Member

  • New Member
  • 126 posts

Posted 27 March 2010 - 10:29 AM

I think of a Open Source Mulitplayer game for everyone to devolp in GM.

I have a great Pirate MMorPG and a Space MMORPG with inventory, shop, planets, bullets, mining...


What do you think of a Open Source MMORPG devolping here in GMC? :medieval:
  • 0

#1376 Rassym

Rassym

    GMC Member

  • New Member
  • 286 posts
  • Version:Unknown

Posted 27 March 2010 - 12:00 PM

I think of a Open Source Mulitplayer game for everyone to devolp in GM.

I have a great Pirate MMorPG and a Space MMORPG with inventory, shop, planets, bullets, mining...


What do you think of a Open Source MMORPG devolping here in GMC? :medieval:


That would be great. But i can make things on my own now.
But i need to ask questions sometimes :chikin
  • 0

#1377 Universal_X

Universal_X

    GMC Member

  • New Member
  • 126 posts

Posted 27 March 2010 - 12:31 PM

I think of a Open Source Mulitplayer game for everyone to devolp in GM.

I have a great Pirate MMorPG and a Space MMORPG with inventory, shop, planets, bullets, mining...


What do you think of a Open Source MMORPG devolping here in GMC? :medieval:


That would be great. But i can make things on my own now.
But i need to ask questions sometimes :chikin


Yes for help and for making a big game here on the community..
That maybe could be converted to 3D with GM OGRE

That would help every single one new game programmer :GM8:
Think about it :GM045: A mmo community project :GM074:
  • 0

#1378 lopezimg

lopezimg

    GMC Member

  • New Member
  • 3 posts

Posted 27 March 2010 - 09:54 PM

So, there's a bug in this engine. I have two ppl online. When one of them has re-logged, other players can't see that he is moving.
Sorry for my terrible english...
  • 0

#1379 Adr3nalin3

Adr3nalin3

    GMC Member

  • GMC Member
  • 357 posts

Posted 27 March 2010 - 10:01 PM

So, there's a bug in this engine. I have two ppl online. When one of them has re-logged, other players can't see that he is moving.
Sorry for my terrible english...


Since I see this is your first post, and you've joined around a year ago, I assume you haven't been online for a long time. This means:

1) if it is true, I suggest you develop some simple, singleplayer games first. Don't jump into online programming just yet.

2) if it's not, and you're an experienced developer, then have you tried fixing it yourself? What code did you change? Do you know why it's happening? If not, I suggest you look around and see if you can find anything. This saves time and you don't have to wait for other people to come and help you.

3) if #2 is correct, but you did look around, you still didn't provide enough info for us to help. Just describing a bug isn't really going to help. It's like saying "I saw a needle in this haystack, can you find it for me?". You need to say how it happened, did you change anything in the engine etc.
  • 0

#1380 Rassym

Rassym

    GMC Member

  • New Member
  • 286 posts
  • Version:Unknown

Posted 31 March 2010 - 07:40 PM

Hey, if it works with one object, it should work with another one! :D

Hey about that question again! Do i need to create new scripts in server and client or can i use the same script just with another object? ^_^
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users