Questions and notes on the latest NG

BlitzMax Forums/BlitzMax NG/Questions and notes on the latest NG

GW(Posted 2016) [#1]
I built the latest the NG from github (everything) and ran into some issues and questions. Here they are in no particular order.

Building for android was tough as there is no docs or reference, only vague references in the forums. I got it working though and i must say it's pretty cool!

Here are some of the errors I ran into.
1) By default, any android app will immediately crash with an error about
"java.lang.NoSuchFieldError: no "Z" field "mSeparateMouseAndTouch""
I had to edit sdl mod to remove this function to get it working.

2) the AndroidManifest.xml file just gets copied over from the resources dir to the project dir without any modifications. I had to manually edit the file in 'resources' to update the 'minSdkVersion' and 'targetSdkVersion' to match what was defined in 'custom.bmk'. Not exactly sure if this was required though.

3) the android build directory has to be manually deleted between compiles to have things updated in the new apk.

4) How to include assets? I tried putting things in an assets folder alongside the source file, but nothing ever gets copied over. I've seen references in the forums to "sdl::.." but with no assets to load it, who knows..
I also tried using 'incbin', but that just crashes the app. So far only drawing text and primitives works.

5) Does audio work? I've read on the forums that soloaudio works, but I'm particularly interested in SDL audio as it has less restrictions.

Other things:
maxide won't compile properly by default because of breaking changes to Timers.

There is something off about the bbdoc for 'WaitTimer' as it crashes 'MakeDocs' preventing any syntax highlighting in maxide.

what is the language/syntax for 'pre.bmk' and 'post.bmk'? Are they lua files? Are there any examples of them being used.


RustyKristi(Posted 2016) [#2]
I can probably answer most of your questions there, at least what has been discussed already until Brucey, Derron and the others could explain these issues further. You have probably noticed that the most of the posts that you were talking abuot were started by me. ;-)

4) "sdl::image.png" will be placed into the assets/directory. So after the first build, copy it to the assets directory and of course directories are supported. So if you have "media/image.png" in your default game directory (root), copy the media folder to the generated "assets" folder accordingly.

"sdl::media/image.png" -> assets/media/image.png

All files must be of type Stream. Incbin works, also stream and don't forget to use BRL.RamStream. Usually the Framework gl2sdlmax2d driver already includes the necessary modules but try to import SDL.SDL if it doesn't work.

5) Audio works perfectly via SoloAudio and Brucey already said that he will be dropping support for SDL AudioMixer and SoloAudio is now the goto for crossplatform sound at the moment.


Derron(Posted 2016) [#3]
@ maxide
search "Import Brl.Timer" and append:

?bmxng
Import Brl.TimerDefault
?


@SDL AudioMixer
The problem there for me is: it only supports 1 (no more) audio streams (eg. ogg-files). This disables useful things like "crossfading" or "audio stream" + "voice overlay".


@assets
After doing the first build, it creates this new project-output-folder. Within that folder, there is "assets". This is the target folder for your ressources.

Maybe this should be changed to either:
- auto copy what is in a local "assets"-folder
- adjust the .bmk files to do that for you (there is "pre.bmk", "post.bmk" - or the bmk-used "make.bmk")


bye
Ron


Brucey(Posted 2016) [#4]
4) How to include assets

Create a file called MyApp.bmk (where MyApp is the same name as your main .bmx file). So, for example, if your main file is called "TVTower.bmx", you create a file called "TVTower.bmk"
(OR, you can put it into pre.bmk, but pre.bmk would be loaded for each app in that folder - which could be a problem if you build multiple apps from in the same place).

In your file, add :
addresourcepath "dir_full_of_stuff"


The folder "dir_full_of_stuff" will be copied into the assets folder, resulting in the following :
assets/dir_full_of_stuff/file1.txt
assets/dir_full_of_stuff/file2.txt
etc


In your code, you could access file1.txt with "sdl::dir_full_of_stuff/file1.txt"

"addresourcepath" also works for iOS - except that the folder is copied into the resource bundle.


Derron(Posted 2016) [#5]
ahh that sounds cool ... was on my way to suggest an "app specific"-bmk (if it did not exist already) to prepare such things like asset-copying.


bye
Ron


Brucey(Posted 2016) [#6]
Latest bmk you can also add some command-line options to custom.bmk. eg.
addoption opt_warnover 1


The full list is (with actual command-line option/flag on the right) :
opt_warnover            -w
opt_quickscan           -quick
opt_gdbdebug            -gdb
opt_standalone          -standalone
opt_nostrictupgrade     -nostrictupgrade

Acceptable values are 1 or 0
Details about what the options do are available from bmk (run with no args to get the help page)


GW(Posted 2016) [#7]
Thanks Brucey, that helps a lot!

I was using
addarg "-w"
addarg "-quick"
addarg "-v"
in my .bmk file. Your method works better.
(debug builds seem to ignore these flags even with debug.bmk file)

I have a few other questions that this brought up.


1)
Using the <project>.Bmk method. The "-g" option gives an error. Currently this is the only flag that's holding up using Blide as a full time ide. Is there a way to intercept the '-g' flag with any *.bmk file?

2)
Are there any benefits of using gdb debug for windows? Can an external profiler be used (like 'Sleepy')?

3)
I added this to core.bmk:
@define exec
bmk.MultiSys(arg0)
@end
so that I could call on "adb" to uninstall and reinstall each new build on my phone automatically.
ex: exec "adb uninstall net.aw.android.myapp"
Sometimes it works, most the time it gives an error.
Is there a better way?

4)
I was able to use soloaudio on android but only by using using the wavstream and incbin method. I tried for several hours and no other method worked for me. Is this the only method? Are soloud-Wav object types and filters planned in the future?


