PDA

View Full Version : Beginners guide to preset writing (beta 1)

Rovastar
13th November 2001, 13:46
There has been a call for the new preset writers to have a detailed guide. This is unbelievably difficult because Milkdrop can do soooo much. And all the different variables have to be just right for it to look good. But I will do my best to explain a little. The below explaination will look a little like old geiss style effect but very basic.

First read Ryan milkdrop authoring guide in the help. There is a lot of useful stuff in there.

But the best thing to do is to learn what the sin, cos, and (to a lesser extent) tan and log equations do. These are used loads in this MD presets.

My initial advice is simple create a blank preset no zoom, no rot, no warp, no colours, etc, I have just created one for you. And

do the following

I will use zoom as the example

Zoom's normal value is 1 and small amounts of zoom are say 0.9 to 1.1
these look reasonable CHange the zoom yourself to find a nice range.
But this range
use the equation in the per-pixel.

zoom = 1 + sin(ang)/10

now see what that does and edit this line so it look like the following for example.

zoom = 1 + sin(-ang)/10
zoom = 1 + sin(1/ang)/10
zoom = 1 + sin(2*ang)/10
zoom = 1 + sin(3*ang)/10
zoom = 1 + sin(-2*ang)/10
zoom = 1 + sin(ang/2)/10
etc, etc (hopefully you get the picture)

Change the waveform for each of these.

then try the same equation with rad, x and y instead or ang. At mix these with time. Like 1 + sin(time*rad)/10.

Also try cos instead of sin. Maybe if brave try tan.
Divide by a different amount than say by 5 or 20 say. Or change the 1 at the start to 0.9 or 1.1 etc.
Try abs as we so you allows get positive values eg zoom = 1.1 + abs(sin(ang)/10).
ANd try - instead of + in the equation.

Then if you want to go crazy do something like

zoom = 1.12 + sin(-2*ang)/9 - cos(rad + (2*x-y))/11
or
zoom = 1 + sin(sin(time*rad)/10 - cos(x/y)/30
(Use with waveform 1 for a nice effect.)

See it isn't that difficult to get a nice effect.

Then do the same for rot (remove the zoom equation first) but with rot it is based around 0 not 1 so no 1+ at the start or us a smaller value like 0.2 or something.

Then maybe combine the two.

This is only a tiny part of this what MD can do it will not let you create anything like unchained presets.

Is this helpful? If it is I will write a more detailed guide soon.

Rovastar
13th November 2001, 13:53
opps did an Unchained and forgot the zip. ;)

unchained
14th November 2001, 00:11
But the best thing to do is to learn what the sin, cos, and (to a lesser extent) tan and log equations do. These are used loads in this MD presets.

When I have some time, I'll paste some stuff from my various math texts that explains these, and add some commentary. Ryan's guide covers sin() pretty well, at least as far as using it for setting a value to a given range over time, which is what you'd most often want to do in a preset. IMHO learning how sin() works is the single most important aspect of creating "interesting" effects. Read Ryan's guide over and over again until you understand at least that part, if nothing else.

zoom = 1 + sin(ang)/10

Just a comment: In the context of working with milkdrop, I tend to use multiplication by the reciprocal rather than division when I can. It just seems to me that

zoom = 1 + .1 * sin(ang)

helps to clarify intuitively that you're changing the value by a maximum of .1 Of course x/3 isn't the same a .3*x, but in most cases for working with MD it's good enough, as the computer's only going to perform up to some arbitrary level of decimal percision anyway.

In my experience, what you'll more often want to do is ADD the time, rather than multiply it. Where

1 + .1 * sin(time + rad)

