[FIXED] Bilinear Interpolation

Get help using Construct 2

Post » Mon Dec 31, 2012 10:50 pm

EDIT: This has been fixed. In fact, I'm so happy with the solution, here's the capx for everyone to use!

Hey Everyone!

I've been working on an experiment to get a good procedurally generated level in C2. I've decided to start with a simple random noise, smoothed with bilinear interpolation, then rounded off for hopefully nice flowing terrain.

The bilinear interpolation is giving me a headache however. At some points the result is looking OK but there are lots of incongruencies and artefacts, so something is wrong with my formula.

Here's what it looks like now. (I haven't gotten to the thresholding yet, so obviously it's not going to look like terrain ;) )



So, if some of the math brains would be so kind as to give this Capx a look, I'd be most grateful.

*Cough* @Yann @R0J0hound *Cough*sqiddster2013-01-01 01:00:15
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Dec 31, 2012 11:00 pm

Is there a formula you are using?
Something like diamond square?
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Mon Dec 31, 2012 11:14 pm

It's the general bilinear interpolation algmorithm - I don't know what its called, but you can see what I did in the capx.

EDIT: Although... that DOES look interesting! Might make a good practice of recursion as well. Hmm...

EDIT 2: But it won't work, because I'm hoping to have a large/infinite world.

EDIT 3: I forgot to change a 5 to a 4. It works well now. I hate myself :Dsqiddster2013-01-01 00:37:16
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Jan 01, 2013 3:53 pm

This looks interesting! But when I run your .capx I only get a few black dots in the top left corner, am I doing something wrong or is the wrong file?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jan 01, 2013 4:52 pm

@Nimtrix, I'm sorry, I was editing the wrong file. It's fixed.sqiddster2013-01-01 16:54:35
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Jan 01, 2013 5:03 pm

Ah, I suspected that might be the case. Works great now, thanks for sharing this!
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: gregorysforster and 22 guests