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
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Mar 2018 02:49 Edited at: 12th Apr 2018 21:55
I think using a texture might really improve things either that or my graphics card is on the blink lol
but I played with the generatechunk() and the generateperlinimage() just trying to make it use a texture
from 1 to 4 and setting fullcolor on objects instead of noise rgb values and the FPS increased significantly
but I messed up the code so I wont post but at one stage I got over 200 FPS with

It may have not been the textures that improved it I was a bit lost in code lol and went back to the older
code I also was playing around with lighting it really got bad just thought ide share my experiences lol

Anyway il wait until the new stuff is added by someone that knows what they are doing I'm going back to
giving myself the noob status lol this 3d in AppGameKit is so different than it was it Dark GDK or Darkbasic
fubar
puzzler2018
User Banned
Posted: 15th Mar 2018 07:29
Again thanks for your efforts - and it works great with the code bits added in - ill use this and adapt to this one, so dont loose your bits of code in the midst

Yeah the map 100x100 will be better in fps.

We are all noobs in a way - i only had my hands on agk for around about a year and come along way i feel with it.

I used to be a 2D and 3D stuff really takes it out of us unless a 3D specialist.

But its all about learning new methods etc i suppose.

Ill crack on more with it tonight and do the memblocks stuff this weekend - i wont stop till i get it right...
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 15th Mar 2018 10:06
Nice work guys, especially on creating the cubes from memblocks. If you can have a 300x300 field full of cubes and still hit in the region of 130fps then that should be performance fixed pretty much. Downhill from there.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 15th Mar 2018 21:37 Edited at: 15th Mar 2018 21:37
Just gave it a bash - seems to work ok, but placing blocks seems to have an issue - I click on the side of a block and it adds one on top?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Mar 2018 22:31 Edited at: 15th Mar 2018 22:51
Quote: "Just gave it a bash - seems to work ok, but placing blocks seems to have an issue - I click on the side of a block and it adds one on top?"

Yep that's the way its meant to work

@Puzzler I think clipping may be able to be done at the shader level done in the shader so it ignores all drawing of an object outside a preset range

just tested that by setting in the pixel shader to ignore all process and only got about 2 FPS improvement with over 20k object about the same improvement
I get setting the fog range. There may be a better way of doing it yet just not sure
fubar
puzzler2018
User Banned
Posted: 16th Mar 2018 07:12 Edited at: 16th Mar 2018 07:16
Maybe

AddObjectMeshFromMemblock

and

SetMeshMemblockVertexPosition
SetMeshMemblockVertexUV
SetMeshMemblockVertexNormal

Example from TomToad -)



Although this works with one object, we would want 100k objects lol

So maybe use the AddObjectmeshMemblock to attach another cube onto the first - and repeat this step over and over until got a 16x16 grid of cubes.

Although havent tested this yet not until this afternoon but the principle of the above would be absolutely fantastic but in practice not sure if it would do this

This theory isnt tested, but will have a go this afternoon
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 09:05
I would've thought the new mesh object would assume the object position it was copied from

and you could create a block and add a mesh from the memblock then delete the block leaving atleast one

but i had troubles with setting the locations of the mesh but with my tests it seemed to make a big difference


fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 16th Mar 2018 09:18 Edited at: 16th Mar 2018 09:20
Furpack, the shader idea won't work.....tried it many times myself. The vertex data all still gets processed, which means every fragment still gets processed. You can discard a fragment, but not a vertex. The only clipping possible is through the camera or the frustrum.

Read something that says you can force the camera range to be reduced for a shader that would clip objects applied solely to that shader, but it's done in the C code and passed over.

OMG......lightbulb moment. I wonder if we use AppGameKit to set a short camera range, then draw one object, then increase the range and draw the rest......would it clip shorter for the first draw call? I assume AppGameKit passes the current camera range to the shader so that should actually work, if you can live with drawing all objects individually.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 09:34
@puzzler2018

found this forum post with some very useful math functions that may help
https://forum.thegamecreators.com/thread/217064#msg2582798
fubar
puzzler2018
User Banned
Posted: 16th Mar 2018 10:11
Cheers guys - lots of inspirational ideas to try out

Quote: "Just gave it a bash - seems to work ok, but placing blocks seems to have an issue - I click on the side of a block and it adds one on top?"


Yeah - I noticed this too, but can be earily remedied by building the cube faces instead of using AGKs createobjectcube. and when a face is been touched - then which ever side its touching - then add a cube to that adjoining face.

Something to come soon

