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 / MeshMemblock Function

Author
Message
puzzler2018
User Banned
Posted: 16th Oct 2018 00:21
More to come for 3D meshes of course

- Rotations

- Coliisions (BIG topic)

Catch up soon on those
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Oct 2018 00:42
Combining and/or using .obj format to add .obj groups (Seeing as AppGameKit doesn't seem to recognize .obj groups) so i could say;
1. Delete object group
2. Get center of object group
3. Return mesh/object of object group

This is handy as hell because i can have one model that contains a whole pile of meshes within it. I can for example;

1. Have a model of a car with wheels. I can find the center of the wheels, extract the model and then rotate/turn it to simulate driving
2. A pinball table with all the bumpers and flippers. I can extract those meshes and manipulate them using the physics commands

These are two instances i have used in games. I really think the possibilities are endless though
puzzler2018
User Banned
Posted: 16th Oct 2018 00:56
Could you send an example OBJ with a group and see if I can sort that
puzzler2018
User Banned
Posted: 16th Oct 2018 00:59
I hope you all like the shattering experience
puzzler2018
User Banned
Posted: 16th Oct 2018 01:09
Anyone know the rotation matrices
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Oct 2018 01:28 Edited at: 16th Oct 2018 01:29
Pinball table. Group headers are lines that start with "g "
It will be slow so i would suggest having an initialize() function that can be called at the beginning of the program to pre-process the model

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 16th Oct 2018 01:51
Thanks - ill test tomorrow x
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Oct 2018 17:20
Would love to be able to help
but not so sure how this can be achieved but sure puzzler will work it out

Some advanced math functions that may or may not help
https://forum.thegamecreators.com/thread/217064

hope things are going well for the both of you

fubar
puzzler2018
User Banned
Posted: 16th Oct 2018 17:36
Thanks Fubarpk - also the maths thread looks really good - shall take a look soon

Im doing ok, just work is long days and not enough coding time so really looking forward to a week off end of Oct - re-energise myself and get more coding done..

By all means can help too - it will be a great achievement and of course will always keep you all updated and future developments

Hope your doing ok too

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 16th Oct 2018 17:43
Your making a world editor? I abandoned mine as the game guru loader pretty much covers it.
puzzler2018
User Banned
Posted: 16th Oct 2018 19:31
I know there is GG - i just like to try and achieve something for myself thats all - so having a good bash at it

Blin0K - I think we nearly there, we just need to seperate the Groups into individual objects, so that can make collisions for them using AGKs normal objects

here is the code for it



You will need those 4 files out of that RAR file into the Media folder

Any probs let me know, ill catch up tomorrow when i tried to extrude all those parts into individual objects for you

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 17th Oct 2018 18:52
Blink0k Ive managed to identify them in the obj loading sequence, just a matter now how you would like them.

1.One one mesh?

or

2.Truly seperated individual objects for AGKs object /physics system? bearing in mind there is 100 of the little tigers

or

3.both (letting us decide how we want them to be imported)

if opt 2 then will have to do some jiggery pokery but non the less it will be possible- i would prefer opt 3
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Oct 2018 20:11
I'd let the user decide. Maybe a flag
puzzler2018
User Banned
Posted: 17th Oct 2018 21:31
Thanks

Please bear with me
puzzler2018
User Banned
Posted: 17th Oct 2018 23:05 Edited at: 17th Oct 2018 23:09


https://www.youtube.com/watch?v=ffxKSjUwKdU
puzzler2018
User Banned
Posted: 19th Oct 2018 21:39
Im really sorry for delay - im full of cold - will get back to this as soon as i can
puzzler2018
User Banned
Posted: 23rd Oct 2018 19:30

I still not neglected this, still finishing off with the cold, so head still rather a bit thick and cloudy - hope it will clear up fully soon in next few days so by the weekend and full time next week can crack on with this OBJ groups thing plus tuns more stuff.


puzzler2018
User Banned
Posted: 25th Oct 2018 21:30
Now ive seen RDR2 and im sure most of you have, there are lots of cool 3D stuff - very much achievable with AGK. Let me have a think to come up wth a few.

One that enlightened me was a blowing tent roof on four stumps.

Shall have a crack at this during next week.

All it basically is a 3d cloth style trianglestrip structure, tilted in a 3D world and textured



Catch up soon


puzzler2018
User Banned
Posted: 26th Oct 2018 00:37
Anyone have any ideas how this little tent blowing cloth conundrum going to work?
puzzler2018
User Banned
Posted: 26th Oct 2018 00:55
I dont know about you all, but lets take Rockstars Red D Redemption has a goal in creating here - thats all im thinking, anything and everything is possible to create anything. just having the idea to begin with

Im talking cods wallop again.


Thats why Rockstar are billionaires and we still trying to fight to be pennyaires

Make something look and feel good then people like it, give them a few in game challenges to do to beat their superiors then all good

any, im still talking cods crap - back to designing


blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Oct 2018 00:58
have a point . and a plane

The point is a wind gust (You might have a few). It has direction and size (it has a radius)

The point has the highest force and force dissipates as you move away from the point.

As the point's radius intersects with the plane it forces the vertex of the plane to move away (depending on the distance to the point)

That's how i'd do it
puzzler2018
User Banned
Posted: 26th Oct 2018 01:09
Thank you makes sense

Let me create the cloth and then can think about the "how it moves about" etc

I was more thinking how it is built
puzzler2018
User Banned
Posted: 26th Oct 2018 01:15
Promise i will extract those group objects in an OBJ too - thats my task for this week too. sorry i havent done it sooner, its blooming challenging
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Oct 2018 07:52 Edited at: 27th Oct 2018 07:46
Just remember you need to flip the z-axis when you're calculating position values
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Oct 2018 21:13
Some requests;
1) FlipNormals(object) (Returns 1=ok 0 bad)
2) GetLocalBounds(object) (Returns bounds type)
3) GetWorldBounds(object) (Returns bounds type)

