Jump to content
IGNORED

Magellan


The Codex

Recommended Posts

  • 3 months later...

What could cause the Export to XB Program to stop working? I even reinstalled. I select that option and nothing happens anymore. Worked fine yesterday.

Could it be some mode I'm in? Can I delete an ini or something?

Export Assembly data works but not BASIC or XB.

II see others ran in to this. Going to try deleting prefs and looking for the latest version.

EDIT: OK Uninstalled, reinstall worked.

Edited by Sinphaltimus
Link to comment
Share on other sites

  • 5 weeks later...

This should fix the problem with the export dialog not working.

 

As I have posted in another thread, I have some ideas for improvement , given you have some time to invest in this great tool, I am willing to document and send you what I have in mind. I use Magellan quite often now and feel that it lacks a few key functions that could make our lives easier.

 

I will mention just 1 or 2 here -

 

1. Right clicking on a character in the map area will open a context sensitive menu which shows several options, for example:

* Go to character definition

 

2. Undo function for the times we mess up the map area by mistake. At least 1 undo step.

 

Thanks.

 

David

  • Like 1
Link to comment
Share on other sites

I'd like to be able to paste at least 64 character code in to the dialog box and it will auto populate the next ascii codes to accommodate (paste 32 at ascii code 33 and ascii codes 33 and 34 get filled in appropriately or 64 and 33-36 get filled in appropriately.). Kind of like the "sprite" functionality but not a sprite.

Edited by Sinphaltimus
Link to comment
Share on other sites

 

As I have posted in another thread, I have some ideas for improvement , given you have some time to invest in this great tool, I am willing to document and send you what I have in mind. I use Magellan quite often now and feel that it lacks a few key functions that could make our lives easier.

 

I will mention just 1 or 2 here -

 

1. Right clicking on a character in the map area will open a context sensitive menu which shows several options, for example:

* Go to character definition

 

2. Undo function for the times we mess up the map area by mistake. At least 1 undo step.

 

Thanks.

 

David

 

2. Already exists. Buttons in the top left right corner.

Link to comment
Share on other sites

And 1. is the Eye icon.

 

Rasmus,

 

Thanks for both 1 and 2, I will not try to justify why I never found those, probably because I did not read the manual or looked hard enough, but having the "eye" icon grouped with the Map related icons and CTRL Z to undo might have been a little more obvious for me. Having said this once you know where they are, they are good enough as is.

 

I will put down some more ideas, maybe the following are not too hard to obtain and will be useful for your game creations too :

 

1. When one imports a Map Image, sometimes many unnecessary repeated characters get created, one could refine the import to have a tolerance threshold entered whereby if a character is already being utilised but is just for 1 or 2 pixels different from an already created character, then that character is used instead and a new one is not created.

 

2. Similar to 1, One can also instruct the import that the destination Map Image is monochrome and all colours in source should be ignored so it will not create extra similar character just to provide a different colour. I go around this by changing the source image to black and white, but it does not always work right.

 

3. One can create a bulk move characters as follows (Enhancing the Replace function that we have today) - Probably this applies only for colour mode 0 -

User inputs a number representing the source row by specifying the first character in that row (0,8,16....) drop down list

User inputs the number of rows to move (1,2,3) drop down list

User inputs the destination row (32,40,48 etc...) drop down list

User selects if colour table should be swapped as well. check box

<User presses OK>

The characters and colour table will then be swapped or moved.

This is needed to reorganise characters stacking them neatly usually after a map import.

 

4. Points 1 and 2 will also be available post import. Let's say you have created a map which contains waste in characters, you can have a button to analyse such waste and offer you to auto fix that waste by replacing similar characters, especially if the output image is monochrome. One can also limit the function to a range of characters it should analyse and fix, not to disturb other characters outside that range.

 

 

Thanks

 

David

Link to comment
Share on other sites

..., but having the "eye" icon grouped with the Map related icons ... might have been a little more obvious for me.

 

It would indeed, but this was there before my time. :)

 

Re 1: The map import code is quite complex as it is, but I guess that should be possible.

 

Re 2: Well, the workaround is quite easy, so I don't think it's something I would do. Note that you can provide a hint to the import routine about what the background color should be by choosing this as the screen color first.

 