Thanks!


RustyKristi(Posted 2016) [#8]
Hey Brucey,

How do you set release build in Android? I know you can do this by using ant but is there a bmk equivalent?

@GW

Ogg files works too I have tested it.


Derron(Posted 2016) [#9]
@gdb

if you do a "gdb"-build, then the executable gets bigger as it includes the original "source position". so when debugging, the backtrace contains the information in which line of the original blitzmax-sourcecode that thing just happened.

-> the C-file contains a line-information for each command it translated.

@ uninstall
"adb install -r bla.apk" does the same, if it was not installed, no "uninstall" is done.

Also I would only call this command, if the "execute"-command was used ("-x"). So a normal build does not deploy, a "build + run" should try to copy to an attached device first.


@ ogg
Will have a try once your flappy-DL works.


bye
Ron


John G(Posted 2016) [#10]
Hello. OddBall's wonderful extensions seem incompatible with BlitzMaxNG on Win32.
I only use: SetScreenFocus x,y ; SetScreenRotation r ; SetZoom z
Is it possible someone could update OddBall's modules someday.
Probably forget DX7 -- only OGL and DX9. 32/64 bit ?

EDIT: Please put OddBalls extensions on a very low priority basis. Probably not enough users and too many forks! DirectX 11 & 12, future OGL graphics. Maybe 3 extensions above could be added into BMXNG someday.

Also, is it possible for someone to post a snapshot of BlitzMaxNG for Win32/Win64 every few months? Like DABZ downloads? I'm lost on GitHub.


xlsior(Posted 2016) [#11]
You can download a zip in the github website if you go to the root of a repository --

e.g.: https://github.com/bmx-ng/brl.mod
In the upper right corner there is a "clone or download" button, and if you click that there is a "download ZIP" option.


John G(Posted 2016) [#12]
@xisior : Thanks for the link. I think I've stumbled there before. I already have a DABZ 'Frisky' folder from 4/26/2016. The new github download contains many MOD folders such as appstub.mod. Should I copy all these MODs and drag them into my 'mod' folder from 4/26/2016? Remember, not as quick as I used to be. In fact, never was...


Derron(Posted 2016) [#13]
appstub.mod belongs into "brl.mod".


bye
Ron


John G(Posted 2016) [#14]
@xisor & Derron : Thanks to both, he says sheepishly ...


Brucey(Posted 2016) [#15]
I've added an odd.mod repo to bmx-ng : https://github.com/bmx-ng/odd.mod

The GL module is only desktop compatible - i.e. not OpenGL ES.


John G(Posted 2016) [#16]
@Brucey -- Thanks. Hope I figure out how to use it now!
You are a Scottish Prince.


FireballStarfish(Posted 2016) [#17]
I decided to update my NG installation today, and as a result, it stopped working.
I pulled the latest version of bcc, bmk, maxgui and all the modules, and as soon I replace my older bmk with the freshly compiled one (win/release/console/non-threaded, doesnt matter if x86 or x64) I can't build anything anymore; I just get the message "ERROR
[string "function bmk_source_type(...)..."]:5: attempt to concatenate local 'arg0' (a userdata value)".
Anyone got an idea how I can fix this?


Derron(Posted 2016) [#18]
Did you copy the current *.bmk files (just the ones you already have in your /bin folder) ?

The error is coming from LUA ... which is used in these BMK files. Maybe that solves the issue already.


bye
Ron


FireballStarfish(Posted 2016) [#19]
Yes, I have the current core and make.bmk in there, and nothing that looks like it could be responsible for this has changed in them since the last time I updated (sometime in June/July).


Brucey(Posted 2016) [#20]
There's a new Windows release on github. It appears to work okay.


FireballStarfish(Posted 2016) [#21]
I tried downloading this release (assuming that's what you mean) and using it, freshly unpacked, to compile bmk from the latest git sources. Dropping the resulting bmk.exe into the bin folder results in the same error described above.


Derron(Posted 2016) [#22]
Does it happen too, if you compile BMK with vanilla-BMX (I compile the toolchain with vanilla rather than NG to avoid issues out of bugs) ?


bye
Ron


FireballStarfish(Posted 2016) [#23]
Ah, no it doesn't. But while I can get an up-to-date bmk like that, that means there's still some kind of issue, right?
Turns out this isn't actually about the *newest* bmk. This release can't compile even its own bmk without the error coming up once it's swapped in. This one still could.


RustyKristi(Posted 2016) [#24]
Yes, it turns out 0.70x windows works really well. At least that's what got me started and having no problems at all with the upgrades. :-)


Brucey(Posted 2016) [#25]
The issues turn out to be a result of unfortunately implementing https://github.com/bmx-ng/brl.mod/issues/36 ...

I've patched the release.


FireballStarfish(Posted 2016) [#26]
Ooh, nice :)