Is it possible to make a level seamlessly load into another?

Well BPR asumes you got basic knowledge of python :wink:

So the script he gave is just an example and not working out of the box. Try this:

position = own.worldPosition
radius = 10
min_distance = 20
max_distance = 50
pool = []

for obj in own['kd_tree'].find_range(position, radius):

    if obj[2] < min_distance:
         if obj[1] not in own['filled']:
             own['filled'][obj[1]] = pool.pop(0)

    elif obj[2] > max_distance:
         pool.append(own['filled'][obj[1]])
         del own['filled'][obj[1]]

docs: https://docs.blender.org/api/current/mathutils.kdtree.html

1 Like
for point in own['kd_tree'].find_range(player_position, radius):
    if point[2] < min_distance:
         if point[1] not in own['filled']:
             own['filled'][point[1]] = pool.pop(0)
    elif point[2] > max_distance:
         pool.append(own['filled'][point[1]])
         del own['filled'][point[1]]

sorry I had a typo also *
I had a ‘near’ that should have been ‘point’
and I use ‘point’ as the search point also - changed that to ‘player_position’

point[0] is the vector returned by kdtree
point[1] is the vectors index
point[2] is the distance from the player

I may already have a working copy.
edit:

(lost it with my last HD I guess - UPBGE Procedural Foliage generator - ) this could be helpful*

yes, that’s right - I’m also a fan of seamless worlds - when a player can not only move from one region to another but also not see the loading screen at the same time, this is possible in UPBGE - but you need to monitor the dysgraph otherwise its overflow will make the game unplayable, and due to the fact that whole worlds are possible, I’ll just show a couple the images from my project are the generation of the surface of the planets by chunks this is proof of the possibility of open worlds - if they are uploaded or generated in parts and not the entire map or the entire planet at once


I do not know where you got this information from and I do not understand where you got it - as far as I know, Rafael Tavaras still wants to update the OpenGL version and introduce new postprocessing functions, I have not seen information anywhere that they are going to make Range exclusive only for macOS - be careful with such reasoning if you are not a Range developer - since even the Range developers do not disclose information about development plans, or share information before making such a loud statement - in the discord, the latest news in the announcements section was about the release of version 1.5a and not a word about the transition to macOS and also where did you get the information on Mad Max that it is based on versions 2.79? Is this some kind of joke? If anything, I don’t like jokes about such things.

Sorry I did that.

will you provide a link to information about the transition of the Range Engine to the Mac OS platform? If not, I just won’t consider your information to be true.

Currently, they only support Windows and Linux, but they do have plans to expand to macOS. It says in their FAQ page here.

Took a while to implement for myself, but the code works.

However, blenderObject.data.polygons does not work on Curves… How do I check the object type to see if it were a Curve or a Mesh in Python? There must be a way to do it, I’m sure.

That is a question better asked to someone else, i don’t use 0.3.+ and i don’t use bpy either, i’m still using 2.5.

Maybe @BluePrintRandom can answer that for you.

if type(KX_object.blenderObject) ==

if you have multiple objects that you are traversing to add them to a single kdtree, a kdtree must know its size before creating.

I would personally just add a property to meshes that are going to be used and then build a masterlist of all their polygons, and then use the list to build the kdtree.

Thanks for telling me what I should use to check if the object is a curve or not.

However, since curves use no polygons, so what is another thing I can use as in blenderObject to get the curve data so I can add it to a kdtree?

Simply use a mesh object, hide the curves, and use geometry nodes object info to get at them, otherwise it does not work.

One issue:

IndexError: pop from empty list.

If I append the objects first after checking for a ‘pool_tag’ property or whatever is used to determine what objects can be added to the list, the error changes to IndexError: list assignment index out of range.

Are there any ways to resolve these issues?

index error means you try to grab something that is not inthere or it’s simply empty. My guess is due to pool get’s rewritten every frame so to solve it, try this:

position = own.worldPosition
radius = 10
min_distance = 20
max_distance = 50


if not 'pool' in own:
    own['pool'] = [obj for obj in own.scene.objects if 'pool_tag' in obj]
    return


for obj in own['kd_tree'].find_range(position, radius):

    if obj[2] < min_distance:
         if obj[1] not in own['filled']:
             own['filled'][obj[1]] = own['pool'].pop(0)

    elif point[2] > max_distance:
         own['pool'].append(own['filled'][point[1]])
         del own['filled'][point[1]]

#fixed an error

I dunno why kind of skeptical with this engine, not only just underrated but kind of still in beta testing.
I prefer Blender 3+ terrain addon, but still people who doesnt know the overall performance which is the same, very tricky overall design.
In my concept of design is simplicity including the engine, and that require coding resources.
I’m studying one of the classic game sadly the best one (AC1) that include precedural crowd is out of my reach.
So this game using terain which is procedural garenated in-game but in a simple flat land, in my assumption the modified land were saved within the assets, somehow the data it self is not yet loaded during starting game, but loaded after the main scene is started that makes the Intros is quite fast, its similar with my game design using library load but not be deleted (on purpose due to crash) afterward so the game memory chache increased over time when active :expressionless:
So there is 2 main point issues here in BGE:
First is Prevent massive data load on starting the game.
Secondly is the removing assets terrain after is done, which is like far distances or changing scene, without any issues.
My best guess is, remesh object and its phisycs load.
best pool of data management, ingame and externaly and this may require export import data capability within one files and its sub-files without any interference to the realtime render.

there are enough reasons for my skeptical attitude - dysgraph is the first of them - it is designed for scene objects, but I think it is not yet fully optimized for realtime, yes, it can do some things and is not bad enough otherwise it has to be tricky so that it does not overload the game logic and does not become the main problem of the game, the second the reason is the playback of animations for actors, if there are more than 14 of them in my project, then problems with frame loss begin, while if I run the same animations and actors in the same number on the Range engine, these problems are not present and the third is the lack of overlapping scenes for me, it is very inconvenient - since I have to keep everything in one scene and often it doesn’t work the way I need it, I mean overlap collections, although I’m a fan of BGE/UPBGE/RangeGE, but it seems to me that version 3.0-4.0 is not ready for medium and even larger projects - maybe in the future better optimization will be carried out and they will show us a great engine, I hope for that’s what I’m waiting for

There is lot of things that I just missed.
Texture Compresion is also very important, most of the classic game has their own format of files, which is thats why external (outside post processing/ingame/realtime) coding is used.
They manage to increase performances as high as possible, this can be done into very fast generation such as high speed movement like racing stuff even in openworld setting.

I do not know why, but UPBGE does not like DDS textures and writes in the console about unsuccessful attempts to compress these textures, although BGE used to work well with them, but the main problem is animations and dysgraphs if they are fixed, new UPBGE fans and new users will appear who will make many examples and working games

I use dds as well and it is faster on high setting CPU than other format that I’ve been tested so far.
To be honest BGE or evee is still the same performances, its depend on how to manage it.
Such as Logic,Physics,Animation,and textures.

I am currently using the Range engine - my recent tests have shown that it is possible to add almost 2000 objects without levels of detail, but further LODs are needed, I used models from megascan, I do not know if UPBGE can add such models through geometry nodes without loss of performance




I like UPBGE, but I understand that there are limitations and I can’t add many objects through the geometry node, this will lead to a load on the scene’s disgraph, so I’m waiting for the developers to make UPBGE better

1 Like