puzzler2018
User Banned
Posted: 16th Mar 2018 14:58
I have tested it with addmeshtomemblock and vertex positions

and its a no go



Not only it takes an absolute age to build a simple 50x50 set of cubes - the performance of it will be rubbish and we are very limited - cause it just boooms if try to increase the 50x50 to something like 100x100

There must be limitations on meshes

This is no go - unless someone else has done it with these principles and will be more than welcome to feedback

These functions are good with small games - but not for a vortex world
puzzler2018
User Banned
Posted: 16th Mar 2018 16:24 Edited at: 16th Mar 2018 16:33
Im just experimenting



Disclaimer:- if it booms your pc - im sorry
puzzler2018
User Banned
Posted: 16th Mar 2018 16:38 Edited at: 16th Mar 2018 16:44
You can try different variations of

#constant mapx=80
#constant mapy=40
#constant mapz=80

or

#constant mapx=400
#constant mapy=2
#constant mapz=400
#constant blockskip=400


So, if you think this is neat - then its time to get started with occlusion culling etc
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 17:29
Wow that's allot of blocks

Quote: "Disclaimer:- if it booms your pc - im sorry"


All good no deaths here yet lol but FPS did drop quite low

Quote: "So, if you think this is neat - then its time to get started with occlusion culling etc"


Its a pity AppGameKit doesnt have built in commands for this


fubar
puzzler2018
User Banned
Posted: 16th Mar 2018 17:34 Edited at: 16th Mar 2018 17:36
Added our good freind perlin




Im just performance testing at moment, to see how many cubes AppGameKit is really capable of.

and then work on different techniques to do culling etc - but this is mainly for how many cubes can it really do
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 17:57 Edited at: 12th Apr 2018 21:57
Setting constants like

and

and


made my FPS shoot back up to >=45 FPS with >40000 blocks
fubar
puzzler2018
User Banned
Posted: 16th Mar 2018 18:00 Edited at: 16th Mar 2018 18:05
It maybe good for a game loading/title screen perhaps



EDIT - yeah those parameters look cool to me


Out of all the experiments of creating worlds - which one would you all prefer been the better one out of them all?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 18:32
I really liked the look of that too

with my playing i found restricting it to around 40000 blocks and increasing the block size by 8 changed my 3 FPS to 45 FPS

Quote: "I guess thats why they created there own engine specifically for minecraft and made the big bucks"


I think the light version when the camera panned out might view a very nice world but to make the world big enough and still have
useable FPS we have to have strict limitations on map size, have blocks appearing quite big and not allow the camera to zoom out
but it could have a view of the world panned out when loading then set camera to a close up view where you dont see allot of block
of blocks and most of them are culled by agk. Thats my two cents worth.
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2018 18:50
brain storm lol well maybe

And If the world was created 200,0,200 for example when you got to the edge of the world it would load another 200,0,200 world
this is done in allot of online games like secondlife for one. I'm thinking it would be possible to still create the perlin image the same
just when you create the map, create it from an x,y location to w,h when you moved near x recreate and position your objects this
way you could still have a large map you would just have locations in the map where it would load another portion of the portion
fubar
puzzler2018
User Banned
Posted: 16th Mar 2018 18:54
Quote: "
Minecraft as got millions of bugs!! and they have direct programming with OpenGL via Java now C - and C is a zillion times faster anyway
and with C and OpenGL, they can select what objects to render in one draw call.
We would have finished it all by now if it was in this language lol
"



Quite an interesting concept you have there. - keeping the viewport (camera range) to 40,000 blocks and spread them out by scaling the further a field the camera sees

The is not to mention that we can create a 3 single sides face (half a cube), the other 3 faces never get seen by anything anyway cause they are at the back of the camera - and we would never need to see the bottom of any cube what so ever- thats 8 polygons per cube that can immediately dissapear from rendering.

Polygons with 40,000 at 24 =960,000 polyigons

3 sided cube = 320,000 polygons

Massive saving for the GPU

Let me have a think and knock this up for my next post.





puzzler2018
User Banned
Posted: 16th Mar 2018 20:38 Edited at: 16th Mar 2018 20:45
Here is a puzzle for all of you



How about or could we do some kind of greedy algorithm, to collapse cubes up.

then if hit anywhere, then it will convert them into segments

like we got 1 object here

hit a block and it will go away and work out a greedy algorythm to split the top layer to peices - resulting in 1 block missing. by shrinking and resizing the layer underneath the player

If any of you get my meaing - its difficult to explain

maybe a good example to work with


