Page 1 of 1

Endless terrain generator

Posted: Wed Dec 02, 2015 2:50 pm
by toneddu2000
Hi guys, did you ever face the attempt to create an endless terrain? I do. :) I "just" want to repeat same 3d model block (let's say 2048x2048x32 sized) in a matrix 3x3 cells. When player moves I delete old cells and recreate new ones. I'm struggling to find a method suitable in quakec but with no luck. There's something already ready to eat?

I tried this video tutorial for Unity in C# and it worked, but I couldn't replicate it in in quakec.

I also trying to do something like this in a static way but, .bsp maps, used as models, are not rendered!

inside worldspawn function

Code: Select all

local int i;
local float isize = 2048;
	for(i=0;i<9;i++){
		terrain = spawn();
		
		setmodel(terrain,"maps/terrain.bsp");
		setsize(terrain,[-(isize/2),-(isize/2),16],[isize/2,isize/2,16]);
		terrain.solid = SOLID_BSP;
		if(i == 0){
			setorigin(terrain,[0,0,0]);
		}
		else if(i == 1){
			setorigin(terrain,[isize,0,0]);
		}
		else if(i == 2){
			setorigin(terrain,[-isize,0,0]);
		}
		else if(i == 3){
			setorigin(terrain,[0,isize,0]);
		}
		else if(i == 4){
			setorigin(terrain,[0,-isize,0]);
		}
		else if(i == 5){
			setorigin(terrain,[isize,isize,0]);
		}
		else if(i == 6){
			setorigin(terrain,[-isize,isize,0]);
		}
		else if(i == 7){
			setorigin(terrain,[isize,-isize,0]);
		}
		else if(i == 8){
			setorigin(terrain,[-isize,-isize,0]);
		}
		terrain.SendFlags |= 1;
		terrain.SendEntity = SendTerrainFlags;

	}	
Another Idea I had is to store previous terrain and then add origin from previous to the new one, but I don't want that use player position, I want that uses old terrain origin and creates a new terrain ACCORDING to player position.

Code: Select all

local entity terrainprev;
local float isize = 2048;
	for(i=0;i<9;i++){
		terrain = spawn();
		setmodel(terrain,"maps/terrain.bsp");
		setsize(terrain,[-(isize/2),-(isize/2),16],[isize/2,isize/2,16]);
		terrain.solid = SOLID_BSP;
		if(terrainprev!=world){
			setorigin(terrain,[terrainprev.origin_x,terrainprev.origin_y+isize,0]);
		}
		terrain.SendFlags |= 1;
		terrain.SendEntity = SendTerrainFlags;
		terrainprev = terrain;
	}	
I dunno if I explain myself correctly, sorry otherwise! Thanks guys in advance for any suggestion!!

PS: I use FTE + CSQC but I don't think it's related in this case.

Re: Endless terrain generator

Posted: Sun May 29, 2016 8:56 am
by Zop
I like the idea, but I can't tell what problem you have.

Do you get an error? When?
Did you make the terrain.bsp model? What map are you testing this on?

Re: Endless terrain generator

Posted: Mon May 30, 2016 7:28 pm
by toneddu2000
Hi Zop! I almost forgot my own code! :) Too much time passed by! Iirc I wanted to make dynamically generated terrain, so, splitting whole world (let's say a huge map of 99000x99000x8192 units) in immaginary sectors, I'd have liked to render every sector only when player was in that sector, rendering neighbour sectors as well. But, I abandoned the project since I didn't receive any inputs from community and after many unsuccesful code tests, I gave up! :confused:
If you want to share some thoughts, I'm here! :biggrin:

Re: Endless terrain generator

Posted: Wed Aug 17, 2016 5:49 pm
by Max_Salivan
Good idea,i want to make something in dp.
And made 16x16x128 entity chunk.
I record video late.

But idk how to make infinite world.
Maybe store chunk 16x16x128 in file then player will be on the last cube on chunk and delete cubes,then generate new chunk.

What is better to this experiments?dp or fte,what is entity limit on fte?i think on dp 32768.

I started my experiments then read this
http://www.mustaine.com/about/one-game- ... uakecraft/

Oh,is there a way,to check enity in entity?

Re: Endless terrain generator

Posted: Wed Aug 17, 2016 6:19 pm
by frag.machine
My understanding is that you two are talking about different things.

Toneddu's idea was to use prefabs to simulate an "endless" world, while the link you provided is a "let's do Minecraft in Quake". I already did something similar to toneddu's idea, almost completely in SSQC (with bits of CSQC for HUD). As Spike commented back then the real pain in the arse is to make artwork that mix in a seamless way. BTW after some testing I settled for a 24x24 grid of 512x512 qu's as a comfortable size in terms of gameplay and performance (at least in Darkplaces, which was my target engine; the mod ran much faster in FTE with the same hardware, but important portions of the world generation were broken on it, so for now I ditched the idea of multiple engine support).

Re: Endless terrain generator

Posted: Wed Aug 17, 2016 6:29 pm
by Max_Salivan
And i made minecraftish quake:D
Without infinitie generation.

Re: Endless terrain generator

Posted: Thu Aug 18, 2016 2:41 am
by Max_Salivan
Image
too many entities:d

Re: Endless terrain generator

Posted: Thu Aug 18, 2016 3:45 am
by frag.machine
Yeah,IMO to replicate minecraft in quake the better approach would be to implement its map format instead.