24.02.2013, 00:13
Hey guys,
I'm currently working on a League of Legends-styled gamemode with a dynamic map which is built out of 3x3 squares.
Using the RNPC Plugin the npcs (the character/player you control) moves where you click, like in LoL/Diablo/Dungeon Siege.
Currently got that far: [ame]http://www.youtube.com/watch?v=o_0ihPKKWAk[/ame]
I already have a very nice looking terrain (500x500 units, with different terrain types, like grass, stone, glass, 250k blocks in total) , but it's flat.
Now, as I don't want to have a pure flat terrain, I'm tryin to build it with some steps in the Z direction (up/down).
Doing that in the y or x direction only is simple.
But there are some requirements for the more complex "steps".
The height difference between two blocks (in any direction, up/down/diagonal) may not be greater than 0.3 units up OR down, otherwise forcing the npc to hang.
I need help for the code to build the terrain so that its not flat AND being usable.
Let's assume we have a 4x4 terrain, looking like that (seen from above):
Looking at square 6, the height difference between 1 and 6, 2 and 6, 3 and 6 (etc...) may not be greater than 0.3 or 0.2 (should be randomly between -0.3 and 0.3).
I'm currently using 2 loops, each from 0 too 500 to create the terrain.
It's basically looking like that:
I multiply x and y by 3.0 because the width and height of the blocks are 3.0.
I need a function/code to check the nearby block's height so that a new height for the next block can be calculated.
I thought that I maybe first should create all the blocks, then run through them, moving them up/down one by one, maybe with a different loop structrue, cause the above one might be not the best for that. But I don't know how that should look like.
I'm not expecting it's going to be easy, but I got the hope that maybe someone did something similar or got knowledge in meshing or similar algorithms.
Every help will be very appreciated!
I'm working on the terrain structure since 5 hrs and my head is going to explode....
I also know that this is maybe a bit too in depth for the samp forum, excuse me then, I just don't know where to ask.
Greetz, NaS
I'm currently working on a League of Legends-styled gamemode with a dynamic map which is built out of 3x3 squares.
Using the RNPC Plugin the npcs (the character/player you control) moves where you click, like in LoL/Diablo/Dungeon Siege.
Currently got that far: [ame]http://www.youtube.com/watch?v=o_0ihPKKWAk[/ame]
I already have a very nice looking terrain (500x500 units, with different terrain types, like grass, stone, glass, 250k blocks in total) , but it's flat.
Now, as I don't want to have a pure flat terrain, I'm tryin to build it with some steps in the Z direction (up/down).
Doing that in the y or x direction only is simple.
But there are some requirements for the more complex "steps".
The height difference between two blocks (in any direction, up/down/diagonal) may not be greater than 0.3 units up OR down, otherwise forcing the npc to hang.
I need help for the code to build the terrain so that its not flat AND being usable.
Let's assume we have a 4x4 terrain, looking like that (seen from above):
Looking at square 6, the height difference between 1 and 6, 2 and 6, 3 and 6 (etc...) may not be greater than 0.3 or 0.2 (should be randomly between -0.3 and 0.3).
I'm currently using 2 loops, each from 0 too 500 to create the terrain.
It's basically looking like that:
Код:
for(new x; x < 500; x ++) { for(new y; y < 500; y++) { CreateObject(..., x*3.0, y*3.0, 200.0, ...); } }
I need a function/code to check the nearby block's height so that a new height for the next block can be calculated.
I thought that I maybe first should create all the blocks, then run through them, moving them up/down one by one, maybe with a different loop structrue, cause the above one might be not the best for that. But I don't know how that should look like.
I'm not expecting it's going to be easy, but I got the hope that maybe someone did something similar or got knowledge in meshing or similar algorithms.
Every help will be very appreciated!
I'm working on the terrain structure since 5 hrs and my head is going to explode....
I also know that this is maybe a bit too in depth for the samp forum, excuse me then, I just don't know where to ask.
Greetz, NaS