Ill let you all ponder for a while..
puzzler2018
User Banned
Posted: 16th Mar 2018 22:43
Or maybe use columns, thinking underground..

we can start with a say 50x50 chunk size, the height been 128, but when hit a block - just simply "scale" the column of that position.

My heads exploding thinking of this,

nice fresh day with it tomorrow
puzzler2018
User Banned
Posted: 16th Mar 2018 23:15
Sorry if this is tormenting you all and not finished yet.

- who suggests they are sick and tired of this thread keeping appearing

or

- who wants to see more developments and reach the final destination of this ( i cannot gaunrentee this will end soon)

Welcome to game programming
puzzler2018
User Banned
Posted: 16th Mar 2018 23:44
Major render problem lol

Pic attached

reproduce with


Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 16th Mar 2018 23:48
My gather is the GPU is run out of processing memory


Computer says no
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Mar 2018 23:55
Quote: "@puzzler2018

found this forum post with some very useful math functions that may help
https://forum.thegamecreators.com/thread/217064#msg2582798"


Wow! Thank you so much for this. I have been disheartened that AppGameKit has not done more with tier 1. Seems like there are a lot of us here that use these functions.

Quote: "
Sorry if this is tormenting you all and not finished yet.

- who suggests they are sick and tired of this thread keeping appearing

or

- who wants to see more developments and reach the final destination of this ( i cannot gaunrentee this will end soon)

Welcome to game programming"


I def want to see more. You and bengismo have been huge additions to these forums for us newbs.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Mar 2018 00:01 Edited at: 12th Apr 2018 21:57
Ide like to see more developments

Just been a day of voting and late sleepless nights lol

Quote: "Or maybe use columns, thinking underground.."

that would work well i think

i was thinking more along the lines i hope this explains


Ive been playing with this concept but i was having probs with resetting the camera pos
but with 10000 blocks i wasnt noticing much of a delay resetting the blocks

which would work fine if there is the same number of blocks on the y axis

heres something just to try


use the left and right arrows theres 8000 blocks and it should seem as tho it is never ending
I get 95 FPS
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Mar 2018 13:15
OK, so I built the world using a single mesh usig a memblock, and I have now got a view to the horrizon with 20k+ blocks running at 800+ fps.

