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: 3rd Feb 2018 20:54 Edited at: 3rd Feb 2018 21:41
Thanks - shall continue tomorrow - been busy with other things today

I can make it E and X
What if you press 'Space' this will delete all blocks below level 4 to the bottom.

then when you as a player play on the top layer, you can only see 4 levels down.

when you move the player down one level - it dynamically builds a level below and keeps doing that, and when you are deep in the cavern, it deletes all blocks 4 levels on top of you, so we will always have about 15k blocks to play with at anyone time

Ill try and develop this tomorrow


EDIT...

I will also

- try and get the camera rotations and positions correct too so if rotate camera it moves forward (UP cursor) in the direction that the cameras facing

- and start the player on the top layer

- identifying block coordinates - so that can add / remove blocks
eg
when move then it can identify what block your standing on, block[x,y,z] becomes block[4,6,5], so then we know we can delete that block or raise one on block[4,6,6]

It will all make sense when i get this posted for you

please bear with me

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Feb 2018 11:53 Edited at: 4th Feb 2018 11:54
Joining this late, so apologies if I am repeating anything.

I made a working (sort of) minecraft engine in DBPro before, and I think you're right about the clusters. What I found (other than the object count being an issue with AGK/rendering) was that the key was to only render blocks with visibility to them, including underneath. Remember the original minecraft, before the lovely threaded version we have now? Whole chunks of world didn;t render and showed underground areas.

