|
2 registered members (Quad, AndrewAMD),
1,007
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
ent_create bug?
#315743
03/18/10 17:58
03/18/10 17:58
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
OP
Expert
|
OP
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
ent_create seems to allocate new memory for the vertices each time it is called for the same model file. Have a look at this thread for a few more details: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=315738#Post315738Oh and while I am already posting a "bug" I also want to mention that the terrain from image importer crashes for about >300x300 vertices. Another problem I found is when using ent_mtlset entSkin1 will always(?) be the first skin and not the one used by the subset.
Last edited by Slin; 03/18/10 18:47.
|
|
|
Re: ent_create bug?
[Re: jcl]
#316207
03/22/10 12:35
03/22/10 12:35
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
OP
Expert
|
OP
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Then please tell me what I am doing wrong that this code takes so long to be executed and finally even crashes: www.slindev.com/files/other/ent_create_crash.zipI actually can´t see a reason for it to crash if it isn´t too little RAM, which also shouldn´t be the case as in my understanding it shouldn´t allocate more than 20mb (actually quite a bit less, but I can´t remember the number I calculated a few days ago). About ent_mtlset, shouldn´t it still make the texture the shader is assigned to accessible as entSkin1? If you want, I can prepare a simple project for this as well.
Last edited by Slin; 03/22/10 12:35.
|
|
|
Re: ent_create bug?
[Re: jcl]
#316212
03/22/10 13:44
03/22/10 13:44
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I did not spend much time on this issue but somehow I can confirm this "bug": You're right, I removed the skin and multiplied the vertices and faces (to 55k). The model is now 3,6mb (mesh only, no skin) and the allocated memory in the task manager increases per new created entity by 3,6mb. What should we expect from a new created entity? Is that behaviour correct?
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: ent_create bug?
[Re: jcl]
#316215
03/22/10 14:21
03/22/10 14:21
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
OP
Expert
|
OP
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Ich erstelle aber ja weder 500000 noch 10000 Entities sondern lediglich 2500. Ich nutze kein ent_clone und setze sie auf PASSABLE nach dem ent_create (vorher geht schließlich schlecht). Bei den 2500*4kB plus die Größe von einmal dem Mesh und dem Skin sollte es dann doch keine Probleme geben. Mag ja sein, dass das alles so nicht sonderlich schnell ist, aber es sollte auch nicht unbedingt crashen... Und laut Taskmanager wächst der "Speicherverbrauch" mit jedem erstellten Mesh um ziemlich genau den Betrag, den die Modelldatei groß ist. Dies crasht übrigens auch noch:
#include <acknex.h>
#include <default.c>
void main()
{
level_load("");
diag("\nlevel geladen");
int x;
for(x = 0; x < 1000; x++)
{
you = ent_create("grass.mdl", vector(0, 0, 0), NULL);
set(you, PASSABLE);
}
diag("\nentities erstellt");
}
Und dies sagt die Acklog dazu:
Mouse found
Lautsprecher (High Definition Audio-Gerät) opened
NVIDIA GeForce 8800 GTS pure T&L device 1ff9 detected
D3D device NVIDIA GeForce 8800 GTS 1ff9 selected.
ent_blendframe: function not found
pan_setcolor: function not found
Running MAIN.EXE.
Main started at 0.072
D3D_Init Window: 720x480 -> Window: 1x720x480x32
Video memory found: 2398 MB
LevelInit at 0.118 0 lmaps 0 textures
Physics restarted...ok
LevelReady at 0.121
level geladen
Es crasht also noch bevor alle Entities erstellt sind.
Last edited by Slin; 03/22/10 14:40.
|
|
|
|