Still lots to do (normals on rear faces don't work yet), but it;s drawing more faces currently than it actually needs (this allows clipping in between faces super easily), so even with a Minecraft sized world you should be able to hit 300+fps on a decent machine. I'm doing this to learn for my own project, but the speed is possible with some really low level memblock stuff - I'd focus there. You'll also need to texture it with a shader. And totally rework the collision/deleting/building.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Mar 2018 14:59
Ps.....in Minecraft you CONSTANTLY see the bottom of cubes btw.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Mar 2018 15:06
Quote: "OK, so I built the world using a single mesh usig a memblock, and I have now got a view to the horrizon with 20k+ blocks running at 800+ fps."


Have you got an example of any changes you made
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Mar 2018 15:22
Once I get the reverse normals working I'll post something.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 17th Mar 2018 20:03
Ok, so here we go - here is a video of the new single mesh based minecraft landscape in action.

This simple demo shows two versions of a minecraft drawing engine. The chunk (area of game world) being worked on is 50x50x50 blocks, so potentially 125,000 blocks per chunk.

The initial method (shown at the start of the video) just draws each cube seperately by generating them one at a time (or loading a pre-made cube, user choice), and with just this one chunk we struggle to maintain 60 fps (8gb 1080gtx)

Using method 2 (the entire chunk is one mesh using memblocks, processed as a single draw call) we generate the chunk and then duplicate it 24 times to make a simple landscape of 5x5 full chunks - thats a whopping 3,125,000 potential blocks.....never dropping below 330 fps.

This is a simple flat landscape but still has huge room for optimisation as each "block" is built individually one face ata time, so joining walls could be completely removed - so here we could further reduce the draw pipeline by around 60-70% with solid optimisation, climbing back to 600+ fps. And the entire chunk is generated in 0.3 seconds - more than fast enough to do in the background if you were so inclined for an infinite landscape using seed generation.

So using memblocks and writing the faces into a single mesh works well (save for the incredible depth screwing that occurs - I get that in everything, need to work it out)...exactly the same as my grass tech demo.

GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 17th Mar 2018 20:25 Edited at: 17th Mar 2018 20:26
Well done @Santman this looks like you have proved Minecraft style worlds can indeed be created in AppGameKit Tier 1. With those kind of frame rates there is plenty of time left each frame to handle enemies, collectibles and gameplay!

Of course, people might not believe it until they see this world with trees, water and all the textures but it certainly looks like this is the foundation to build on.
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: 18th Mar 2018 00:45
Thanks Gar, and it is exactly that.....a foundation. You could use at atlas to texture the cubes by setting the correct UV data for each face I think, and as for trees and water etc, that's truly just a case of playing with the landscape settings. This just creates a flat surface at level 25, then randomly creates spikes on the surface.

Very single cube is a cube, so it literally makes no difference what the landscape is, the mesh is built to match it. I plan to adapt this to my own landscape code now, using it to do better grass. Then internally in my 3d ships to allow for faster performing interiors. Thinking it would also make good for buildings outside.

The key is that the command to add a memblock to a mesh seems to create limbs, which I'm guessing still get separately processed in AGK. By writing everything into a single mesh, it's one process and one draw call. Some minor tweaking and this can merge meshes using that technique.....limited uses, but for example i plan to try using one mesh for all tree so I can have thick forests that don't need multiple draw calls and so perform really fast
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Mar 2018 02:55 Edited at: 18th Mar 2018 02:56
So last video, attached is a stress test. This one generates a much larger world, and makes it much more complex to see exactly what performance at it's worst might look like.

Not bad for 54.5 million faces...



If you want the code let me know - it's buggy just now due to the rushed hill/dip generation, but it'll give you the basics.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2018 03:07
Quote: "If you want the code let me know - it's buggy just now due to the rushed hill/dip generation, but it'll give you the basics."


Yes please !!
fubar
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 18th Mar 2018 03:15
@Santman That last update... your stress test... is very impressive. Seems like that is a massive world when you zoomed in. Get the textures going on and so forth then can move on to enemies and so forth! 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: 18th Mar 2018 14:19
Need I say or do anymore with this.

Congratulation Santman
puzzler2018
User Banned
Posted: 18th Mar 2018 15:06
Santman - I really want to achieve what you 3D guys can achieve in no time - and make all us inexperienced guys go WOW! lol

All I ask of you is what are the full range of 3D commands you have used to create such a thing in your demos - then I can work with those commands to produce similar

You dont have to provide the full code, just the commands so I can start from somehere

Many thanks


Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Mar 2018 16:27
Hey guys and gals. OK, here it is. There's a few things to note:

This needs 64 bit (uses roughly 3.5gb of ram, you'd need to tweak it to reduce - it can go as high as 9gb if you get too carried away (460 chunks)!
It crashes 50% of the time when run - this is solely the code that access the array to create a random hole - sure it's an easy fix, but I'm moving on now
Texturing should be easy enough by assigning UVs to each face from an atlas (not tried it, so not sure)
Collision is per chunk - so needs altered to detect the individual cubes

So I don;t thinkt his thread is done, all this does is allow large volumes of 3d data on screen, there's still so so much work left to get to MineCraft level: lighting needs sorted, texturing, generation of new chunks, proper seeded generation of terrain (probably thee single most impressive minecraft element), building, deleteing, aligning the edges of chunks so that there is effectively dummy data to avoid holes.....really all I wanted to show was if we *could* do a vast 3D world, and I think this shows we can.

This also needs opptimisation - faces that aren't needed should never be built (there is some rem'd out code that shows this s fairly easy in principle, but I think I got two the wrong way around), and indices could be used to further speed it up - fairly certain you could double the speed here with decent optimisation.

Enjoy guys - really looking forward to seeing what you can do.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Mar 2018 16:38
This is my take on silly memblocks



Catch up later in the week when ive understood them more
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2018 21:11 Edited at: 18th Mar 2018 22:09
Thanks Santman

getting some really strange results but with the method set to 3 I noticed
Error: Failed to set mesh from memblock data, memblock is too small for the data it claims to contain in main at line 773
but if I run a program of mine in the background that uses opengl
Creating chunk 32 of 168 -3*4
Error in main.agc at line 69

"773 CreateObjectFromMeshMemblock(2,2)"


if I close the program in the background and recompile it reports Error: Failed to set mesh from memblock data again

I probably running out of memory but it seems the first error to me would appear some kind of AppGameKit bug
system
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Mar 2018 22:45 Edited at: 18th Mar 2018 22:46
That's an error that comes up....it started after i addwd the raused and lowered bits. Goto the function for building of the chunk and look for the random function that days it adds holes....and modify it to stop the holes and hills

I think it's because these result in holes at the edges that don't create faces, so the code doesn't build them but counts them.

P.s. when I run it, it uses about 3.2gb at the sizes I uploaded
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2018 23:27 Edited at: 12th Apr 2018 21:58
Thanks yes that worked a treat
I commented out as follows


and then made the map 5 * 5 * 5 chunks instead of 6 * 6 * 6



For anyone having trouble getting it to work
but I found it very impressive

I think then we need a routine to select a face that we can either add another block to chunk or delete a block from a chunk a more complex routine than what we
currently have even if we don't modify the texture which would allow a green block being placed on green land etc
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Mar 2018 00:03
Quote: "Need I say or do anymore with this."


Please don't feel discouraged Puzzler
it was you who started this thread, it got minds thinking and made the thread active
some of the people on here have been playing with memblocks and mesh for a lot
longer. you have come a long way in a short time and I'm sure there is much more
that you can do on this project

There is much to do yet, I was just hoping this thread would achieve the ability to
have a minecraft type world where we could add and remove blocks and move around
in, it was your approach that proved it could be done but limitations on FPS meant
we had to look at other methods to make a world that was big enough. Theres so much
to be done to just get the basics to work as it should.
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Mar 2018 09:15
No I agree totally, keep at it guys......this is just a part of the puzzle, and rough.

Had a thought about collision: if you project the camera forward on the Z axis an amount, then gets it's world coords and divide them by the bkcoksize, you should get the X, Y and Z coords of the array holding the chunk data, to detect what block is selected. Then place a hidden cube primitive at that location, and recast to it......you'll get the face collided with.

So what you would need to do is add fields to the array holding the chunk data, storing the vertice numbers relating to that part. The thing about memblocks is, they don't need to be in sequence, so deleting or adding faces doesn't need to be done in order.... New ones just get added on (read the number of vertex entries, increase it, add the new one, rebuild the mesh from it). Deleting is the same, except you'd need to then remove the gap, which is a bind. Maybe store the raw vertex data in a separate one, then use the array sorting.

For textures, try playing with the uv coords. So six faces in a texture going across in a line, face one would be 0.0 to (1.0/6).....i think. For normal blocks no bother, for ones different from all sides youd need to work out the coords based on angle.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 19th Mar 2018 11:55 Edited at: 19th Mar 2018 12:02
@Santman: What you are trying now with removing the faces from inside/below the map is what I did in my demo from the beginning.
The Demo just added Faces as whole objects but It should be easy to change that, the only difficulties I could see is detecting the vertices of a face which you want to remove to generate the map in realtime.

Nice fast demo
puzzler2018
User Banned
Posted: 19th Mar 2018 12:42
Now ive got the gist in what Janbo/Santman has acheived, it is quiet cumbersome but straight forward just making a note of the vertices/uv/normal data for the world instead and setting the vertexpositions in realtime once the map is built from random perlin.
and the faces.

Ill get a version to you at the end of the week after I've had a good hour or three on it each night this week

Again, thanks for the memblock inspirations guys

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Mar 2018 16:15
That's the key Janbo, I've learned that AppGameKit can be perfectly fast, but only with smaller numbers of objects. I got my grass shader running 450,000 planes for grass at 80-500 fps dependant on distance......doing those exact same shapes with individual planes runs at 46fps with 20,000.

Batching draw calls is the key. I note in AppGameKit you can instance an object but it makes zero impact.....but I wonder if that's the foundation to instances rendering in the shader. Still a way to go to learn that, but I may play around with it one day.....the tutorial for it is fairly basic.
puzzler2018
User Banned
Posted: 19th Mar 2018 17:33 Edited at: 19th Mar 2018 17:58
we nearly there with instancing.

I got 450k cubes with instances - ok at 1-3fps

general createobjectcube - would just crash when it reaches 80x80 cubes

and thats with no textures

huge difference those two commands and instancing is the way to go

Just wondering if CreateObjectCube creates the cube with double sided faces, similar to createobjectplane, if so , then manually create a cube with a single side faces all way round and then instance that, this may make things a little lighter on memory and give us more too

then once got that - then perform tests on grids

10x10
15x15
20x20
30x30
40x40
etc
etc

to see how FPS is heading - a nice 150+fps (not anything below) for a starting map/grid is where we need to be heading towards

creating a cube straight away will bring in all 6 sides (if there a touching another cube on the map - then that face is pointless to be created.

So need to work out the positioning of adjacent cubes and skip the creation of that face - instead of creating and using setobjectvisible.. This wont affect anything, but if dont create the face object to start with then thats better than anything

Shall crack on with a few bits and bobs on it

Login to post a reply

Server time is: 2024-11-22 06:15:19
Your offset time is: 2024-11-22 06:15:19