GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#41 2011-09-26 06:30:35

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Hi, BlaXun, welcome to the forums! I agree, this is a very interesting time to be a GameMaker user.


Abusing forum power since 1986.

Offline

#42 2011-09-26 07:09:21

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

As bug reports stream in and are handled, it is becoming more clear which of GM:HTML5's "bugs" are intentional. This should prove to be a fruitful week for documenting some of the functional differences between it and other versions of GameMaker runner. With any luck all of these will make it into the help file, which I'm told is being edited at a furious pace. At the very least they should be reported by the compilation debugger.

  • show_menu() is not supported in HTML5.

  • image_single is no longer supported. It was deprecated years ago.

  • Color blending is not well supported (eg. draw_text_color, image_blend, part_type_color3). Clever caching allows some blending, but WebGL will enable them completely in "the very near future".

  • sprite_save is not supported because local storage is limited.

  • sprite_add does not provide a new resource immediately because of network latency. Web events are used to indicate when the resource is ready (see example in next post).

  • variable_local_* (and variable_global_*) are no longer supported due to obfuscation, although it would appear that they work under certain circumstances.

  • Precise collision checking is now off by default for performance reasons. This seems to be causing some confusion for people expecting it to be automatically enabled.


This isn't really a functional difference since Projects are a new GM feature, but I'll note here that because of some buggy or simplistic string handling, projects are not allowed to contain '.' (period/full-stop) in their names.

A new feature will display the help file entry of a highlighted keyword or function by pressing F12 (find resource).

Last edited by xot (2011-09-27 02:40:25)


Abusing forum power since 1986.

Offline

#43 2011-09-26 10:21:18

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Mike posted a bit more about web events in a bug report:

Mike Dailly wrote:

sprite_add() is different from windows. When you use sprite_add() you get an event to tell you when the sprite has actually loaded, it is not available immediately. This is because unlike windows, loading "could" take a very long time, tens of seconds - or more! These commands are being added to the documentation now.

Basics...In code somewhere, do something like this to initiate loading.
spr = sprite_add("temp_sprite2.png",1,false,false,0,0);


Then in the new Image Loaded WEB event, something like this...



var name,spid,stat;

name = ds_map_find_value(async_load, "filename" );
spid = ds_map_find_value(async_load, "id" );
stat = ds_map_find_value(async_load, "status" );

if( stat<0 ){
    show_message("Error loading "+name);
}else{
    if( spr==spid ) sprite_index = spid;
    show_debug_message("loaded sprite");
}


Abusing forum power since 1986.

Offline

#44 2011-09-26 10:28:59

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: GameMaker:HTML5 - Things that work differently

hmm that's no good news..

Means that everytime you add a sprite it reloads it from your server.. Now it is no longer possible to "load & free" sprites to save memory.. And especially coupled with the update that everything is in video memory this is quite a big problem for me.

Offline

#45 2011-09-26 10:45:56

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Prolific bug reporter Piotr Gnys of GMCLAN.org tweets:

gnysek wrote:

GM HTML5 games works faster on ubuntu than on windows :)


Abusing forum power since 1986.

Offline

#46 2011-09-26 10:52:09

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

paul23 wrote:

Now it is no longer possible to "load & free" sprites to save memory.

I don't follow your line of reasoning or perhaps I don't know what you mean by "load & free".


Abusing forum power since 1986.

Offline

#47 2011-09-26 10:59:03

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Now here's an odd one: pucone reports problems seeing particles under certain circumstances.

pucone wrote:

In the attached example, particle effects are not being displayed (or created?) UNLESS the size of the view port in the initial room is not the same as the view port in the rooms in which I try to create the particles. This only occurs in html5 mode. The particles will appear as expected when running the windows executable.

repro steps:

1) run the game in html5 mode
2) note that no particles are appearing
3) change the width AND the height of the view port of the first room. you need to change both, even if only by a single pixel each. however, changing one - even by hundreds of pixels - doesn't seem to work.
4) note that the particles now appear.

Mike Dailly wrote:

They ARE actually there.... If you change your particle type scaling, they will come back. Scaling and pixel selection is done by the browsers, so we have very little control over what pixels they select for drawing. You will just have to be careful about the size and shape of your particles, and possibly even have a separate path for the version that goes on the web.

You can use os_browser to detect if the game is running in a browser, or if it's an .EXE

On your original "non-working" demo... try pressing F10 (to go full screen), they do suddenly appear here....

I asked Mike if WebGL would fix the problem and he replied:

Mike Dailly wrote:

Im not sure.There would still be browser scaling going on. it should certainly help,but I'm not sure it would fix it completely.


Abusing forum power since 1986.

Offline

#48 2011-09-26 12:00:02

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: GameMaker:HTML5 - Things that work differently

xot wrote:
paul23 wrote:

Now it is no longer possible to "load & free" sprites to save memory.

I don't follow your line of reasoning or perhaps I don't know what you mean by "load & free".

Sometimes only a certain group of graphics has to be loaded.. And others can be out the memory.

Previously you did that with sprite_add & sprite_delete. To load a sprite temporary.

This method of sprite_add() fetches the sprite from your site each time you add it to the game. This means that there is constant (large) data passing to and from your site. Also it becomes unreliable and often a complete waste of resources.
Either that or you have to keep images loaded into memory, in some games this is not really working.

Last edited by paul23 (2011-09-26 12:01:18)

Offline

#49 2011-09-26 12:42:28

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

So you're saying sprite_delete is not useful if you plan on using the sprite later because of the latency of sprite_add? Or are you saying sprite_delete somehow doesn't free memory?


Abusing forum power since 1986.

Offline

