1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Group up and create a Warcraft hero based on a member of the Hive and win up to 100 rep and a rank icon. Enter the team contest now!
    Dismiss Notice
  3. The results for Mini-Mapping Contest #14 is up! Congratulate the winners here!
    Dismiss Notice
  4. The Concept Art Competition #10 has come to an end. Check out the results!
    Dismiss Notice
  5. Paired Modeling/Texturing Contest#3 has finished. Check out the results!
    Dismiss Notice
  6. The Music Contest #9 - Steampunk has begun! Tell the nearest aristocrat, aviator or adventurer.
    Dismiss Notice
  7. The rewards for the 27th texturing contest have been upped and deadline extended. Enter now to win the new cash price.
    Dismiss Notice
  8. The [$100 Prize Pool] Special Melee Mapping Contest - Results are out! Congratulate the winners!
    Dismiss Notice
  9. We need your help nominating resources for or next YouTube video. Post here now.
    Dismiss Notice

This Summer in Wurst

Discussion in 'Latest Updates and News' started by Cokemonkey11, Nov 15, 2017.

  1. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,074
    Resources:
    16
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    7
    Resources:
    16
    [​IMG]

    Hello! This is the first issue in a regular series of news posts about wurst and the wurstscript community. Actual years have passed since we last summarised wurst-related content for hive workshop news, so keep in mind that this is a very sparse summary, whereas our future news posts will more densely discuss current events.

    Background on wurst: wurstscript is a programming language that compiles to JASS, and is developed alongside a suite of tools for a coherent development experience. It can even work alongside maps written in vJass. A usual workflow looks like this:
    • Design a terrain in a world editor (vanilla editor, WEX, or anything really)
    • Define objects, either using the object editor, or using the wurst “objectediting” subsystem
    • Write scripts, get instant feedback, and compile & build in the lightweight vscode editor
    • Check in your code to version control
    Unlike vJass, wurstscript is a higher level programming language with a strict type system and a powerful optimiser. The result tends to be shorter code written quicker, without any sacrifice to performance.

    So, what’s changed recently?

    The Wurstscript community has been steadily active with frequent and regular changes, not only in the Wurstscript language, but across the whole map editing toolchain.

    Wurstscript has found its niche as the toolchain that aims to maximise productivity and consistency of the development experience, without sacrificing quality.

    The maintainers of Wurstscript are typically programmers first, and mappers second. Sadly, time constraints mean that we’ve not spent much time publicizing our progress for the larger modding community. This is something we’re keen to change, with more frequent curated summaries of what’s going on in our bubble.

    With that context in mind, we hope this will be the first of many “Best of the Wurst” recap posts, wherein we highlight major changes - certainly more frequently than once every three years. There are too many changes to count, so in this post we’ll discuss some of the changes made just this summer that we’re excited about.


    GUI tool for compiler updates and map project setup

    [​IMG]

    Probably the most major development this summer is a new tool for maintaining your installation of wurst, bootstrapping new map projects using a template and importing existing projects.

    This tool maintains a global instance of the wurst compiler, automatically updates it, and can generate & update projects in a way that’s friendly for version control repositories as well as the vscode plugin.

    The key point here is that we’ve done some refactoring of the wurstscript project structure to make wurst play more nicely and consistently with vscode. With the addition of dependency management and template projects, we envisage great strides in productivity as the project template (or templates!) progress.


    New runmap/run-arguments design, with readonly terrain mapfile

    Alongside great improvements to the JMPQ3 library, wurst now accesses your map project as a read-only archive file. Instead of overwriting it (as done traditionally), the compiler now writes built mapfiles out to a separate
    _build
    directory. This has tremendous gains, including:
    • Map files can more safely be version controlled since they’re accessed read-only by the wurst compiler.
    • In the extreme case, alongside native objediting, you can maintain your map end-to-end using your checked-in mapfile only for terraining purposes.
    • Better integration with existing maps that have JASS/vJass, because wurst can reuse the existing map script without mutating the source file.
    • Building and compiling wurst maps is now done independently in vscode by default - thus there is no need to use a custom editor (apart from for terraining) or even have warcraft3 installed at all.
    Map metadata in
    wurst.build


    [​IMG]

    The overall structure of a wurst map project has changed, and now comprises two new metadata files:
    wurst.build
    and
    wurst_run.args
    - the first providing build artifacts, and the second for passing arguments to the wurst compiler.

    One advantage of using the
    wurst.build
    file is that consistency is maintained from build to build - dependencies are segregated, and maintaining library code can be more modular and convenient.

    Another advantage is that the world editor is no longer needed for some metadata like the map's name, description, author, etc - that metadata is sourced from the build file and injected into the final map.

    The setup tool also interacts with this metadata by importing the
    wurst.build
    file, thus updating the project's dependencies to keep the standard library and other used packages up-to-date.


    New docs and website, at a new address

    Documentation and tutorials for wurstscript now live at wurstscript.github.io - a new landing page which we believe provides a much more consistent and attractive experience for consuming wurst. We’re encouraging community-written tutorials, and indeed the Wurst for vJass Users is one such tutorial.

    Take a look here as well for the wurst setup tool mentioned above!


    ...And more

    As a lightning recap of the last few years, here’s more:
    • Vscode plugin and workflow, which deprecates the Eclipse plugin and workflow.
    • New Github organization - refeactoring work to split up repo; now using gradle for dependency management.
    • Wurst standard library v2 now active and de facto standard.
    • Improved JASS compliance in Jurst (the vjass-friendly wurst dialect).
    • Compiler performance and RAM usage improved.
    We hope you’ll find this summary informative. Please do give us some feedback as we plan to write curated content like this more frequently in the future.

    As usual, we chat all things wurst at the #inwc.de-maps IRC channel.

    Thanks!
    --
    @Cokemonkey11, @Frotty, and @peq




    WurstScript - Blog - Getting Started
     
    Last edited: Nov 15, 2017
  2. IcemanBo

    IcemanBo

    Code Moderator

    Joined:
    Sep 6, 2013
    Messages:
    5,263
    Resources:
    19
    Maps:
    2
    Spells:
    11
    Template:
    1
    Tutorials:
    3
    JASS:
    2
    Resources:
    19
    It's awesome to push Wurst with more publishing. Thumbs up, and I would follow also more of these. First, it's nice to get the technical background in short, but maybe there can also be a tiny wurst example in the future planned events to directly demonstrate its power in practice. Maybe just as gimmick at the end of the news, after showing the changes/features.

    Is it planned to push resources on hive here, too? I realized just now that there's not too much information at the moment directly in the section. If it's useful we could put there a sticky, too, with general links, or information.
     
  3. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,074
    Resources:
    16
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    7
    Resources:
    16
    That forum predates git-based artifact management and the (now quite mature) standard library.

    What I would like to see on THW, however, is spell submission written in wurst.

    About code snippets: yes, definitely, that's a fantastic idea. Maybe a little "Wurst snippet of the month" in each blog post, at the bottom.
     
  4. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,097
    Resources:
    9
    Models:
    3
    Tools:
    1
    Maps:
    3
    Tutorials:
    1
    Wurst:
    1
    Resources:
    9
    [​IMG]

    @IcemanBo sure, submissions in that forum could be for more specific scripts that don't fit the standard library.
     
  5. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    7,838
    Resources:
    84
    Models:
    61
    Icons:
    20
    Packs:
    1
    Tutorials:
    2
    Resources:
    84
    I used to be naysayer for all things new (with wc3 being so old), but ever since I realized how amazing Wurst is, I decided to dedicate the rest of my wc3 days to it. I think anyone who doesn't at least try it is missing out a LOT. If you believe your favorite library won't be on it - please do realize that the standard library has most standard functionalities anyone would want, and it is so easy to code in wurst that you can recreate anything you need.

    Wurst per se doesn't make anything that was impossible possible - but it makes things practical. If you've ever had an idea that you've deemed to impractical to do in wc3, try it with wurst, I am sure a lot of them will become pretty simple!
     
    Last edited: Nov 17, 2017
  6. Regno

    Regno

    Joined:
    Sep 16, 2016
    Messages:
    71
    Resources:
    0
    Resources:
    0
    Frotty told me about Wurst... soon one year ago? 7 months? Anyhow, it was quite a long time ago and I've consistently used Wurst since then. And trust my words, I am NOT disappointed.

    Keep up the good work on Wurst
     
  7. kantarion

    kantarion

    Joined:
    Oct 18, 2015
    Messages:
    34
    Resources:
    0
    Resources:
    0
    I have 0 knowledge about proramming . My question is :

    1.This is wc3 related right?

    2.What benefits this brings for warcraft 3 in practice (plz be specific and short,sorry but tnx)
     
  8. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,074
    Resources:
    16
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    7
    Resources:
    16
    Hi, thanks for the comments!

    Yes, it's relaetd to wc3 custom maps specifically.

    Wc3 custom maps use "custom scripts" (triggers) to change gameplay. Wurstscript lets you do more stuff, faster, using programming.
     
  9. Regno

    Regno

    Joined:
    Sep 16, 2016
    Messages:
    71
    Resources:
    0
    Resources:
    0
    I will go ahead and ask a question too, then;

    If beginners find using Wurst is hard, is it possible to contact anyone of you personally and chat, for guidance and support? The IRC channel?
     
  10. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,097
    Resources:
    9
    Models:
    3
    Tools:
    1
    Maps:
    3
    Tutorials:
    1
    Wurst:
    1
    Resources:
    9
    The IRC channel is good for wurst related questions and usually the quickest way to get a reply. Most active wurst users reside here to chat and we are always happy to welcome new people.
    However it is not the place to be taught wurst/programming step by step, or however intricate you expect "personal guidance" to be.

    Sadly there aren't any tutorials teaching wurst to beginners without prior programming knowledge, and I don't know any good Jass tutorials I could recommend.
    We want to have such tutorials, but it takes a lot of time and effort to create them.

    Maybe specify what exactly you're looking for and just stop by the channel.
     
    Last edited: Nov 22, 2017
  11. kantarion

    kantarion

    Joined:
    Oct 18, 2015
    Messages:
    34
    Resources:
    0
    Resources:
    0
    Tnx for answers but i got more questions . Along with the triggers, is it possible to improve how Wurst is reading for example warcraft 3 tilesets in custom map ?
    For example regular wc3 tiles are made of 32 square samples (usualy 64x64 samples on 512x256 wc3 tileset plane, but i use 128x128 samples on 1024x512 tileset plane)...
    Lets say my goal is to clone 512x512 pixels sample image by aligning every 128x128 square inside it to be tileable (share same edge) + in artistic way i acomplish almost identical look from 512x512 sample . But theres a problem : Meele maps will read every 128x128 square randomly (i lose original square order) and in World Editor its painfull to draw whole map and search samples to clone original source .
    In 1 sentence : is it possible for custom map to program it to read 512x512 or 256x256 tile sample as a whole image on a 1024x512 wc3 tileset panel (plane)
    P.S Sorry i am lunatic for this area...
     
  12. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,097
    Resources:
    9
    Models:
    3
    Tools:
    1
    Maps:
    3
    Tutorials:
    1
    Wurst:
    1
    Resources:
    9
    I'm still not sure what you're asking for - You can't change wc3's load mechanisms without dll/exe hacks which need to be present on every players' wc3 installation.
    In any case, I don't think this is related to Wurst at all.
     
  13. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    7,838
    Resources:
    84
    Models:
    61
    Icons:
    20
    Packs:
    1
    Tutorials:
    2
    Resources:
    84
    Wurst is a programming language, and as such it allows you to code things that jass can do - just better, as well as providing compiletime capabilities that allow you to quickly create new object data through program code.

    Wurst can't help you with tilesets.
     
  14. kantarion

    kantarion

    Joined:
    Oct 18, 2015
    Messages:
    34
    Resources:
    0
    Resources:
    0
    Guys huge tnx for explaining,responding and providing me with info . Goodluck in future work :)
     
  15. Arsenal

    Arsenal

    Joined:
    Nov 3, 2017
    Messages:
    7
    Resources:
    0
    Resources:
    0
    Damn read about this, but why did not understand how to use it (((:)(
     
  16. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,097
    Resources:
    9
    Models:
    3
    Tools:
    1
    Maps:
    3
    Tutorials:
    1
    Wurst:
    1
    Resources:
    9
    Are you missing programming experience in general or did you have problems setting it up?
     
  17. Arsenal

    Arsenal

    Joined:
    Nov 3, 2017
    Messages:
    7
    Resources:
    0
    Resources:
    0
    Well, most likely the experience is not enough, so I'm writing on the normal JASS code freely and without problems, but it became interesting and tuned everything but did not understand how much to use, how the code executed in Visual Studio will reflect on my map
     
  18. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    7,838
    Resources:
    84
    Models:
    61
    Icons:
    20
    Packs:
    1
    Tutorials:
    2
    Resources:
    84
    To put it in simplest terms - the code you write in VSCode is going to be added to the map and executed much like it would in the trigger editor or vJass.

    Here's some examples:

    Code (vJASS):
    function InitTrig_SomeTrigger takes nothing returns nothing
        call DoSomething()
        call DoOtherThing()



    In ordinary jass, this is the initialization block that is run when you add the trigger script to your map.

    Code (vJASS):
    library SomeLibrary initializer Init

    private function Init takes nothing returns nothing
        call DoSomething()
        call DoOtherThing()


    This is how you'd do it in vJass.

    Code (vJASS):
    package SomePackage

    init
        doSomething()
        doOtherThing()


    And this is how it is done in wurst. The only major point in how the code is executed (that should concern you at this point) is that you should know that the init block is executed much like the init block of the
    function InitTrig_TriggerName takes nothing returns nothing
    or
    library SomeLIbrary initializer Init
    would but, this is not a trigger script in WorldEditor, it is an actual file called SomePackage.wurst that's put in your project folder.

    Another great thing about wurst is that you can have as many init blocks as you want, meaning that this is legit:

    Code (vJASS):
    package SomePackage

    init
        doSomething()
        doOtherThing()

    init
        callSomeOtherThings()


    But more importantly most of the time you want to do this if you are making object data as well:

    Code (vJASS):
    package SomeObjectGeneratingPackage
    import ObjectIdGenerator
    import UnitObjEditing

    constant UNIT_ID = compiletime(UNIT_ID_GEN.next())

    @compiletime function initialize()
        if compiletime
            new UnitDefinition(UNIT_ID, 'hpea')
            ..setName("Other Peasant")
        else
            doOtherThing()

    init
        initialize()


    This means you can have one script, that runs your code ordinarily as you write it, as it would in other init blocks, but also generate object data that you can type inside the code. The code you just read creates a new unit in object data, called "Other Peasant", that is in every other way exactly like peasant (except having a different object Id).

    While things like these were possible with vJass to some extent, it was never really handy, and the interaction between LUA and JASS was actually very poorly integrated.

    If you just want to create ordinary, good old triggers, here's how you can do it in wurst, in a way that resembles how you'd do it in vJass or JASS:

    Code (vJASS):
    package SomePackage

    function action()
        print("Hey, this building just started getting built!")

    init
        let trig = CreateTrigger()
            ..registerAnyUnitEvent(EVENT_PLAYER_UNIT_CONSTRUCT_START)
            ..addAction(function action)


    But wurst also allows you to do this, since it can use anonymous functions/closures:

    Code (vJASS):
    package SomePackage

    init
        let trig = CreateTrigger()
            ..registerAnyUnitEvent(EVENT_PLAYER_UNIT_CONSTRUCT_START)
            ..addAction(() -> begin
                print("Hey, this building just started getting built!")
            end)


    One of the biggest advantages of wurst is that it limits your ability as a programmer way less than other languages do, since it is a properly designed programming language. But also, if you're bad at programming or want to stick to wc3 ways a lot - you are allowed to do that. Not encouraged, as there are some differences, but wurst is way more limited by your abilities and knowledge, than it is by the language design.

    Any code you write in wurst is going to be added to your map's existing code, meaning you can still have GUI triggers up, as well as ordinary jass, and then use wurst to add more code, but it is kind of hard to make them interact, one of the greatest strengths of wurst is that it uses a full integrated environment on its own which, along with it being a compiled language, can give you way more useful feedback while you're working.

    This is a essentially a rundown on how the init block (the point at which wurst code STARTS interacting with your map) works as compared to jass and vJass. Making a new file in wurst (for this package called SomePackage.wurst) in your map project folder, will make it behave much like you'd expect a "trigger" from the WorldEditor (obviously I don't mean the
    trigger
    object, but the whole "script" as a trigger. If you have any other questions, feel free to ask. You can also look at the beginner's guide.
     
    Last edited: Nov 25, 2017
  19. oger-lord

    oger-lord

    Joined:
    Jul 24, 2006
    Messages:
    151
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
  20. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,219
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Awesome writeup! Super happy that you guys moved away from Eclipse. It was a lot of bloat to install for one portion of modding, and a little tricky to set up (at least when wurst first came out). The progress that you've all made on it is amaazing, seriously.

    I'm really curious how this works for cross-platform now that you guys have your own java mpq lib. I'd be happy to be a guinea pig for mac. :) Gonna try this out as soon as I can!