So imagine the layout - this is 2d, but just extend it into the Z in your head. Each block can have one block in every direction around it. So it would be like this (where Y is the block being evaluated to be drawn:

XXX
XYX
XXX

But, lets look at this logically - diagonal blocks don;t let you see inside the larger "box". So, let's say:

ZXX
XYX
XXX

In this example, it doesn't matter if Z is there or not when deciding whether to render Y. So if we are deciding if we render Y, all we need to evaluate are directly adjoining blocks:

--X
XYX
--X

So now we imagine a giant 3D "plus" sign. When looking at the data, I evaluated each block in turn and said "only make this block (create the object) if there is a gap in the plus, otherwise it would never be visible". Every object number was generated based on it's coord and world chunk, with a repeating pattern. This builds the minimum number of blocks based on what "can" be visible, but also allows the construction of vast underground caverns which are initially invisible - but the removal of a single block means the entire cavern becomes visible without the need to recalc the world chunk. If we remove one block, we need only to the above evaluation on a maximum of 9 other blocks, so this is perfectly quick.

The other thing is interaction with the world - it was easy in DBPro, but in AppGameKit the system I use (probably not the best - I'm not that good) is to create a dummy object, set invisible. I then position this at the camea position and angle, then move it X units locally along the Z axis. Then just raycast from the camera to that point and see what gets hit first - that's the block being "mined", from which (since each is numbered using world coords) we can easily work out where it is, and what the surrounding impact is.

Hopefully this wasn;t a worthless waffle - would love to see this come to life.
puzzler2018
User Banned
Posted: 4th Feb 2018 12:44
Texture designer



Thanks Santman - ill have a read
puzzler2018
User Banned
Posted: 4th Feb 2018 18:32
Thanks Santman - ill head towards that type of thing - and Janbo's idea soon

I think I will work with this

2 Examples here

This one shows a bit of invisible in a set camera range (Thanks Golelorn)

Just to show how it works


Example 2- same code but the camera range been changed from 30 to 90-line 397 - to make it not look better but does make objects behind invisible



puzzler2018
User Banned
Posted: 4th Feb 2018 21:30
Hows this for the time being.



Shall do more on evenings- catch up soon
puzzler2018
User Banned
Posted: 4th Feb 2018 22:22
Oh no,we have a flood


puzzler2018
User Banned
Posted: 4th Feb 2018 22:47
Pic attached of a certain location - feels infinate

Keep going for a more better week in some good construction now

Tasks for this week

- A perfect rolling map

- tidy code a bit
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Feb 2018 23:42 Edited at: 4th Feb 2018 23:46
Ohw wow, great work man. Thanks for sharing the code as well. I'm going to play around with my own ways of doing it but it's cool to see how you do this. If I discover something relevant or can provide code in the future, I will!

Edit:
I'm going to work on a system that loads meshes with UV maps. Meshes that essentially use the space of a cube, but can have a little bit more polies and shaping to it. I plan to use those to create assembled objects.
Regards Sph!nx
puzzler2018
User Banned
Posted: 4th Feb 2018 23:43 Edited at: 5th Feb 2018 00:16
your welcome and thanks

EDIT - This will be most welcome...
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 5th Feb 2018 01:38
This latest demo is really looking good. You've captured the basic essence of the Minecraft look & feel well. Now all you need is building and destruction and call it a wrap. lol
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Banned
Posted: 5th Feb 2018 22:53
Thanks

Im on with the collisions

Call it a wrap - does that mean a rolling wrapping mechanism lol
or
Lets close this thread now cause its finally over - sorry about the extent of posts - im only giving you my experience of building this type of game and how i came to the final conclusion on how it would work

Sorry for sooooo many posts on thislol

GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 5th Feb 2018 23:30 Edited at: 5th Feb 2018 23:31
Not at all. Lol I meant get that building and destroying functionality in and that should basically achieve the goal of the project at least for a first release serving as a template starting point for a MineCraft style game engine.

Never can be too many posts when they are focused on experiments and building something.

Keep posting! Keep building. The further you take it probably the more interest it will get.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Feb 2018 23:37
I Agree...keep posting as much as you want.
In the last demo you still have double sided planes, which decreases performance
puzzler2018
User Banned
Posted: 5th Feb 2018 23:45
Thanks both - I will, Janbo - i havent forgot your idea...

Im on with building and destroying the next few days instead.

I just need a tad longer to learn how and why memblocks work like they do then ill be spot on

i never knew about texture repeat mapping until yesterday, so all this is an excellent learning curve to everyone

Thanks for you advise so far
puzzler2018
User Banned
Posted: 6th Feb 2018 00:31
Sorry, it took me an age with AMOS memory allocation commands

Just wish TGC could have provided a small example of each command when bring one out - instead of saying there you go. work it out for yourself!

My mind doesnt work very well with 3D vectors just yet lol
puzzler2018
User Banned
Posted: 6th Feb 2018 00:47
It really does feel that this 3D meshing / vectoring stuff is one big secret - no one except Janbo has given a full set of commands.

But what does each of those commands do and why is still a mystery

Any offerings on what those commands do and why we need to use them the way we do would be a great learning curve to learners here

Any offerings?
puzzler2018
User Banned
Posted: 6th Feb 2018 00:59
Thats why I havent developed this with memblock meshes - non comprehensive... I dont like to use copied code - i like to understand how code works, so can chop and change it and make it work to how i like


puzzler2018
User Banned
Posted: 6th Feb 2018 01:26
Anyway - i forgot this is Xaby's post -Xaby, any thoughts?
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th Feb 2018 05:43 Edited at: 6th Feb 2018 05:45
I don't know what exactly it is you are working on when you say 3D meshing / vectoring / memblock meshes.

I mean I guess you are talking about building or manipulating a mesh inside a memblock but I thought you were already doing that.

Things like double-sided and single-sided planes conceptually it is clear to me but I have never experimented with such things so cannot readily help out. I'd need to spend time focusing and experimenting to figure it out.

In fact, maybe you are not getting many code tidbits posted because you are boldly going where no man (and woman) has gone before. Meaning perhaps others would need to experiment and figure it out themselves before they can share.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 6th Feb 2018 20:22
Ok, so this is only about an hours work, but I figured this would make things more clear RE what I was saying.

Here I generate a 50x50x50 chunk (125,000 blocks), starting it half filled up (so to level 25 on the Y axis). I then run a simple random algorythm on it to generate a raised and dipped landscape, and the result is drawn. First, I draw it without culling blocks we don't need - very slow. Then I draw it again using a very very simple "plus" check and remove any blocks that cannot be seen.



This is still VERY slow, and would need altered for transparent blocks, but wihtout occlusion culling I don't know hw much faster tier 1 can be.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 6th Feb 2018 22:12
As well as occlusion culling, we can also merge meshes to reduce number of drawcalls! I just did a quick test using Preben's drawcall optimiser code from GGLoader and got quite a good frame rate boost on my first attempt (see pics). This is a bunch of 10x10x10 boxes. I hacked preben's code to manually merge the meshes of cubes within a distance of 100. Framerate jumped from 38fps to 50fps! Nice.

Attachments

Login to view attachments
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 6th Feb 2018 22:18
I have it now fully functional for deleting blocks, just adding the code to place them and I will upload it. Would love to see what you do with it.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 6th Feb 2018 23:53 Edited at: 7th Feb 2018 00:58
Yeah its all about reducing the number of drawcalls/vertices per object.
If you say "only render what is actually needed" I think about this:
50x50x50 Cubes

The left picture is from above and the right is from below+inside the chunck so you can see there is nothing except of the hull.
It was work for half an hour and it can still be optimized by combining all the faces to one object.

Attachments

Login to view attachments
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 7th Feb 2018 02:51
Wow, looking very cool guys!
Regards Sph!nx
puzzler2018
User Banned
Posted: 7th Feb 2018 07:23
Thanks guys! looks really good too.

puzzler2018
User Banned
Posted: 7th Feb 2018 07:36
The only way I imagine this huge block been created, is by using planes

so say 50x50x50 cube will be

- 6 planes at 50x50 each
- all connected together to make one cube (but huge)
- the faces on them then is textured with repeat texture wrapping on each side.

- so the full top is textured with grass
- so the 4 sides and bottom is textured with dirt

This wont use much memory at all - it will be 4 polygons to 6 faces = 24 polygons

Because of that - then the map can be what ever you want, 60x60x60 - 80x80x80 - 100x100x100 - or even 1000x1000x1000
Head is going to explode with trying to work all this out

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Feb 2018 07:47
Creating one single cube won't work like that where heights vary I don't think - the sides of blocks protruding upward would also take the grass top would they not? You'd also hit issues when trying to add code to break and add blocks. The biggest issue I hit was tracking what the number of each block was, so you know which to delete, where it Is, and which adjoining blocks to create when destroying one.

I'll play again tonight and post what I've got working. I wonder if making blocks further away from the player static and then pulling them back as they get closer would help.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Feb 2018 13:32 Edited at: 7th Feb 2018 13:32
@puzzler2018: It might be that you describe a quadtree.
Someone already mentioned it, and I also think that quadtrees could be a good solution.
puzzler2018
User Banned
Posted: 7th Feb 2018 18:57
Interesting read

http://docs.overviewer.org/en/latest/design/designdoc/

I will not be beaten lol
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Feb 2018 19:19
Pretty sure this is for 2d isometric games........
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 7th Feb 2018 19:58
I will not be beaten

That's the spirit @puzzler2018! If Notch did it you can do it. Surely the man is very knowledgeable and skilled but I imagine that is the result of years he spent experimenting on development of Minecraft much like you are doing now. Obviously you are benefitting from some of that shared knowledge but considering the overall timeframe spent in a part-time capacity you are doing extremely well I think!

It will be very cool when building and destruction are in. And although the biggest hurdle is likely the rendering I wonder if some of this (such as your culling process) would benefit from being implemented in C as a DLL. Seems like that would be worth testing once you get to that point later on where the concerns are purely performance.

Anyway I always check this thread eager to see your latest updates.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Banned
Posted: 7th Feb 2018 20:33
Thanks

Here is an interesting concept which I have applied to my last update

and this is that the smaller cubes only have a top, front and right face, no bottom, no left or no back planes

Thorectically, we would never see these anyway - cause they are either masked by blocks behind or blocks at each of there sides and if at any time any blocks do get seen with those openess, then do a quick
movement of the left and right faces for each cube. - always keeping a cube with 3 faces instead of six-cause the player will always be in front of a cube.

I shall try and code this concept theorm over the next few days





GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 7th Feb 2018 21:22
That is an interesting approach. Reminds me a bit of billboard sprites always facing the camera.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Feb 2018 21:46
I wonder if there's a shader based approach......not just would it be quicker to have a shader draw it the textures.....but could you actually have a shader draw the cubes full stop? Kind of like grass. You can I believe have a shader duplicate a mesh and render it, such as with procedural grass.
puzzler2018
User Banned
Posted: 7th Feb 2018 21:48 Edited at: 7th Feb 2018 21:51
Going also try a column splitter

1 cube column wise- textured with wrapping

if hit any part of the cube, to programitically split the planes in two/three....hundreds of times

So, starting with 1x1x256 column cube - 16 times to make a cube

can use objectscale to add/delete blocks

but what if player hits in the centre of the column block - then need to split it in two.

Ok... Im going with this....

Be back soon


EDIT - Shader--- please dont use that foul word... not at moment for me anyway lol
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 7th Feb 2018 22:13
Just a thought.
I'm working on manually writing a .obj file. It's quite easy. Perhaps it is a good idea to have a process generate data, write the .obj file, and then reload the object file as one mesh.

Just for the curious...
I'm fiddling with a retro-fps project, similar to wolfenstein, but with some different RPG gameplay elements. I'm not working on something elaborate as a complete dynamic terrain but I'm testing this for some in-game structure building or perhaps an editor.
Regards Sph!nx
puzzler2018
User Banned
Posted: 7th Feb 2018 22:39
Im concerned dynamically creating an obj file from a map would blow someones hard drive space and if on Android

Just something to try and consider - thats why i love procedural

No media is ace

puzzler2018
User Banned
Posted: 7th Feb 2018 22:43
Please give it a try.
puzzler2018
User Banned
Posted: 7th Feb 2018 22:50
Minecraft was around 5GB of size and worth billions

Most of the 5GB probably was textures and code
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 7th Feb 2018 23:13 Edited at: 7th Feb 2018 23:14
I know, the data of the generated worlds are in the save files, not with the product itself. Data used to create (possibly temporary) 3D files would be in the save file.
Regards Sph!nx
puzzler2018
User Banned
Posted: 7th Feb 2018 23:23
Oh yeah - i forgot load / save mechanisms - good one!!
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Feb 2018 00:23
Ok, so an update.

I have turned off lighting for the blocks and this bumps the frame a bit, but it looked rubbish. So I threw in a simple shader to do it for me, and on my laptop I get (with around 4.5K cubes):

In AppGameKit texturing and lighting - about 43 FPS with all on screen
With the shader texturing and lighting - about 57fps

Visual quality remains identical. So what's interesting here is bypassing AppGameKit lighting and passing it to a shader and having that render it seems to give a fair boost.
puzzler2018
User Banned
Posted: 8th Feb 2018 00:35 Edited at: 8th Feb 2018 00:39
Ive updated mine to use columns - this is frantic but used 100x100



use cursors to move about.

the fps will be high- but the same thing is been able to a decent cubes in play without blowing the GPU


EDIT - Wrong app - getting tired

puzzler2018
User Banned
Posted: 8th Feb 2018 00:37
Thanks for you effots but can be simplified more with different tactics
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Feb 2018 00:42
I can see what you've done....but I only get about 33fps when they are all on screen. Also, I can go behind them and see "inside"? Changing all those meshes as you move will be really really intensive. Also, you're actually adding to the object count are you not? I'll upload my effort in a few - trying to add building now.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Feb 2018 00:43
p.s. For PC, you can use setsyncrate(0,0) to set it unlimited.

Well you can use it for any platform really.
puzzler2018
User Banned
Posted: 8th Feb 2018 00:46
It is - I set for Windows 6000 or something and let AppGameKit choose othersize depending on hardware

if android - i would suggest 30.. and if programatically do things right - then should always stay around 27/29 when on androids

its about optimization for all platforms

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Feb 2018 01:44
Ok, so here we have it. This version use a shader to render the blocks, and a landscape of 50x50x50, culling what isn't needed. You can mine with the left button and build with the right. There's no saving, but that's just saving an array.

Still a bit slow, but that's over to the experts now - I'm off to paint more landscapes.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 8th Feb 2018 03:03
For better or worse lol
[href]null[/href][img]better.bmp[/img][img]worse.bmp[/img]

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 8th Feb 2018 03:08
We could create a real mine feild lol

Login to post a reply

Server time is: 2024-11-25 06:10:50
Your offset time is: 2024-11-25 06:10:50