#50 2011-09-26 12:57:02

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: GameMaker:HTML5 - Things that work differently

xot wrote:

So you're saying sprite_delete is not useful if you plan on using the sprite later because of the latency of sprite_add? Or are you saying sprite_delete somehow doesn't free memory?

It needs to be relocated from the server. Obviously it still frees memory, however in my latest engine I was working on an advanced garbage collection system - especially with the limitations of memory when using it in a browser in mind.. Seems I can scrap that at least..

You don't want megabytes to be reloaded each other second.

Offline

#51 2011-09-26 13:15:46

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

This is a little infuriating. Russell Kay says they are retroactively changing the *.gml file format. GM8.1 will be changed to work like GM:HTML5. Without further changes, that means it will not be possible to import multiple scripts from a single *.gml file into GM8.1. The kicker is, scripts exported by GM:HTML5 are exported in the old format and can't be correctly imported from the same file. "By design", my ass. "Didn't think it through", more like it. The idea that I have to recode GMLscripts.com to accommodate such a pointless decision doesn't make me happy. At the moment it relies on the existing format to build its pages and indices. It may not be a lot of work in the end -- I can't say until the multiple script issue is addressed -- but why????????

UPDATE:

Script importing and exporting will be completely removed from GM:HTML5 because "there is no need now". Problem solved! wacko

Last edited by xot (2011-09-26 18:18:19)


Abusing forum power since 1986.

Offline

#52 2011-09-26 14:36:05

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: GameMaker:HTML5 - Things that work differently

Should be much easier I tink?

Aren't there many xml-crawlers available? - Shouldn't be more difficult than the old format just look for a <script> ... </script> part.

I'm going to start soon on a simply (command line) tool to "merge" applications. - Depending on wether or not yoyogames has it once gm:html5 is out of beta

Last edited by paul23 (2011-09-26 14:36:33)

Offline

#53 2011-09-26 14:38:00

BlaXun
Member
Registered: 2011-09-26
Posts: 18

Re: GameMaker:HTML5 - Things that work differently

GM 8.1 has a merge function as far as I know... I think they'll add this back...maybe add it to the bug tracker? smile yeah, sounds like a good plan smile

Edit: Well, you could at least import another games exported...stuff... so this was basicly like a merge.

Last edited by BlaXun (2011-09-26 14:38:56)


blax_sig.png

Offline

#54 2011-09-26 14:42:02

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Ooooo, very interesting extension for reading the iPhone accelerometer from aiacono.

http://gmc.yoyogames.com/index.php?showtopic=520292

He posted a "fake" callback workaround as well.

http://gmc.yoyogames.com/index.php?showtopic=520277

And some random person posted a regular expression extension.

http://gmc.yoyogames.com/index.php?showtopic=520251


Abusing forum power since 1986.

Offline

#55 2011-09-26 14:56:57

BlaXun
Member
Registered: 2011-09-26
Posts: 18

Re: GameMaker:HTML5 - Things that work differently

Yikes....a random person... nobody special tongue
Very nice. Regex will sure make some things easier...thank you random person.

I am starting to love the Java Combinations <3

Now we need somebody to make a small Extension that connects to the HTML DOM to set the background image on-the-fly :3

I placed a instance in the room editor and it appears infront of another instance.
Once i run the game the instance is placed behind the other instance.


Its the lil bunny thats normally infront of the tree, but as HTML5 he appears behind the tree.

Instances at the SAME depth will not have a guaranteed sort order. If you require a specific order, set the depths specifically.

Last edited by BlaXun (2011-09-26 15:40:20)


blax_sig.png

Offline

#56 2011-09-26 15:54:29

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

I was about to post that depth issue. smile

Looks like textured primitives are not supported which would explain why my jigsaw game doesn't work. That's obviously something WebGL would restore.

Have to say, bugs are being clobbered at a great pace. I hope there is a new build pushed out today, although it is getting late over there in Merry Old England Bonnie Old Scotland.


Abusing forum power since 1986.

Offline

#57 2011-09-26 16:03:17

BlaXun
Member
Registered: 2011-09-26
Posts: 18

Re: GameMaker:HTML5 - Things that work differently

rwkay
OK for the sake of completeness can I just say that most of these issues are fixed in the most recent versions of GM:HTML5 this topic looks very negative when read, it would be good if there could be follow ups when you confirm fixes... most of the functions above are fixed in v1.0.112 (which as I write Mike is preparing for publication, should go out in half an hour or so).

http://gmc.yoyogames.com/index.php?show … &p=3837299

However, that was a few hours ago wink


blax_sig.png

Offline

#58 2011-09-26 16:18:01

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

It has always been frowned upon, but different resources sharing the same name has been allowed by GameMaker in the past. D&D would let you get away with murder. With GML it usually lead to bugs. It is no longer allowed at all.


Mike just tweeted: "Testing a new version... 98 issues addressed, fixed or changed. #gamemaker #html5"
I think that's a good sign that we are getting a new build very soon.

EDIT:

And it's up. Went from .111 to .113, but I'm not complaining

Last edited by xot (2011-09-26 17:33:36)


Abusing forum power since 1986.

Offline

#59 2011-09-26 18:39:05

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: GameMaker:HTML5 - Things that work differently

xot wrote:

And some random person posted a regular expression extension.

http://gmc.yoyogames.com/index.php?showtopic=520251

I'm quite random ><


I'm finding javascript already too limited to continue developing in lol.. Missing things like "heap" vs "stack", function overloading and classes/typing.

Offline

#60 2011-09-26 19:49:06

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GameMaker:HTML5 - Things that work differently

Javascript arrays have stack-like methods with which you could construct a heap.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB