Introducing my next project: Tile World!
Tile World is going to be an improved version of my Fractal Terrain Generation program, rebuilt to use lists instead of matrices (to allow for a larger world), an improved terrain generator, a better view angle, and (hopefully) cool terrain features like trees and rivers! I am still figuring out how to draw it correctly, but the generation code is below. A download file is on the Github. I look forward to any feedback/optimizations any of you have!
Code:
Tile World is going to be an improved version of my Fractal Terrain Generation program, rebuilt to use lists instead of matrices (to allow for a larger world), an improved terrain generator, a better view angle, and (hopefully) cool terrain features like trees and rivers! I am still figuring out how to draw it correctly, but the generation code is below. A download file is on the Github. I look forward to any feedback/optimizations any of you have!
Code:
ClrHome
Input "SEED ([i] FOR RANDOM): ",S
Input "DETAIL (1-10): ",D
startTmr->T
ClrHome
int(max(1,min(10,D->D
If imag(S:int(.01randT->S
Output(1,1,"SEED: "+eval(S
Output(9,1,"INITIALIZING... "
775->dim(|LX:775->dim(|LZ
5(1-rand(775)2->|LY
0->|N
For(X,1,25
For([recursiven],1,31
|N+1->|N
X->|LX(|N:[recursiven]->|LZ(|N
Output(9,17,eval(int(100|N/775))+"%
End:End
Output(9,1,"GENERATING HEIGHT... "
3->|N
For([recursiven],1,D
|LY+|N(1-rand(775)2->|LY
|N/1.3->|N
If [recursiven]>=.6D:max(0,|LY->|LY
Output(9,22,eval(int(60[recursiven]/D))+"%
End
Output(10,1,"SMOOTHING..."
|LY->|LYA
0->|N
For(X,1,24
For([recursiven],1,31
0
If X>1:|LYA(25(X-1)+[recursiven]
If [recursiven]>1:Ans+|LYA(31X+[recursiven]-1
If X<24:Ans+|LYA(31(X+1)+[recursiven]
If [recursiven]<31:Ans+|LYA(31X+[recursiven]+1
.5(|LY(31X+[recursiven])+(Ans/((V>1)+([recursiven]>1)+(V<24)+([recursiven]<31)->|LY(31X+[recursiven]
|N+1->|N
Output(9,14,eval(int(60+40|N/744))+"%
End:End
checkTmr(T->T
Disp Ans