Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Can parts of a heightmap terrain be deleted?

Author
Message
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 14th Dec 2022 01:15
I'm using two heightmaps to make one terrain. One for grass and one for roads.
Much of the road terrain is under the grass terrain and I thought it might run faster if I could delete the non visible parts of the road.
I can't see any commands for deleting verts or any memblock commands that might help.
I tried using alpha on parts of the road HM but had no effect.

It works as is but I was just wondering if it's possible.

BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.

Attachments

Login to view attachments
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Dec 2022 04:06 Edited at: 14th Dec 2022 04:12
I would not use a grass terrain, I would use a grass texture and just texture what verts you want to.

Edit, or you can just leave it like it is, I ran it and my frames where perfect and I drove a long time.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 14th Dec 2022 18:31
Thanks GCH.
The program will be fairly simple so I don't really need to worry about optimising.
After I buy a USB steering wheel I'll add the code for that.
Add a wall around the outer edge and maybe a few obstacles.

After seeing how many bad drivers there are on the roads, a few years ago I had an idea.
What if we could give little children some kind of driving experience. I'm thinking about 3 years old and up.
Those 4 wheel electric mobility scooters are ideal for converting to mini cars so kids can get a feel for driving.

Since this is about safety then a simple driving sim should prep a kid before they get in a mini car.
Maybe... if they can drive around for 5 minutes in the sim without going on the grass then they are ready for the mini car. (supervised by the parent)
I have a history of building go karts and this will be even easier.

BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Dec 2022 18:53
ando

I wonder if I could use this to build on myself? and make a drive here and there app to finish game goals? just a idea.

I would start this after my other project. If granted permission by you.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 14th Dec 2022 19:37
No problem GCH. Sounds good to me.

I'm hoping I can turn this in to a local community project.
Maybe get the local council and mens shed involved to provide a free service for the kids.
Here in Australia many of our towns have a mens shed where guys can go to make friends and work on projects
for themselves and volunteer work for the community.

Local councils already do projects for kids like learn to cycle tracks.
Here is a pic of a track and it's next to a mens shed...(it's an old photo so I drew the location of the shed)
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2022 19:43
Great idea ando. Please keep us updated. I am keen to see the results
As for the road, maybe you could write something that creates the mesh from the image?
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 14th Dec 2022 20:09
Thanks Blink. At the moment I'm gathering materials to make a mini car or two.
Youtube has many examples of converted mobility scooters. I'm sure the kids will like it too.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2022 20:30
If you need a kart model or something like that just let me know
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Dec 2022 18:45
To delete vertices you basically need to remeber wich vertices you want to keep and ignore the rest when you build a new mesh from them.
But that whole process isn't what you would call easy as you need to link the indices correctly.
Creating a road from scratch would probably be easier then you can use splines for smooth trail ect...
The easiest solution is probably a custom shader with a splatmap.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2022 11:09 Edited at: 17th Dec 2022 11:29
Ive attached a shader that might help, which is a modification to one of my first shaders that just blended 2d this is 3d version which im sure i got help along the way with
my shaders from both santman an janbo and the glsl shader library

this version uses a shader to blend a rendered image which im sure was on the shader thread but cant find it hope this helps also one of the games i procrastinate to much about finishing i used two gid objects and used that to move vertices with memblocks one being to reveal water and the other to create mountains. If you use a grid its allot easier to select verts the issue is selecting the right one(grid water and gid land)

goodluck
fubarpk
https://fubarpk.itch.io/
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 19th Dec 2022 23:05
Cheers guys, much appreciated.
I'm working on a few things at once so I'll post an update when it's ready.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Jan 2023 13:30
If all else fails you could use a grid, and texture map over it
here is a piccy of a terrain editor i used with that process



it uses two grids where it simply lowers the land below the water level
this approach worked well for my retro game im working on. The codes
bad spaghetti atm but if you want i can try and whip up an example but need
a little time just pm me if your interested ando
fubarpk
https://fubarpk.itch.io/
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 26th Jan 2023 15:59
Looks like you could draw a jet boat race track with that editor fubarpk. (or is that what you're actually doing?)

I did make a little proggy where I could raise and lower verts using memblocks
but I didn't get to the stage of saving and loading some kind of vertex data file.

And I'm used to seeing spaghetti code, I see it every time I type something. An old habit from my C64 days.
Thanks for the ideas.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.

Login to post a reply

Server time is: 2024-02-24 02:48:32
Your offset time is: 2024-02-24 02:48:32