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 Studio Chat / AGK2 or AGK studio Procedurale World limitation number of objects

Author
Message
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 2nd Sep 2019 11:04 Edited at: 5th Sep 2019 10:29
Hi..,

I'm making a procedural world with AGK2 AND AppGameKit Studio.....

I'm confronted with a big limitation on the number of 3d objects (assets) loaded!!!

the loading time of the assets is already super Slow ... (more than 2 minutes on my MSI GT72..... (I7+GTX1060) and SSD
I use a 2048x2048 heighmap (on PC)

and I'm very quickly limited by the number of "Cloned" objects..
with 2356 Fir objects
1440 objects leaf tree
57 grass objects
211 grass objects2

my world is very depopulated for two minutes of loading!
I specify that the objects are with few polygons...

look here :





if I try to increase their numbers a lot, I have a loading that lasts indefinitely without ever displaying the result...... see a crash on the Objectclone command....

it's far from what we can do with Unity for example...
do you think it will be improved in the future?

I would add that my loads are of the type:



very basic

it should be noted that I load a lot more objects with AGK2
than with Studio


Translated with www.DeepL.com/Translator
Carpe Diem
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 2nd Sep 2019 14:48 Edited at: 5th Sep 2019 10:28
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Sep 2019 07:24
Its hard to see why you cant load much as I have seen even swaying grass etc added amongst jungles of objects
but I would start by looking at CreateObjectFromHeightMap( objID, szImageFile, width, height, length, smoothing, split )
how hi is your split ?
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
houndog66
5
Years of Service
User Offline
Joined: 1st Mar 2019
Location:
Posted: 3rd Sep 2019 09:46
you could optimise a bit by making your objects only show up when they are close enough, and that means you will need less objects!

something like this maybe?

smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 3rd Sep 2019 12:24 Edited at: 3rd Sep 2019 12:27
you have a sync inside your for loop meaning every single object refreshes the screen... remove it and your map will load much faster
also you don't need the drawobject call at all
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 3rd Sep 2019 19:56 Edited at: 6th Sep 2019 14:17

I tried full of value (1,8,16,4096...)
that's not really what changes anything.

on the other hand, if I change the number of cloned objects, then it changes a lot...
example if I use this:



It's very fast. !!

but if I put : For i=1 to 6000 it's already much longer (2 minutes of loading)
and it only works on AGK2 , AppGameKit studio, stay out of order!

no need to expect to exceed the value 6000 by 3d elements

it must be considered that considering the fact that I place my assets according to the altitude of the map

if I make a loop from 1 to 6000 it is in fact only 2400 trees that I lay
Carpe Diem
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 3rd Sep 2019 20:18 Edited at: 5th Sep 2019 10:27
tomorrow I look at my 3d objects...
the problem may come from them.....
Carpe Diem
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 4th Sep 2019 13:56
you don't need to draw the objects but yes if your objects are more mesh intensive it will of course take longer, i used some basic cubes and capsules and it doesn't take that long to place up to around 30k objects but i did find it crashes if you try to loop more than 60k objects (no error given, just a blank runtime error screen, i assume it's running out of memory even though i delete all the objects each time)
based on my heightmap i was placing just over half the objects but even if the reported timer felt a little generous it was still quick for a loading time.



(press space bar to increase the object limit)

life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 4th Sep 2019 15:24
Thank you all for your suggestions,
I'll look into it, thank you again.
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 4th Sep 2019 16:18 Edited at: 5th Sep 2019 15:56
Well, I can't solve this problem of slow loading......

here is my almost complete archive; (I just removed my map creator) , but there is everything it was to test the code

if you can make the loading fast.....
tell me about it


I attach my archive so you can see
Carpe Diem

Attachments

Login to view attachments
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 5th Sep 2019 12:54
looks like you forgot to include your actual main code file
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 5th Sep 2019 15:54 Edited at: 5th Sep 2019 16:06
ha.... Well, yes...

the management of AGK's working directory is not easy to understand

I have a file in d:\.........
and he works in c:\users\........

I rebuilt the archive, sorry.

Download here :
http://michel.dobro.free.fr/AGK/procedural_world.zip

move keys :

left =shift left
right=x
forward=q
retreat =w
E=Put on the floor

wait a little while for the sun to rise

to test the code
it is necessary to increase the number of objects

line 198,223,243,261
Carpe Diem
Bored of the Rings
User Banned
Posted: 5th Sep 2019 16:27
thanks Dobro, I'll have a look at the code, see what can be done.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Bored of the Rings
User Banned
Posted: 5th Sep 2019 16:31
oh dear, I get archive corrupt error when unarchiving.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 6th Sep 2019 06:55 Edited at: 6th Sep 2019 06:58
Dorbro in agkstudio iv'e had well over 20,000 high poly objects loaded into agks at one time all with lighting and shadows and within camera view and all moving and rotating without any issue whatsoever. However i have been unable to reproduce this in agk without a crash.
also u do not need to manally draw your objects sync will do that for you unless u need to draw them in a very specific depth order. Sync() refreshes based on the refresh rate set it also limits the speed at which your game loops runs.
if you want load 1600 objects it will take 1600 divided by refresh rate in seconds to load them. putting a syn() outside the loop will drastically speed up the program as well as eliminated a manual draw each loop, like running a double refresh every loop. the code below shows a way to control the speed of the main game loop and the speed of a refresh. independently of each other. allows the throttling of the cpu and gpu. Also a texture resolution of 2048x2048 is massive. most textures under 1024 will suffice for almost all models.



Dobro
5
Years of Service
User Offline
Joined: 23rd Apr 2018
Location: France
Posted: 6th Sep 2019 12:44 Edited at: 6th Sep 2019 14:16
@Bored of the rings :
Quote: " oh dear, I get archive corrupt error when unarchiving. "


I just tested my archive by downloading it, it works!

I use Winrar 5.70 ...


Well, I rebuilt the archive with 7-zip.
http://michel.dobro.free.frAGK/procedural_world2.zip


@Smerf : (my Pseudo is DOBRO )
the name of a famous musical instrument in the United States, (Bluegrass Music) I have had this nickname since 1988


Yes, I removed the "Draw" and Sync() from the load.
they were there to control

Tanks all
Carpe Diem

Login to post a reply

Server time is: 2024-04-19 02:26:14
Your offset time is: 2024-04-19 02:26:14