ENIGMA Forums

Contributing to ENIGMA => Function Peer Review => Topic started by: fervi on September 15, 2013, 02:40:43 pm

Title: Yoyogames Example in Enigma
Post by: fervi on September 15, 2013, 02:40:43 pm
First Game (Catch The Clown)
Works fully

FPS (Doom-like)
Compiling, but no walls (background_get_texture problem?)

Maze Game (Maze)
Works fully

Multiplayer Example
Not compiling - (mplay_init_ipx)

Platform Game Example
Playable, compiling without any problems, but Highscore table doesn't work

Shooter Example (1945)
Playable, compiling without any problems, but Highscore table doesn't work

Isometric Example
Works fully

Parallax demo
Not sure, probably background doesn't work

Parallel demo
Works fully

Scaling example
Background doesn't work and bugged collision
Title: Re: Yoyogames Example in Enigma
Post by: DaSpirit on September 15, 2013, 03:59:29 pm
YoYo Games fully removed mplay_* functions in recent GameMaker editions. We shouldn't be supporting it either, as it was never even recommended in GameMaker either.
Title: Re: Yoyogames Example in Enigma
Post by: fervi on September 15, 2013, 04:24:02 pm
YoYo Games fully removed mplay_* functions in recent GameMaker editions. We shouldn't be supporting it either, as it was never even recommended in GameMaker either.

In theory yes, but enigma should be compatibile with mplay (or just create mplay like technology)

Fervi
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 16, 2013, 01:18:41 am
Quote
mplay_init_ipx

DirectPlay has been officially deprecated for like 10 years now and I don't feel like writing the code only for it to buggy and outdated, there is no point in wasting time on it. MPlay is obsolete in both ENIGMA and Game Maker, it never worked well anyway.

Quote
In theory yes, but enigma should be compatibile with mplay (or just create mplay like technology)
Sure if someone wants to write a networking system that uses DirectPlay which for reasons I stated above and the fact IsmAvatar already wrote Berkeley Sockets, I feel it is a huge waste of time.

Quote
Not sure, probably background doesn't work
Build->Settings "API" tab, sometimes it helps to try these games in different graphics systems.

Quote
but Highscore table doesn't work
That is part of widget systems, which is defaulted to Win32 on Windows and I don't think highscore functions were added, on Linux for widgets you need to set GTK+

Quote
Compiling, but no walls (background_get_texture problem?)
That should not be happening in the current version, there are collision bugs because game maker returns -4 for noone constant which people do if (!collision) and GML assumes negative values as boolean false, which ENIGMA and no real programming language does so you generally have to do if (!collision == -4) in ENIGMA

But as for the texture problem, try the version on the EDC as it has these changes, and you can also try Build->Settings "API" and switch graphics systems.
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 16, 2013, 07:21:34 am
Quote
Sure if someone wants to write a networking system that uses DirectPlay which for reasons I stated above and the fact IsmAvatar already wrote Berkeley Sockets, I feel it is a huge waste of time.
I think he meant we need to support those functions, not some underlying system. So just create a wrapper around Berkeley sockets. I don't know how hard the current net_ functions are to use, but the mplay ones were easy as far as I remember.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 16, 2013, 03:53:52 pm
Harri, with networking you still need to obtain the curl headers for http functions, that is why if it were done it should just use DirectPlay since that is already distributed with our MinGW just like DirectSound, DirectInput, and Direct3D 9 I'd rather not hang on to those functions forever, nor emulate an obsolete part of the DirectX API
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 17, 2013, 11:53:47 am
Quote
with networking you still need to obtain the curl headers for http functions
Why? I don't remember mplay having any http functions.

Quote
MinGW just like DirectSound, DirectInput, and Direct3D 9 I'd rather not hang on to those functions forever, nor emulate an obsolete part of the DirectX API
Then that clearly wouldn't work with Linux. So I don't get why BS cannot be used here.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 17, 2013, 04:35:49 pm
Quote
Why? I don't remember mplay having any http functions.
Not what I said, I said the new Berkeley Sockets have networking, and you have to obtain the curl headers in order to compile with Berkeley Sockets enabled.

Quote
Then that clearly wouldn't work with Linux. So I don't get why BS cannot be used here.
Yes, and neither did the original mplay functions. Mplay functions were designed specifically like the DirectPlay version, that is also why joystick functions are named the way they are, and all of the Direct3D functions, a lot of GML functions are named directly after the DX equiv. But anyway, Mplay was shit, and nobody ever used it, me and Josh were fine just leaving it obsolete/deprecated because it performed so fucking horribly, other than the one tutorial, there is not any other game in Game Maker that used mplay, maybe a few side ones, but I have found very very few, and none that are even worth porting. Anybody who knew anything used 39dll, etc. Like I said I am not wasting my time with it, someone else certainly can, but I am not.

Edit: Fuck it, I guess I'll write mplay functions wtfever
Title: Re: Yoyogames Example in Enigma
Post by: time-killer-games on September 18, 2013, 01:26:07 pm
I always wondered, why is it called "39dll" if you ask me that is an extremely stupid name, heck, it's some random number. I'm tempted to think the guy who named it was tripping on acid.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 18, 2013, 04:17:09 pm
Think it's a pun on a baseball team...
http://39dll.wikia.com/wiki/39sters_39DLL:_winsock_for_Game_Maker_Wiki
Title: Re: Yoyogames Example in Enigma
Post by: fervi on September 18, 2013, 06:30:18 pm
@Robert B Colton
I thinking about recreate mplay functions, but using better tools. I understand about mplay-GM - is very bad, but enigma should have better, but compatibile (by GML-code) functions

Fervi
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 18, 2013, 07:19:19 pm
Fervi, we do, it's called Berkeley Sockets networking, mplay is just Microsofts shitty designed multiplayer, we have real networking.
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 19, 2013, 04:19:56 am
Quote
Not what I said, I said the new Berkeley Sockets have networking, and you have to obtain the curl headers in order to compile with Berkeley Sockets enabled.
Why? I have used BS with mingw without any extra headers before.

Quote
Fervi, we do, it's called Berkeley Sockets networking, mplay is just Microsofts shitty designed multiplayer, we have real networking.
But you still don't get it. We are saying that we don't need DirectPlay or whatever, because we have Berkeley implemented. It doesn't matter on what mplay was originally based on and it doesn't matter how it is called. I am saying that mplay can be implemented as a wrapper for the now implemented BS.  So no need for DirectPlay which will only work on Windows and will probably not give any benefit.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 19, 2013, 04:54:59 am
Quote
Why? I have used BS with mingw without any extra headers before.
Weird, everyone else has had to obtain the curl headers, I have yet to test it on Windows, but for me it was the same on Linux.

Quote
But you still don't get it.
No, I do get it, you want to keep that API alive longer than it should be, it's dead, it was never alive, and should be left to rest in peace :| That said, networking functions would be weird to wrap around the mplay functions, they wouldn't fit nicely together.
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 19, 2013, 06:16:39 am
Quote
Weird, everyone else has had to obtain the curl headers, I have yet to test it on Windows, but for me it was the same on Linux.
On linux you proably have to install loads of crap. On Windows it worked for me with just the MinGW. I once made a server which simulated traffic lights and ran it on Linux - and a client that visualized it in ENIGMA.

Quote
No, I do get it, you want to keep that API alive longer than it should be, it's dead, it was never alive, and should be left to rest in peace :| That said, networking functions would be weird to wrap around the mplay functions, they wouldn't fit nicely together.
We can let it die. Just saying that implementing DirectPlay seems useless. Either wrap around BS (which shouldn't be that hard at least as much as I remember both mplay and BS) or don't do anything. Of course implementing the new GM:S networking functions should be more important. While you already added network_ and buffer_ functions (I think) we still need to implement the events. http://www.yoyogames.com/tech_blog/11
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 19, 2013, 05:43:24 pm
Quote
On linux you proably have to install loads of crap.
Code: [Select]
sudo apt-get install libcurl-devLike I said on Windows is where people were having problems getting the curl headers, and I don't know where you got them from because they are not in the MinGW folder.

Quote
We can let it die.

It's fine I already have it started and that will be the last of the remaining old Game Maker API to implement.

Quote
Of course implementing the new GM:S networking functions should be more important.

Here is what is left to do...
1) Make buffers be able to read/write floats right now if you write 214.568 it comes back out as 214 with the point precision dropped off.
2) Implement buffer data alignment
3) Merge networking functions together, I don't think we need two sets, I think I can expand Studio's so that there exists only one set, I haven't decided yet.
4) Implement network_receive(); which decodes a buffer into a data structure map, or else just implement that asynchronous network event and make a global constant for it.
5) Make network_ functions non-blocking.
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 20, 2013, 09:52:52 am
I just checked my previous project and I used #include <winsock.h> on windows (exactly the same as sockets on linux, but requires some 3 init lines) and this on Linux:
Code: [Select]
#include <sys/types.h>
        #include <sys/socket.h>
        #include <netinet/in.h>
        #include <arpa/inet.h>