Re 3: Yes the bulk move could be improved a lot. Something I use a lot is to click on a character, the press shift and click on another character to swap them. It's quite fast to reorganize your character set this way.

  • Like 2
Link to comment
Share on other sites

 

Re 1: The map import code is quite complex as it is, but I guess that should be possible.

 

Today I took the plunge, downloaded IntelliJ 2016.3 for the first time of my life and fired up the Magellan source code. (I was a C# guy back in 2002-2006 and never used Java - I skimmed OOP as in my programming years I always developed with non OOP languages).

 

I dug deep in the functions that analyse the RGB and check if a character is new or same. It was tough... I managed to change behaviour and reduce some over usage but I am not happy. I am attacking primarily public static boolean gridEquals(int[][] grid1, int[][] grid2).

 

I tried finding ways of analysing change and detecting if change is minimal, but it is much harder than I thought it would be. I even tried converting RGB value to Mono, ignoring the colour component, but results were not what I expected.

 

I am sure that the solution will be a few lines of code, but like when preparing food, the ingredients are simple but their combination is complex :)

 

Just out of curiosity can you please indicate if I am decomposing the RGB integers properly ?

 

 

 

gr1=grid1[y][x];

r1 = (gr1 >> 16) & 0xFF; // red

g1 = (gr1 >> 8) & 0xFF;// green

b1 = gr1 & 0xFF;//blue

 

David

Link to comment
Share on other sites

 

Just out of curiosity can you please indicate if I am decomposing the RGB integers properly ?

 

 

 

gr1=grid1[y][x];

r1 = (gr1 >> 16) & 0xFF; // red

g1 = (gr1 >> 8) & 0xFF;// green

b1 = gr1 & 0xFF;//blue

 

David

 

Yes that looks right, but I think perhaps the gridColorDistance method is what you need.

Link to comment
Share on other sites

Rasmus,

 

Thanks for your guidance, I have added this function which needs to be called only from one place as when I replaced both places it is called from it will produce unwanted results.

 

The 200 seen below, needs to be a variable fed by the user. I got good results with some images if I make it 1000, but for other hand drawn images it needs to be low <200.

 

Compression so far is good. For hand drawn simple image I recorded the following results:

100 = approx. 90% of original with no loss,

200=approx. 50% with almost no difference,

300= approx. 40% of original with some loss

 

For complex images with a lot of detail I got amazing cleaning of unwanted colours when using a value of 6600. I am attaching the images for you to experiment with

 

tree2.png requires 6600 to clean up

tree4.png and tree5.png needs a value of 200-300 or else will disappear.

 

New Method in Global class:

public static boolean gridEquals2(int[][] grid1, int[][] grid2) {
long distance = 0;
for (int y = 0; y < grid1.length; y++) {
for (int x = 0; x < grid1[0].length; x++) {
distance += colorDistance(grid2[y][x], grid1[y][x]);
}
}
if ( distance>200 ) {
return false;
}
return true;
}

 

Called from only this method:

 

// Check if pattern already exists
int ch = -1;
for (int i = 0; i < patterns.size() && ch == -1; i++) {
if (Globals.gridEquals2(rgbGrid, patterns.get(i).getFirst())) {
ch = i;
}
}

 

 

post-44331-0-31037300-1480533073.png

post-44331-0-93896500-1480533073.png

post-44331-0-32313000-1480533079.png

Link to comment
Share on other sites

AsmusR et all

 

Success at last... my first Java end to end modification :) I am so pleased

 

I can send you the modified code if you want to include in GitHub.

 

I do not feel I can be presumptuous and add any code to this work without a peer review.

 

Regards

 

David

 

post-44331-0-27513700-1480543534_thumb.jpg

 

 

Edited by Davvel
Link to comment
Share on other sites

Great, I have also made more or less the same changes, in addition to fixing the import bug. ;-) I used a logarithmic slider for the tolerance because I figured the numbers don't mean anything. We better get this into GitHub if you or others want to continue working on it, but I'm a bit reluctant to do this without the consent of The Codex.

Magellan_windows-x64_3_1.zip

Magellan_windows_3_1.zip

Magellan_3_1.zip

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...