ENIGMA Forums

General fluff => General ENIGMA => Topic started by: egofree on July 02, 2014, 03:23:30 am

Title: Improving rooms editor
Post by: egofree on July 02, 2014, 03:23:30 am
I've added two features in the rooms editor, and they are now available for everyone in the latest executable of the 'Download' section. So if some people want to test these features, they are welcome.

The first is the undo :

The undo is available when the user, with the mouse or with text fields, adds, deletes and moves an object or a tile. The undo does not take into account others properties, like 'instance creation code'. If you modify these properties, you will get only the latest version when using the undo. The undo and redo can be used also with the shortcut keys : ctrl-z for undo and ctrl-y for redo. The limit of the undo history is 100. If a sprite, a background or an object is modified in the left tree, the undo is reset.

I will add settings for the undo in a future release. It will be possible to disable the undo or to change the limit of the undo history.

I've added also a preview of views in the rooms editor, with a black and white boxes. I will add also others features for the preview in a future release. For example, the preview will take into account the 'Object following' option, and it will be possible to use a filled rectangle instead of outlines.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 02, 2014, 12:16:05 pm
Great stuff there thanks a lot :)
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 03, 2014, 03:48:40 am
Yes you did a great job egofree and the help is appreciated!  (Y)

Also where the hell is TKG?
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 03, 2014, 11:52:51 am
Yes you did a great job egofree and the help is appreciated!  (Y)

Also where the hell is TKG?

Have you looked under the table ? ;) :P
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 12, 2014, 03:09:56 am
I just made a new pull request : https://github.com/IsmAvatar/LateralGM/pull/126
I added two new features : when a view is selected in the views list, it is now displayed centered in the room editor. Also, the 'Object to follow' property is now taken into account. You will have a  preview of the view centered around the selected object.

If you want to test already the new LateralGm : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 12, 2014, 06:10:40 am
Thanks will try this one later today.
Title: Re: New functions available in the rooms editor.
Post by: time-killer-games on July 13, 2014, 12:18:36 pm
Quote
where the boobies is TKG?

HD graphics + no zoom feature = I only use GMS for room editing, I can't see anything.

These additions are pretty useless to me for the time being. :P

Boobs.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 14, 2014, 06:16:16 am
New ideas for future releases concerning views :   :o  ;D  :D  ;)

Version 2.0 :

