Endless Procedurally Generated World

Get help using Construct 2

Post » Wed Jan 02, 2013 1:17 am

Ah, well thanx anyway because its was your post on the forum that got me thinking in the first place.
All the best to working out your game mechanics!

Greets.
Savvy001
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Wed Jan 02, 2013 11:58 am

@Savvy001

link to .capx doesent work!


Also, finding candy is fun! :D


edit: Ok, i'm a bit late :D

thanks for sharing!JohnnySheffield2013-01-02 11:59:31
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Jan 02, 2013 3:23 pm

@JohnnySheffield

I did 2 post reply's
On the first the .capx was not working.
On the second it did.

Now i have corrected the first one also.
So thanx for the heads up.

Nice that u liked finding the candy.
In the future im going to make a game out of this simple infinite engine.
Its super basic and opens up lots of possible outcomes.

Kind Regards
Savvy001 Savvy0012013-01-02 15:25:15
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Wed Jan 02, 2013 7:59 pm

@sqiddster
A large array shouldn't be too much of a problem as most computers have a lot of memory.

I tried out seeded random using the RandomPlus Plugin and here is the result:
http://dl.dropbox.com/u/5426011/examples16/inf_map.capx

If you're doing a scroller that goes in only on direction you could use the standard random, but store the values until they are no longer needed for interpolating.
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Wed Jan 02, 2013 9:06 pm

@R0J0hound...

That's amazing! But what is your generation algorithm? Is it a different version than mine, or just condensed?

EDIT: I see that it's bilinear, but how did you do it with zero arrays? And as I can't use the seeded random, how would I adapt the regular random?sqiddster2013-01-02 21:21:59
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Jan 03, 2013 1:51 am

With seeded random I can calculate the same value every time for a square so I don't have to store the random values in an array.

For regular random you would need an array to store the random values to interpolate between. I've yet to work out how it would be implemented exactly.R0J0hound2013-01-03 01:51:43
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Thu Jan 03, 2013 2:26 am

Hmm. Let me know if you get it figured out!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Jan 03, 2013 8:04 am

The solution I had in mind was proving to be too complicated, but here is another solution that doesn't use any third party plugins.

http://dl.dropbox.com/u/5426011/examples16/inf_map3.capx

The idea is save a bunch of random numbers in a big array at the start of the layout. Then using an formula like Array.At((x*23+y*5)%Array.Width) you can get a random number for any position on the layout. The 23 and 5 are arbitrary and can be any value.

The main drawback is this method does create a pattern that is noticeable when the array is small.
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Thu Jan 03, 2013 11:27 am

@R0J0hound, thanks!

I'm trying with a width of 100,000 and there doesn't seem to be any performance problems. Is this array too large?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Jan 03, 2013 12:19 pm

An array with a width of 100.000 uses 0.762939 MB memory. Astrosus2013-01-03 12:21:50
B
8
S
2
Posts: 110
Reputation: 1,463

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Lordshiva1948 and 16 guests