Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879763 Posts in 33004 Topics- by 24378 Members - Latest Member: ProjectAce

May 24, 2013, 09:37:32 PM
TIGSource ForumsDeveloperTutorialsRequest a Tutorial
Pages: 1 ... 17 18 [19] 20 21 ... 33
Print
Author Topic: Request a Tutorial  (Read 89939 times)
Glyph
Level 6
*


Your ad here


View Profile
« Reply #270 on: September 30, 2009, 04:52:33 PM »

I'm requesting an explosion sound effect creation tutorial. I know only of one, only one!

PS: oh silly me, I already requested that and totally forgot about it. Well, this one is more specific at least.
sfxr has worked nicely for me in the past. I just click until it sounds right, heh. Not sure if you're going for a very high-end sound or not, though.

--
I have a question of my own. Anyone know how to do permanent, unchangeable (or at least largely so) file writing, like perhaps saving to the registry, in Game Maker? Is there a tutorial of some sort?
Logged

Feel visible matter...
Feel invisible matter...
There is life everywhere...
Craig Stern
Level 10
*****


I'm not actually all that stern.


View Profile WWW Email
« Reply #271 on: September 30, 2009, 06:55:24 PM »

make sense? For an example, try making a program that prints out random numbers, and try a few specific seeds (1, 2, 7, whatever) and then try seeding with time(0).

Well, that makes sense, but I'm actually more interested in knowing how to reliably generate the same series of random numbers from a seed, rather than generating the seed itself. (I probably wasn't very clear about that.)
Logged

Aquin
Level 10
*****


Aquin is over here.


View Profile WWW Email
« Reply #272 on: September 30, 2009, 09:19:25 PM »

Craig... that doesn't make much sense to me.  Just reseed the random and you'll start getting the same numbers over again. 

Unless I'm missing something here....

As for the permanent file writing... um, geeks tend to not like that.  Using the registry is probably your best bet though.
Logged

I'd write a devlog about my current game, but I'm too busy making it.
ChevyRay
Guest
« Reply #273 on: September 30, 2009, 11:23:45 PM »

I have a question of my own. Anyone know how to do permanent, unchangeable (or at least largely so) file writing, like perhaps saving to the registry, in Game Maker? Is there a tutorial of some sort?

Using a Checksum (or Hash Sum) is a good way of doing this, to avoid using encryptions (which are often easy to crack anyways). Writing a good checksum is a tricky thing, though, and knowing how to write them so that even barely significant changes yield frighteningly different encryption values in the worst of cases can be hard.

I haven't written any good ones that I have saved away, and I'm kind of out of Game Maker mode right now Sad so I won't be able to write you one. Googling lots will yield some good pseudocode results, I'm sure though.
Logged
allen
Level 10
*****



View Profile WWW
« Reply #274 on: September 30, 2009, 11:52:32 PM »

to simply write to the registry do something like this:

Quote
registry_set_root(0)
// root 0 is hkey_current_user/root 1 is hkey_localmachine (i think)/i forgot root 2/root 3 is hkey_users
registry_write_string_ext("key","name", string)

don't forget registry_exists_ext(key,name) and if else blocks, etc-which you should know that already.

Chevy's idea is good but too much work. come up with some creative reg names and no one will find them without a bit of work.

just open up a blank script file or whatever and type reg in it and look at the code shortcuts in the box in the same window. it's too simple so you should have no problems.
Logged
dchurch24
Level 0
**


View Profile Email
« Reply #275 on: October 06, 2009, 01:17:28 PM »

Hi all,

I'd love a tutorial on creating a scrollable viewport in c# using SDL.Net.

Logged
Jared C
Level 10
*****


hostess with the mostess

jaredsgems@aol.com
View Profile WWW
« Reply #276 on: October 07, 2009, 04:51:20 PM »

I request a tutorial covering Actionscript 3's physics library, Box2D.
Logged

John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #277 on: October 07, 2009, 04:54:42 PM »

Okay, I'll do one after TIGJam. Remind me.

Or maybe during TIGJam. Maybe.
Logged
ChevyRay
Guest
« Reply #278 on: October 07, 2009, 04:57:43 PM »

to simply write to the registry do something like this:

Quote
registry_set_root(0)
// root 0 is hkey_current_user/root 1 is hkey_localmachine (i think)/i forgot root 2/root 3 is hkey_users
registry_write_string_ext("key","name", string)

don't forget registry_exists_ext(key,name) and if else blocks, etc-which you should know that already.

Chevy's idea is good but too much work. come up with some creative reg names and no one will find them without a bit of work.

I think it's fun Shrug a good challenge, and you learn some valuable things. It's not too hard once you know what you're doing Smiley
Logged
Craig Stern
Level 10
*****


