How Do I Handle Arrays For Terrain??

Get help using Construct 2

Post » Sat Jun 29, 2013 9:54 pm

@Whiteclaws after remaking and understanding how to use this type of array.
I need to know how do i precisely add the tiles to a certain place?

In the tutorial he shows you how to fill your whole layout with tiles which would be good for isometric but im making a platformer and I need to know how to make the terrain start generating at about half of my layout? I dont want tiles to be in the sky I just need half of my layout with tiles.
my layout is 6400x6400
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Sun Jun 30, 2013 1:47 am

@Yann @Kyatric

Can someone break this down to me
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Sun Jun 30, 2013 2:24 am

How are you going about loading the array with data?
B
70
S
10
G
9
Posts: 300
Reputation: 8,962

Post » Sun Jun 30, 2013 2:24 am

@TheNewGuy Im not sure if the mods will come and help you dude.
If you need help on the forums you should ask for @GeometriX or @Nimtrix them two guys are pretty damm smart and if they cant help nobody can.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jun 30, 2013 2:30 am

@brent_hamel

Im not sure what you mean by that. The only way I know how is the way I learned from @Whiteclaws post. I am trying to figure out how to Precisely Place Tiles so they are only showing up on half of my layout. My layout is 6400x6400 I need the bottom half which is 3200x3200 filled with tiles
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Sun Jun 30, 2013 2:34 am

Also @Whiteclaws I asked for a tutorial that was not showing RANDOM GENERATION. I dont need random I need SPECIFIC GENERATION.

That tutorial showed how to make tiles appear through an array at random in 3 events. Im sure its even easier if I dont want random. Im sorry if im confusing im not familiar with what im even talking about
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Sun Jun 30, 2013 2:42 am

As you may have learned, an array is basically a grid of data. For building a tile-based level, each grid space represents a point on the layout. The system then needs to read the array data, and place the appropriate tile in the correct place accordingly (or not, if it's supposed to be empty). So my question is, how are you filling your array with the values you need to create your level. Without customizing the data in your array, all of its values will be "0", and if they're all the same, then you're entire layout will be filled with whatever "0" is supposed to be (empty tile, solid tile, etc...) So how are you entering your level data into the array?
B
70
S
10
G
9
Posts: 300
Reputation: 8,962

Post » Sun Jun 30, 2013 3:51 am

Try this and see if it helps make what I'm referring to a little clearer.

Level Data from an Array Capx

Please keep in mind, that I've only used a single way to put the level data into the Array, there are lots of ways. You need to find the way that best suits your needs. Hope this helps :)
B
70
S
10
G
9
Posts: 300
Reputation: 8,962

Post » Sun Jun 30, 2013 7:42 am

If you are trying to Stack your Array from the Bottom..Use Push to back....
Your Tiles are made up of I presume for terrain stuff like Grass, dirt , rock, etc and you want it done in layers?
There would need to be some limited Randomization to your Generation seed but no so much that its too chaotic...this takes time to figure out...Seeding is a fairly exact science..you need to know the basics...its not something you will pick up in 5 min....You will get the concept but not the actual coding..
You probably should start a proper Grounding in the idea... before you get serious..its a complex field but easily doable once you understand what has to happen in order to do it..
Read up as much as you can then do some tests...before you make your game..every hours you spend studying will make your game better in the end..
Try these for starters and run with it...

http://www.gameprogrammer.com/fractal.html
http://en.wikipedia.org/wiki/Category:Computer_graphics_algorithms

Also this might help you...
GENERATING RANDOM TILE

The basic idea is to Generate a seed , then load it into the Array either from front to back or vice versa....persona preference for me is start at the base. the ROOT data and then move up the tree creating nodes of detail as you require..
this way..the over all effect is a coherent world populated by detailed areas with Gold, lava, rock, gems etc...that are created and populated at the right place and layer ..this is all determined by your seed or Ruleset that you create and must know how this works before you can really even start to think about it.

Load your tile data or create a generation algorithm that generates the tiles you need and then "push to Back all of the Data in the right sequence...so obviously Grass would go at top..Dirt next, then rock etc...but yeah..STUDY first ..then test, then refine...mystazsea2013-06-30 09:06:47
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Sun Jun 30, 2013 12:30 pm

B
18
S
5
G
4
Posts: 568
Reputation: 5,079

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: ezgaming420, marcinkowski, plinkie and 11 guests