Jump to content

Photo

Magellan


515 replies to this topic

#451 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,261 posts
  • Location:Cookeville, TN

Posted Sat Jul 16, 2016 4:09 PM

Hey Rasmus, is there any way to run Magellan from a usb stick?

Work computer is pretty tight on installs.

#452 LASooner OFFLINE  

LASooner

    Chopper Commander

  • 154 posts

Posted Sat Jul 16, 2016 10:45 PM

If you have JAVA installed, you can just run the JAR file from the USB stick without having to install it. I think the JAVA install is the part your IT department would have a problem with.

#453 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,261 posts
  • Location:Cookeville, TN

Posted Sun Jul 17, 2016 2:35 AM

Thanks!

#454 Sinphaltimus OFFLINE  

Sinphaltimus

    Stargunner

  • 1,971 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Fri Oct 28, 2016 9:45 AM

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, Fri Oct 28, 2016 10:00 AM.


#455 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Fri Oct 28, 2016 10:54 AM

I haven't looked at the XB export for ages. Let me know if there are bugs or if you have suggestions for improvement.



#456 Sinphaltimus OFFLINE  

Sinphaltimus

    Stargunner

  • 1,971 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Fri Oct 28, 2016 11:45 AM

I dunno. It can probably do everything I need it to but I haven't really gotten too deep in to it. It just stopped exporting xb for some reason. Uninstalled and reinstalled fixed that issue. I should probably look for the manual..

#457 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Sun Nov 27, 2016 2:29 PM

It stopped exporing assembler data for me too. But a quick re-install fixed it.



#458 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Mon Nov 28, 2016 3:36 PM

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

Attached Files



#459 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Tue Nov 29, 2016 5:21 PM

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

 

Thanks.



#460 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Tue Nov 29, 2016 5:36 PM

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



#461 Sinphaltimus OFFLINE  

Sinphaltimus

    Stargunner

  • 1,971 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Tue Nov 29, 2016 6:32 PM

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, Tue Nov 29, 2016 6:33 PM.


#462 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 12:03 AM

 

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.



#463 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 12:05 AM

And 1. is the Eye icon.



#464 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 1:36 AM

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



#465 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 10:40 AM

..., 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.



#466 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 11:27 AM

 

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



#467 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 11:48 AM

 

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.



#468 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 11:59 AM

 

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

 

Thanks for your prompt reply. You are right, I shall dig into that method as it looks promising.



#469 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 1:13 PM

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;
}
}

 

 

Attached Files



#470 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 1:29 PM

What I am noticing, is that since I did this colour distance function many images that used to give me "ERROR" when loading, such as images larger than 240 by 160 pixels now load perfectly but create a very large map.



#471 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 1:48 PM

The attached image is a good example of importing a large image made possible with some tollerance. A value of 3600 removed the error from appearing.

 

Attached File  snowtree.png   129KB   1 downloads



#472 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 2:04 PM

The attached image is a good example of importing a large image made possible with some tollerance. A value of 3600 removed the error from appearing.

 

attachicon.gifsnowtree.png

 

Thanks, I'm looking into fixing that error. Just need to remember how the import works.  :)



#473 Sinphaltimus OFFLINE  

Sinphaltimus

    Stargunner

  • 1,971 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Wed Nov 30, 2016 2:53 PM

 

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.

 I could have use THAT info last week! LOL. Holymollies..



#474 Davvel OFFLINE  

Davvel

    Chopper Commander

  • 248 posts
  • Married
  • Location:Malta

Posted Wed Nov 30, 2016 3:54 PM

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

 

Attached File  Magellan2.jpg   46.11KB   1 downloads

 

 


Edited by Davvel, Wed Nov 30, 2016 4:05 PM.


#475 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,465 posts
  • Location:Denmark

Posted Wed Nov 30, 2016 4:04 PM

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.

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users