[New File] Strange Grid

Made for BGE / upbge

edit post for updated file
new video


Check_this_out_2.blend (526 KB)

ok now it generates a 100x100 list of dict entries and decides what should go in them

as it walks physics blocks over 5 units away are moved ahead of the player 5 units on that axis


Check_this_out_3.blend (529 KB)

I knew this had potential :smiley:

very dark hard to see anything.

yeah I need to cut my monitor brightness a bit apparently
is this better? - https://www.youtube.com/watch?v=RN3DiUw1H-o

way better

ok new version

1 large mesh split up into a grid of faces [8x8] or [16x16] quads (segments) with gaps larger than the segments between each segment.

build kdtree of all faces vertex (sometimes dupilcates)

use known grid to do (for x in range(), for y in range to check positions of grid and vertex in radius using kdtree

pos = Vector([-(range/2)+(xgridIncriment),-(range/2)+(ygridIncriment),0])

this data is used to build a dictionary of the segments

the players location , orientation and linear velocity are then used to mark tiles as ‘free’ by putting the dictionary key in the free list,

another system markes likely positions that may need a tile,

next ‘free’ tiles are used to fill up the likely spots, and register using the position as a key in a worldTile dictionary (tile.worldPosition.freeze):segment_index_key

as the tile is placed, it also registers it’s vertex in another dictionary
(vertex.xyz.freeze()):[vertex] if it does not exist, else they append themselves

during this time a list is built of faces that changed,

next normals are calculated on the faces that changed, then next the vertex.xyz are used to look up to check to average the normals of all vertex that overlap at face edges.

now I use objects again(instead of 1 big mesh, but not new ones eachframe and no libnew

now at idle it uses .6ms and at a full clip(faster than possible by a jeep) its 7ms logic

however my pc has ‘outside’ spiking in tandem with my logic, getting 57-60 fps

so… I was still rounding by 1/4 when there were 2048x2048 vertex all overlapped into 1/4 …

now not only is it prettier its much faster

next up, when registering a place that needs a tile, it will check to see if there is a dictionary entry already for the tile and load that instead,

as a tile is reused/moved it will register it’s data in ‘SaveDict’
allowing streaming the world and saving it to disk and editing it in game etc.

after that it’s attaching lists of static items to spawn per tile

Ok here is the voxel version for your use and abuse!

needs commented etc but the brave can take a peek under the hood!!


mineCraft_accelerator_5C.blend (2.97 MB)

what is the framerate for it?

the faster you move the worse the framerate.
but 55-60 I think.

one could use servo motion, and lower top speed, cut the number of blocks and use a steady 5ms and leave 11ms fpr everything else.

i get a framerate of 6.2.
On our hewlett packard.Is there anything I need to enable in the upbge?

block easy demo gives me better framrate sometimes it’s framerate is 45.

As a tip for future videos:

Please edit your videos and make them brief and succinct. Nobody wants to watch you spending half the video setting up the view, writing code and testing, unless you clearly narrate what you are doing. If its a demo video, show the demo in full screen, no need to leave all the other footage in there of setting it up. A little bit of effort/time put into editing or at least clipping the start and end of a video can make it a lot more enjoyable to watch.

it’s a resource and it’s not perfect, nor is the video, it is a concept to be expounded on.

I can spend my whole life documenting old projects
(this is a side thing to try and help bge people on discord)

and lost science what is eating the resources?
can you show a screenshot?

from the screenshot I am posting it is the logic that is eating up the framerate.

ok, reduce the number of placed cubes, and reduce the agent top speed.
the variable is called go,

the internet was down in my area.That is why i could not get on the internet sooner.
when i do that the character will get stuck in the wall.
The framerate still bad.
Look at the screenshot of what i did.