Skip to main content

News

Topic: The Sphere Studio v1.2.1 (Read 200285 times) previous topic - next topic

0 Members and 4 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #120
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.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.5.0
Reply #121
I have added a stylesheet to the wiki, and modified the wiki for first time users and developers.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #122
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! :-[
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Radnen's Sphere Studio v1.1.5.0
Reply #123
Keep in mind that a plugin repo now exists, so you can commit 3rd-party plugins to it now.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #124
@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.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.5.0
Reply #125
The API will continue to change until I feel it's good enough to do everything I would like it to do.

NEO: the plugin repo is good for user made plugins. The ones here are the stock plugins. They will release with the editor so that people who first download it have tools to use.

Bruce: I found it, I found why the thread error is happening. The filewatcher is doing it. It runs on its own thread, of course! I don't know why, the project tree does the same thing. Weird...

I think I fixed the problem but it won't build, due to an 'incorrect format' issue with the IrrKlang library. I have seen this before, and it's a bug in MSVC with .resx files that causes it. Because I know for a fact everything checks out. The problem is fixed by using the filesystemwatcher from the toolbox and placing it into the control. This internally sets it so that it can invoke code used in it's parent control. This resolves the cross-thread issues. However, it also mucks up the .resx file in such a way that it can no longer compile on my machine.

Edit2:
Problem solved with a delegate and thread-safe invoking. (this does not require the modification of the .resx file).

Edit3:
Shit, I can't make any change to the .resx file of the sound test plugin's main control. What the hell? As soon as I modify a property in a control in the editor for the sound test plugin, I cannot compile due to an invalid format issue with IrrKlang. What's wrong with the .resx file for the sound test? I know it's not you Bruce, weird. Keeping it the way it is makes it work. Ugh. I've had this issue once before. I think I had to completely delete the control and rebuild it from scratch. But I do not want to do that to your otherwise nicely working plugin. Do you use VS2010 or 2012?

Edit4:
It's a bug when compiling against .Net 2.0. .net 4.0 will fix this problem. Visual Studio will attempt to encode things in base64 even when compiling for an x86 machine. But the error was only for image lists... Which you are using.

Edit5:
Fixed by removing your image list.
  • Last Edit: May 03, 2013, 09:43:31 pm by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #126
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
  • Last Edit: May 03, 2013, 11:07:15 pm by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.5.0
Reply #127
I know LINQ quite well. :)

The reason to keep it at .net 2.0 was twofold:
1) High support, very versatile, supported by Mono (well, now Mono is 4.0 compatible), and Wine
2) Dockpanelsuite is for .net 2.0 (but I think it might be for 4.0 now).

Obviously time has changed since starting the project, I think moving to 4.0 is a lot better now. It also has a native way of supporting plugins. I should also get VS2012, since I basically get it for FREE from my college. :) I'm running VS2010 pro right now, and dang was it good. But now 2012 is out and I was reluctant to try it until bugs were fixed. I think now's a good time to switch over, though.

Just so you know, I've used 4.0 in many, many other projects. ;)


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.


Oh, I thought due to the discussion here: http://stackoverflow.com/questions/2992075/could-not-load-file-or-assembly-or-one-of-its-dependencies-an-attempt-was-m that the base had something to do with the environment. I guess I was wrong.
  • Last Edit: May 03, 2013, 11:11:10 pm by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #128
I think you killed the sound test plugin.  I'm getting directory not found exceptions now on launch...

I see what it is, you're trying to manually search the "sounds" and "music" directories (the latter of which doesn't exist).  That's why I just had it search the whole project recursively, this way it picks up files whereever they happen to be.  The Sphere engine itself doesn't really care where you put stuff, so I figured the editor and plugins shouldn't either in most cases.
  • Last Edit: May 03, 2013, 11:18:47 pm by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Radnen's Sphere Studio v1.1.5.0
Reply #129

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) {
    // ...
}


The first thing I noticed is the similarity with Common Lisp:
Code: (lisp) [Select]

(loop for unit in battle-units when (eql (unit-type unit) :enemy) do
   (do-stuff-with unit))

Cool.

I'm glad C# programmers get something like this. Why Microsoft didn't settle for filter/map/reduce methods, I'll probably never know. Haskell, ML, Common Lisp, Ruby, Python, Perl, JavaScript, Erlang, and probably a lot of others have had this sort of thing for a while, just under the admittedly somewhat intimidating name of higher-order functions.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #130
Eesh, Lisp code always makes my head spin.  I mean, I can kind of figure out what it does if I study it hard enough, but I don't find it intuitive to read at all.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Radnen's Sphere Studio v1.1.5.0
Reply #131
I'll definitely admit Lisp can be kind of write-only at times. There are good ways to right it and bad ways to write it. It also takes a lot of getting used to.

Controversial opinion: A language you can't write unreadable code in is a bad language. If a language doesn't give you freedom to write terrible code, it can't give you power to write beautiful code.

Anyway, the similarity just made me wonder if LINQ was inspired by Common Lisp's loop feature (which is both loved and hated among Lispers; I'm of the opinion it's pretty awesome).

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Radnen's Sphere Studio v1.1.5.0
Reply #132


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) {
    // ...
}


The first thing I noticed is the similarity with Common Lisp:
Code: (lisp) [Select]

(loop for unit in battle-units when (eql (unit-type unit) :enemy) do
   (do-stuff-with unit))

Cool.

I'm glad C# programmers get something like this. Why Microsoft didn't settle for filter/map/reduce methods, I'll probably never know. Haskell, ML, Common Lisp, Ruby, Python, Perl, JavaScript, Erlang, and probably a lot of others have had this sort of thing for a while, just under the admittedly somewhat intimidating name of higher-order functions.


That's kinda jQuery-looking to me.

Code: (javascript) [Select]
var enemyUnits = $(".battleUnits[type='enemy']").each(function(e,i){
    // ...
});


Granted, most of the jQuery I end up writing is still web-oriented but theoretically the library can be modified to work with more generic object models than the DOM, as previously shown with Prototype (Scrototype) and MooTools for Sphere.

Seems like y'all are starting to head towards a discussion of programming philosophy, which would probably be better suited to a separate topic unless it's directly related to Sphere Studio.

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.5.0
Reply #133

I see what it is, you're trying to manually search the "sounds" and "music" directories (the latter of which doesn't exist).  That's why I just had it search the whole project recursively, this way it picks up files whereever they happen to be.  The Sphere engine itself doesn't really care where you put stuff, so I figured the editor and plugins shouldn't either in most cases.


Luckily github has a history, so I can show you that it's not entirely my fault ( ;) ). You manually searched the sounds directory, I just added the 'music' directory. It so happens that the sounds directory was a standard sphere directory (one of the 7 created automatically) and so it's existence was (almost) guaranteed. See the history: here. It's the last time you touched the repo, perhaps you had made an uncommitted change?

So, I guess we make it check the entire project. It beats relying on the existence of directories the user may or may not have.

Anyways, try to refrain from making code changes right now. I want to upgrade the whole project to .NET 4.0, and try to get VS2012 installed. So this might take awhile. I said I was busy, but seeing as this is now the weekend now I can take a little more time to do this.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.5.0
Reply #134
That's odd, I know I originally had it explicitly search the sounds directory, but I could have sworn I changed that later in development... Oh well.  I think I must have had to revert my changes for some reason and then forgot to make the edit again.

But yeah, I'll leave the code as-is for now while you upgrade the project.  It'll give me a chance to do more work on Specs.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub