1

i have problem with my python code that is running ursina engine. When i have all blocks (cubes) with 1 texture game works fine without any problems, but when i add another texture game is loading long time and than it's very laggy (about 3 fps) or it crash during loading. With this it's working fine

for z in range(25):
for x in range(25):
    Entity(
        model="cube", color=color.dark_gray, collider="box", ignore=True,
        position=(x, 0, z),
        parent=scene,
        origin_y=0.5,
        texture="resources/pavement1.jpg"
    )

but when i add

for z in range(26):
for x in range(25):
    Entity(
        model="cube", collider="box", ignore=True,
        position=(x, 0, z),
        parent=scene,
        origin_y=0.5,
        texture="resources/road1-1.png"
    )

there is problem with long loading, lagging and crashing. And error is Known pipe types: wglGraphicsPipe (3 aux display modules not yet loaded.) :pnmimage:png(warning): iCCP: known incorrect sRGB profile

There are textures:

texture that works fine:

texture that works fine

Texture where is problem:

Texture where is problem

toyota Supra
  • 3,181
  • 4
  • 15
  • 19
  • This is not the way to go to generate this amount of entities. Each frame, ursina is executing the update method *of each* entity, therefore the app lags a lot due to the amount of entities. This is a regular question, either here or on [the discord server](https://discord.gg/p56QCXHwA7) and there is no short answer on how to fix it. Start by understanding how rendering works and how popular games such as Minecraft do it. This is mainly by combining the entities into a ``Mesh`` in order to lower the updates count. See this : https://www.youtube.com/watch?v=4O0_-1NaWnY&t=157s&ab_channel=jdh. – DiamondsBattle Sep 04 '22 at 13:42

1 Answers1

-2

I tried to compile code to exe and now it crash instantly and i got another error

Warning: unable to auto-locate config files in directory named by "<auto>etc".
package_folder: C:\Users\user\AppData\Local\Temp\_MEI204402\ursina
asset_folder: .
screen resolution: (1920, 1080)
←[93mwarning: missing model: 'cube' ←[0m
:display: loading display module: libtinydisplay.dll
:display(warning): Unable to load libtinydisplay.dll: Path not found
:display: loading display module: libpandadx8.dll
:display(warning): Unable to load libpandadx8.dll: Path not found
:display: loading display module: libpandadx9.dll
:display(warning): Unable to load libpandadx9.dll: Path not found
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "main.py", line 4, in <module>
  File "ursina\main.py", line 28, in __init__
  File "direct\showbase\ShowBase.py", line 339, in __init__
  File "direct\showbase\ShowBase.py", line 1024, in openDefaultWindow
  File "direct\showbase\ShowBase.py", line 1059, in openMainWindow
  File "direct\showbase\ShowBase.py", line 769, in openWindow
  File "direct\showbase\ShowBase.py", line 749, in <lambda>
  File "direct\showbase\ShowBase.py", line 821, in _doOpenWindow
  File "direct\showbase\ShowBase.py", line 650, in makeDefaultPipe
  File "direct\directnotify\Notifier.py", line 130, in error
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.
[22808] Failed to execute script 'main' due to unhandled exception!