(http://nsa33.casimages.com/img/2014/07/14/140714011458274342.jpg)


Version 3.0 :

(http://nsa33.casimages.com/img/2014/07/14/140714011717234099.jpg)


Version 4.0:

(http://nsa34.casimages.com/img/2014/07/14/140714012207463911.jpg)


Version 4.5 :

(http://nsa33.casimages.com/img/2014/07/14/140714013355219916.jpg)


Version 5.0 :

(http://nsa33.casimages.com/img/2014/07/14/140714012327909454.jpg)


Version 6.0 (ultimate view of reality):

(http://nsa33.casimages.com/img/2014/07/14/140714012911236080.jpg)
Title: Re: New functions available in the rooms editor.
Post by: Rusky on July 14, 2014, 10:15:24 am
You've got a tight schedule, there.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 14, 2014, 12:20:14 pm
Multiple views is just as much of an illusion as computer 3D........since it is rendered to a flat 1D object :P
And multi views is rendered to one.

I like version 6 best, as reality itself is an illusion created by chemicals in our brain.

 :P :D
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 14, 2014, 12:25:18 pm
I think you mean 2D object.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 14, 2014, 01:24:05 pm
You've got a tight schedule, there.

It depends also if my pull requests will be accepted quickly or not  :)

Anyway my new ideas were successful as usually i don't have much feedback !  :D
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 14, 2014, 02:10:53 pm
You've got a tight schedule, there.

It depends also if my pull requests will be accepted quickly or not  :)

Anyway my new ideas were successful as usual i don't have much feedback !  :D

lol yeah hopefully your pull requests can be accepted, but now I think I understood the purpose behind the original post :P 

I am also planning some stuff too for ENIGMA and LGM, new functions, extensions and new features. 
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 14, 2014, 02:36:04 pm
I am also planning some stuff too for ENIGMA and LGM, new functions, extensions and new features.

Great to hear this !  (Y) Not afraid of C++ and OpenGl ?  :D
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 14, 2014, 03:22:57 pm
I am also planning some stuff too for ENIGMA and LGM, new functions, extensions and new features.

Great to hear this !  (Y) Not afraid of C++ and OpenGl ?  :D

lol not afraid of much, but I know my limits.  I do know enough to contribute certain things though, which will be mostly features and not have to do with graphics/rendering, as I am not familiar with the more advanced graphics programming stuff (oGL, d3d, etc.) But know how to add extensions, and add new functions.  What I plan to do is make a tool to parse an EGM file and let the user configure different options to pack resources into files or single file, with or without encryption, allowing them to call these individual resources from their games, directly to memory, straight read to memory. That tool will be written entirely in C++, and be a console mode.  Though later I could add a GUI to it.  As far LGM, that is JAVA, something I am not 100% familiar with but could use a convert for that purpose.  Ideally I would like to convert it and interface it with LGM as a plugin like ENIGMA is a plugin to LGM, adding an option under build, build resource files.  etc.
And some small fixes, addons to LGM here and there.
See where this brings me.  My contribution level will be very limited, the more advanced graphics stuff and major stuff will be left to the experts :D

After this whole pain my arsehole font fix and DX9 fix playing around with the code, nah, not afraid :D My knowledge on how the code interfaces to each components is limited, so far I know how to write extensions and enable them, how to add new functions, how to modify existing ones and where to look for them.  Wish I knew more but that might come in time or never come, :P it was never a plan, I guess I found out about ENIGMA by accident and I got into C++ by accident. :P  There's a great tool out there for Java to C++ and C++ to JAVA, as I'm sure you are aware, if I could do my stuff in C++ and port it to JAVA and integrate it in LGM that would be fantastic.



Title: Re: New functions available in the rooms editor.
Post by: egofree on July 17, 2014, 11:00:12 am
Darkstar2, if you are reading this topic, you will be glad to know that i've just added the setting for the 'undo history size'. If you put 0, the undo is disabled, and if you put -1 it will be unlimited :

(http://nsa33.casimages.com/img/2014/07/17/140717062426112770.png)

Also, as i said in another topic, i've added the border zone preview.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 17, 2014, 02:03:13 pm
Nice job, follow zone preview is great ! I have not used GMS in a while, did it have that feature ? last time I used it only had view borders.  So REALLY nice to see ENIGMA gain more unique features, it doesn't have to suck GMS cock all the time ! :P

One remark though, I think it is a bad idea to allow unlimited undo history.  In my opinion keep the range 0-100.    Let's see what others here think about it.

Otherwise fantastic !  Now if only your pull requests can be merged before christmas ! :D
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 17, 2014, 02:05:53 pm
I think he should allow unlimited. More choice is always better.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 17, 2014, 02:25:48 pm
Nice job, follow zone preview is great ! I have not used GMS in a while, did it have that feature ?

No it doesn't have that feature. By the way in GM Studio the undo in the rooms editor is only 'one shot' ! And you can't modify this behaviour.  :o  ;)

One remark though, I think it is a bad idea to allow unlimited undo history.  In my opinion keep the range 0-100.    Let's see what others here think about it.

But by default the history limit is set 100 (This is the java default limit). I think if the user wants to test unlimited he should be allowed.

Otherwise fantastic !  Now if only your pull requests can be merged before christmas ! :D

Thanks mate ! Today i asked IsmAvatar to commit my pull request and he did it ! We just have to wait Robert to make new executables.
Next i will implement the 'filled version' of the views (will test with inverted colors also). Then i will add others features : global shifting of objects and tiles (already available in GM studio), improving the selection and move of objects (i will my present ideas later), and most of all multi-selection of objects and tiles! Also global search within scripts. This would be really useful ! (But this could take time, so be patient  :D )
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 17, 2014, 02:46:00 pm
You are on a roll, indeed what you are suggesting would be great.  Also if you want TKG to worship you :D you might want to add object rotation, scaling and selection as in GMS.  :P

BTW are you doing all this through JAVA or C++ to JAVA conversion ?

I'm not familiar with JAVA to make significant changes in LGM.

Title: Re: New functions available in the rooms editor.
Post by: egofree on July 17, 2014, 03:00:33 pm
BTW are you doing all this through JAVA or C++ to JAVA conversion ?

I'm not familiar with JAVA to make significant changes in LGM.

As LateralGm is made with Java, i am programming directly in Java. I had a little bit experience in java, but it was very long time ago : more than 15 years ago ! :o (Try to guess to my age !  :) ) In programming this is prehistory. At that time the developments tools for Java and Swing (the graphical API of Java) were really buggy !
By the way i don't mind programming in Java or in C#, which is a little bit similar, on the contrary : they are modern and 'elegant' languages, rather easy to learn and use. It seems to me much more easy than C++ anyway !  :) Of course C++ is faster and needed in some situation. Nowadays the king of language seems to be Javascript ! Everything, even on the server now, must be done in javascript. But this is not the topic of religious wars in programming, right ?  :D
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 17, 2014, 03:34:05 pm
Good job. I previously had a simple implementation suggestion for the rotation and scaling of objects in room editor. The room editor part isn't easy or simple, but tying with ENIGMA could be. My idea was that LGM would just export rotation and scale as creation scripts for the object (image_angle/direction, image_xscale/yscale) and that would basically mean no changes in ENIGMA itself. You would still need to save those changes in EGM and GMX, but I guess Robert should do that.
Also, I really would want global searching - and not only in scripts. In everything. I want a way to search for a variable and it would list all the objects+events, scripts, room creation codes and so on where it is written. Basically in every Code Window in LGM.

Also, Ism is female.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 22, 2014, 01:40:45 pm
I just finished to add settings for views :

(http://nsa33.casimages.com/img/2014/07/22/140722085515367067.png)


You can select  two colors : 'outside' and 'inside' colors. When selecting a color, you can choose also the transparency (i use a french version of windows, so the words are automatically translated in french with the colors selector of Java) :

(http://nsa33.casimages.com/img/2014/07/22/140722085317805772.png)


By default, the rectangle is not filled :

(http://nsa33.casimages.com/img/2014/07/22/140722085408259211.png)


With the option 'Use filled rectangle' :

(http://nsa33.casimages.com/img/2014/07/22/140722085744506637.png)


And with the option 'Use inverted colors' :

(http://nsa33.casimages.com/img/2014/07/22/140722085852785241.png)

Here is the latest version of LateralGm, for people who want to test it now : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar

By the way i don't intend to add more features for views, because my goal is NOT to make a new clone of photoshop !  :P ;)

I will make soon a new pull request, but before i want to do more tests and clean-up.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 22, 2014, 03:48:46 pm
that was brilliant !  :D

Amazing.......Now we have features that even GMS doesn't have......

The coloured area and following view boundary can be really helpful when making scrolling games.......

Thanks.
 
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 26, 2014, 03:28:13 pm
I added the global shift of instances :

(http://nsa33.casimages.com/img/2014/07/26/140726104034191328.jpg)

If the tiles tab is selected, the shift command will shift tiles, otherwise it will shift objects. Of course it can be undone. Also, i will add  a new button to clear all instances in the room. It is present also in GM Studio. But i don't think i will add the possibility to undo the clear of instances, because it can use a lot of memory.

You can download the latest version of LateralGm here : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 26, 2014, 04:12:46 pm
Quote
It is present also in GM Studio. But i don't think i will add the possibility to undo the clear of instances, because it can use a lot of memory.
Depends on the room. I don't think normally it would require that much memory, but not sure, as I don't know how the instances are stored in Java. But I still think this should require an undo. Every destructive action requires an undo. If you don't want this to have an undo, then at least make a popup window warning that this will not be reversible, and if you want to proceed. An action like that shouldn't happen without notice.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 26, 2014, 06:27:27 pm
I agree with Harri.

And nice work egofree, I just have one simple request, make sure the English translations are sensible if you can not translate something ask me for help. "Objects" in that caption should probably not be plural, in fact I am certain it should not be.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 26, 2014, 07:43:28 pm
Robert, it's fine.

Objets is french plural of Objet.  Since we are not dealing with only ONE object, but potentially many objects.... Objet(s) can be used too.

Also the screenshot "no object" should be translated to "aucun objet" or "aucun objet selectionné"

Cheers.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 26, 2014, 10:28:55 pm
I would prefer it just be "Shift Instances" instead of having a double plural, since instances automatically infers objects which is entirely unrelated. Otherwise we should call it Objects Instances Creation Code as well.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 27, 2014, 02:00:22 am
I would prefer it just be "Shift Instances" instead of having a double plural, since instances automatically infers objects which is entirely unrelated. Otherwise we should call it Objects Instances Creation Code as well.

I was wondering if it was correct or not to write objects instances. At first i wrote 'Shift instances', but depending on the selected tab the command is not the same, so i think it's useful to write if we are shifting objects or tiles.
Instead i propose the following titles : 'Shift all objects' and 'Shift all tiles'. By the way all labels are stored in the messages.properties file, so if one day another developer wants to modify them, it should be easy.

I am still working on the  undo function. It's working fine if you are only shifting instances, but if you are mixing with others commands (delete or moving instances), it can be corrupted. The way LateralGm is managing the selected instance is still a mystery for me.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 27, 2014, 03:17:02 am
I've finished to fix the undo. I had already the same problem when moving a single instance and it's very strange : before moving every instance, it must be selected in the list of the left panel :

Code: [Select]

for (Instance instance : room.instances)
{
  roomFrame.oList.setSelectedValue(instance,true);
  roomFrame.fireObjUpdate();

  Point newPosition = new Point(instance.getPosition().x - horizontalShift, instance.getPosition().y - verticalShift);
  instance.setPosition(newPosition);
}

It doesn't seem very clean, but this is the only working solution i've found so far. (Firing the object update or tile update is not sufficient) .If you don't do this, all instances will be messed up if you use the undo with others commands, like deleting or moving a single instance. This means also that the undo will be much slower for shifting, but i don't think it's a big problem. For a room with thousands of objects, it will take something like 2 seconds instead of 0.5 second.

Here is the latest version of LateralGm : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 27, 2014, 05:18:20 am
Quote
I was wondering if it was correct or not to write objects instances. At first i wrote 'Shift instances', but depending on the selected tab the command is not the same, so i think it's useful to write if we are shifting objects or tiles.
Instead i propose the following titles : 'Shift all objects' and 'Shift all tiles'. By the way all labels are stored in the messages.properties file, so if one day another developer wants to modify them, it should be easy.
"Instance" is GM and ENIGMA is defined quite precisely. There is no such thing as "Tile instance" or something like that. Objects are something different from instances. So "Shift all objects" is not correct from the terminology standpoint. So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 27, 2014, 05:21:31 am
I added the delete instances button :

(http://nsa33.casimages.com/img/2014/07/27/140727124136605071.png)

I didn't implement the undo, but the user is informed that the undo is not available.  But is 'It can't be undone' correct ?

I sent an email to IsmAvatar for asking her is she has any ideas about optimizing the undo, and then i will make a pull request.

Edit:
The message will be updated also : i will not use the objects word but instances.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 27, 2014, 05:23:40 am
So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.

This is the way it's written in GM Studio, it's ok for me.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 28, 2014, 01:40:16 pm
I made a pull request for global shifting and deleting of instances and tiles. I merged the pull request into the main repository of LateralGm. IsmAvatar was kind and gave me the role of collaborator. (Y) This means i don't need anymore others permission for my pull requests. That's very useful as anyway there is nobody now who has enough time to review my pull requests for LateralGm (Of course i would be pleased to have some code review of my pull requests).

When deleting instances, i display the following message :

Quote
Are you sure you want to delete all instances ? All data will be lost

I've found also that during global shifting, each piece must be selected in the list. I still don't know why. This means that it's slower, but as i said before it's not a big deal, as it takes about 2 seconds for a room with thousands of objects.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 28, 2014, 07:14:33 pm
Quote from: TheExDeus
"Instance" is GM and ENIGMA is defined quite precisely. There is no such thing as "Tile instance" or something like that. Objects are something different from instances. So "Shift all objects" is not correct from the terminology standpoint. So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.

Not necessarily, Studio and YYG as well as I, Robert, use instance colloquially to define anything indexed. Their manual promulgates it mostly, I can't find an example right at the moment but I know I have seen it before.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on July 28, 2014, 09:14:35 pm
I agree, I too use the term instance.

Isn't it more like instance of an object, after all you are loading your sprite inside an object and placing instances of that object in the room......  ;D :D ;)
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 29, 2014, 02:32:09 am
Instance is a "clone" of an object. Or in C++ terms, object is a class, and instance is one individual of that class. From one class there can be many instances. That is what they are in GM. I personally haven't seen the word used otherwise. The word "instance" could of course be used differently in some contexts (e.g. "for instance"), but I don't think the official terminology should be mixed up in the room editor.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 29, 2014, 03:54:29 pm
http://en.wikipedia.org/wiki/Instance_%28computer_science%29


https://www.google.com/?gws_rd=ssl#q=instance+meaning
Quote from: Google
an example or single occurrence of something.

http://docs.yoyogames.com/index.html?page=source%2Fdadiospice%2F002_reference%2Fgame%20assets%2Fsounds%2Faudio_play_sound.html
Quote from: Studio Manual
This means that if you have multiple instances of the same sound playing at any one time you can target just one instance of that sound to deal with using the audio functions.
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 29, 2014, 05:27:34 pm
And that is exactly the other contexts I mean. The word "instance" is a very generic English language word. Of course it will be used in documentation just as a language construct. Like when I make an RPG in C++, I can use the word "class" to describe an RPG element ("classes such as wizard, thief and pink unicorn"), but at the same time when making a C++ editor it's important not to use "class" and "instance of a class" interchangeably. So in your example they used the word "instance" to represent the same sound. But in programming context "instance" is defined to only belong to objects instances.

tl;dr - Use "instances" when referring to "object instances" instead of "objects".
Title: Re: New functions available in the rooms editor.
Post by: Goombert on July 29, 2014, 06:26:43 pm
While I agree with you Harri you are misinterpreting my motivation, I would prefer tiles be called simply "Tiles" in the room editor and not "Tile Instances" just as I would prefer "Instances" as opposed to "Objects" or "Objects Instances"

Hope that clarifies.
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 29, 2014, 06:53:32 pm
I think he already clarified, that he will remove the word "Instances" in all those texts. So we should be good.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 30, 2014, 02:23:15 am
I don't intend to change anything, but it seems to me that it's inconsistent in GM studio. You have resources, displayed in the left panel, and you have resources instances in a room. For shifting objects and tiles, GM Studio displays the following message :

Quote
Shift all instances by a given amount
Shift all tiles by a given amount

But if we want to be consistent, we should have :

Quote
Shift all object instances by a given amount
Shift all tile instances by a given amount

Or

Quote
Shift all objects by a given amount
Shift all tiles by a given amount


Anyway for me it's not so important, and it will not prevent me from sleeping !  ;)
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on July 30, 2014, 04:17:23 am
But that is correct. You shift instances, no objects. So it's correct this way:
Quote
Shift all instances by a given amount
Shift all tiles by a given amount
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 30, 2014, 06:40:42 am
As i proposed before, i modified the way objects are selected :

- Left button : add an object when there is no objects, and move otherwise
- Left button + ctrl : always add an object (useful when you want to add an object on top of another one)
- Left button + shift : add multiple objects (no change)

The right button deletes objects, it's the same.

The commands in the rooms editor are identical now to GM. I think it's better than before.

Here is the latest version of LateralGm : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
Title: Re: New functions available in the rooms editor.
Post by: IsmAvatar on July 30, 2014, 10:25:02 am
The message should read something more like:
"Are you sure you want to delete all instances in this room? This operation cannot be undone."

Instance is the official term and a well-defined concept in LateralGM; it even has its own wiki page: http://enigma-dev.org/docs/Wiki/Instance

"in this room" is an important qualifier, to not confuse the user as to what scope of instances will be deleted - will it delete all instances in the entire project or just the instances in this room - we must clarify.

"All data will be lost" is a horrible sentence to use here. It conveys nothing more than the first sentence, and does not imply that the operation can't be undone. It is also scary - ALL data?! Throughout the entire project?! Say what you mean, and be clear about it. "This operation cannot be undone."

Punctuation is a little important as well. We should avoid contractions like "can't" (prefer "cannot" or "can not"), and remember to terminate sentences with a period.

Also, remember to send the string through Messages.getString so that it gets translated.

As pointed out, we should also be translating "<no objects>", although that may be a challenge to translate since "objects" should be independently translated.



Edit: I have committed this change. Also, it appears that "<no objects>" already has a translation key; not sure why French didn't translate it.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 31, 2014, 04:17:20 am
I want to add a help button for the room controls. I don't want to spend hours to figure out if my sentences are correct or not, and i will take the sentences of GM Studio :

Quote
Left mouse button : Move/Add
Left mouse button + Alt : No snap
Left mouse button + Shift : Add multiple
Left mouse + Ctrl : Add on top
Right mouse button : Delete

It's ok, but i think it's succinct. If you have any advises, they are welcome.
Title: Re: New functions available in the rooms editor.
Post by: egofree on July 31, 2014, 03:18:59 pm
I've implemented the 'room controls' window:

(http://nsa33.casimages.com/img/2014/07/31/140731104011307921.jpg)

Also i've put in the main repository of LateralGm the latest modifications about the room controls.
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on August 01, 2014, 12:16:38 am
Very nice work there.

One minor thing,

I see some new features being added, I think those should be updated in the wiki documentation to reflect changes, removal, fixing or adding new functions, features, etc.

Also, why is LGM version frozen ?  With all the changes added to LGM lately shouldn't the version increment ?  Like 1.8.7 ?

You should also add your name in the about section in LGM. :D

Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 01, 2014, 01:08:48 am
Editor documentation belongs at the following pages.
http://enigma-dev.org/docs/Wiki/Working_with_LateralGM

Never had much time to work on the pages, do with them what you people want to do and I'll come back later and clean it up.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 01, 2014, 01:58:17 am
I see some new features being added, I think those should be updated in the wiki documentation to reflect changes, removal, fixing or adding new functions, features, etc.

As i am not a native English speaker, i don't feel competent to do it, and anyway i was told i write 'horrible sentences' !  ;)
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 01, 2014, 02:10:26 am
Also, why is LGM version frozen ?  With all the changes added to LGM lately shouldn't the version increment ?  Like 1.8.7 ?

I propose this : let me finish the scaling and flipping functions, and then we will increment the version and make a announcement so people will know that new features have been added in LateralGm.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 01, 2014, 03:49:27 am
Quote from: egofree
As i am not a native English speaker, i don't feel competent to do it, and anyway i was told i write 'horrible sentences' !  ;)
Alright, don't worry about it then, I will correct any mistakes I see in the English translation, but also, still feel free to consult us on your translations.

Quote
I propose this : let me finish the scaling and flipping functions, and then we will increment the version and make a announcement so people will know that new features have been added in LateralGm.
Try to keep a change log of everything like I usually do, and do not worry about the version number I can find time to increment that and package a new Portable ZIP. But first I would like to get all the scalling, flipping, rotation and instance locals added to the room editor since they require the back end to be updated. In fact I am going to be working on some other things like implementing the audio quality settings, which I've yet to do, with some help from Josh. This is nice to do it all at once so that users don't constantly have the plugin becoming inconsistent with the compiler.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 02, 2014, 03:30:09 pm
I've fixed two errors concerning views :
- It was not working correctly if the OS is non-English (Testing the selected tab with the title was not very optimal  ;) )
- If the room starts with the views tab, the views are displayed now. Before it was displayed only if you switched to the views tab manually.

I've finished to implement the selected instance/tile. If you click on an object in the rooms editor, it will be displayed with a white and black border. This will be useful when more fields will be added to instances (scale,rotation, flip), as the user will know exactly what instance is modified. Also if you click an instance in the list, it is displayed centered in the rooms editor and with a border (similar to views) :

(http://nsa33.casimages.com/img/2014/08/02/140802105116748689.png)

I will do more testing and make pull request tomorrow.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 02, 2014, 03:33:58 pm
Egofree, another thing I think would be cool that Studio does partially is add the handles to the corner of the selection box, but expand upon that by allowing you to draw those handles for scaling and rotation.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 03, 2014, 03:55:26 am
I added settings for selection also. They are identical to views :

(http://nsa34.casimages.com/img/2014/08/03/140803111415822252.png)

(http://nsa33.casimages.com/img/2014/08/03/140803111707354825.png)
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 05, 2014, 03:41:35 am
Teasing :  :D

(http://nsa34.casimages.com/img/2014/08/05/140805110122728304.png)
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 05, 2014, 04:46:41 am
That's cool. Just wandering - what are the rendering capabilities of the Java thing (swing?) that we are using? Like I know you couldn't do something because of that, like render a dashed line or something.
So will it be capable enough to render the transformation controls (so you can click a corner and drag to scale, or rotate)?
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 05, 2014, 05:51:34 am
That's cool. Just wandering - what are the rendering capabilities of the Java thing (swing?) that we are using? Like I know you couldn't do something because of that, like render a dashed line or something.
So will it be capable enough to render the transformation controls (so you can click a corner and drag to scale, or rotate)?

For the views, i've already used dashed lines. I don't think there should be any problems rendering the transformation controls :
http://docs.oracle.com/javase/tutorial/2d/advanced/transforming.html
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 08, 2014, 02:57:18 pm
I am still developing the functions for rotating, scaling, and modifying the alpha property of instances. The methods in Java for displaying images with these properties are trivial :

Code: [Select]
Graphics2D g2 = (Graphics2D) g;

g2.scale(scale.getX(),scale.getY());
g2.rotate(Math.toRadians(-rotation));
AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) (alpha / 255.0));
g2.setComposite(ac); // Alpha

But the code for calculating the bounds of the instance when it is rotated is far from being simple ! (We are not rotating the object around its center, but around its left upper corner. This is how it's done in GM Studio). At least from me : i am far from being a genius in trigonometry. ;) Still, i am confident i will finish soon this problem. I don't intend to implement flipping in this version. Anyway flipping is just a rotation and translation. Here is some new screenshots:

Scaling:

(http://nsa34.casimages.com/img/2014/08/08/140808100848788536.jpg)

Rotation :

(http://nsa33.casimages.com/img/2014/08/08/140808101636217683.jpg)

Opacity:

(http://nsa33.casimages.com/img/2014/08/08/14080810172854771.jpg)
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 08, 2014, 05:52:19 pm
No I can guarantee you that Studio probably rotates around the sprite center, whatever the defined behavior of image_angle is.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 09, 2014, 02:26:40 am
It depends of the 'origin' of the sprite. By default the origin is 0,0. Here is an instance at 32, 32:

(http://nsa33.casimages.com/img/2014/08/09/140809094630515339.png)

With a rotation of 160 :

(http://nsa34.casimages.com/img/2014/08/09/14080909470376220.png)

But if you set the origin around the center, you are right. But this is bad news, i didn't take into account yet this property.
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 10, 2014, 01:25:14 pm
Rotation around origin together with flipping should be as easy as this:
Code: [Select]
g2.setToIdentity(); //Set everything to default. This should also be true in general before any translation
g2.translate(-g.xoffset,-g.yoffset); //So move to 0-xoffset (xorigin),0-yoffset (yorigin)
g2.scale((xflip==true?-scale.getX():scale.getX()),(yflip==true?-scale.getY():scale.getY()));
g2.rotate(Math.toRadians(-rotation));
g2.translate(g.x,g.y); //Translate to instance position

So the order is translate the origin, scale, rotate and translate to position.

Flipping is not rotation and translation - well it is, but it's the same as scale- so scale by negative amount and it's flipping. Try inputting -1.00 in Scale X, it should show the same as Flip X. I don't know how GM handles that fact (does it allow Scale X to be negative?), but I think we should allow it to be negative and Flip X to be enabled at the same time. It's useless, but still.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 13, 2014, 02:24:31 pm
I've finished to implement scaling, rotation and alpha property. It was a pain in the *** to integrate correctly all these properties, especially with the sprite's origin. :D
If some people would like to test my latest version : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar. This is work in progress and it is made just to test the new properties in the rooms editor. It is not working yet within ENIGMA, and i need to add missing features, like the undo. I need also to be sure that they are saved correctly in project files. I am working right now on the image blending with colors.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 13, 2014, 11:11:24 pm
Alright egofree, just a heads up I am planning to update the Portable ZIP this weekend possibly Friday when classes end.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 19, 2014, 10:53:13 am
The reading of GMX files with the new properties is implemented. I created a project in GM Studio :

(http://nsa33.casimages.com/img/2014/08/19/140819061204706780.png)

And then i open it in LateralGm:

(http://nsa33.casimages.com/img/2014/08/19/140819061514506452.jpg)
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 23, 2014, 02:55:28 pm
I've finished the work on LateralGM and the modifications for the new properties are now in the repository : https://github.com/IsmAvatar/LateralGM/pull/138

In order to integrate the new properties in Enigma, the following tasks must be finished in the LateralGm plugin :  changing the new instance's properties (image_xscale,image_yscale,image_alpha,image_angle) in the new property : pre_creation_code. Also these properties must be supported when reading and writing egm files. But anyway i consider the work to be finished in LateralGM, and there is not much remaining work to be finished. About 90% of the work is already done.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 23, 2014, 10:14:26 pm
Very nice ego, keep up the good work, I am still pressed for time, even more so now.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 27, 2014, 03:58:21 am
I've finished everything for the new properties. Here is a test project :

(http://nsa33.casimages.com/img/2014/08/27/140827111645250394.png)

and the result, when running :

(http://nsa34.casimages.com/img/2014/08/27/140827111716199648.png)

But this was done only for testing purpose with modifying the creationCode. But in my pull request (https://github.com/enigma-dev/lgmplugin/pull/27), i am not modifiying creationCode but the new property preCreationCode. Currently, it will give the following error :

Code: [Select]
Stack trace:
java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy0.compileEGMf(Unknown Source)
at org.enigma.EnigmaRunner$CompilerThread.run(EnigmaRunner.java:679)

But i am rather confident it is because the ENIGMA engine must be modified in order to take into account the new property.
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 27, 2014, 06:29:40 am
Did you modify enigma.jar as well? If so, then compile both and post here. I will download them and try to add the precreation code.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 27, 2014, 06:53:59 am
Yes, i've modified both. Here is the latest version of enigma.jar and LateralGm.jar :

https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
https://dl.dropboxusercontent.com/u/29802501/enigma.jar

I don't know if the fields order is important for you or not, but the preCreationCode is declared just after the creationCode.
Title: Re: New functions available in the rooms editor.
Post by: time-killer-games on August 27, 2014, 01:04:10 pm
Ego free I was going to upgrade to windows 8 but I've heard a lot of bad things about it so no promises until after I hear you are interested, thanks to your contribution that I've waited so long for I'd like to reward you a donation from about $20-$40. I offered this to Robert in times past but he wanted me to use the money for something better.

I want everyone to know this when I offer donations I do it as a joy not a burden. I really like to share the love. What I get out of it is the pleasure to help someone who has helped me greatly. :) I like to make people happy. It makes me happy to see people happy. :D

HAPPY HAPPY JOY JOY HAPPY HAPPY JOY
Title: Re: New functions available in the rooms editor.
Post by: Darkstar2 on August 27, 2014, 01:55:49 pm
Ego free I was going to upgrade to windows 8 but I've heard a lot of bad things about it so no promises until after I hear you are interested, thanks to your contribution that I've waited so long for I'd like to reward you a donation from about $20-$40. I offered this to Robert in times past but he wanted me to use the money for something better.


I think this amazing contributor needs more than donations, he should acquire YYG and remake GMS  :P

Now imagine if ENIGMA was a closed sourced project and running alongside GMS........it would have been good for BOTH sides.......GMS would have been far better than the over priced pile of poo that it is, and ENIGMA would have been far better off, full time development on board, constantly evolving, and UNIQUE on its own, :P

Quote
What I get out of it is the pleasure to help someone who has helped me greatly. :) I like to make people happy. It makes me happy to see people happy. :D

HAPPY HAPPY JOY JOY HAPPY HAPPY JOY

Yeah I agree with TKG...... I guess there are situations when giving is better than receiving..........well in most cases yea....:D

Title: Re: New functions available in the rooms editor.
Post by: egofree on August 27, 2014, 02:30:13 pm
Thanks guy !  :) I just hope the new features will work for you and will not have too much bugs, otherwise i am afraid you will be less grateful !  ;)
This is the first time i am participating in an open project, and i have a lot of pleasure to do it. As i've a lot of fun, i don't notice how time flies.
Time-killer-game, thanks for you donation, but i don't need it, as i am not doing it for money. Use this money to have a good diner or to watch an interesting movie ! :)
As this seems the time of thanking everybody  :D, i would like to thank all developers who have worked on this project and specially Robert. If i started to work on this project it is mostly because of Robert, with all the efforts he made on this project and all the help he gave on this forum. (Y)
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 28, 2014, 11:12:45 am
Test this: https://github.com/enigma-dev/enigma-dev/pull/809
You will have to recompile the .dll. I do it by opening Git Shell and typing "mingw32-make". After that the plugin error shouldn't show and the transformation options should work fine.

Also, I noticed that there is some weirdness when using "inverted colors" option together with instance sprite transformations. And "color" should be used instead of the english spelling. Just to be more consistent. And you could maybe have a "preCreation code" modifiable just like creation code is, for both the instance and rooms. So the transformations are prefixed to the user made precreation code.

Also you should allow negative scale (right now it doesn't allow you to set -1 in scale for example). If you had that I wouldn't need the "flip" option, which is also missing now.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 28, 2014, 01:42:25 pm
First, TheExdeus, thanks for having made quickly the needed modifications in Enigma.

Test this: https://github.com/enigma-dev/enigma-dev/pull/809
You will have to recompile the .dll. I do it by opening Git Shell and typing "mingw32-make". After that the plugin error shouldn't show and the transformation options should work fine.

I am a beginner with git and i don't know how to get your modifications. If i use the command 'git pull', it will give me the modifications from the main repository, but as your pull request is not yet accepted, what we are supposed to do ? So far i didn't succeed to use the latest version of Enigma with LateralGm.

Also, I noticed that there is some weirdness when using "inverted colors" option together with instance sprite transformations.

I guess you are speaking of the 'selection' option. I didn't see any special. Can you show us an example ?

And "color" should be used instead of the english spelling. Just to be more consistent.

Ok, i've changed this and it's already in the repository.

And you could maybe have a "preCreation code" modifiable just like creation code is, for both the instance and rooms. So the transformations are prefixed to the user made precreation code.

I don't see the use of this. Users have already the creation code. Also preCreationCode is just a temporary property recreated each time the compilation is started. It is not saved in project files.

Also you should allow negative scale (right now it doesn't allow you to set -1 in scale for example). If you had that I wouldn't need the "flip" option, which is also missing now.

That's ok for me, but it will be for another release. I will put it on my 'todo list'. Also Robert was talking about changing the scale with mouse, it would be cool also. Rotation could be done also with the mouse.
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 28, 2014, 03:19:44 pm
Quote
I am a beginner with git and i don't know how to get your modifications. If i use the command 'git pull', it will give me the modifications from the main repository, but as your pull request is not yet accepted, what we are supposed to do ? So far i didn't succeed to use the latest version of Enigma with LateralGm.
All pull requests are just branches. So from web you can go here: https://github.com/enigma-dev/enigma-dev/tree/PreCreationCode . And so the .zip is here: https://github.com/enigma-dev/enigma-dev/archive/PreCreationCode.zip
You can also do "git checkout PreCreationCode".

Quote
I guess you are speaking of the 'selection' option. I didn't see any special. Can you show us an example ?
Try setting the sprite transparent and colored in room editor, then enable the inverted colors option and drag the sprite. It won't have inverted colors and the will even look more weird when over other sprites. I will maybe later post a picture.

Quote
That's ok for me, but it will be for another release. I will put it on my 'todo list'. Also Robert was talking about changing the scale with mouse, it would be cool also. Rotation could be done also with the mouse.
Yeah, that would be awesome.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 02:26:46 am
I've downloaded your source and i executed the 'mingw32-make' command, but when i try to run an empty project, i've the following error message :

Quote
g++ -I../Additional/i686-w64-mingw32/include -Wall -s -O3 -fno-rtti -fno-exceptions -DPATH_EXT_SET -IPlatforms/Win32/Info -IGraphics_Systems/OpenGL1/Info -IAudio_Systems/OpenAL/Info -ICollision_Systems/Precise/Info -IWidget_Systems/Win32/Info -INetworking_Systems/None/Info -IUniversal_System/Info -I. -IC:/ProgramData/ENIGMA/ -Wall -s -O3 -fno-exceptions  -MMD -MP -c -o C:/ProgramData/ENIGMA/.eobjs/Windows/Windows/Run/Audio_Systems/OpenAL/ALsystem.o Audio_Systems/OpenAL/ALsystem.cpp
In file included from Audio_Systems/OpenAL/ALsystem.cpp:23:0:
Audio_Systems/OpenAL/ALsystem.h:28:22: fatal error: AL/alure.h: No such file or directory
 #include <AL/alure.h>
                      ^
compilation terminated.
g++ -I../Additional/i686-w64-mingw32/include -Wall -s -O3 -fno-rtti -fno-exceptions -DPATH_EXT_SET -IPlatforms/Win32/Info -IGraphics_Systems/OpenGL1/Info -IAudio_Systems/OpenAL/Info -ICollision_Systems/Precise/Info -IWidget_Systems/Win32/Info -INetworking_Systems/None/Info -IUniversal_System/Info -I. -IC:/ProgramData/ENIGMA/ -Wall -s -O3 -fno-exceptions  -MMD -MP -c -o C:/ProgramData/ENIGMA/.eobjs/Windows/Windows/Run/Platforms/Win32/WINDOWSexternals.o Platforms/Win32/WINDOWSexternals.cpp
Platforms/Win32/WINDOWSexternals.cpp:36:17: fatal error: ffi.h: No such file or directory
 #include <ffi.h>

Anyway that's not a big problem for me. On the client side, i did already a lot of tests, and if it works for you with the Enigma engine, it's ok for me if we merge.


Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 04:11:36 am
Try setting the sprite transparent and colored in room editor, then enable the inverted colors option and drag the sprite. It won't have inverted colors and the will even look more weird when over other sprites. I will maybe later post a picture.

Well, it's not exactly 'inverted colors'. At first, i've the found the method setXORMode (http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#setXORMode(java.awt.Color) (http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#setXORMode(java.awt.Color))), which was interesting, but it's not really inverted colors. This is the method currently used to display 'inverted colors'. Now when i was looking how to make 'color blending' in java, i've found others methods, like RGB filters (c.f http://docs.oracle.com/javase/7/docs/api/java/awt/image/RGBImageFilter.html), which could be used to implement real 'inverted colors', but it doesn't seem to me a high priority right now. So my question is : the problem is that's not exactly 'inverted colors', or it's because there is others graphical 'glitches' ?
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 29, 2014, 08:02:08 am
Quote
I've downloaded your source and i executed the 'mingw32-make' command, but when i try to run an empty project, i've the following error message :
Did you just pull the branch in a new directory? Those errors are because you didn't install the "Additional" packages which are no in git. They are added in the portable zip and downloadable from the wiki separately as well. What I actually suggest you to use on windows is GitHub For Windows. It is a clean interface where you can just drag the folder with .git inside the window and it will show all the commits and branches. Then on the top you will be able to change the branch and it will do it automatically.

Anyway, I just merged into master so you can test from there. If it's broken, then I will try to fix it or revert.

And I guess the problems I was seeing were just no proper inversion. Like it didn't override the blend function (so it was still transparent and red just as I put it), and only the outline was blending. Not a big problem for me, as I don't actually use the inverted colors option. Just played with it.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 09:35:34 am
And I guess the problems I was seeing were just no proper inversion. Like it didn't override the blend function (so it was still transparent and red just as I put it), and only the outline was blending. Not a big problem for me, as I don't actually use the inverted colors option. Just played with it.

I've found at least one error : the 'fill rectangle' option does not work anymore for selected pieces. I have to fix this.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 01:51:44 pm
For inverted colors, i think i know what could be the problem. With certain colors and with certain objects (specially faded colors), it looks sometimes horrible. For example, with a wall object which has solid colors, it looks more or less ok :

(http://nsa34.casimages.com/img/2014/08/29/140829091301261415.jpg)

But with the clown, it's really not good looking :

(http://nsa34.casimages.com/img/2014/08/29/140829091348723540.jpg)

I was already aware of this problem. It should be improved, but i think for the moment we can survive with the current situation.  :D
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 03:13:16 pm
I've fixed the bug of the 'filled rectangle'. It is in the repository.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 29, 2014, 03:47:47 pm
I made a new install of Enigma on Linux and then i've copied the new LateralGm.jar and Enigma.jar. It scares me a little bit, but i can't manage to run any old projects.  :o I hope it's because there is some missing files (I executed also the 'make' command). TheExdeus, did you manage to load and run old projects (gmx or gmk) ?
Title: Re: New functions available in the rooms editor.
Post by: TheExDeus on August 29, 2014, 04:10:36 pm
What kind of error you have? Those alure.h and ffi.h errors are when you don't have the additional packages installed. I am not sure what you have to do on linux, but on windows it means you don't have ENIGMAsystem\Additional folder. You can get that by downloading the installer zip and copy out from there.

I manage to compile fine, but there are massive stability issues with ENIGMA right now. Like the minecraft example crashes on GL1 (something to do with texture_set_stage changes) and GL3 works fine, but transparency is a little broken. Other GL3 examples don't render correctly either, so we will have to fix it. It's just that there are very few active developers now, so it got a little messy.

edit: The GL1 minecraft segfault is actually something I already fixed, but had to revert because of other bugs. Should probably complete that branch and try to implement again.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 30, 2014, 02:48:05 am
Ok, i've found the problem in one of the project. The Background0 object was set to visible, but it was not linked to a background object. The game will not run.
Title: Re: New functions available in the rooms editor.
Post by: egofree on August 30, 2014, 03:06:40 am
I did more tests, and everything seems to be fine with the new properties.  :)
Title: Re: New functions available in the rooms editor.
Post by: Goombert on August 31, 2014, 06:02:04 pm
I would just like to offer some feedback here with the latest Portable ZIP. After testing the various features and preferences for selection and moving instances I must say you've done an excellent job here egofree with implementing everything, I am very proud of you and happy to have you as a contributor.

I so far have only thought of one suggestion, I believe we should add a check box for tiles and instances on the "Delete All" button so that you can delete just tiles or just instances. Does that make sense?

Also I set the default grid size to 18x18 since that is what size Josh's Calico icon set was exported in but we really should keep the default 16x16 of GM in my opinion. Perhaps we could check if the default object icon is being used and then scale it?
Title: Re: New functions available in the rooms editor.
Post by: egofree on September 01, 2014, 03:27:57 am
I would just like to offer some feedback here with the latest Portable ZIP. After testing the various features and preferences for selection and moving instances I must say you've done an excellent job here egofree with implementing everything, I am very proud of you and happy to have you as a contributor.

 :)

I so far have only thought of one suggestion, I believe we should add a check box for tiles and instances on the "Delete All" button so that you can delete just tiles or just instances. Does that make sense?

Well, it works this way : if you are on the objects tab it will delete only instances, and if you are on the tiles tab it will delete tiles only. This is identical to GM Studio.

Also I set the default grid size to 18x18 since that is what size Josh's Calico icon set was exported in but we really should keep the default 16x16 of GM in my opinion. Perhaps we could check if the default object icon is being used and then scale it?

I don't understand : Calico icons are used in LateralGm as icons, but are they really used in games ? Anyway i am not against changing the default grid size to 16x16.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on September 01, 2014, 07:36:11 am
Quote
Well, it works this way : if you are on the objects tab it will delete only instances, and if you are on the tiles tab it will delete tiles only. This is identical to GM Studio.
Eh, I really don't like that. I would like someone other than me and you to offer their preference.

Quote
I don't understand : Calico icons are used in LateralGm as icons, but are they really used in games ? Anyway i am not against changing the default grid size to 16x16.
Create an object without a sprite, then create a room and add the object, the icon used to represent it will be the object ball. In GM it was always a question mark if the object had no sprite, in LGM we just use the object icon. But anyway that icon is 18x18 but I'd like a 16x16 default grid where that icon fits properly into it since power of two is better. So in other words I'd like 16x16 default grid size and when an instance uses the default icon to display itself in the room editor it should scale itself down to 16x16.
Title: Re: New functions available in the rooms editor.
Post by: egofree on September 01, 2014, 10:46:38 am
Quote
Eh, I really don't like that. I would like someone other than me and you to offer their preference.

LateralGm, as GM Studio, works in the rooms editor with the tabs context : for instance, if you want to work with instances (moving,adding,deleting), you've to be in the objects tab, and it's the same with others tabs. So the global delete of instances/tiles is consistent with the way LateralGm works. Of course this doesn't mean i could not change the way we delete instances/tiles, but it doesn't seem very important to me.  :D

Quote
Create an object without a sprite, then create a room and add the object, the icon used to represent it will be the object ball. In GM it was always a question mark if the object had no sprite, in LGM we just use the object icon. But anyway that icon is 18x18 but I'd like a 16x16 default grid where that icon fits properly into it since power of two is better. So in other words I'd like 16x16 default grid size and when an instance uses the default icon to display itself in the room editor it should scale itself down to 16x16.

Ok, i understand now. In this case, i think it would be convenient to have a specific icon for empty objects which has already the needed size. No need to scale every-time the icon.
Title: Re: New functions available in the rooms editor.
Post by: egofree on September 01, 2014, 11:40:20 am
I made a new pull request with the new default grid size and the new icon : https://github.com/IsmAvatar/LateralGM/pull/142/files

If it's ok for everyone, i will put it into the repository.
Title: Re: New functions available in the rooms editor.
Post by: Goombert on September 01, 2014, 12:26:26 pm
Ok I've reviewed it and pulled it already, however I still think we should reconsider the former because I don't really think it's reasonable or uhm intuitive to make the user switch tabs in order for the buttons to work. It just doesn't seem like it is easy for people to pick up compared to them just being able to set what they want to delete and what they don't want to delete, plus it saves them a number of clicks by being able to do it all in one go.
Title: Re: New functions available in the rooms editor.
Post by: IsmAvatar on September 01, 2014, 08:36:50 pm
* Deleting and shifting all instances/tiles are bulk operations and are not performed frequently, and the operations should ideally be global (independent of the tab).
* The Toolbar is for convenient access to frequently used things.

Therefore, the toolbar is not the best place for these two actions. I agree with Robert, it is rather unintuitive to have to switch to the Tiles tab for a toolbar button to delete all tiles.

Move the buttons. Either into their respective tabs, or into an Actions menu.


Also, I'm seeing that the Objects tab is starting to get cluttered. We should think of some ways to improve and declutter it.


Oh, and one more thing: NPE if you click on the Instance List with no instances present.
Title: Re: New functions available in the rooms editor.
Post by: egofree on December 14, 2014, 08:22:44 am
I've added the functions to manage tiles layers : in the rooms editor, the user can now select and manage tiles layers, with a drop down which contains all layers. An 'add' button adds a new layer and the 'delete' button erases all tiles for the selected layer. The check box 'Hide other layers' allows to see only on the selected layer. I've also discovered a bug which was already present before : when you move a tile, and try again to move the same tile, it is not working.

(http://nsa33.casimages.com/img/2014/12/14/141214120619476605.png)
Title: Re: Improving rooms editor
Post by: egofree on December 15, 2014, 05:48:45 am
I added a new checkbox : 'Edit other layers'. If the checkbox is checked, the user can select a tile, regardless of its layer. Also i fixed the bug where it was not possible to move again the selected tile.

(http://nsa33.casimages.com/img/2014/12/15/141215114831560799.png)
Title: Re: Improving rooms editor
Post by: The 11th plague of Egypt on December 15, 2014, 06:12:22 am
I added a new checkbox : 'Edit other layers'. If the checkbox is checked, the user can select a tile, regardless of its layer. Also i fixed the bug where it was not possible to move again the selected tile.

(http://nsa33.casimages.com/img/2014/12/15/141215114831560799.png)
Looking at the title of the tab and the name of the buttons, the first thing that comes to my mind is "Add adds a layer", "Delete deletes a layer".
But from this discussion, I gather it doesn't really work like that, does it?
And why is there an Add tab too?
The difference between the Add tab and the Add button may not be so clear.
Title: Re: Improving rooms editor
Post by: egofree on December 15, 2014, 06:16:28 am
The add and delete buttons are used to add and delete layers. The add tab is used to add tiles. Perhaps i could use panel entitled 'Layers' around the first fields to be clearer.
Title: Re: Improving rooms editor
Post by: IsmAvatar on December 15, 2014, 07:52:29 am
Good work. The titled panel is a good idea. Also, ensure that the checkboxes are visually dependant. That is, when the first one is checked, the second one is grayed out and unchecked.
Title: Re: Improving rooms editor
Post by: egofree on December 17, 2014, 05:12:39 am
I've already implemented the basic functions for filling a selection. First, i added new settings in preferences for the multiple selection. By default, it's a filled rectangle with a blue transparent color :

(http://nsa34.casimages.com/img/2014/12/17/141217111103742920.png)

In the rooms editor, you click on the selection button, and draw a selection :

(http://nsa34.casimages.com/img/2014/12/17/141217111151963157.png)

Then you choose the object, and click on the fill button, and voila ! :

(http://nsa33.casimages.com/img/2014/12/17/141217111258254647.png)

Now i need to do it also for tiles, and do more testing. Then i will implement also delete, and after that copy and paste.
Title: Re: Improving rooms editor
Post by: Goombert on December 17, 2014, 04:34:27 pm
I actually have a few suggestions that relate to these features that I was actually going to start working on before you decided to improve the room editor, so this is great it means we're on the same page.
https://github.com/IsmAvatar/LateralGM/issues/188

Basically all of what I had planned you are already working on. I am going to go work on an undo manager for the background frame, an event transfer handler for the object frame, and a moment transfer handler for the timeline frame.
Title: Re: Improving rooms editor
Post by: egofree on December 18, 2014, 12:09:40 pm
I've finished to implement the fill and delete functions for instances and tiles. I added two new buttons in the room toolbar : 'Snap to grid' and 'Add on top'. Instead of pressing the Alt and Ctrl keys, now you can switch on/off these buttons. When filling a region, if the 'Snap to grid' mode is set to on, the pieces will be placed on each grid's cell, otherwise the region will be filled according to the piece's size. Here is an example : on the left i filled a region with 'Snap to grid' mode enabled and on the right, with 'Snap to grid' mode disabled. You can see also in the screenshot the two new icons.

(http://nsa33.casimages.com/img/2014/12/18/141218061049223580.png)
Title: Re: Improving rooms editor
Post by: Goombert on December 18, 2014, 02:21:10 pm
These features are really handy for making RTS games and placing groups of soldiers and AI bots. I'm going to ask Josh to SVG those new icons for Calico though, they look a little aliased.
Title: Re: Improving rooms editor
Post by: egofree on December 20, 2014, 12:06:07 pm
I've finished to test the fill and the delete functions for the selection tool. I added also a new switch icon for the 'Add multiple' mode.
I just made a new pull request : https://github.com/IsmAvatar/LateralGM/pull/189. So the new features are available in the main repository. The next step is to implement the copy and paste functions.
Title: Re: Improving rooms editor
Post by: Goombert on December 23, 2014, 04:51:57 am
So essentially you're all done and waiting for me to move on to the next part ego? Or are you planning on doing the copy and paste?
Title: Re: Improving rooms editor
Post by: egofree on December 23, 2014, 04:57:04 am
I started to implement the copy and paste functions. I added three new buttons in the rooms editor : cut, copy and paste. They can be called with the standard keyboard shortcuts : ctrl-x, ctrl-c and ctrl-v.
To give an example, let's say that you want to copy a region in the room. First, you click on the selection tool and select the region to copy :

(http://nsa33.casimages.com/img/2014/12/23/141223105444799249.png)

Then you do an ctrl-c (copy) and a ctrl-v (paste). You have now a stamp :

(http://nsa34.casimages.com/img/2014/12/23/141223105645156783.png)

And every time you click on the left button, the instances are pasted in the room :

(http://nsa33.casimages.com/img/2014/12/23/141223105814138428.png)
Title: Re: Improving rooms editor
Post by: Goombert on December 23, 2014, 05:03:52 am
Haha that's awesome egofree you're saving me the work, really awesome to have someone else helping with LateralGM. If you get bored you don't have to finish I can pick up any unfinished tasks for you as well. Once this is complete we can also get a new Portable ZIP out, as I said I like to update it about every 10 or so LGM features/fixes. Are you planning to link the selection with the list selection? If not I think we should discuss that aspect of this because it may need done again because of the sorting that I am planning to work on, unless of course you end up doing that too. Regardless, keep up the great work ego!  (Y)
Title: Re: Improving rooms editor
Post by: egofree on December 23, 2014, 05:09:50 am
Haha that's awesome egofree you're saving me the work, really awesome to have someone else helping with LateralGM. If you get bored you don't have to finish I can pick up any unfinished tasks for you as well. Once this is complete we can also get a new Portable ZIP out, as I said I like to update it about every 10 or so LGM features/fixes. Are you planning to link the selection with the list selection? If not I think we should discuss that aspect of this because it may need done again because of the sorting that I am planning to work on, unless of course you end up doing that too. Regardless, keep up the great work ego!  (Y)

I am not bored, i have a lot of fun doing it. :D I am not planning to link the selection with the list selection.
Right now, i have to figure out how to display only instances or tiles in the 'stamp'. I think we should select only instances or tiles when we are doing a copy and paste. It is not complicated to select instances or tiles in memory, but the class RoomVisual, which is dealing with the display, is not making any difference between instances and tiles.
Title: Re: Improving rooms editor
Post by: egofree on December 25, 2014, 01:08:33 pm
LateralGM has now three different states in the rooms editor : single object selection (the default), region selection and a pasting mode. I added a new toggle button in the toolbar in order to activate the single object selection. This is needed when we are in pasting mode and we want to go back in single object selection. The copy and paste functions are almost done. I need to do more tests and i will make a new pull request.

(http://nsa33.casimages.com/img/2014/12/25/141225070932731450.png)
Title: Re: Improving rooms editor
Post by: Goombert on December 25, 2014, 03:58:44 pm
Nice work so far egofree, when you're done then I will pull your changes and make an LGM release and if that goes well I'll update the Portable ZIP with some recent compiler fixes for alarms by me and instance activation by sorlok which you reported (and saw that he fixed too).
Title: Re: Improving rooms editor
Post by: TheExDeus on December 25, 2014, 06:13:25 pm
I would want a way to merge projects together, but in controlled way. Like I need to take 10 sprites from one project and add it to another. This is especially useful now with things like GUI's, for which I constantly need to import 20 sprites in every project. There is a "Package" button, but neither Export, nor Import works there. And it allows exporting and importing whole groups of resources, not individual ones. I remember having this feature in GM, but can't remember how it worked. I think it just took two projects and made them one.
Title: Re: Improving rooms editor
Post by: Goombert on December 25, 2014, 08:09:23 pm
TheExDeus, I designed the package interface similar to GM's but in a way that lets you control all installed resources types in LGM. The reason it doesn't work is because it is just supposed to run the read/write routines and pass them the resource types they are allowed or not allowed to write/read. The reason this hasn't progressed is because it is really really hard to do with the GMK reader, the GMX and EGM readers/writers can be broken down to handle a single resource at a time which allows us to abstract how we merge the projects together to make it one interface for all formats.

So basically, it is the GMK format that is stopping this feature from progressing. That said, GM8.1 had a funky way of importing single resources, it used a special binary format for each resource, which is likely just GMK but we don't know how each one is formatted, IsmAvatar apparently hasn't investigated and I am unaware of any available documentation on it. They were all essentially the gmres format or whatever which was an adaptation of the GMK format. Studio has the GMX format now which can obviously be easily abstracted to let you handle single resources at a time so they have added import/export buttons in the main tree context menu.

If I click the "Add Existing Sound" button it will display an open dialog with the *.sprite.gmx filter. To do this in LGM requires abstracting the GMX readers/writers in a way that allows it to handle singletons which I haven't done largely because of a lack of sufficient feedback on design and implementation.

(http://i.imgur.com/1ThNpyR.png)

Ceteris paribus, this is also off topic, let's keep this topic focused on the room editor and its transferability, resource importing/exporting/merging is beyond the scope of this topic.
Title: Re: Improving rooms editor
Post by: egofree on December 26, 2014, 05:26:44 am
I've finished to implement the cut, copy and paste functions, and i made a new pull request : https://github.com/IsmAvatar/LateralGM/pull/192.
Title: Re: Improving rooms editor
Post by: Goombert on December 26, 2014, 06:49:18 am
I've pulled and tested and everything seems to work out pretty good. I've caught a small minor visual bug however, notice the one object is less opaque than the others? It's as if it's above the selection. I don't have steps to reproduce, I was just clicking around, I did not change the depth or anything.

(http://i.imgur.com/1Js2FI2.png)

Since this is such a minor bug I've gone ahead and made a new quick release anyway so we can catch any other bugs or issues to resolve before putting it in a new portable.

Also it would be really useful to have these shortcuts for the room editor documented on its wiki page.
http://enigma-dev.org/docs/Wiki/Working_with_LateralGM
http://enigma-dev.org/docs/Wiki/Room_Editor
Title: Re: Improving rooms editor
Post by: egofree on December 26, 2014, 06:58:55 am
For the bug, i am not sure, but perhaps it's for the following reason : when you are doing a paste, it makes a transparent image of the current selection (Alpha value 0.5f). If you copy instances which have already an alpha value, it will take into account this value in the image's selection only if it's more transparent than 0.5f. But when you are doing a paste (left click), it should not change anything.
Title: Re: Improving rooms editor
Post by: Goombert on December 26, 2014, 07:33:24 am
Also, I've found another bug as well, you forgot to include a version of the new icons for the contrast icon pack. So these icons are missing under that icon pack now which breaks the dark theme. These icons need vectorized anyways, post a request for Josh to SVG them for Calico, he will make them less aliased.
https://github.com/enigma-dev/Calico-Icon

(http://i.imgur.com/lsVvwmY.png)
Title: Re: Improving rooms editor
Post by: egofree on December 26, 2014, 11:19:29 am
post a request for Josh to SVG them for Calico, he will make them less aliased.

Done.

Edit:
I forgot to say that when you are pasting or filling a region, it will take into account the 'Delete underlying' setting.
Title: Re: Improving rooms editor
Post by: Goombert on December 26, 2014, 08:57:21 pm
All of these caveats would best be documented on the Wiki page I linked you to. Instead of repeating the same instructions over and over again, just write them on the Wiki and then share the link to anybody who needs to know. Also so you don't forget either.

http://enigma-dev.org/docs/Wiki/Room_Editor
http://enigma-dev.org/docs/Wiki/Working_with_LateralGM
Title: Re: Improving rooms editor
Post by: egofree on December 27, 2014, 04:45:35 am
Robert:
You said you want to work on LateralGM and specially on the rooms editor. As i understand the user interface will be modified. Does it worth to document it now if it will be modified ?
Title: Re: Improving rooms editor
Post by: Goombert on December 27, 2014, 08:06:52 am
Yes because I don't plan on changing any of those shortcuts. I'm concerned with functional changes, my biggest irk is that you can't set the creation order that's all I really care to fix in the room editor besides bugs.

On a side note, have you been adding the keyboard shortcuts to the properties file I added? That was a change I made a while back, you should use KeyStroke.getKeyStroke(Messages.getKeyboardString(""))
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/messages/keyboard.properties
Title: Re: Improving rooms editor
Post by: egofree on December 27, 2014, 09:08:25 am
On a side note, have you been adding the keyboard shortcuts to the properties file I added? That was a change I made a while back, you should use KeyStroke.getKeyStroke(Messages.getKeyboardString(""))
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/messages/keyboard.properties

Yes, in general i've used the keyboard.properties file, except for the following keys : Alt, Ctrl and Shift. There is no problem when you combine these keys with a letter (Ctrl-c, Ctrl-x, etc), but i didn't succeed to declare and use them in the keyboard.properties when they are used alone. I spent several hours, and the only solution i've find so far is this : (e.g for Alt Key)

Code: [Select]
KeyStroke altKeyPressed = KeyStroke.getKeyStroke(KeyEvent.VK_ALT,InputEvent.ALT_DOWN_MASK,false);
KeyStroke altKeyReleased = KeyStroke.getKeyStroke(KeyEvent.VK_ALT,0,true);
Title: Re: Improving rooms editor
Post by: Goombert on December 27, 2014, 05:09:29 pm
Ok great, don't worry there's a few places where some keyboard modifiers are not stored there yet, I'll figure it out when I can.
Title: Re: Improving rooms editor
Post by: egofree on December 28, 2014, 08:04:42 am
All of these caveats would best be documented on the Wiki page I linked you to. Instead of repeating the same instructions over and over again, just write them on the Wiki and then share the link to anybody who needs to know. Also so you don't forget either.

http://enigma-dev.org/docs/Wiki/Room_Editor
http://enigma-dev.org/docs/Wiki/Working_with_LateralGM

Done !  I documented the new features in the wiki :

http://enigma-dev.org/docs/Wiki/Room_Editor

It's strange, i didn't find any documentation about the new features you added recently in LateralGM (Global search, Image effects)  :D ;)

Edit:
I think we should make additional sub-pages in the wiki for the rooms editor. As there is a lot of stuff in the rooms editor, one page doesn't seem enough if one day we will document every feature.
Title: Re: Improving rooms editor
Post by: Josh @ Dreamland on December 28, 2014, 12:04:51 pm
We will split the page into multiple subpages as individual sections become large enough to qualify. For now, just document to your heart's content on one page.
Title: Re: Improving rooms editor
Post by: Goombert on December 28, 2014, 01:25:44 pm
egofree, wow that's is very nice, I didn't expect you to document it that well, I just wanted the keyboard shortcuts listed really lol, but you did an awesome job! I love it  (Y)
Title: Re: Improving rooms editor
Post by: egofree on December 29, 2014, 05:11:57 am
I've modified the way we select objects : it takes into account now the relative position of the mouse within the object. This prevents a shifting when an object is selected. I think it's much more precise.
Title: Re: Improving rooms editor
Post by: egofree on December 29, 2014, 02:13:36 pm
I added the undo when a region is filled, deleted, or pasted, or when all tiles or all instances are deleted in the room.

Edit:
Also adding undo when deleting a tile's layer.
Title: Re: Improving rooms editor
Post by: egofree on December 30, 2014, 04:41:25 am
I have updated the wiki : http://enigma-dev.org/docs/Wiki/Room_Editor and added a paragraph about the the tile's layers. It was important to add this paragraph, as the selection tool is linked to tile layers : when you copy a tiles selection, it will copy by default only tiles of the selected layer, except if the option 'Edit other layers' is checked.
Now i have finished to work on LateralGM, and you will not hear me anymore for a while on the rooms editor ! :P