So I am still not sure what curl you are talking about. It seems to be very specific for some http stuff and in that case they may be required. For regular TCP/IP Berkley Sockets though, they are not needed.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 20, 2013, 05:50:58 pm
Quote
libcurl - the multiprotocol file transfer library - Haxx
curl.haxx.se/libcurl/‎
May 6, 2013 - libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP ...
Title: Re: Yoyogames Example in Enigma
Post by: TheExDeus on September 22, 2013, 11:16:29 am
Well that explains it. But why do we need HTTP? Shouldn't that be an extension or something? For games and GM:S compatibility we only need TCP/IP / UDP. I don't think GM:S allows using HTTPS (although I don't have it, so I don't know). But at least TCP/UDP should be supported out of the box. Then HTTPS can be added via the Additional folder by including curls.
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on September 22, 2013, 11:21:44 am
Quote
The HTTP Event is one that is triggered by the call back from one of the http_ functions, like http_post_string. It actually generates a ds_map (more commonly known as a "dictionary") that is exclusive to this event and is stored in the special variable async_load (please see the individual functions for code examples that explain the use of this event in further detail). This ds_map has the following structure:

◦"url": The complete URL you requested.


◦"result": The data received (string only).


◦"http_status": The raw http status code (if available). This returns the standard web status code for most browsers, eg: 304 for "Not Modified" or 204 for "No Content", etc...


◦"id": The id which was returned from the command. If you fire off a series of http_ requests then you need to know which one you are getting the reply to, and so you would use this value to compare to the value you stored when you originally sent the request to find the right one.


◦"status": Returns a value of less than 0 for an error.
That is for when you use the http_post_string() function, but each of the http_ functions will return a slightly different map, so please refer to the manual entry for each function to find out the precise data that is returned for it.



NOTE: The variable async_load is only valid in these events, as the ds_map that is points to is created at the start of the event, then deleted again at the end, with this variable being reset to a value of -1.

NOTE: As async_load creates a ds_map, these functions are particularly useful when coupled with the json_encode and json_decode functions.



Quote
http_get(url);




Argument Description
url The web address of the server that you wish to get information from




Returns: Real




Description
With this function, you connect to the specified URL in order to retrieve information. As this is an asynchronous function, GameMaker:Studio will not block while waiting for a reply, but will keep on running unless it gets callback information. This information will be in the form of a string and will trigger an Async Event in any instance that has one defined in their object properties. You should also note that HTTP request parameters (the bits sometimes "tacked on" to the end of a URL when you submit a form on a web page) are perfectly acceptable when using this function, for example:


http_get("http://www.YoYoGames.com/logon?username="+name);


will pass the string held in the variable "name" to the server as well a retrieve the data from that URL. So, essentially, any time a simple, short piece of data needs to be passed from the client to the server, this would be reasonable choice as the function to use.

This event will generate a "call back" which is picked up by any HTTP Events, in which case it will generate a ds_map (more commonly known as a "dictionary") that is exclusive to this event and is stored in the special variable async_load. This ds_map has the following structure:

Yup.
Title: Re: Yoyogames Example in Enigma
Post by: fervi on October 28, 2013, 03:27:19 am
Quote
but Highscore table doesn't work
That is part of widget systems, which is defaulted to Win32 on Windows and I don't think highscore functions were added, on Linux for widgets you need to set GTK+

With GTK+ Widget still doesn't work (in theory, because you have highscore into the game [like a text], no popup)

show_message, also doesn't work (but in linux console you have infos about it)

Fervi
Title: Re: Yoyogames Example in Enigma
Post by: Goombert on October 28, 2013, 03:36:09 am
Ok, it'll need fixed but it's not priority right now.
Title: Re: Yoyogames Example in Enigma
Post by: IsmAvatar on August 26, 2014, 10:18:24 am
DirectPlay had a few things going for it:
* The ability to sniff games over a LAN.
* Global storage of variables
These are things that I was never able to figure out in Berkeley, and especially LAN sniffing is extremely useful. Minecraft has this ability (even on linux), and it's used a LOT.

Frankly, I don't care if you port mplay as-is or not. DirectPlay is dead - decaying, and touching it is likely to give you and all your players the bubonic plague. I also don't care if you re-imagine multiplayer and build some fancy new multiplayer library. But one thing is for sure, DirectPlay gave us some really fancy features that made it usable and make ours unusable. At the very least, we need to offer some usability features, and I really want to see LAN play.