[PLUGIN] GridTree (0.2)

Post and try out addons that are currently in development.

Post » Tue May 10, 2011 12:17 am

download link dose not work.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Tue May 10, 2011 12:22 am

[quote="toralord":1fl9xa0b]download link dose not work.[/quote:1fl9xa0b]
First bug fixed! Hehe. Sorry about that.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Tue May 10, 2011 12:51 am

This is awesome. So we an use this to generate levels?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue May 10, 2011 1:15 am

[quote="Azu":2ypgnd4p]This is awesome. So we an use this to generate levels?[/quote:2ypgnd4p]
Yep, that is one use for it. In Void Runner we use it to do pretty much everything. We didn't call it GridTree back then, but this is the same code that we used for placing all of our sectors, planets, rocks on those planets, cave interiors, buildings...everything. I figured someone else would like to have access to that power, and GridTree was born.

In the example cap you can generate a screen of colored circles, and clicking a circle will generate a screen of squares. The squares are unique to each circle. If you click the same circle twice you will get the same field of squares. It seems kind of simple until you realize that it is only taking a few events, and that all of this is being done without storing anything anywhere. It's all coming out of the root grid's seed. One number. If you change the root grid's seed, you will get a new field of circles...also with their own square "instances". This is a VERY abstract example of a world map and areas within that world.

Each grid is two dimensional, but in the example cap I only use one dimension of each grid to show off how flexible it can be. You'll notice that "X Position" is always 0. So the second dimension isn't being utilized.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Tue May 10, 2011 1:34 am

MMMM fractals :)

The original Perlin plug made it possible to create clouds, or even a nebula effect. This on the other hand should make it possible to make stuff like those magnificent images taken from the Hubble telescope.
Cant wait to figure it out!
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue May 10, 2011 6:12 am

GridTree.PollGrid(Name, X, Y, Data Type, Max)

Sorry, but I'm somewhat confused at whats going on with the expression.
I get name, and x,y... although an x,y for every x,y is blowing my mind, but Data Type needs a bit more of an explanation.
The Data Types "BubbleX", and "ColorR", etc, are um, I dunno...
Are they labels you made up, or are they undocumented system expressions?
If they're plugin specific, that's fine, but users need some sort of reference to all of them.
Thats kind of like loumu's dungeon plug using keywords like wall, and rock without an indication of of value.
Also, on "BubbleX", isn't that a reference to an object being created within the same action?

Thanks
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue May 10, 2011 8:00 am

[quote="newt":fo7rehim]GridTree.PollGrid(Name, X, Y, Data Type, Max)

Sorry, but I'm somewhat confused at whats going on with the expression.
I get name, and x,y... although an x,y for every x,y is blowing my mind, but Data Type needs a bit more of an explanation.
The Data Types "BubbleX", and "ColorR", etc, are um, I dunno...
Are they labels you made up, or are they undocumented system expressions?
If they're plugin specific, that's fine, but users need some sort of reference to all of them.
Thats kind of like loumu's dungeon plug using keywords like wall, and rock without an indication of of value.
Also, on "BubbleX", isn't that a reference to an object being created within the same action?

Thanks[/quote:fo7rehim]

As far as X, Y's within X, Y's goes. That's the nature of the plugin. It's hard to comprehend sometimes, even for me. Just remember that when you Poll Grid you want to make sure that you've set your current position for every grid above the current one. You don't need to set your position on the grid you are polling, because that's what X and Y are for in the expression. Of course it wouldn't hurt to set the position anyway, but for large amounts of polling that might be processor intensive for reasons that would take a while to explain. That's why you can poll along a grid without setting position.

The data type is specific to the plugin, but it isn't explicit. There is no list of them - you can make up any data type you like. You could set it to "badjfo9a8d789dabfiausd" or " "fnord" and it would still behave the same.

What that actually is is a numeric seed for a type of data, but to make it easier to understand I had it accept strings. The string is then hashed and the hash is used to seed the data type. So basically it is anything you want it to be, as long as you always use that specific word to reference whatever you are trying to look for. Because that word/string/hash/value is used to modify the GRID seed - which allows you to poll for multiple things within the same grid. Does that make sense? Think of each point in the grid like a set of gym lockers, and the data type is the locker you are selecting. You are not drilling down into the next grid - merely specifying that you are checking out something different on the current one.

So notice how I poll for R, G, and B, all within the same grid - at the same locations - and with the same maximum values. Since this is persistent - technically R G and B should all be the same number. That's what data type does. You specify a unique identifier for what you are looking for - and that identifier can be anything you like - and it splits your grid up into clones with different sets of data. Pretty nifty eh?
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Tue May 10, 2011 10:37 am

I won't have time to check this until much later today (again), but I just wanted to post to say thanks.

I've been looking forward to this.
As I said in another post, I've been using seeded randoms to create my world space, and I've had to develop a system to make sure everything was connected to the original seed, etc, but this looks like it will do all that for me, and more.
So I'm more than happy to rewrite my code to use this, because in the long run, it'll be much more flexible for what I need.

Not enough hours in the day. :)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Tue May 10, 2011 1:41 pm

this is so awesome arsonide. already checked out the example cap. this sets the timeline for the world editor I'm making after my character editor way forward. you've really outdone yourself, this time. perlin used to be my favorite 3rd party plug.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue May 10, 2011 3:37 pm

[quote:2eu3i45n]What that actually is is a numeric seed for a type of data, but to make it easier to understand I had it accept strings. The string is then hashed and the hash is used to seed the data type. [/quote:2eu3i45n]

Wow, had no idea it could be that flexible.
So are those values generated when the seed is named, or is that also generated from the root seed?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests