-
Posts
705 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Blog Comments posted by Slastraf
-
-
12 hours ago, Marcousik said:
Very interesting ...
I never thought about this.
So you are generating the terrain depending on the height map, is that correct?
Would this run with an open third person cam game typ?
How do you do that???
what do you mean exactly? I never had problems with cam and player.
I know the terrain is not infinite and over the choosen map size, things become to disappear. BUt 4096x4096 is big enough if performances stay ok, isn't it
First you need some kind of noise funciton in lua.
https://github.com/Auburn/FastNoiseLite/releases/download/v1.0.3/FastNoiseLiteGUI-Win64.exe
this is an example program to make differnent kinds of noises (-> https://github.com/Auburn/FastNoise_CSharp)
This is perlin lua noise : https://gist.github.com/kymckay/25758d37f8e3872e1636d90ad41fe2ed
Here an explaination. http://adrianb.io/2014/08/09/perlinnoise.html
I have already implemented a noise generator in c++.
This is the most important part :
int roundedPosX = std::round(playerPos.x/tileSize)-offset; int roundedPosY = std::round(playerPos.z/tileSize)-offset; // skip calculations if player moved in the same chunk if(lastUpdatedPlayerPos.x==roundedPosX&&lastUpdatedPlayerPos.y==roundedPosY) return; else lastUpdatedPlayerPos = Vec2(roundedPosX, roundedPosY); const siv::PerlinNoise perlin(seed); // new chunk generation for(int x = roundedPosX; x<roundedPosX+chunkRows; x++) { for(int y = roundedPosY; y<roundedPosY+chunkRows; y++) { /**code skipped here */ for(int i = 0; i<surface->CountVertices(); i++) { Vec3 xy = surface->GetVertexPosition(i); float xPos = (x+(xy.x*.5)); //the vertex position ranges from float yPos = (y+(xy.z*.5)); float height = 0.5*perlin.accumulatedOctaveNoise2D(xPos/(frequency), yPos/(frequency), octaves); height += 0.25*perlin.accumulatedOctaveNoise2D(xPos/(frequency)*2, yPos/(frequency)*2, octaves); surface->SetVertexPosition(i, xy+Vec3(0,height,0)); } surface->Update(); // enable physics //c->chunkModel->SetShape(Shape::PolyMesh(surface)); c->chunkModel->UpdateAABB(Entity::LocalAABB | Entity::GlobalAABB); activeChunks.insert({Vec2(x, y), c}); } }
It takes the player position , converts it to chunk coordinates and spawns chunks around the player.
For each vertice of a flat plane base we put the height of the vertice at the height of the perlin noise function. Thats it.
All other things, e.g. chunks, loading, unloading is up to you because you wanted to make a third person game so you want to load bigger chunks with more vertices so you can look further.
Honestly if I could go back I would do more reasearch for leadwerks plugins and write these things to the leadwerks internal terrain.
12 hours ago, Marcousik said:You would check for the "whiteness" and if it is above a threshold,
How do you do that???
You look for each point on xz, the noise function returns for example -1 to 1. So if above 0.9 then generate road .
//edit- 1
-
8 hours ago, Marcousik said:
But there are things in an open world that have to remain persistent or your world will become nonsense. Nothing for the player that can be recognized is nothing good.
Well for one, have an engine that allows you to walk more than 10 minutes into one direction with my character controller without despawning the camera.
__________
(alternative answer)
__________
There is a huge difference between random generation and procedural because the latter adds many rules to your liking.
Procedural noise such as Perlin allows you to make height maps. The more "octaves" you add ( 0.5*perlin(frequency)+0.25*perlin(frequency)+) essentially (for i<n do (i/2)*perlin(frequency) + (i/2*n)*perlin(frequency) ). Octaves = detailThis looks something like this:
If you wanted to add roads for instance you can generate a ridged fractal
and you see where this is going. You would check for the "whiteness" and if it is above a threshold, generate a road texture. Alternatively, use line detection algorithms.
Same thing for the textures, but this is a whole different topic.Blender has good content on procedural textures e.g. Eevee procedural textures.
This looks pretty persistent to me, and if scaled up on a map you have roads and detail. Maybe you can think of rules to generate villages ?
It would require there to be a "straight" road patch, then make a origin in the center of that road, then generate some houses / npc's along the road and perhaps generate smaller "alleys" from the dot or orthogonal vector of the road.- 1
-
2 minutes ago, Marcousik said:
Yes nice the problem with adding complexity and features like this is at the end FPS = 10
For this we need LE 5 or a powerful engine.
With LE 4.6 you can really make everything but by setting all features together on one map you will encounter big performance problems
I have gone from 15 fps to 130 fps by optimizing my code about terrain generation and procedural textures.
Chances are if it runs at 15 fps in LE 4 it will also run at 15 fps in LE 5
There are many things that cannot be done in LE 4 without many workarounds such as transparency shaders, geometry shaders etc.
Once the first run-able instance of the new engine is out I will start to write my own plugins for procedural stuff and do the things that right now are hard.
-
You should add AI to the game that follows you really fast and shoots guns and stuff at you
and you will be able to get revenge by upgrading your car + weapons- 1
-
I see, but I talked about actual roads to drive on, that can be placed in the terrain.
- 1
-
Hey that looks really good.
Do you want to collaborate on a procedural road decal ?- 1
-
Theres always risks not running everything correctly in the browsers.
Opera offers anti tracking, free unlimited vpn and addons and built in whatsapp twitter etc.
- 1
-
This looks very exciting.
Every finished game should have some sort of combination of post effect shaders, because these add just something to the game.
Really looking forward for 52 shaders !- 2
-
1 hour ago, reepblue said:
Gonna be real. Once Ultra Engine/App Kit goes Linux, I'll probably be using Linux as my main OS. I already converted my software suite to Free/Open Source Software.
I also perfer Mint these days as the cinnamon desktop is very close to Modern Windows and doesn't force everything to download as snap.
This. My current new job will require usage of Linux at some point. It is a lot easier to get all the "stuff" for your environment unlike windows.
-
You can add multiple gradient noise generators to make different type of height maps. You can also subtract height gradually more at the edges and make an island generator.
In the library I used I used only one perlin noise, with different octaves and frequency of details in it. if you have less frequency hills will get larger on xz and if you have higher octaves you can get more hills and holes.
//EDIT
You can also generate Biomes / textures with https://en.wikipedia.org/wiki/Voronoi_diagram Voronoi.
basically use one texture ant interpolate between them.- 1
-
Ultra Coin
- 1
-
I cant wait and implement my own infinite perlin noise based terrain in c++.
The blog is coming, need to just finish up some AI stuff and then can write about the prototype. -
Almost could be in an environment where there is a guy slaughtering devils and demons
-
Well I already find it a little comedic that my comment criticizing LE game engine got removed so I cannot partake in this discussion. Honestly its kind of sad.
- 1
-
I think you could make alot games look much better with good lightning, and also some more tools that do not directly have modeling / texturing in common. Just a thought
-
I will join the community projects the second they open ^^ Btw , for the racing game... I posted a thread few weeks back and comments said it were hard to make one in leadwerks or its close to impossibility because of the physics engine or so ?
-
Leadwerks Winter Games Tournament 2016
in Ultra Software Company Blog
A group blog by The Ultra Software Team in General
got my hoodie just today, definetly will make a game
-
quality>price
- 1
-
Leadwerks Summer Games 2016 Roundup
in Ultra Software Company Blog
A group blog by The Ultra Software Team in General
"psychadelic first-person jumping experience" haha nice
-
See you on twitch. Omahwk here
-
Three New Model Packs available in the Workshop Store
in Ultra Software Company Blog
A group blog by The Ultra Software Team in General
As I can see from the screenshots, some very detailed models but still low poly. Great to actually see larger packs like this in the workshop. Am gonna use them If i make a related game.
-
Thats a very good deal if you looked at the skyrim workshop
-
Greenlight soundsgood. there are much worser games that got published, this one shoudnt have a problem with that. Keep focussing on the game i couldnt do that (for such a long time)
- 1
-
but still not terrain holes.
Basics
in Ultra App Kit (Advanced Custom Widgets)
A blog by klepto2 in General
Posted
new script editor pls !