• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Snippets vs. Spells vs. Systems - Where's the Line?

Status
Not open for further replies.

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,504
I recognize that this question might have no true, objective answer. But heck if that'll stop me from asking. : )

~~~

Basically the title: What is the difference between a Snippet, a Spell, and a System? Is there a strict, definable line which delineates these things from each other? If not, why not? Of all fields, coding/computer programming seems like the one to have clearly stated & objective definitions for classifying things; is it a matter of "lines of code" or how many dependencies a thing has? Is it rather a more subjective look at the overall 'length & complexity' of a piece of code?

Thoughts & debate are much appreciated.
 
I think that

System:

It usually runs in the background, and is not designed (scripted or coded) to be understandable to the user (consumer).

Spells:

These things are designed to be configurable and readable to the users (consumers). Thus, it is very easy to implement to a certain map.

Snippet:

It is like a system, except that it denotes light-weightedness in coding and it can easily be coded by a user.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
I think difference of spell and system is quite obvious. While snippet is piece of codes that doesn't need to be demonstrated with a map file because it has straight forward and self explanatory purpose. But attaching map into a snippet resource is not wrong as well, it helps mods to test whether the snippet works properly or not.
 
I think systems tend to work internaly some more with data, next to just input/output: UnitIndexer, Missile, Damage Detection

Snippet is for me something like a collection of functions that have a certain purpose. You call them, get your result, and are happy. PlayerEvent, ArrowKeyEvent, GetZ, GetUnitScale

I think snippets can also work internaly by themselves, but it shouldn't be the major part. Their work is mostly used to provide the correct result, but not to do extra work with data.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
imo, (which is always the best :p)

Systems are pieces of code that dont really do something by themselves, they just provide easy-to-implement functionalities so you (as map creator) can use them to create your desired effect.
Systems would be a buff system, damage (detection) system, missile system, ui system, etc.
They could handle data structure, deal with life cycles, provide some events, etc, etc, etc.

Spells are basically showcases of what you could do with whatever is used by that spell.
Spells scale from something like holy bolt to whatever Tank-Commander comes up with.
They should (for user friendlyness) be easy to import and have some configuration to make it fit for your needs.
(This doesnt mean it is necessarily required, but to make it good and have it approved, you should definately have it.)

As spells' size can vary between that holy bolt and something like this, systems can also scale from almost nothing to a full 20k line jass abomination.
However, when a "system" can be implemented as one (or a few) function(s), then it is ussually called a snippet. (A small piece of X.)
For example, a function that checks if said coordinates are within a rectangle, or a few functions to deal with angles, timing, maths, etc.
When these snippets are piled up in one large file/trigger, it is ussually called a library. (Which systems are also called sometimes.)
 

AGD

AGD

Level 16
Joined
Mar 29, 2016
Messages
688
For me

Snippets - "Custom functions". They only do things when their functions are called. Some good examples that I can think of are linkedlist, alloc libs, and other data structures, Table, etc.

Spells - systems whose purpose is to be implemented as unit ability extension that is triggered upon certain unit events such as spell events, item use events, or those passively attached to certain units.

Systems - "Automated scripts". They run their core tasks in the 'background' automatically. They usually handle the game's balance and safety, and the game in general.
 
Status
Not open for further replies.
Top