Uses of skookumscript


#1

im a fairly new programmer, i decided that against all recommendations to learn c++ as a first language its been a couple of months since i started learning c++, I tried out blueprints i didnt really like it that much.
basically what im asking is

  1. If i am making gameplay that is heavily reliant on player input (e.g a combat system) would skookumscrpt be suitable for that, or would i have to use blueprints.
  2. Ai behaviours things like telling the Npcs to walk around and attack the player stuff like that, would skookumscript be suitable for that or would i have to use blueprints.

Basically im asking if skookumscript can do most of the things blueprints can, i really dont fancy the idea of drawing nodes. So can i use skookumscript and c++ as the primary way of making my games, limiting blueprints only to things its good at.


#2

Yes, SkookumScript is ideal.

Yup, SkookumScript is still great for that sort of a task.

SkookumScript can be used interchangeably with Blueprints. All the more than 1000 classes and 3500 methods in Blueprints are added to SkookumScript. If a function is added to Blueprints then it is automatically added to SkookumScript.

:ue4: expects Blueprints in a few locations in the Unreal editor. The initial nodes of these Blueprints can immediately connect to a node representing a call into SkookumScript and stay in SkookumScript from that point onward.

So you can do most things in SkookumScript and just have a few calls into and out of a few Blueprint nodes.


#3

thank you for the reply, i like the way you guys intereact with the community, is skookum on the ue4 marketplace yet? Also one more question you say that blueprint functions are also added to skookum, are skookum functions also added to blueprints.


#4

(Replying from a plane on return from GDC.)

Expected time for SkookumScript on Marketplace is on or soon after UE4.11 release which according to staff at Epic Games is March 28.

Examples of exposing SkookumScript functions to BPs can be found near the end of the page here - http://skookumscript.com/docs/integrations/ue4plugin/


#5

@melvinbengtsen

That’s basically exactly how I use SK. I use SK to write the high level code for things BP is bad at and where the sheer performance of C++ isn’t relevant(which is almost everything).

So on my current project it’s ending up like 80% SK 15% BP 5% C++

I think SK is really great at filling the gap between C++ and BP, I always wished Epic had included something else between the two, but the SK team gives really great support and commitment to the language which made me comfortable using it unlike a lot of the random lua/js/c# community plugins in UE4. Which not to knock those community efforts by any means, but even the best one isn’t up to the standard of quality that SK already has.


#6

@VolkerEinsfeld ah i see how that works, before i found skookumscript i had seen a c# mono scripting thingie and also i think a lua binding, You seem to have some experience using skookumscript, when working on your project(s) how is your workflow usually, lemme clarify do you start your project as a c++ project and then add in Blueprints and SK or start as a blueprint project and then add in c++ and SK. Aso do you have any examples of areas where you can say that skookumscript excels or blueprints excels. as i am yet to see any area where i would prefer to use blueprints


#7

I don’t think it’s specific to SK, because it works either way(C++ or BP project), but I personally start a C++ project(because I know I’ll usually write at least a little anyways). SK is an engine level plugin so it’s already present when you start a new project regardless of the type(if the plugin is installed).

So soon as I start a new project and open it, the SK IDE and workspace opens right alongside it automatically.

SK to me particularly excels in situations where you have concurrency and a need of coroutines. Having easy to use out of the box support for these concepts makes a lot of complex AI or world interaction mechanics extremely easy to code compared to C++, where you’d either need to write your own library, use a third party one, or painfully alter things to keep in lock step with the frame count otherwise. SK really makes long-running processes that happen in the world really easy to reason about.

BP to me is really good for “one offs”, I personally don’t want to code complex systems in BP, but I think BP excels at simple tasks or actor/object specific scripts in the scene/map. It’s often faster to slap a simple on_overlap BP onto actors than to code the equivalent in C++.

The other thing BP excels at is engine access, BP is the primary language of UE4 even if they don’t market it that way. Many systems have BP support before C++. Like if you’re touching the animation and matinee systems you want to use BP because using them via C++ is just a pita even if possible.

Those are really the major areas I use BPs in.


#8

@VolkerEinsfeld that was what i was suspecting just needed confirmation, sorry if im becoming a pain in the a** but one more question.Have you experienced anything where using skookumscript instead of say c++ has drastically reduced performance??


#9

If you try to use :sk: to do a lot of number crunching like ray casts or a physics system - that would bog things down. It is designed for the high-level stage direction, events, AI, gameplay, logic, etc.

In some instances :sk: actually can make code faster than C++. For example some sort of test that can be spread over time because it only needs to be human-speed - way easier to do in SkookumScript than C++. And not calling code at all is the best optimization.

loop
  [
  expensive_test()
  _wait(.3)
  ]

Boom! Call spread out over time so it is only called once every third of a second.


#10

ohkay thanks, oh in one of your videos i heard something about routines i think they were called however i cant find any documentation on em


#11

As Noolarch said, for anything where you’re interacting with the physics system SK(and BP, and basically any High level language for the most part), is a bad choice. Those instances are basically where I still use C++.


#12

There are two types of routines in SkookumScript:

  • methods - functions running on objects that evaluate and return immediately. Methods can only run other methods (_or coroutines wrapped in a branch command).
  • coroutines - functions running on objects that may take more than one frame to execute (like pathing commands) and their names start with an underscore _. Actually more sophisticated than standard Computer Science definition of coroutines, though closest term out there. Coroutines can call either other coroutines or methods.

We just group them together under the term “routines”. You may also hear: subroutines, commands, or calls - we are trying to call them “routines” to be consistent.


#13

@Noolarch and @VolkerEinsfeld i think that settles all my questions (for now) thank you.
i might get the SK beta soon to test it out for myself