Search Unity

Unity's Image Effects as C# ?

Discussion in 'General Discussion' started by hippocoder, Sep 20, 2013.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi,

    I'm having to convert unity's default js scripts for image effects to c# - ie the editor scripts. This causes longer compile time and (AFAIK) a 2mb bloat when exporting due to the boo lang stuff.

    Do you think its wiser that all scripts are by default c# as this results in a smaller footprint for everyone using c# and also the post fx stuff is pretty highbrow enough that js users probably wouldn't mind if they were c# - you'd need to know your way around pretty well to modify them.

    In any case having to port them manually for new projects to keep compile times quick and so on.

    I respect people's choice in using Boo or JS - I'm just saying that unity will be more efficient for the majority and see no change for others if the scripts are natively c# for the unity stuff.
     
    CharlieSamways likes this.
  2. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I think Unity is moving to C# for all there stuff, though I guess its only new stuff?
     
  3. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    Just trying to follow how you phrased this. If you stick to C# for scripts, it can reduce how big the deliverable exported package ends up, but including JavaScript or Boo increases the deliverable. Am I reading you right?

    This kind of makes sense, but I'd still rather stick with Boo for its similarity to Python. Since it looks like Unity can't really tell if a script is JUST an editor script or merely has editor-sensitive functionality, this probably means all the editor scripts and artwork gets bundled into the deliverable package. Is there a way to flag certain stuff as definitively NOT INCLUDED in the runtime?
     
  4. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    938

    If a script is within a folder that's called "Editor", it will exclude these scripts from the build. This is where all your editor-related scripts go.
     
  5. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    I've been requesting this for some time. Its a real pain for C# developers to have to suffer the addition of JS scripts from image effects.

    Obviously we can port the scripts to c#, but then you might have to do this for every dot release, depending upon the level of changes made by Unity, plus of course it means you've got many developers doing the ports, where as Unity could just do it themselves and save everybody the time. Its also been suggested that perhaps a community based system of having the image effect scripts on git or similar, so that we can maintain a c# version, but that still means someone has to update them every time Unity makes a change that affects the scripts.

    The best course of action would be to provide two code path versions of the image effects, but I suspect that Unity would be against that as it increases their workload.
     
  6. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    This, a million times this.

    All image effects should be in C#, or at the very least Unity should give us the option of language we want them in.
     
  7. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Concur. They should be in C#.
    Gigi
     
  8. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    607
    agree +1
     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I only wish I had more hands, so I could give this suggestion four thumbs up. :)
     
  10. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Yes, C# please.
     
  11. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    +1 for Csharp.
     
  12. kor

    kor

    Joined:
    Oct 29, 2009
    Posts:
    122
    +1 for C# Image effects please.
     
  13. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    +1

    I'm willing to finance so long as the price is reasonable.
     
  14. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    This is particularly relevant at the moment with everyone trying to convert projects to the new Windows platforms that don't allow the JS scripts... I'm trying to figure out how to replace the effects in Requiem Z right now and didn't fancy trying to convert the JS scripts to C# :(
     
  15. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    They don't?
     
  16. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    When you submit Windows Store apps, they have to pass Microsoft's "WACK" tests. If you have UnityScript or Boo scripts in your project currently, the project will fail the tests and can't be submitted to the store. So, image effects have to be removed - at least, the UnityScript ones do.
     
  17. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Yeah; I wish all the default scripts Unity provide would be written in C# - I'd love to get rid of all the JS dependencies we have in our projects.
     
  18. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    I wonder if Unity have options so this is possible:


    - I'd like an option to remove all the C# scripts from my project and use BOO fully.


    - I'd like an option to remove all the C# scripts from my project and use JS fully.



    :cool:
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hate being a language Snob, I'm all for freedom of expression and programming is very much a creative thing at the Unity level where you are scripting gameplay most of the time.

    However this is a concrete example of Boo/JS harming C# where C# does not harm Boo/JS. Therefore these scripts ought to just be supplied in C#.
     
  20. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    I think this is a matter of Microsoft's business rules harming the developers. It's funny since they were all about .NET supporting multiple languages.
     
  21. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Ive always wondered why unity supplied scripts are js
     
  22. TheMcGivvern

    TheMcGivvern

    Joined:
    Apr 3, 2013
    Posts:
    7
    I had a go at translating the entire Image Effects Package. Check out my thread here.
     
  23. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    +1
    They should probably provide these packages in both JS and C#.
    But having to deal with this half-arsed mix is a pain in the butt.
     
  24. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    Don't like C# at all. To start with writing an f after a float number is totally counterintuitive. I like the bracketing in .js..It allows me to swiftly parse any script easily. I see alot of total messes in C# when I get client projects the former dev did not finish with functionality scattered across multiple scripts with super this and namespace that and unnecessary esoterica bogging the understanding of the framework down to the ground.. I have the notion it is due to MS taught coding patterns meant more for business applications. Keep the .js. I have thousands of helper scripts and dozens of frameworks written in .js. I can write and parse .js in my sleep. Add C# for those needing it but stop trashing the .js devs with selfish calls to remove it.. I will go on a rant and get booted:D. I stayed away from here for months due to arguing about this previously. It cuts into my workflow and money per hour per task. YMMV.
     
  25. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
  26. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Not sure where you saw me demand removal of js. Read then rant. ;)
    I just want Unity to be consistend with what they sell to their customers. Providing standart assets scripts both in js and C# seems only fair. Then its up to the customer to decide what to pick up.
    But again - this mix does not help any side. As both will have to deal with the respective evil alien language they oh so hate.

    nice picture btw.
    I feel rewarded for being able to correctly use a search function. This was your intention. No?
     
  27. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    Hi Marco.. Not you specifically..heh..Just take a gander through the thread and you will see folks saying ONLY C#. This is always occurring here and it gets under my thin skin as you do not see the reverse nor do the folks asking or demanding such take into account others do not wish use to nor even like C#. I come from a 15 year background in javascript and actionscript doing RAD (not webpages). I can write C# but have to review often at MSDN. I do not even have to refer to the docs when writing unityscript. I can do it in my sleep..and have:) When I get paid via fixed price contract I lose dollars per hour under a C# paradigm. And frankly I have never run into a situation in 5+ years that UnityScript could not handle so I don't get the "it is inferior" routine. Like I said..I think alot of the C# only folks come from a business or server side coding background or are strictly Windows platform users. I have been on macs since 1993. I ain't gonna change that anytime soon. I also use UnityScript with all kinds of packages that use C# so I don't get the "incompatible" routine either.

    Again Marco.. My song and dance is not directed at you. It was just a general shot in the air. Folks should be more considerate of others in their community. If they had their way I would have to trash/rewrite over 2000 scripts I can repurpose for the latest contract or project I am working on.

    Best Regards
    Randy