Bounds data would look something like this


puzzler2018
User Banned
Posted: 27th Oct 2018 15:00 Edited at: 27th Oct 2018 15:00
Hi - Thanks Blink0K, ill take a look

I really wanted to have a go at this tent thingy ma jiggy first



It uses nice perlin noise for the affect

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 27th Oct 2018 15:14 Edited at: 27th Oct 2018 15:15
and if you make a few adjustments to the initial size# and width#, it somehow sorts the UV out for a full image on the plane flag/tent roof etc



Use the image that just posted in the media folder

Enjoy
puzzler2018
User Banned
Posted: 27th Oct 2018 17:02
Sorry for posting lots-just having fun

With this same code and a few more objects, can make a wavy flag



Again use the texture attached earlier.
puzzler2018
User Banned
Posted: 27th Oct 2018 21:30 Edited at: 27th Oct 2018 21:32
Check Point



You get the idea

Happy programming

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 28th Oct 2018 00:00
Folks - its time for me to make something for myself now.

Good luck in your developments
puzzler2018
User Banned
Posted: 28th Oct 2018 09:59
This is something can do with meshmemblock programming



Use the two attached files

Enjoy and catch up later in the week for more


Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Oct 2018 19:27
That is insane!
puzzler2018
User Banned
Posted: 28th Oct 2018 22:14 Edited at: 28th Oct 2018 22:14
Thanks

Have I converted you all yet!!!
puzzler2018
User Banned
Posted: 29th Oct 2018 22:07
I really need to start working on a mesh collider work too- im falling behind on a lot of this


fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Oct 2018 02:56 Edited at: 31st Oct 2018 20:34
Havent had no internet for a week puzzler and I see there is many developments here for me to test

Great Stuff as always
fubar
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 31st Oct 2018 18:56 Edited at: 31st Oct 2018 20:10
I have a question that fits good here I think.
Also... I think I asked that already some time ago:
How are we possibly supposed to remove a mesh which we have added previously with AddObjectMeshFromMemblock ?

@puzzler2018: looks good now ...but I'll wait till you can dig holes
puzzler2018
User Banned
Posted: 1st Nov 2018 11:22 Edited at: 1st Nov 2018 11:29
Thanks Janbo.

My technique is not ever going to use all of AGKs versions of the mesh commands - im re-writing them. thus, i dont use AddObjectMeshFromMemblock command and use the technique to "remove objects" is to delete the vertices at any given coordinate location on a particular mesh that we maybe standing on and if want to add / translate / rotate any objects on a given "small" mesh. would be too add a new object (cube) of what ever and rebuild the mesh object entirely and because its only small meshes then we wont significantly see any drop in FPS on the rebuilding - i feel this is the better way to make our FPS and gaming experiencing miles better


I know ive made a rod for my own back doing it this way, but im sure it will work brilliantly eventually.

A comparison is in order

The two attached are a running app.

- AppGameKit instancing mesh objects (say we build a 16x16 chunk of blocks / or what ever we require and then instance them to spread them out further a field - FPS is a drastic 29FPS

and

MeshMemblockInstancing - creating a 16x16 chunk and repeat creating this for the exact same amount of info - FPS is a well profound 210FPS for exactly the same thing

Are we all converted yet!

Ill post the latest once I have gathered up all my commands up into one app for you all agian

Attachments

Login to view attachments
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Nov 2018 11:30 Edited at: 1st Nov 2018 11:31
Oh sorry you think my sentences above did correlate with each other. They don't
I expected you to do it the way you described, nevertheless I want to see what you come up with to store the cubes vertices or vertexoffset so you can reverence them for the digging process later
With other words I'll watching this thread.
puzzler2018
User Banned
Posted: 1st Nov 2018 11:33 Edited at: 1st Nov 2018 11:36
Thanks Janbo - you feedback is always greatly appreciated - sorry if i misunderstood.

Ill start on the digging techniques- i think its come to near to start this - even though i cannot seem to get it like a massive world look and feel as minecraft, but i shall have a go at this now.

Catch up soon with some progress
puzzler2018
User Banned
Posted: 1st Nov 2018 13:17
Here is my take on rebuilding the chunk mesh



Use the attached files

Enjoy!

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 1st Nov 2018 13:41 Edited at: 1st Nov 2018 13:43
Here is my take to build surrounding chunks


each chunk data now can be idenfied in a chunk array


buildchunk(0,-size,0,-size,size) // centre
buildchunk(1,-size*4,0,-size,size) // left
buildchunk(2, size*4,0,-size,size) // right
buildchunk(3,-size*4,0,size*4,size) // front left
buildchunk(4, size*4,0,size*4,size) // front right
buildchunk(5,-size*4,0,-size*4,size) // back left
buildchunk(6, size*4,0,-size*4,size) // back right
buildchunk(7,-size,0,size*4,size) // front centre
buildchunk(8,-size,0,-size*4,size) // back centre


This can be re-factureed into a X and Z for loop but just showing that the 1 - 8 is the chunk array data

chunk[ID, X,Y,Z]

Wll leave you in peace for a day or so whilst i crack on with more
puzzler2018
User Banned
Posted: 1st Nov 2018 23:11
Multi texturing with different alphas for each block


Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 1st Nov 2018 23:29 Edited at: 1st Nov 2018 23:30
Possibility to be able make an individual object alpharised on a mesh would be helpful - like water see through water cubes for example

I had to make the creation of the main mesh have color as well as texture variant

can now fade an individual object on a mesh with makecolor(255.255.255) as full alpha and makecolor(0,0,0) as no alpha

shall send code update soon
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Nov 2018 01:23
Looks Good
fubar
puzzler2018
User Banned
Posted: 2nd Nov 2018 01:27
looks good ..

Is there anything more i should be doing
puzzler2018
User Banned
Posted: 2nd Nov 2018 01:31
Just pretend the whole AppGameKit software was triangular based construction.

Hard work...Not really

Speed - 2nds 2 none

Anyway
puzzler2018
User Banned
Posted: 2nd Nov 2018 01:33
Documentation time
puzzler2018
User Banned
Posted: 2nd Nov 2018 02:25
Here is another example

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 2nd Nov 2018 12:11 Edited at: 2nd Nov 2018 12:46
I didn't looked over everything but whats the chunk[id,x,y,z].x#/y#/z# dont you already have that information in the dimenstions of the chunk array [id,x,y,z] ?
If thats the offset of the faces then maybe add a direction bit to your chunk type like up=0 down=1 front=2 etc (Or at least pass the chunk as reference)
Its a chame AppGameKit has no byte datatype or we would actually save some space with it
I only found AddVertex and AddTriangle no remove... are you building the mesh from scratch each time you add or delete a cube ?
You know this isn't optimal

If you care for performance then you also need to remove adjacent faces or with other words faces which are inside and can't be seen at anytime(well except you clip through the world ).
I think it's easier if you watch the world like a bunch of faces instead of cubes so add/remove faces where needed.
I would do that before trying chunks and after you made chunks clean it up and create a proper voxel library from it.
You could implement something like a face-merging/Greedy Meshing algorithm to also combine adjacent faces but I think that goes to far.
Then you made us all happy and we start creating all sorts of voxel games with it

I think there is no voxel library yet because it's not an easy task so kudos to you if you still want to takle this
puzzler2018
User Banned
Posted: 2nd Nov 2018 12:47 Edited at: 2nd Nov 2018 12:53
Thanks Janbo

Particularly for this type of app, the chunk data is now



Which contains necessary information on each cube within a chunk structure - all of which as some useful data collecting infomration about it

a chunk data structure chunk[id, x, y, z] is the location of the data array that contains the info

ID is the chunk reference. x,y,z is what is stored in that location of a particular chunk

so, if ID = 0 been the centre chunk of the world, then surrounding chunk data will have different chunk references.

So, for at least minecraft style app, We do need a few 16x1x16 chunks which surrounds the players 16x16x16 chunk, and i think minecraft does have 6 x 6 surround 16x1x16 chunks to create its world, so thought of this style of coding to be able to keep a reference to whats going on in the vortex world

and adding a skydome for a nicer effect

I been meaning to indeed make the faces not create if next to any other blocks too and will work on this shortly

Login to post a reply

Server time is: 2024-11-23 15:17:32
Your offset time is: 2024-11-23 15:17:32