Blitzmax to Monkey - workflow

Monkey Forums/Monkey Programming/Blitzmax to Monkey - workflow

GfK(Posted 2011) [#1]
To anybody who's taken a large Blitzmax project and converted it to Monkey (therevills?):

I was about to start doing this with an old game of mine but my first thought was (using Jungle), to add each .bmx file into my solution and convert then one-by-one to Monkey. It seemed like the logical approach but after faffing around for a bit I've come to realise that I am not going to be able to compile and run anything until the whole lot is completed (or at least until I THINK its completed).

I got to thinking that I'm probably setting myself up for a world of pain here as I could end up spending months trawling through code, sans-debugger, looking for problems.

So, what's your approach to this?


therevills(Posted 2011) [#2]
You need to "Monkey-fy" it ;)

Most of your old bmx code should just work with a little bit of help.

Go screen by screen... get one screen working and then move onto the next one.


GfK(Posted 2011) [#3]
Thanks... so I guess I'll crack on with what I'm doing and just import new stuff as I need it!


ENAY(Posted 2011) [#4]
Dave, dunno if it will help you, what I did was get all the old source codes from a bmx project and copy and paste them all into one big file.
This eliminated any includes problems.

I put Import OldGame at the top of my monkey code and then then I put "Class oldgame" and wrapped the entire source code into one big class. Then I replaced all 'Function' with 'Method' and all 'Global' and 'Local' with 'Field'. What comes next is having to change the odd thing like adding an ":Int" to where I didn't declare anything and then for 2 dimensional or more arrays having [2*2] instead of for example [2,2]

Eventually I was able to compile after about 5 or so hours of going through all the errors that came up whilst compiling.

Whilst there is still a lot of work to do my program now compiles. For sure my program will probably crash if I call certain old functions the fact I can test each function individually really helps.

I can call any of my old code by doing something like Old.MyFunction()
This lets me see clearly which is monkey and blitzmax code, I have where needed copy and pasted old functions out of the old file and converted that into Monkey Code. Dunno if that will work for you but it's nice to be able to work on some old code and get that working without having to try and fix EVERYTHING in one go before the damn thing will compile.


GfK(Posted 2011) [#5]
Neil - my project is fairly huge; almost 100 source files and just shy of 20,000 lines of code.

I started translation to Monkey a week last Monday - I imported all of my Blitzmax source into a new Jungle solution, renamed them one by one and did the translation like that. The biggest single problem I had was case sensitivity. Didn't realise how sloppy I was on the subject until I started using a language that constantly pulls me up on it.

Its taken me til about an hour ago to get it to compile. So, probably 60 hours of work. Sounds a long time but I've written a rudimentary filesystem class and a timer replacement class and a load of other bits along the way.

Now to get it to actually run and... you know... work!