Jump to content


Demion

Member Since 23 Apr 2008
Offline Last Active Apr 11 2013 02:48 PM

Topics I've Started

GameMaker Websocket

04 December 2011 - 03:29 PM

GM Websocket v3



Description

GameMaker WebSocket is small javascript code providing gamemaker to use websockets. Currently project is still in a very early alpha but includes all needed functionality. Tested with all popular browsers - chrome, firefox, opera, ie, safari (nothing missing?). Now works correctly only with chrome and firefox. I will add opera support in a week. Fully supports gm windows version server (39dll for example). Extension supports multiple connections.

Functions

double gmws_connect(string serverip, double serverport); // returns websocket id
gmws_clear_buffer(double wsid); //clear write buffer
gmws_write_byte(double wsid, double data); // 1 byte unsigned number 0..255
gmws_write_char(double wsid, double data); // 1 byte signed number -128..127
gmws_write_word(double wsid, double data); // 2 byte unsigned number 0..65535
gmws_write_short(double wsid, double data); // 2 byte signed number -32768..32767
gmws_write_dword(double wsid, double data); // 4 byte unsigned number 0..4294967295
gmws_write_int(double wsid, double data); // 4 byte unsigned number -2147483648..2147483647
gmws_write_float(double wsid, double data); // 4 byte floating point number
gmws_write_double(double wsid, double data); // 8 byte floating point number
gmws_write_string(double wsid, string data); // null-terminated string (1 byte per char code, last byte - 00)
gmws_write_widestring(double wsid, string data); // null-terminated unicode string (2 bytes per char code, last bytes 00 00)
double gmws_send(double wsid); // return 0 if disconnect, return -1 if no data was sent, return buffer size normally
double gmws_read_byte(double wsid); // return 0 if no data in recv buffer
double gmws_read_char(double wsid);
double gmws_read_word(double wsid);
double gmws_read_short(double wsid);
double gmws_read_dword(double wsid);
double gmws_read_int(double wsid);
double gmws_read_float(double wsid);
double gmws_read_double(double wsid);
string gmws_read_string(double wsid); // return "" if no data in recv buffer
string gmws_read_widestring(double wsid)
double gmws_recv(double wsid); // return 0 if disconnect, return -1 if no data was received, return buffer size normally (real sent size = returned size + 8 bytes)
double gmws_get_state(double wsid); // 0 - connecting, 1 - connected, 2 - disconnecting, 3 - disconnected;
Guide
1) Launch gmws.exe (websocket traffic "translator" with params gmws.exe ip1 port1 ip2 port2, where ip1 port1 - client connects to (example 127.0.0.1 8080) and ip2 port2 - server (for example 39dll) listens at (example 127.0.0.1 8081). Default values (if no params set) - 127.0.0.1 8080 127.0.0.1 8081
2) Launch your server
3) Connect with html5 client to server

Downloads [reupload - 26.01.12]
GM WebSocket Extension - gmws.gex
Websocket Traffic "Translator" - gmws.exe
Example (server - 39dll) - gmwsexample.zip

Bugs, wishes, suggestions. Please give me feedback.

Motion Planning

23 May 2009 - 09:04 PM

Hi.

I need to make motion to some coordinates avoiding obstacles. Integrated mp_potential_ functions arent good enough.
So please give me some examples / ideas how to code it without using extra modules (DLL etc).

Thanks.

Mp_grid+mp_potential

29 November 2008 - 09:42 AM

Hi.

I`m making my movement system with mp_grid, but it cant move if objects on path are moving (if I will make new path every step there will be bugs) , but mp_potential is not very good. So I`ve seen here thread about using mp_grid to make a path and then go with mp_potential thrue path points. Can someone give an example how to do it?
I hope you`ve understand me =)

Mp_grid+path

25 November 2008 - 07:30 PM

Hi,
I`m trying to do mp_grid+path movement system, but i get stuck with some problem. If I make object which must move (player, npc, mob or other) in grid (mp_grid_add_instances) then this object cant move. How can i make that object can move and also be in grid.

Sorry for pure english, I hope you`ve understand me.

Games W/o Video Card

05 November 2008 - 06:13 PM

Hi.

Is it possible to run games (created on gm) w/o video card on machine? Ofcourse there i dont use any drowing functions.(For example it is needed for games like mmo server and other) ?