|
Post by IsmAvatar on Mar 10, 2007 21:30:00 GMT -5
Thanks a bunch, Quadduc, for the format fix. I'll link it in the first post as the official format.
The idea I had behind the Primary Resources was that the user would have an option to protect them in the same way that GameMaker does, so that you can't move/rename them etc. Having this option unchecked would allow the user to rename them as desired. In this respect, your third idea sounds most desirable. Furthermore, when the user loads in a file with all default names, they can have the option to convert them to their language-specific names. Possibly also the option to convert them back to their English names when saving.
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Mar 11, 2007 18:36:54 GMT -5
@ismavatar - generics The ArrayLists use generics, but the map only returns Resources, meaning you still have to cast most of the time. My system is implemented as a separate container for each resource. Each one returns a specific type of Resource, but through the use of generics, not 9 different classes. Anyway to use it, you would just say something like LGM.currentFile.Sprites.add(). If you wanted to get by type as well as id, a few wrapper functions with switch statements would do the trick. eg LGM.currentFile.getRes(Resource.SPRITE, id)
-clone To use clone, you must overwrite the clone method (which is protected in Object), and implement the Cloneable interface. Then, in the overwriting method, you call super.clone(), and everything is copied exactly (including all references/pointers), meaning there's still heaps of manual code required to make a deep copy. So there's pretty much no point in using clone(), we may as well just have a method called copy() in each resource.
I know this is getting a bit ahead of myself, but I think it would be cool to integrate a scripting language into LGM such as Jython, which seems to be extremely powerful, another possibility is BeanShell. This would mean advanced users (which is our target audience, isn't it?) could automate certain tasks.
Hopefully I'll be back online at home soon, and then I'll try and sort out this stupid svn thing (which refuses to work except when I use the command line client).
|
|
|
Post by IsmAvatar on Mar 11, 2007 22:22:50 GMT -5
Generics Again, please download the latest commit (or at least the latest commit from me, which was probably a few weeks ago) and you will see that I've actually taken a slightly different approach that is far more efficient. Instead of delegating the methods to their appropriate classes as I was originally planning, I instead downcast each resource as read in from the file down to Resource and stored it in an List of Lists (or something along those lines). Thus, getting a resource was exactly as you described, LGM.currentFile.getRes(Resource.SPRITE, id), only it doesn't usually require a switch, it just accesses directly from the array based on the Type passed in. Sometimes a switch was required (to handle different aspects of the resource), and the clone method (or copy method) will be too specific for this purpose and will have to be delegated to each respective class.
Clone Understood.
Language I already have 2 ideas planned since day 1 of the project (would like to implement both). 1) The ability to switch to a code-only mode where you can actually tell it that you are now coding a different event with E.G. #Create and such. Likewise, I also considered the ability to turn the entire interface into 1 big code ide where you can say E.G.: #Sprite0 hello.png or the likes, however I feel this is a long stretch and would be difficult to write an interpreter for. 2) Since G-Java 1 will most likely be incorporated into LGM, we are planning on allowing sections of Java-specific code with E.G.: /*#Java System.out.println("Hello world"); */ or the likes
At any rate, of course, these are ideas for the distant future. Right now it would just be nice to get the interface workable so that users can at least modify their GM6 files in LGM. In fact, the save function isn't quite correct, since if you delete a resource and resave, the resource will still exist in the file.
Our target audience is both advanced users and somewhat newer users. I would like to place more power and easier programming in the hands of advanced users, but all without alienating newbies, and also provide a transition. This will be achieved through options/settings, but not going overboard, because many programs just become so obfuscated with options that most users won't bother with them But for now, keep it simple but functional. We'll bring it together later. Obviously, if you have a better idea, by all means go ahead. This is just my suggestion.
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Mar 12, 2007 18:55:55 GMT -5
I was referring to your system with the above phrase (which I have seen). One of the things I don't like the idea of is having to specify Resource.SPRITE etc. every time you use it, and having to cast every time.
To get a sprite with my system, you would just say: LGM.currentFile.Sprites.get(id) It's only when you want to use a type from tree node or something that you have to call LGM.currentFile.getRes(node.kind,id)
edit: I just noticed you said the save function doesn't work if you delete a Resource. The original code I sent you iterated through the Resources of a specific type by using getUnsafe and going from an id of 0 through to an id of Last<res>Id, this meant if it wasn't in the list, a false was put in for "whether this resource exists or not". If that makes sense....maybe not, anyway the point is if it's removed from the list, it shouldn't turn up in the file. Also all references to ResId's should be checked upon saving to make sure that the Resource they were associated with still exists.
|
|
|
Post by IsmAvatar on Mar 17, 2007 22:53:49 GMT -5
I understand how this may be easier to type, and even more logical, but I chose this way because it is more direct, more dynamic, and less internal coding. If you know a way to place the method once inside of the Resource class, so that the resources inherit that method without having to code so (I don't want 13 get() methods floating around all doing the same thing...), then by all means go ahead. I, however, am not too savy with Class functions (like having a class be aware of itself), so this is the way that I did it, and it seems to work well.
I mentioned dynamics above. In case this isn't exactly clear, say you wanted to get a resource, without having to code the 12 switch statements, you'd simply pass in the type. I'm not exactly sure how you'd do this statically with <Resource>.get()... If you know of the way, like Class.name("Sprite"); or whatever on earth you'd do, by all means...
Edit: Just saw your proposed workaround to dynamics. This would work fine. Actually I think you would put this inside of Resource as the second get method, with 2 arguments instead of 1.
As for saving - I know what I did wrong and how to correct it, you don't have to tell me. I just brought it up because, well, you guys should obviously know, but also because at the time being I wasn't able to do anything about it.
Tomorrow I will be reunited with my computer, so I should get working on this stuff again.
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Mar 18, 2007 18:34:36 GMT -5
Anyway, now that we've all had a good philosophise (ze in American English?), I'll try and implement my system as soon as I'm online at home (which should be some time this week) - unless the upshot of all that talking is that you don't like my idea.
Actually, I'll show you rather than talk about it more (it still needs a little bit of work) note that it relies on Resource having a copy() method, and the add() method I know how to fix so that a new instance is created automatically:
edit: code removed to free up real estate
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Mar 28, 2007 7:33:40 GMT -5
(Sorry for the double post, but you mightn't notice this otherwise) I'm finally back online, Subclipse etc. is all working fine now (still on a 56k connection though - I would have had ADSL, but the phone company stinged on wiring or somehing and split it between two houses) I'll make the Resource container changes as soon as I get a chance (and I'll run the formatter over everything while I'm at it - one commit for each part of course)
|
|
|
Post by IsmAvatar on Mar 28, 2007 11:32:27 GMT -5
Also, if someone hasn't done it already, make the changes to GmStreamDecoder/Encoder that you were talking about. I was going to do it, but I figured it wasn't a big enough change for its own commit. Also, a small correction to GmStreamDecoder, in the readTree method, around line 128, it says "path.add", but you'll notice that path is a stack, not a list, so it should read "path.push". Please make this correction in your commit as well. Thanks.
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Apr 14, 2007 0:14:10 GMT -5
By the way, it was more than a week ago, but I made those changes. The ResourceList class isn't elegant to instantiate, but I figure there's only 9 lines of code that actually need to create one, so it doesn't matter.
|
|
clam
User
Even I don't know where my name came from!!
Posts: 30
|
Post by clam on Apr 18, 2007 2:14:52 GMT -5
I've found some free SVN hosts that look pretty good: www.assembla.comFree accounts have 200MB of space, and no specific license seems to be required either. www.bountysource.comFree. No licenses mentioned. No limits mentioned on space.
|
|
|
Post by Quadduc on Apr 26, 2007 14:23:29 GMT -5
I've had a look at the SVN hosts that you suggested.
Assembla has some nice features, but doesn't provide encrypted SSL (HTTPS) support. This is bad, because anything that gets transferred between you and the server could then be seen in clear and even manipulated by an attacker, potentially revealing confidential information or injecting e.g. malicious code. In other words, it is not secure. I think security should be taken very seriously when dealing with executable code. Maybe an attack is not very likely, but the results of one could be very unfortunate.
I don't see any big problems with BountySource. The feature list isn't that detailed, but it has SSL support, wiki and a custom tracker.
I'm still in favor of changing the license to either the GNU GPL or the MIT license. Such a license will immediately make it clear to people in the free software community that this is really free software, it's like a seal of quality. To use myself as an example, whenever I see a new software project that I find interesting, one of the first things I do is to check if I recognize its license as a free one.
|
|
|
Post by IsmAvatar on Apr 26, 2007 15:47:36 GMT -5
After reading through both the MIT and GNU licenses in full, I am now setting the license of the LGM project and all things on my website (where not provided under their own licensing) to the GNU General Public License, effective immediately.
An update will need to be made to the code to reflect this. I will also reflect these changes in the original post and my website.
|
|
|
Post by IsmAvatar on Apr 28, 2007 21:51:06 GMT -5
I just committed version 1.6.0.1.0. Basically I focused on adding in a Sound Editor. Beware, this version is unstable (meaning that it may corrupt any GM6 files saved with it and/or may throw errors)
I'd appreciate it if someone could look it over and figure out why none of the controls are reading their string values from the messages.properties file. (solved by Quadduc)
I'd also greatly appreciate it if someone would go through and fix those 12 Type Safety warnings that were left in there by Clam after adding in ResourceList (3 of which are talking about casting and erased types, the other 9 about ResourceList being raw and needing to be parameterized)
I also ran into a NullPointerException in TreeCellEditor at one point, but I have been unable to reproduce it. If anyone can figure out what happened there..
I think the Game Information window is not displaying bold font. Displaying Underline, Italics, Font, Color, and Size works but I found it difficult to tell the difference between bold and non-bold fonts. Bold works for larger fonts, but size 10 courier new it's impossible to tell it apart, even though it's quite distinct in GM. This may be a Java bug. Perhaps it's not zoomed in enough? Is there a reason we use a dropdown box for Font Size, and not a Spinner like GM uses?
BTW, the Bold, Italic, and Underline buttons are temporarily text. I was debating between displaying actual text or using images, so I went with text, but then found out the Underlining didn't work, so I just left them all unformatted. I believe you'll find the code commented out.
And finally, the last thing needed for the MDI is cascading windows, if someone can figure out how to implement that.
|
|
|
Post by Quadduc on Apr 29, 2007 12:53:11 GMT -5
I just fixed three bugs, including the one you mentioned about externalized strings in SoundFrame. The problem in SoundFrame was that it imported the Messages class from another package, thus reading the wrong messages.properties file. Another bug I found was in CustomFileFilter, where the function to check whether to accept a file assumed that every file has a dot in it. This may often be the case in Microsoft Windows, but in other operating systems, like GNU/Linux, files often have no dot or extension, and file types are rather determined by reading the contents of the files. The bug caused an exception, rendering the file open dialog useless. I fixed it by changing the code in CustomFileFilter to use String.endsWith, like it was before, but in a for loop iterating over the accepted extensions. There was also a small bug in the sound loading code Gm6File which I fixed. PS: About the GNU GPL licensing: I have taken the following from www.gnu.org/licenses/gpl-howto.html:We should add a copyright notice and a statement of copying permission to each source file, something like: Also, a file named e.g. COPYING or similar, containing the text of the GNU GPL at www.gnu.org/licenses/gpl.txt, should be added. We could additionally add a notice to an "about" window in the GUI, saying that it comes with no warranty and is free software, and add options to view the license there.
|
|
|
Post by IsmAvatar on Apr 29, 2007 16:09:15 GMT -5
As of my commit, there are 60 source files, and the copyright notice you showed is 811 bytes. That's about 48 kb, about the same as the size of all the source files and property files in SubFrames combined. If possible, I'd be in favor of a much much much shorter copyright notice, one that's only about 2 or 3 lines. If necessary, can't we just say "See COPYING" or something similar? I'm not opposed to making the copyright notice readily apparent, but I take great offense to making it so ridiculously abundant that it just about takes over our project...
Ah, didn't think of that. I'm sure this can be avoided without having to use a for loop. I was intentionally avoiding the for loop. I'll look over the code again now that you've fixed my string problem. I think I still have a few more things to do to the Sound Editor anyways.
Edit: Hmm, the strings still aren't showing up as of your update. Maybe it's just my computer acting up on me, since Eclipse seems to have trouble finding some QTJava or something and is giving all my projects errors because of a bad build path. I'ma try and fix this and report back later. Also, did you fix all the warnings that I had mentioned? Or maybe that's just Eclipse acting up as well. Edit2: Yes, that was just eclipse acting up.
|
|