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 Classic Chat / Mapping Surface 3D (Calling 3D Guru's)

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 5th Jan 2021 16:24
Hello and happy new bla bla bla, 21 already looking bleak so I return to AppGameKit land for some escape!

I have a sphere (a planet) and I place small buildings on the planet (intersect + normal) which works great, some of the building are mining buildings and are resource dependant, this is where I'm stuck and fishing for ideas

I basically want to map the surface of the sphere but am unsure how to go about it, can this be done in memblocks, I was thinking I could paint a resource map as a texture (red for hi resources and shade down or different color for different resources and then have a shader read the color value of that location on texture and return it to AGK.......

Or whats with vertex colors, can I paint the vertex color in blender and read it back in AppGameKit?

I thin k I would probably need to blend the resource map texture over the top of the planet texture to turn resource mapping on/off for some visual candy

So my idea is when I mouse over the planet with a mining building selected a lil readout tells me how much resource per hour I can mine based off the density of the resource patch (color under cursor, nearest vertex color, shader reading texture color or some other system I have not thought of?)

Any ideas/suggestions?, am I overthinking a simple solution or is this really as tricky to do as I imagine it will be?

FYI: game will have 100's of planets, it would be nice to set them up programmatically and not have to paint anything in anyapp,, just set some boundaries and generate the resource map with some degree of randomness, so maybe a non image based approach is best, I just need a bit of a shove in the right direction.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Jan 2021 18:22
Could you just apply a texture to the planet then read the colour of the pixel under the mouse cursor and get it from that? Or do you need the ability to change the mask?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 5th Jan 2021 19:25
I was hoping for a more dynamic approach than having to use images

I think I may have a solution, it should work

What I am working with now is setting a camera on a locked orbit around the planet and place it at several random points (angle, elevation) and cast a ray into the planet, at the intersect point I log a resource type and density and place a marker on the planet do this 100+ times with varying attributes , save it all out to text and in game load one of 100+ random data setups so each planet seems unique and when placing the mining building I can base its efficiency off its distance to its nearest resource node and density of the node .... yes, this might do it

For lack of a better idea that's the plan anyway

Login to post a reply

Server time is: 2024-04-24 07:49:22
Your offset time is: 2024-04-24 07:49:22