Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Fat Cerberus

2821
I use VS2012 Express (Express is one IDE now, not one per language as in old versions).  The .resx/image list issue must be a bug fixed in the new version, because I compile for x86 all the time and never had any issues.  The only thing that's a pain about me using 2012 and you the older version is that sometimes VS2012 rewrites the solution file and then I have to manually edit the header so that VS2010 will open it.  This was braindead design on MS's part, since the solution format is otherwise identical other than the header.

Base64 has nothing to do with x86/x64 though, it simply means it encodes the binary data (normally base-256) as base-64 numbers, which can be mapped easily to only ASCII characters.

I would recommend upgrading to VS2012, though, it fixes a lot of bugs that existed in 2010.  Any reason you're still using .NET 2.0 though?  I assume for compatibility reasons, but that doesn't really help since Win8 doesn't actually include .NET 2.0 or 3.x (it automatically prompts the user the first time they run an app requiring these versions, but it still takes 10 minutes to download and install), only 4.0 and 4.5.  .NET 4.0 will install on XP, no reason you couldn't target that at this point.  Either way, somebody is going to have to download a framework.  And in .NET 4 you'd get some nice new features, such as LINQ.  I don't know if you have any exposure to LINQ, but it's basically awesome.  You can do stuff like this:

Code: (csharp) [Select]
var enemyUnits = from unit in battleUnits where unit.type == "enemy" select unit;
foreach (BattleUnit enemy in enemyUnits) {
    // ...
}


I don't know if I have the syntax exactly right, but that's the basic idea, the ability to do an SQL-style query against any collection in your program.  Something that would be awesome to have access to when developing an IDE, I think. ;D
2822
@NEO
Yeah, I've been holding off on making more plugins until the plugin API is a bit more stable.  My past few additions have changed it quite a bit.
2823
So are there any other features you wanted to implement? If they're not too much trouble I'll see if I can do them. I do want to get back to working on Spectacles though, so nothing too involved.

Good that you added stuff to the wiki, I'll check it out. :). Also, I think we should take any further discussion on editor coding into PM. I've kind of derailed the thread beyond all recognition, it was just supposed to be for feature requests and bug reports! :-[
2824
I tend to view the situation this way: You have an open source project on GitHub, anyone can fork the project, make edits and request a merge. While you might know that, say, _fileTypes is an instance field, a new developer looking at a method referencing it won't know that right away (especially if their preferred style is different as in my case) and could introduce bugs, e.g. thinking the variable is local and modifying it--now your state is invalid).  Some such bugs will be obvious in the diffs, but others could be harder to spot.

I won't object any further (and you'll see in my latest edits I tried to stick to your style), but if I had to make one suggestion it'd be to add some documentation to the repo saying what the coding conventions are for the project.  Most large projects have a document like this, so that you can direct new contributors to it before they make any edits.
2825

Cool, I merged the rquest. I'm getting a cross-thread issues when testing the editor with music playing:

Quote

Cross-thread operation not valid: Control 'SoundPicker' accessed from a thread other than the thread it was created on.


On line 134 of sound picker.


Odd, I never had any issues like that and I was constantly playing music and changing tracks throughout my testing just to stress test the thing.  I didn't think the editor was multithreaded though, that's a really weird error. ???

Quote
Woah, and this line of code is amazing:
Code: (csharp) [Select]

dirInfo.GetFiles(searchFilter, SearchOption.AllDirectories);


I did all of my recursive directory searches by hand, huh, never would have thought .NET would/could do this for you.


That's why I love the .NET Framework. 9 times out of 10 the framework will do the manual labor for you, you just have to go deep enough. (Inception reference... okay that was terrible, don't shoot me please :-X).  If you've ever heard the framework described as "the mother of all dependencies", this kind of thing is the reason why. ;D

Quote
Edit:
I cleaned up your code file. Um, it suffered from some complexity issues that made the code hard to read. >.<
Don't fear, the changes are minor and stylizes it in such a way that it resembles (for the most part) other portions of the editor. I don't like using 'this' everywhere and I usually put an '_' underscore prior to a private field. I also use a lowercase letter such as 'm', but I did not choose to use that style for this project. I hope you don't mind.