will create an effect based upon the sin of the radius, that changes over time, like a ripple spreading inward/******d.

1 + .1 * sin(time * rad)

will create a situation where the value of the sin wave changes very fast at the outer edge of the screen, and not at all in the middle where rad=0.

It's VERY helpful, even to me, as it gives me a chance to clarify my somewhat fuzzy thoughts on the subject. You have NO CLUE how much I appreciate it.

Rovastar
14th November 2001, 01:06
It wasn't really written with you in mind Unchained your complexity of preset goes far beyond mine. But I am really gald you found it useful I must have done something right. It is more of a beginners guide. And to be honest just what I do when I start writing my presets.

Point taken about the /10 vs 0.1 debate - I have just got used to using the divide sometimes.

The time*rad thing was only one example I could put every one combination down - there are so many. (I actual just put a random symbol in there it could have been +,- or /) Good point about time+rad (or ang, x, y, whatever) though. The idea was 'don't be afraid of MD' you can put any old values in and see what happens. But adding time can have some great effects.

Who knows

probably could do something useful it is all about expermenting.

lol cannot beleive the lack of grammer and the missed out words in the guide. I was thinking quicker than I was typing.

More soon.

Illusion
14th November 2001, 10:09
This is just the kind of stuff I'm looking for Rovastar, much appreciated... do you reckon it's worth putting it into a .doc format, just so someone such as myself or SM can take a look at it and make suggestions or say what we don't understand. And people like you, unchained & Krash would be able to add anything that they thought might be useful? Then we could keep posting a better and updated help file each time there was an improvement, maybe zipped as I don't think the boards let you post .doc files??

Otherwise it tends to be split across threads and messages and is a bit difficult to read. If you could do this that would be excellent, I would be happy to help compile this as I think it would be very useful, so let me know when you have a more complete guide, and you can email it to me at phidj003@students.unisa.edu.au if you like as well. I think it could be worthwhile kind of integrating Ryan's help in so it flows too. I won't be looking at this much the next couple of weeks (exams), but if we could get some stuff together by the end of November, I reckon we could have a very good preset guide by Christmas :)

BTW, wonder if Ryan's planning any more updates to MD? Haven't seen him post anything anywhere for a while....

This is a little off topic, but anyway.. what do people think of Smoke (his new plugin)??

Krash
14th November 2001, 23:12
I think the most essential thing for any budding Milkdrop preset author to realise is that it involves alot of mathematics. You can just randomly put things in and possibly get a decent result, but if you actually understand what you're doing, you'll be able to get specific effects with relative ease. A background in programming doesn't go astray either.

So if you're looking throuhg the MilkDrop Preset Authoring Guide (Ryan's doc), and wondering what the hell it's talking about, go and get yourself a maths textbook. Any high-level high school text or a low-level university text would be fine. These books will go into way more detail than you really need to know, but they will have explanations of stuff.

It's important to learn exactly what a sine curve is, and how changes to various parts of the equation will affect that curve. The relationship between sin and cos should be understood - you have to realise that they are essentially the same, but at the same time you need to see that they are out of phase, and you need to know what this means.

You should understand the behaiviour of other curves too - tan curves, logarithms, squares, cubes, exponentials, etc. You need to learn what arcsin, arccos and arctan do.

All of this will appear in a decent maths textbook. Obviously, you don't need to know all of this for most cases - it's a very rare preset that uses more than one or two of these curves. But you should be able to use them if you need/want to.

It sounds like alot - and it is. To be able to get some of the very complicated presets, there is alot of understanding that's necessary. For a lot of the things MilkDrop can do, I wouldn't even attempt teaching to someone younger than 15 or 16. Even then, they'd have to be fairly proficient at maths to be able to grasp some of the concepts.

In short, you need to have a firm grounding in the basics before you can go getting complicated.

If you want some constructive help in getting particular effects, post in the "Post here if you want help" thread. If you want, you could pick an existing preset, and I'll walk you through replicating it, and try to explain things as I go along.

- Krash

Krash
14th November 2001, 23:41
I just had a good idea - why don't we (meaning the more experienced among us) make a list of a couple presets in order from least to mosth complicated, and then do walk throughs of how to reproduce them?

We could start with simple things like solar flare, and move on to different effects like bonfire, planet, etc, and then moving up to complicated things like dynamic swirls, dynamic borders, etc.
I don't think going as far as UNchained would be necessary - even I have trouble figuring out what he's doing sometimes - all those bors and bnots get me confused =]

- Krash

unchained
15th November 2001, 00:07
So if you're looking throuhg the MilkDrop Preset Authoring Guide (Ryan's doc), and wondering what the hell it's talking about, go and get yourself a maths textbook. Any high-level high school text or a low-level university text would be fine. These books will go into way more detail than you really need to know, but they will have explanations of stuff.

Or take a look at http://www.math.gatech.edu/~cain/textbooks/onlinebooks.html
where there is a collection of online math texts.

In particular, I'm a HUGE fan of "Basic Concepts of Mathematics" by Elias Zakon. Though written in the 1960s (actually, it's a compilation of prepared material that was never published before the author's untimely death), it includes just about everything you could possibly need to understand what milkdrop's doing. In particular, it has an EXCELLENT treatment of n-dimensional vector spaces. (ie. how to use simple algebra to work with geometric points) The name's a bit misleading, because this is hardly 1+1=2 stuff, this is the fundamentals that everything is built up from. There's plenty of diagrams and excersices too, and the PDF file printed up beautifully for me.

And of course, don't be afraid to ask for help on the hard stuff :)

Illusion
15th November 2001, 01:37
This all sounds like a great idea. What are your thoughts on posting it all as one file, which could be continually updated? I think it might be easier to follow for people like myself or SM if it had some semblance of order... which would be easier if it was kept all together.

unchained
15th November 2001, 03:54
a more convenient option for the time being might be to start a new thread, and those interested could use the "receive email updates to this thread" option way down at the bottom. That way we could keep the Q&A form of the content alive while building up our knowledge base without anybody having to compile and edit anything. If we used meaningful subjects in the replay, that would make a primitive sort of index, and could even be searched by the various engines that archive groups and junk like this anyway. (ex. google)[1]

(Sorry if this sounds like propaganda, but I'm highly in favor of generalized intelligent methods of data storage that are already extant over creating more work for people. We invented computers to work FOR US, and it's time we started forcing them to do it vs slaving to write their software for them and perform menial tasks that we DESIGNED THEM TO DO. (ie. all forms of text manipulation, distribution, archival and retrieval)

Yes, I'm a nutbar.

Love, Unchained.

[1] I have not personally verified this method, and if it should be found wanting for one reason or another I'm sure I could come up with something just as simple that would work.

Illusion
15th November 2001, 11:05
Yeah, that sounds fine unchained, I think we should keep a thread which is strictly MD help only, which hopefully follows some kind of logical order. Maybe you'd like to start it? ;)