v67 module compatibility

Monkey Forums/Monkey Programming/v67 module compatibility

marksibly(Posted 2013) [#1]
Hi,

Just want to get some idea of how well v67 works with 3rd party modules, so if your a module author (esp. if your module is on the community 'module registry' page) could you please post here to let me know how well your module works with the latest v67 version(s) of Monkey.


Playniax(Posted 2013) [#2]
Thanks Mark! I have tested the latest version of Ignition with all its projects and samples and it works fine!


MikeHart(Posted 2013) [#3]
So far so good. I needed a little change in the timing area as you changed the way Millisecs behave but anything else goes fine so far in fantomEngine.


marksibly(Posted 2013) [#4]
Mike, Millisecs should be back to normal (ie: starts at 0 when app starts) in v67d.


devolonter(Posted 2013) [#5]
Flixel port has a small issues with new Millisecs() values and conflicts with ShowMouse and HideMouse functions. But after correcting these errors it works properly. I plan to release an update for V67 this weekend.

Mike, Millisecs should be back to normal (ie: starts at 0 when app starts) in v67d.

Thanks for that!


ziggy(Posted 2013) [#6]
It works well with Fontmachine and JungleGui. not a sigle issue detected


marksibly(Posted 2013) [#7]
v67d now up with Millisecs fix.


Amon(Posted 2013) [#8]
Thanks, Mark!


DruggedBunny(Posted 2013) [#9]
Think I have one in AutoFit with V67C:

https://dl.dropbox.com/u/3592022/megademo.zip

This runs fine in 67B, regardless of platform (testing XNA, GLFW and HTML5), using either of the two versions (megademo_autofit and megademo_noautofit).

However, in V67C, megademo_autofit is juddery on GLFW, and fine on all other platforms, yet megademo_noautofit seems fine on all.

Switching between 67B and 67C, deleting build folder each time, the problem clearly comes and goes.


DruggedBunny(Posted 2013) [#10]
... aaaand it's fine in 67D, so likely due to Millisecs! The characters depend on it for their bobbing movement -- Sin (Millisecs ()) if I recall correctly.


therevills(Posted 2013) [#11]
Diddy needs a few minor changes, but should be okay.


Rushino(Posted 2013) [#12]
There some problem with Ignition and v67d was working back in v65.

See this screen :




marksibly(Posted 2013) [#13]
> There some problem with Ignition and v67d was working back in v65.

Looking at the 2 overloads for GetImage in my version of Ignition here, there should be no way for Monkey to tell which one to use so the error is correct.

This probably relates to a recent fix to the Monkey translator - in previous versions, it was likely just calling the first overload even though it really should have been causing the above error.

Actually, there appears to be no way to call the first overload at all, so this will need to be fixed in Ignition (sorry!).

One fix would be to remove the default value for the _frameCount param for the second overload - which is exactly what LoadImage does.


Rushino(Posted 2013) [#14]
Alright thanks for the update !


Playniax(Posted 2013) [#15]
Hi,

I was aware of this problem but did not mention it in this thread because it is not a compatibility problem but a bug in Ignition. Anyway, I uploaded Ignition v1.5c

Thanks guys!


rIKmAN(Posted 2013) [#16]
@marksibly

Mark, I have code that works fine in v66b but when I try and compile in 67d I get the following error:

Monkey Runtime Error: TypeError: Cannot call method 'SetDelegate' of undefined

Any idea what change might have caused this?
I'm hoping an existing bug in my code will be fixed by the Millisecs update, but can't try due to these new errors, and I'm not sure where to look as I don't get a line number or any other clues.

@ziggy
Do you have to update JungleIDE for every new Monkey release?

I am trying it out at the moment (1 day so far) and have just grabbed 67d but Jungle keeps telling me the Monkey dir is not valid.
Just wondering if there is something else I need to do that I am missing?


AdamRedwoods(Posted 2013) [#17]
miniB3D+monkey:
works great with just a couple easy mods to minib3d/monkeybuffer.

In fact, I noticed that Android now starts off in correct aspect orientation and.... IS FASTER! (higher fps) neat-o

EDIT: XNA breaks a little but I think it's our end.
EDIT2: Ok, I see what changed: Extern Classes are now putting the class name before Functions when called. Different than v66.

per versions.txt:
"Extern static class member functions must no longer be 'pre-munged'." Easily fixed.

Class XNABlendState = "XNABlendState"
	
	Method ColorSourceBlend:Void(value%) Property = "SetColorSourceBlend"
		
	Function Create:XNABlendState() = "XNABlendState.Create"

End


Now becomes...
Class XNABlendState = "XNABlendState"
	
	Method ColorSourceBlend:Void(value%) Property = "SetColorSourceBlend"
		
	Function Create:XNABlendState() = "Create"

End



EDIT 3: my XNA fps seems to be off. Could just be me.
update rate 30 = 28fps. update rate 60 = 56 fps.....


Jesse(Posted 2013) [#18]
Nice update. I like that flash games now start of the html code. and there is an actual html console for it. Awesome!


AdamRedwoods(Posted 2013) [#19]
can we create a sound from a databuffer yet?


marksibly(Posted 2013) [#20]
> Monkey Runtime Error: TypeError: Cannot call method 'SetDelegate' of undefined

Have you deleted .build dir? Can you post code/email me project?

> EDIT 3: my XNA fps seems to be off. Could just be me.

Should be the same - XNA handles all timing, I just give it the rate. I'll double check I haven't stuffed anything.


rIKmAN(Posted 2013) [#21]
Have you deleted .build dir?

...from the wrong folder...

*facepalm*

Working now - apologies.


Tibit(Posted 2013) [#22]
EDIT

I had linked my Modules folder to an external one, so the original monkey modules did not run from the original dir...

omg what a miss :)

Is it possible to hook more than one /modules/ directory somehow? Would be really nice to not have to manually copy blr, monkey, trans, mojo each new release.


Tibit(Posted 2013) [#23]
I get this on glfw



EDIT manage to fix xna & win phone by installing an update to visual studio and re-installing xna + some magic thing happened.


AdamRedwoods(Posted 2013) [#24]
Hi,

It looks like long #Preprocessor variables connected with "+" are not allowed. if I use a +=, it automatically adds a semi-colon. So I can't do this for the wxMonkey target unless I use a very long line with no breaks:

#CC_OPTS = "HEADER_SEARCH_PATHS=~q/Monkey/modules/wxmonkey/wxMac-2.8.12/include~q LIBRARY_SEARCH_PATHS=~q...etc....q "+
 " OTHER_CFLAGS=~q-D__WXRELEASE__ -D__WXMAC__ ~q"+
 " OTHER_LDFLAGS=~q -lwx_base_carbon-2.8  -lwx_mac_core-2.8 -lwxjpeg-2.8 -lwxpng-2.8 -lwxtiff-2.8~q"


I guess I can do this though:
#CC_OPTS0 = "HEADER_SEARCH_PATHS= ...etc..."
#CC_OPTS1 = " OTHER_CFLAGS="
#CC_OPTS2 = " OTHER_LDFLAGS="

#CC_OPTS=CC_OPTS0+CC_OPTS1+CC_OPTS2



Rushino(Posted 2013) [#25]
Hey Mark,

Ive been able to advance in my game port to v67d and i get more problems and errors. This is on the XNA platform.



The problem is probably due to the fact that you've refactored the monkeygame class or something. Cause if i compare with v65 and v67d sources.. here what ive found.



The gxtkApp do not exist.. but it seem to be replaced with MonkeyGame class.

EDIT: This seem to be related to Diddy module which have reference to gxtkApp. What gxtkApp has been changed to ?

This is from diddy... it seem that anything related to gxtkApp is broken now in diddy. Anyway i don't use theses fonctions.. do you think there an easy fix to avoid getting thoses errors in diddy ?

public static void flushKeys()
	{
		for( int i=0;i<512;++i ){
            gxtkApp.game.app.input.keyStates[i] &= 0x100;
            
		}
	}
	
	public static int getUpdateRate()
	{
		return gxtkApp.game.app.updateRate;
	}
	public static int getPixel(int x, int y)
	{
		if ((x > 0 && y > 0 && x < gxtkApp.game.app.graphics.Width()) && (y < gxtkApp.game.app.graphics.Height()))
		{
			Texture2D backBufferData = new Texture2D(
				gxtkApp.game.app.graphics.device,
				gxtkApp.game.app.graphics.Width(),
				gxtkApp.game.app.graphics.Height());


Other than that the game seem to compile and run.


MikeHart(Posted 2013) [#26]
The Diddy creators have stated that it isn't compatible with Monkey V67 so far.


Rushino(Posted 2013) [#27]
I know that but i am just helping out to fix it.


devolonter(Posted 2013) [#28]
I almost adapted flixel. Everything seems to be working well. But there are a few questions:

- OpenUrl doesn’t work in Win8 target. But the documentation says: "OpenUrl is only available on the hltm5, glfw, android, ios and win8 targets" Will this be fixed?
- I have some problems with the sound discard in Win8. It seems that discard happens automatically during garbage collection. Is that correct?
- Does Win8 support #MOJO_IMAGE_FILTERING_ENABLED?
- What can you say about this bug - http://www.monkeycoder.co.nz/Community/posts.php?topic=4501 Is this my issue or a Mojo bug?

Thanks!


Neuro(Posted 2013) [#29]
I almost adapted flixel. Everything seems to be working well.

Likes this :). I've been holding off upgrading until i'm positive this is working.


marksibly(Posted 2013) [#30]
> I have some problems with the sound discard in Win8. It seems that discard happens automatically during garbage collection. Is that correct?

All resources on all targets will 'free' themselves automatically when (eventually) GCd.

Could you describe the problem you're having?


devolonter(Posted 2013) [#31]
Could you describe the problem you're having?

Mark,

Unfortunately I can not reproduce this with a simple example. In my case, it occurs as follows: After a manual sounds discard I reload state and at loading the new state copy I get an error. If I don’t discard sounds manually, reload state occurs without errors. This happens only in Win8 target.
Here is a call stack, if it helps:



I can also send you the project files.

At the moment, I solved the issue by not doing discard for sounds before reloading state in Win8 target.

Edit More info: error occured on this line
[monkeycode]
voices[i]->DestroyVoice();
[/monkeycode]


devolonter(Posted 2013) [#32]
Discarded flag could be a possible fix for the sound discarding by garbage collector. Something like this:
[monkeycode]
int gxtkSample::Discard(){
if (discarded) return 0;

for( int i=0;i<16 && voices[i];++i ){
voices[i]->DestroyVoice();
delete callbacks[i];
}

discarded = true;
return 0;
}
[/monkeycode]
I'm not sure if it’s a bug. Eventually I can avoid calling Discard myself, as it is done automatically. But it seems wrong that the garbage collector can’t call Discard, if I did it before myself. When the garbage collector tries to call Discard application crashes with an exception "Access violation reading location".


marksibly(Posted 2013) [#33]
There's a v67e up with several fixes for win8 audio (and OpenUrl) up now!


Rushino(Posted 2013) [#34]
Thanks mark.


devolonter(Posted 2013) [#35]
Thank you Mark. Now everything works perfectly on all targets!

Recent comments from me: OpenUrl also doesn’t implemented for GLFW (Mac) and iOS


ziggy(Posted 2013) [#36]
@ziggy
Do you have to update JungleIDE for every new Monkey release?

No, I don't have to for every new Monkey release. The thing is that the new experimental release has modified the compiler executable name from trans_winnt to transcc_winnt and this forces a Jungle update. This version is so diferent to previous versions in many areas that this time, the update was required. It's the first time it happens and hopefully it won't happen again soon. Also notices that Jungle Ide is always backwards compatible so it can be used with older Monkey versions.


therevills(Posted 2013) [#37]
I've just tried to run an example (Storyboard) from Diddy using v67e, and I get the following error:
Error : Duplicate identifier 'game' found in module 'monkeytarget' and module 'framework'.

Diddy uses a global "game" variable for convenience...
Global game:DiddyApp

If we change this to "diddyGame", it will break a lot of people's code. Do we have any other solutions?


qwerty(Posted 2013) [#38]
to therevills
O, I thought you know about it and you are solving this problem already :)
This error happens not only in Storyboard example. My game used Diddy, so I found this problem one week ago too.
The only thing that occurred to me is rename your variable "game" to "gameD" in my game while you do the possible update.
But only renaming does not help, in diddy\native\diddy.android.java stopped working:
flushKeys, getPixel, getUpdateRate, showKeyboard, showAlertDialog, launchBrowser, launchEmail, startVibrate, stopVibrate, startGps, seekMusic
in general, all things that use MonkeyGame.app.

You will get this kind of error:
[javac] 2506: cannot find symbol
[javac] symbol  : variable app
[javac] location: class MonkeyGame
[javac] 			MonkeyGame.app.input.keyStates[i] = 0;
[javac] 			          ^


Definitely, in 67 version this variable has changed. But my knowledge of this is not deep, so I just commented out this functions, because they do not want me yet.
But you should fix that to :)


Rushino(Posted 2013) [#39]
To therevills: I suggest you rename it in diddy. Yes it could break thing but if poeple dont want to break stuff they can just get an older version of diddy. They unlikely will get the new version since it will be incompatible with old monkey versions. Your diddy release is essentially to make it work with v67+ which i think make sense to change that variable in the first place. Second, its only one variable so the fix isn't a big deal just put a readme of changes and ppl that go to v67 will simply fellow. That my opinion offcourse.


Samah(Posted 2013) [#40]
Yes it could break thing but if poeple dont want to break stuff they can just get an older version of diddy.

Which will require them to also use an older version of Monkey.

Second, its only one variable so the fix isn't a big deal just put a readme of changes and ppl that go to v67 will simply fellow.

The problem is that most people DON'T read readmes. I can guarantee you that if the variable is renamed in Diddy, we will see bug reports in the User Modules forum.


Rushino(Posted 2013) [#41]
Yeah i agree with you on this. Then maybe mark should stick to monkeygame var.


MikeHart(Posted 2013) [#42]
My Flurry module works great with v67f.