I guess that's okay.  It's just that I don't like not qualifying references to instance variables, since that can cause problems if you're not careful--for example, if you have a local variable with the same name as a private field, when you assign to it which one are you referring to?  The compiler could probably figure it out, but someone reading the code may not be able to at a glance (I'm a big advocate for self-documenting code). And naming instance variables with conventions like 'm_' etc. I feel is hackish when the language already has a method built-in (this) to resolve the ambiguity. You're already referring to instance fields as obj.something from outside code, why should it be any different on the inside?  But yeah, it's an official plugin now, might as well keep things consistent.

For what it's worth though, I find the "cleaned-up" code harder to read than the original version. I see the underscores, yet I have to keep reminding myself "Underscore, okay, this is an instance field, not a variable"--it's not as instinctive as when I see 'this.fieldName', if I see that then I immediately know where to look for a declaration.
2826
All right, done.  Works wonderfully, Sound Test even plays stuff right from the tree now.  I think I may have had a bit too much fun with this though... check the commit descriptions and diffs if you don't believe me.  :D
2827


Don't get mad at me, but I also renamed the events.  Events aren't supposed to start with 'On', that's the naming convention for the overridable protected method that raises the event (if one exists).


No, it's fine. I rename things all the time. I just had the habit of using 'On' for events, but they probably shouldn't use that. (Just, uh, tell me what you renamed so I can find things).


All right, OnOpenProject is now called LoadProject, OnCloseProject is now UnloadProject.  And the new one I added at your suggestion is TestGame.  Since these are part of the public plugin API, I figured it was best to stick to the same naming conventions as WinForms uses, to minimize confusion.

As for multiple inheritance of interfaces, I don't really have an issue with it.  An interface is not a class, but a contract.  Multiple class inheritance doesn't make much sense (one of the dumber features of C++ if you ask me, and complex as hell--I'd hate to have to write a C++ compiler!), but there's nothing wrong with "signing" two different contracts. :)  I suppose you could make the case that IEditorPlugin is a subcontract of IPlugin (i.e. to extend the metaphor, you can't sign the latter contract without first signing the former), but I don't know, the setup still bugs me, I can't put my finger on why...

Edit: Hmm, seems I somehow missed your idea about custom events for file types.  That's a good idea, mind if I try my hand at implementing that? :)
2828
Libraries / Re: [Script] Tweens
Just did a trial run with using tween.js in Spectacles, works wonderfully.  At some point I'll have to replace my linear-only Fader with this, it's going to be a pain as there's Fader references all over the place!
2829
Game Development / Re: The Screenshot Thread
Showing off the (currently console-based) Spectacles battle engine. A proper battle screen is on the way, but almost all battle mechanics are implemented, which you can see here. Additionally, something you can't really tell by the screenshot, but I designed the Specs engine to be very flexible; it's easy to change battle formulas, add new move effects and stats, etc. without messing with the engine code at all.  Since I'm making the saga into a trilogy, having such a flexible engine is invaluable! ;)
2830
@Radnen -
Just added another commit.  I implemented the TestGame event you suggested above (good idea!), so now Sound Test automatically pauses any playing music when you click the Test Game button.

Don't get mad at me, but I also renamed the events.  Events aren't supposed to start with 'On', that's the naming convention for the overridable protected method that raises the event (if one exists).
2831
All right, I finalized the Sound Test plugin.  The only thing I couldn't do was register filetypes to it, since that apparently requires an IEditorPlugin implementation.  Oh well.  I just pushed one last commit into the pull request, your call now if you want to merge it.
2832
If I had to suggest one change to the plugin API, it would be to remove the explicit dependency on dockpanelsuite.  That's the one big thing that bugs me, since if in the future you decided to use a different, better GUI library (unlikely but it could happen), ALL existing plugins would break. That's the hardest part about designing a plugin API: You want it to be stable. Not like Firefox extensions where half of them break with every new release!

And not only that, but forcing the plugin author to create their own DockContent object means it'll be a lot more difficult to eventually implement saving the docking layout...

Other than that, no real issues with the plugin API, except maybe that you could redesign the IEditorPlugin interface to not inherit from IPlugin. Seems counter to the way interfaces are normally used. The contract shouldn't be "editor plugins implement IEditorPlugin", it should instead be "editor plugins implement IPlugin AND ISphereEditor".  Something to think about. :)
2833
I had a feeling you'd have reservations, but I intended for the Sound Test to be a full replacement for the existing audio player, a component I consider an integral part of a default game-making IDE along with the script and map editor, that's the only reason I proposed a merge.  There's a few other changes I'd have to make to it to meet that goal (registering the proper file types for one!), but that was the intent.

As for the editor fix, it turns out it was just a quick hotfix to move the Open Last Project code AFTER plugin evaluation so that plugins get an OpenProject event for it.
2834
So thanks to your plugin tutorial (I'm a hands-on type of person so I didn't even check the wiki page, just opened up the MyPlugin project and went from there, thanks for making that! :) ) I managed to implement an audio player, but I went in a decidedly different direction to the existing player: "Sound Test", styled after the Sound Test modes from the old Kirby games.  Basically it adds a tab to the sidebar which lists all the music tracks and sounds in your project and lets you double-click one to play it without leaving your current map/script/whatever.  Much better, I think, than opening a separate document window for audio. This interrupts your work, however briefly; losing your train of thought is never fun!

I opened a pull request to merge it in, that's been open for a few days now I think and thanks to my perfectionism has accumulated a total of 7 commits...  and I think there might have been a hotfix for the editor in there as well, don't remember.
2835
Engine Development / Re: TurboSphere
Windows 8.  Seems odd that the Win8 drivers would be worse than the Win7 ones, though...