Christmas Project - Streaming Terrain Editor

Started by Kronos, December 18, 2019, 22:24:57

Previous topic - Next topic

3DzForMe

QuoteHowever today after only 10 minutes I got the shader working and it's like a little ray of sunshine which has totally transformed my outlook on the project again. It's good to have a win now and again. It also makes me happy that I can pull together all those little experiments I have been coding for years and make use of them in one project. No code is ever wasted in the long run. 
 

Great stuff, my project has been kinda on hold for a bit - real life stuff getting in the way ;)  I do love the way AGK renders heightmaps though ;)
BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

Kronos

#16
Added shadows and water. I am using a variation of the water code Janbo posted on the AGK forums, which I think he sourced from ThinMatrix. Well worth watching his video series on Youtube  btw.

Halfway through the video I noticed that i had lost my selection lines but was able to fix afterwards. This is starting to look not half bad ;D Except for those damn tile edge normals!!

Not sure I am going to stick with the AGK skybox as it is a bit shonky. Doesn't stay in the correct position when camera goes high.

Also just figured out how to anchor my form elements so in next video screens should be much bigger. Enjoy.

Edit: Eureka fixed those normals \o/


Kronos

Taking a break from the terrain editor which has stalled a bit as I am having problems figuring out how best to load models, and have been experimenting with some simple procedural terrain generation.

I create a 2d map using various rules which holds the terrain types(this was probably the most fun bit to do) From this I generate a heightmap and a splat texture and then use these to generate the map in 3d. I am using a texture atlas to hold 16 terrain textures and a a second texture to hold 16 splatmaps. Just using place holder models and low res textures at the moment. Been trying to follow the advice from various forums about dealing with the edges lines that appear on the textures but so far not working.

The idea is that eventually I should be able to seed structures, entities and then quests on the map.

The map creator is written using appgamekit and the 3d stuff is written in python, as I wanted to see what the language is like but still uses appgamekit as the 3d engine.


Kronos

I have been doing some work on steering behaviours today. Quite relaxing watching the tanks milling around. They are still a bit twitchy but for the first time I kinda understand how they are supposed to work.


Kronos

#19
Re-visiting the terrain editor last few days. It had devolved into a bit of a mess code-wise and also wasn't a streaming terrain editor which is what I wanted. I hit a bit of block when it came to adding objects to the terrain which is why I stopped. So re-writing from scratch but pulling out chunks of previous code.

Still using AGK as the engine with the C# wrapper. Anyway at the moment the streaming part is now working fine, not async but works good enough. I can raise, lower and flatten terrain and changes are instantly saved. Next thing to do is the normal calculation and then I will think about how best to add objects before worrying about texturing terrain etc. For the texturing I plan to use a texture atlas approach, probably1 texture + 1 normal map for whole terrain initially but eventually move this down to terrain chunk level. I am trying to work with a minimalist gui(practically non existent at the moment) not sure how far I can go with this.

Not really happy with how appgamekit loads models as it doesn't seem to be able to loadchild objects in all cases and doesnt work well with alot of my old b3d/obj models so I may need to write my own  loader.

blinkok

I get;
An error occurred. Please try again later. (Playback ID: tvYjVBGXH10eITrO)
When i try play the video

Kronos

If I could edit my posts I could try and fix that.

Kronos

Managed to put a few hours into this today. I have the basics of model loading and saving, positioning, rotating, scaling working plus a simple menu system using agk text commands.

Kronos

#23
Add map creating, loading and saving in menu.
Add terrain vertex painting - colours only at the moment
Add background sprite to menu items so that they are more readable.


3DzForMe

#24
@Kronos - cracking looking project! If you need a beta tester let me know. I don't know if 'VistaPro' means anything to you, but your project takes me back!
https://youtu.be/5UMcB8dTxPQ



BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

Kronos

#25
re-did the menu code as I wasn't happy with it.
porting code from the old project - terrain texturing is now working using the old method ie non texture atlas - had some problems with this.
added reflective water plane.

Work on a separate model program so that I can load meshes into the editor with all their attributes ie textures and shaders etc defined.
Next step will be to add this format to the editor.

Kinda not happy with the "click and release" method I am using for terrain changes but can't think of any other way to do it at the moment. In Appgamekit my understanding is that you can't change a memblock linked to a mesh on the fly, you have to amend the memblock, then delete the mesh and then re-create a new mesh from the memblock. If anyone knows different please let me know. Currently I only do the mesh creation step after the mouse button is released so you cant see the actual meshs deforming or painting in realtime.  I am using lines as a substitute for when deforming meshes but painting is complete invisible at the moment until the mouse key is released.

Edit: I think I have found the command I need re the memblocks. Didn't realise that I dont have to create new meshes every time ;o
Edit2: Change was simple now it looks much better, visible terraforming and painting. I am happy and now going to bed.

William

so, your app is with the appgamekit? presently i use rcterrain editor and importing heightmaps but i think there are other/better ones. maybe i should work on terrain soon.
im still interested in oldschool app/gamedev

Kronos


Still a long way to go but happy with progress so far.

Kronos

Added the update normals code back in, went surprisingly easy.
Started work on a vegetation layer system.
Various other tweaks and fixes.

Kronos

#29
So after a day of struggling with adding meshes together it now appears the AddObjectMeshFromMemblock commands basically just adds the memblock mesh as a child object of the original, it does NOT merge the child mesh  into the main mesh like the Blitz3d AddMesh command does. So I am going to have to rethink my approach to this.
Edit: think I have fixed by writing my addmesh function.