I'm not actually all that stern.


View Profile WWW Email
« Reply #279 on: October 08, 2009, 12:20:27 PM »

Craig... that doesn't make much sense to me.  Just reseed the random and you'll start getting the same numbers over again. 

Unless I'm missing something here....

Right--forget seeding for a sec. How does one write the random number generator itself? From this article I read on the creation of Elite, I gather that you want to write a "Fibonacci-derived mechanism." I can conceptualize it in my head, but I'd like to see how it gets implemented in code.
Logged

Sam
Level 3
***



View Profile WWW
« Reply #280 on: October 25, 2009, 10:23:56 AM »

Right--forget seeding for a sec. How does one write the random number generator itself? From this article I read on the creation of Elite, I gather that you want to write a "Fibonacci-derived mechanism." I can conceptualize it in my head, but I'd like to see how it gets implemented in code.
A linear congruential generator is your best bet.  Wikipedia

I recently made a simple one in Actionscript:
Code:
package 
{
/**
* ...
* @author Salt
*/
public class rng
{
//this is a naive implementation of a Linear Congruent Generator.

private var _seed:int;

//m > 0
//0 < a < m
//0 < c < m
//0 < seed < m

//m determines the number of possible results the generator can give.
private const m:int = Math.pow(2, 12);

//a-1 should be divisible by all prime factors of m
//if m is a multiple of 4, then a-1 should be a multiple of 4
private const a:int = 17;

//c should be a coprime with m
private const c:int = 3;         

public function rng()
{
_seed = int(Math.random() * m);
}

public function set seed(val_:int):void
{
if (val_ >= 0 && val_ < m)
{
_seed = val_;
}
else
{
trace("rng.as tried to set a seed outside valid range.", val_);
}
}
public function giveNumber():Number
{
_seed = ((a * _seed + c) % m);
return (_seed / m);
}
}
}

The trick is picking good value for the constants M, A and C.  Poorly chosen values will cause it to produce only a few potential numbers, and they'll repeat in an obvious pattern.  Even the most carefully chosen values will inevitably result in repeats, but you aim to have that happen after a few hundred thousand iterations rather than half a dozen.

Many languages/libraries/whatever will have their own random number generator, and most will let you seed it yourself (often it'll be automatically seeded with the current time to be "random".)  Flash is one of those that doesn't let you seed its RNG, and the documentation doesn't reveal how it generates its results.

I actually initially seed the above random number generator using the built-in Math.random() function.  But if I manually seed it with (for instance) 123, its giveNumber() function will always produce:
0.51123046875
0.691650390625
0.7587890625
0.900146484375
0.30322265625
0.155517578125
« Last Edit: October 25, 2009, 10:31:59 AM by Salt » Logged
Aquanoctis
Level 5
*****



View Profile WWW
« Reply #281 on: October 29, 2009, 11:55:09 AM »

Hey.
Not sure if we've got any experts on PXTone here but could anyone explain how to use the Keyporta function found within the program? I've had a look at the offical tutorial for it but I can't figure out what to do from that... Durr...?

Anyone?
Logged

William Laub
Level 10
*****


Gold Cray


View Profile WWW Email
« Reply #282 on: October 29, 2009, 03:46:28 PM »

Hey.
Not sure if we've got any experts on PXTone here but could anyone explain how to use the Keyporta function found within the program? I've had a look at the offical tutorial for it but I can't figure out what to do from that... Durr...?

Anyone?
It's the first result in a google search for pxtone. Here.
Logged

Digital Modular Theremin: A new KiNd of Theremin<br />C C++ Python Verilog Java VBA C# Fortran
easyname
Level 5
*****



View Profile WWW
« Reply #283 on: October 29, 2009, 04:39:56 PM »

Hey.
Not sure if we've got any experts on PXTone here but could anyone explain how to use the Keyporta function found within the program? I've had a look at the offical tutorial for it but I can't figure out what to do from that... Durr...?

Anyone?
It's pretty simple actually:



The length of the key porta decides how long it takes to slide between two notes. You only need to set it once and it will stay like that until you change it. (You'll have to use the hand tool to change the notes)

Here's the effect it created here:
http://dl.getdropbox.com/u/421763/song14.mp3

I just used it to make wobblyish notes here but I could make a more obvious example if you want.

edit: Oh, I also use sliding notes later on.
Logged

Craig Stern
Level 10
*****


I'm not actually all that stern.


View Profile WWW Email
« Reply #284 on: October 30, 2009, 12:14:26 PM »

A linear congruential generator is your best bet.  Wikipedia

I recently made a simple one in Actionscript

Awesome, thanks!
Logged

Pages: 1 ... 17 18 [19] 20 21 ... 33
Print
Jump to:  

Theme orange-lt created by panic