[PLUGIN] GridTree (0.2)

Post and try out addons that are currently in development.

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
90
Posts: 7,347
Reputation: 66,749

Post » Tue May 10, 2011 6:17 pm

The grid seed is dependent on the root seed, and the data type "fudges" it a bit, so the hash itself isn't dependent upon the root seed, but after it fudges the grid seed, the result is. Technically. The hash is generated at runtime when you poll for data.

With Void Runner I found myself defining a bunch of constant variables simply to reference the TYPE of data I wanted from the tree. So the start of every file would look like this:

[code:2ab29jsv]
#define PLANET_EXISTS 0
#define PLANET_TYPE 1
#define PLANET_DEFAULT_COLOR 2
#define PLANET_WATER_LEVEL 3
[/code:2ab29jsv]

...and so on. These were then used to "fudge" the grid a bit, by modifying the Mersenne Twister slightly. The data type is to prevent you from needing to do something similar to this with variables in Construct - while at the same time making your data easier to read.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Wed May 11, 2011 8:51 am

After trying the .cap and reading latest posts my head started to hurt. :) I'll finish it later, just wanted to say thanks.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Thu May 12, 2011 11:34 pm

Now I've finally spent some time with this, I'm blown away.
This takes so much of my current code away, and really streamlines the process.

Over the next couple of weeks, as I try to implement this into my existing project (don't worry, I've backed that up :) ), I'll let you know if I come across any bugs.
So far, I've had no problems with either performance or functionality, no matter how many levels I go down.

Excellent work mate.

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

Post » Thu May 12, 2011 11:49 pm

[quote="KrushBrother":2m3sw1es]Now I've finally spent some time with this, I'm blown away.
This takes so much of my current code away, and really streamlines the process.

Over the next couple of weeks, as I try to implement this into my existing project (don't worry, I've backed that up :) ), I'll let you know if I come across any bugs.
So far, I've had no problems with either performance or functionality, no matter how many levels I go down.

Excellent work mate.

Krush.[/quote:2m3sw1es]

Just keep in mind that this [size=150:2m3sw1es]is [/size:2m3sw1es]alpha, and I do plan on patching up some things. (There's an extremely small chance that I may just move it up to release status as is, if nobody reports any bugs, but I doubt that will happen.) If I patch it, it may integrate seamlessly with whatever you've done, there's a chance that it may not however. So just keep track of everything you are doing, so if you have to redo it at some point it'll be easier.

I'm glad you haven't run into any problems so far though! It worked pretty good for us, I'm hoping more people will find uses for it. :D
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Fri May 13, 2011 12:41 am

Yeah, my middle name is "backup". (not really :) )
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Mon Oct 24, 2011 1:53 am

UPDATE: I have released a new version of this plugin with some exciting new, slightly experimental options. There are four new actions that will assist you in changing the GridTree. Allow me to explain.

Imagine you have a grid representing a forest of trees, but your player wants to chop one down. Before, you'd have to keep track of this change the player made, save it somewhere, and overlay it on top of GridTree's procedural data. Now, GridTree can do all of this for you.

There are two actions: set value at, and revert value at. These actions will ask you what grid you're referring to, what data type you're referring to, and what position you are referring to. If you set the value there, GridTree will now output that value that you set there instead of it's procedural data. This will allow you to "cut down a tree" so to speak. If you want to revert the change, that action is there as well.

There are two more actions available as well that save the entire GridTree to a file, including all of your manual changes...and another to load this file into the GridTree.

This expands the possibilities of the plugin quite a bit. I hope you guys like it. There is a new "advanced" example in the zip that shows off these features, with comments and stuff. The example actually is a procedural forest with trees you can chop down. Keep in mind this is still in alpha, but is now back in active development. Please reply with any gripes, complaints, or praise, or bugs, or whatever. It will help me as I continue to develop this.

The download link in the original post has been updated. Here is a short video showing the changes. They're kind of hard to recognize, but they're there: video. There is a known "bug" in which after you load a file in the example cap, the editbox doesn't update to show the new seed. The seed changes internally, it's just the editbox. I'll update again soon with a new expression to fix this.

SIDE NOTE:

I am appending this message at the end of all of my threads. A recent discussion with a friend has led me to a conclusion.

Many of you know that my girlfriend went through a very rare form of cancer this year. One which only manifests in 1% of cancer patients, and is four times more likely to kill you. She survived it somehow, but recently the treatment center she was treated at has lost some rooms. If it weren't for that treatment center, she'd be dead right now. We are getting married in two weeks.

A combination of things, including my readings into Buddhism, and my discussion with this friend, has led me to the conclusion that any further donations to any of my plugins are going directly to cancer charities.

Most of you have noticed a few patches recently, and that will continue. I'm patching up the plugins I released this year, and then I'm releasing MUSE. After MUSE I am going to develop a toolkit cap designed to help people make roguelikes much easier, by utilizing all my plugins, as well as helper functions and examples. You can also bet your ass that I'm going to port all of my plugins to Construct 2 when it gets an OpenGL runtime.

So your donations will encourage this further development, and assist in cancer research. The link is in the original post. That is all I have to say. Arsonide2011-10-24 08:41:47
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Mon Aug 27, 2012 11:35 am

Holy jesus. I just discovered a way to linearize the calculation costs of GridTree.

Basically, at the moment, GridTree does a lot of looping. Generally the larger your grid, the more looping it's going to do. This can cause some slowdowns in ambitious programs. I found a way to get rid of the loop entirely, so that every calculation GridTree does is nearly instantaneous regardless of how large your grids are. I'll be playing with this method in the coming days, but expect an update.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Wed Aug 29, 2012 12:28 am

I'm extremely excited to see the update. From what I can tell your current file only works in the first Construct (unless I am missing something?). Keep up the great work!
B
45
S
13
G
7
Posts: 34
Reputation: 5,919

Post » Wed Aug 29, 2012 12:32 pm

Well I would hope so - this is the forum for the first Construct. Arsonide2012-08-29 12:34:05
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests