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 / Is there anything like a Minecraft clone out there, made with AGK?

Author
Message
puzzler2018
User Banned
Posted: 26th Mar 2018 19:57
Task 3 - perhaps have a chunkdata type with an array of 16x16x16 (for now)

if the value is 1 - then a block is there (dont move)
if the value is 0 - then there isnt (can move)

Like:-



this gets populated when a chunk is generated

puzzler2018
User Banned
Posted: 26th Mar 2018 20:13
Task 6 - scrolling.

Maybe use the idea thought of before and the starting chunk (middle of the world) is the main chunk play on - reduce the world map a little (say 20x20)


All chunks that are behind camera gets repositioned in front of the world, and because starting in the middle of the world (then there is quiet a few that are rendering for no purpose what so ever so move them to the opposite
side (in front of you)

Setting the world size from 80x80 down to 20x20 will increase FPS drastically.

Hmmm - interesting cocept
puzzler2018
User Banned
Posted: 26th Mar 2018 21:25
Breadth first searching is very similar to file compression huffman - ouch thats heavy (for me anyway, always been fond of how compression works) - need time to think about this one

Shall think about it after a few other tasks are in place and done...
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Mar 2018 23:20
I'm sure you will work it out and theres plenty of people on this forum to help
Love TGC forums
fubar
puzzler2018
User Banned
Posted: 26th Mar 2018 23:24
its all about learning now - it is for me too

Once mastered it all -and i will definately make sure i comment everything so to learn how fellow beginners

puzzler2018
User Banned
Posted: 26th Mar 2018 23:40 Edited at: 26th Mar 2018 23:45
I really do need to give credit and my hat off to Janbo/Santman and Bengismo for your meshing contributions - its very worth while and wont be forgotten in the final app
puzzler2018
User Banned
Posted: 26th Mar 2018 23:54
Anyone thought something like this - in VR



Skip to the middle of the video if it gets a boring intro
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Mar 2018 00:50
not sure if you've seen this but def worth a look
http://store.steampowered.com/app/623100/AppGameKit_VR/
fubar
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Mar 2018 16:51 Edited at: 27th Mar 2018 18:31
Hey I started today writing a big part of the Culling Algorithm.
I took primitive Cubes to represent the Chunks as I was only interested in the behavior of the algorithm obviously.
I think I need to fix the TraverseVector that vector that should tell you the direction between the face we came from and the Chunk we want to visit next.
And the demo world is pretty much the worst case as there are holes, to look through, everywhere.
But here is what I got for today.

Not Finished Demo Code:

^We got AppGameKit Syntax highlighting

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 27th Mar 2018 17:33
Wow thanks Janbo thats super cool.

I shall have a read in a little while, to see how its coded and implement it into the app
puzzler2018
User Banned
Posted: 27th Mar 2018 18:59 Edited at: 27th Mar 2018 19:13
Experimenting with Task 7



Make just the players chunk 16x16x16 and the rest of the surrounding meshes - 16x1x16 to conserve fps and memory

EDIT -

If change totalworldchunks to

#constant totalworldchunks=10 // how many of the 16x16 chunks are generated and surrounded

It produces 400k cubes and fps gets down to 20fps - but looks stunning all the same
puzzler2018
User Banned
Posted: 27th Mar 2018 19:25
Been thinking about having multiple textured cubes on a mesh.

Lets think about "layers", so create

16x1x16 "layer1" mesh the green blocks
16x1x16 "layer2" mesh the sand blocks
16x1x16 "layer3" mesh the emerald blocks
16x1x16 "layer4" mesh the other blocks
16x1x16 "layer5" mesh the other blocks

Then position each of the layers in the same position and repeat 16 times (down)

if all the layer has only green blocks on there - then only create layer1

if place a emerald block on that level - then build layer 3 and position it at the same level as layer 1

Hope this makes sense

I did an example on Saturday I think on how to use layering

This technique will only be used on the players chunk - but then not sure how memory would suffice doing it this way
puzzler2018
User Banned
Posted: 27th Mar 2018 19:45
Like this



Enjoy

Crack on with some more later
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Mar 2018 20:58
Great work Jambo and puzzler
fubar
puzzler2018
User Banned
Posted: 27th Mar 2018 21:24 Edited at: 27th Mar 2018 21:26
Thank you - also to Santman/Janbo/Bengismo for their inspritations of meshing

Who says we cant exceed expectations of this



Will be last major code post for today, but here is what achieved last few days

Cubes buiilt in this scene is astronomical
puzzler2018
User Banned
Posted: 27th Mar 2018 21:54 Edited at: 27th Mar 2018 21:55
Tomorrow eve will be to occlude all chunks for 2 levels only the rest of the blocksizey# will be invisible - except the players chunk which will have 6/7 layers below visible (the rest invisible)

Occlude all chunks thats is at the back of the camera

This will drastically up FPS,

Tried the following settings

#constant blocksizex=32 // size of the chunk
#constant blocksizey=32 // size of the chunk
#constant blocksizez=32 // size of the chunk
#constant blocksize#=10 // size of each cube
#constant texturedlayers=1 // the amount of textured layers per level on the chunk
#constant occludelayer=3 // this will make all layers of blocksizey and below visible anything higher is invisible
#constant totalworldchunks=25 // how many of the 16x16 chunks are generated and surrounded


even though its getting huger - fps is slower - the above should rectify, plus Janbo's idea

Im getting tired, catch up tomorrow
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Mar 2018 22:26 Edited at: 28th Mar 2018 01:18
Awesome puzzler

Im sure there is prob some good reason why the mouse movement is like it is

but by changing movecamerawithmouse to


function movecamerawithmouse()

fDiffX# = (GetPointerX() - startx#)/6.0
fDiffY# = (GetPointerY() - starty#)/6.0

newX# = angx# + fDiffY#
if ( newX# > 89 ) then newX# = 89
if ( newX# < -89 ) then newX# = -89
SetCameraRotation( 1, newX#, angy# + fDiffX#, 0 )
//SetCameraPosition(1,camerax#,cameray#,cameraz#)

endfunction

and changing checkkeypresses

function checkkeypresses()

if GetRawKeyState(37) then MoveCameraLocalX(1,-5) //Left
if GetRawKeyState(39) then MoveCameraLocalX(1,5) //Right
if GetRawKeyState(38) then MoveCameraLocalZ(1,5) //Forward
if GetRawKeyState(40) then MoveCameraLocalZ(1,-5) //Backward
if GetRawKeyState(87) then MoveCameraLocalY(1,-5) //87 W
if GetRawKeyState(83) then MoveCameraLocalY(1,5) //87 S
//if GetRawKeyState(65) then RotateCameraLocalY(1,1)
//if GetRawKeyState(68) then RotateCameraLocalY(1,-1)

// if cameray#<(blocksizey*10) then cameray#=(blocksizey*10)
if GetRawKeyPressed(27) then end

endfunction

we get true movement forgive me if i misunderstood the reason why it wasnt just makes more sence to move this way
The only problem is that it will only rotate as far as mouse can go but resetting the mouse pointer with SetRawMousePosition( x, y )
might be able to be used here allowing full 360+ degree movement

The code indenting is causing me havoc
fubar
puzzler2018
User Banned
Posted: 27th Mar 2018 22:32
Thanks for that - much appreciated - all ideas/inspirations or adaptations are always welcome

Ill give this a try tomorrow

Talking on camera and movements- i just cannot fathom out how to move the camera/player in which the camera is facing.

Pressing the UP cursor to move forward great if dont move the camera

but once move cam - it still goes in the same direction lol - we really need to move camera facing
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 27th Mar 2018 23:19
Wow, puzzler. Keep it up!
Regards Sph!nx
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Mar 2018 02:01
Hey besides the code could be much much cleaner
you could write indices for each face using 4 vertices instead of finishing each face with 2 triangles using 6 vertices.
Also please don't create an object just to read data from it either print them out once and "hardcode" the values for makememblock() or look into my CreateMeshMemblock() function I posted somewhere at the beginning.
Now the interesting part is how you want to get the vertices if you want to remove a block. You could work with the vertex positions here but thats a not so nice solution.
But it works and is nice and fast.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Mar 2018 02:33
Quote: "please don't create an object just to read data from it"

The block gave a way of knowing where you would build or delete as the cross hair seemed unpredictable
but it could also be used as a way of getting data. And I think a block with transparency that just sat slightly
above the chunks could show highlighting theres prob a much better way that just seemed the easiest.
fubar
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Mar 2018 04:22 Edited at: 28th Mar 2018 04:23
Not sure what the cross hair has to do with Line 437 I was referring to ?
You are reading the memblock of Object A and write the result into memblock B but instead you can just calculate the vertex/indexOffset etc. hardcode the default attributes of an object and write directly to object B.
Or have I misunderstood ?
puzzler2018
User Banned
Posted: 28th Mar 2018 07:03

Thanks guys for inputs here,

oh yeah - its creating a new makememblock, with an objectplane creation in it, for every layer and mesh now so thats 25x25x25 (chunk) x say 3 layers x 25 x 25 (world), so thats a really good point.

tonight ill check what the data is from the created object and hardcode the values into them -

The cross hair object idea was to see if when it collides with a mesh (chunk) and get the block positions in the world to identify which block to delete or where to add new one.

Like Fubarpk suggests maybe another alternative and cleaner solution - and im sure there will be, so will have a think on getting the world position another way, santman suggested
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Mar 2018 08:50
It may be possible if you know the vertices to select one face and show selections with a shader but that is so far beyond my abilities

fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Mar 2018 09:07
We're not all geniuses Janbo, some of us need to learn you know, and that's easier with the steps shown.
puzzler2018
User Banned
Posted: 28th Mar 2018 10:11
Don't worry, we will all get there and once we have got there with this - then the possibilities will be endless to create many other variation of world like apps, - so use this as a massive learning curve.





janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Mar 2018 13:55 Edited at: 28th Mar 2018 13:57
@Santman: I guess neither am I a genius as I went the same track and discovered memblocks, just a bit earlier. There is very much information here to learn, but I prefer to give too much than to less information.

I still prefer 3 Dimensional arrays to save the VerrtexID's for each face of a block.
So you are able find the Vertices you need to delete via the vertex ID or offset you saved into the array.

Something like this:
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Mar 2018 15:20
We're very much all learning, all I meant was that unless you physically.understand memblocks and how they work for 3d (which took me 3 days of disecting a primative) I'm not sure there's value to saying just make it from scratch. As a tutorial, it's maybe good to leave in some pointers, anyone taking iflt further can remove that part.

I agreed totally with the array, but I thought a different approach actually.....I was thinking a 3 dimensional text array. So you build a string for each block that has vertices positions, block type, strength, timer value for growth....whatever else you need to store that doesn't need extracted from regularly. That way it can be saved and loaded as a single command.

The problem I can see is when you destroy a block.....easy to identify and erase the vertices, but then it's got a gap.....So when you write the next new one for creating a block, how do you know where to put it? I guess you could just make the memblock big enough to store every single block, then use coords to work out the offset and then you wouldn't need the array to store them at all?
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Mar 2018 02:10 Edited at: 29th Mar 2018 02:13
Not sure if I understand what you are trying.
Don't you just go from saving the data into arrays to saving the data into memblocks/strings or something ?
If you are saying that we don't need the array because we already have all the data in the mesh memblock then my response would be: you trade "searching actual positions" for "looking up the array".
Not sure
puzzler2018
User Banned
Posted: 29th Mar 2018 06:11
Wow lots of info here.

We could do either way - which ever is fastest to look up

- Data array - wouldnt this be another memory allocation to be applied to the apps memory resource

- Memblock

Couldnt we just work out the position on the memblock for a certain block?

For example:- Hit a sand block 100 on chunk 14, layer 3 (the sand layer)

Chunk 14 is mesh would relate to worldlayer[14].layer[3]

Block on that layer is in position 100 so on that mesh if bring it into memory with createmeshfromobject

and then calculate the starting vertices on that memblock something like Offset = <header?> + 100 * <Vertices 23> and change them from the currenvaliues - blocksize#

Ill need to sit down and work out the actual calculation but the principle is all the same.


puzzler2018
User Banned
Posted: 29th Mar 2018 07:11 Edited at: 29th Mar 2018 07:26
As we move around the world - we will be travelling over chunks or going deep into layers, so as we move, bring in the chunk we enter into memory to work on - this will only be one load into memory per say 25x25 area.

Then, as we have ltried before - that is each block as a damage level

So create a nice 3D particle system so when just click the left button - it generates some particle blocks same colour as block hit until damage reaches 0 and then remove it - this can be identified by which layer on the layer its hitting,

Layer 0 - grass
Layer 1 - dirt
layer 2 - sand
ect

Whilst working on bringing the damage down (we will assume that the player really wants that block removed), we can start the calculations on the memblock or data array lookup and then when reaches 0, we will have the coordinates on the memblock to remove.

Ill convert the worldlayers[x].layers[textureid] to 3 dimensional when i get chance

like

worldlayers [ x, y, z ].layers[textureid]

Hope makes sense - if not then sorry

puzzler2018
User Banned
Posted: 29th Mar 2018 17:37 Edited at: 29th Mar 2018 17:39
I dont know how you guys think of this but i was thinking of asking TGC to put it on the Mini-Games Series style which Xaby thought of at the beginning also to add to a Games Pack similar to

So a playable demo for the brand new comers and let them see for themselves that its not impossible to create apps like this

i.e

https://www.thegamecreators.com/post/appgamekit-games-pack-2-released

Of course when we have this completed, fully documented and a workable app (like with music/sound/title screen/inventory) etc etc
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Mar 2018 17:42
I think its a great idea and minecraft would encourage many new users

I notice the games pack is very well priced
fubar
puzzler2018
User Banned
Posted: 29th Mar 2018 22:52 Edited at: 29th Mar 2018 22:53
I have now a full week off work until the 9th April so got lots of exciting development work to do on this.

Shall try and send major updates each evening with all the above mentioned.

Catch up tomorrow
puzzler2018
User Banned
Posted: 29th Mar 2018 23:04
Been thinking - this style of programming like with memblocks, can create such things like GTA - im thinking too much - shall finish this first lol
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Mar 2018 23:30
Don't forget to enjoy the Easter Break

Happy Easter to All
fubar
puzzler2018
User Banned
Posted: 31st Mar 2018 10:45 Edited at: 31st Mar 2018 11:10
Happy easter to all for a nice long weekend break



Press the W a little bit to head into the air an then keep hold of space bar.

Im really not sure if this is doing this perfectly though

So if you could test as well, that would be grand

Thanks

edit - there only one snag - its duplicating the 1st created chunk - that will never do and will resolve, just testing removing blocks at moment
puzzler2018
User Banned
Posted: 31st Mar 2018 18:44
Im normally a follower in life - so Just thought try something



OK if looks a bit rubbish but its a start

Attach these to a mesh would be the next stage for this, but not at moment. Got head heavily on the main app at moment
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Mar 2018 20:36
both look good to me
fubar
puzzler2018
User Banned
Posted: 31st Mar 2018 20:54
I dont like the way its (cloning) the removal of blocks on the world

But I suppose thats how i programmed it to do that lol

Ill rectify somehow over the next few days

Maybe indeed go with the DataArray idea
puzzler2018
User Banned
Posted: 31st Mar 2018 21:17
Memblock programming on objects is a nightmare but very powerful if know them well

We have getobjectraycast and getspritecollision but no world collision on a pure memblock (which we want to achieve with this)

So, this will result on many new functions for this type of memory programming

I will aim to learn you all once i have worked it all out

Keep in touch
puzzler2018
User Banned
Posted: 31st Mar 2018 22:53
you all think im a shit prorammer - thanks

i will proove you all wrong
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Apr 2018 00:34
Quote: "you all think im a shit prorammer - thanks"

there's some very good programmers on this site and I think your up there with them

I just been playing around with USGS height data and Wilber to create height maps
ive done this in past with some success with TGC Dark GDK.
(USGS height data 1 pixel of data represents 10km of real terrain) Which is quite fine
for flight simulators but in my last terrain based game i had you moving a vehicle
around on the terrain which i plan to reproduce with AGK.

Its been a bit of a pain as it seems im getting a ravine around the edge of mountains
but incase your interested

Wilber is free and available here http://www.fracterra.com/wilbur.html
So are the USGS height maps but the site I originally got mine from no longer exists
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2018 09:19 Edited at: 12th Apr 2018 22:01
I just been wondering if a shader could be used to color parts of a mesh by passing the vertices
and then the color similar to the way my fade shader worked


if so it may make it easier to color blocks in a mesh
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Apr 2018 12:49
Whoa puzzler......what was that about?
puzzler2018
User Banned
Posted: 2nd Apr 2018 20:50
Dont worry about it - its me over thinking too much. Like, hasn't he finished this yet or thought may have been completed by now with the tools right there in front of us!!

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Apr 2018 04:14
puzzler your too hard on yourself
fubar
puzzler2018
User Banned
Posted: 3rd Apr 2018 07:26 Edited at: 3rd Apr 2018 07:35
Thanks Furbarpk - appreciated.

Today.. If people in my world leave me in peace for a few days. I think i will have a look into

SetMeshMemblockVertexColor
SetMeshMemblockVertexNormal
SetMeshMemblockVertexPosition
SetMeshMemblockVertexUV

Commands with the memblock we have already established.

Edit - these require their own attributes set at the beginning of the memblock, so first job is to identify what that lovely makememblock data is bringing in that santman provided
maybe perhaps we need to add a color attribute for the color one to work properly
puzzler2018
User Banned
Posted: 3rd Apr 2018 18:34
I now have a possible multi-coloured vertex colors now on a an object via memblocks. Im currently building up a fresh cube code from the new way and attaching mutiple coloured cubes to 1 mesh. Hopefully will have something tomorrow afternoon/eve
puzzler2018
User Banned
Posted: 3rd Apr 2018 19:13
A little teaser to get you started


Login to post a reply

Server time is: 2024-11-22 06:52:06
Your offset time is: 2024-11-22 06:52:06