Large RPG loading and rendering issues
by Howard Dortch · in Torque 3D Professional · 02/08/2012 (9:05 am) · 62 replies
As the title implies. I load a mission file with buildings, doors, switches etc. As each item loads the engine creates a unique ID for reference. Now I have dynamic items that get loaded as POI items. I have them listed in a database (sqlite) so at the end of the mission load I load the dynamic POI stuff.
Here is the problem: Before all the items from the mission file actually get rendered in the game, the dynamic item loader gets called and one or more items from the mission file will disappear.
So my assumption is that one of the dynamic items is overwriting the ID number from the mission file and it causes the disappering item issue.
Couple of questions:
When creating the mission file would it help to bundle things in Simgroups ?
When creating the dynamic items should I delay creation until I am sure all mission items have been created?
Any help on the proper way to do this?
Here is the problem: Before all the items from the mission file actually get rendered in the game, the dynamic item loader gets called and one or more items from the mission file will disappear.
So my assumption is that one of the dynamic items is overwriting the ID number from the mission file and it causes the disappering item issue.
Couple of questions:
When creating the mission file would it help to bundle things in Simgroups ?
When creating the dynamic items should I delay creation until I am sure all mission items have been created?
Any help on the proper way to do this?
#22
I even added a %obj.setScopeAlways(); to the door onAdd()
Thanks..
02/28/2012 (6:53 pm)
This is just a solo player in the game so server/client same box all local. I understand even local is still client/server but still the object gets created and does not exist.I even added a %obj.setScopeAlways(); to the door onAdd()
Thanks..
#23
02/29/2012 (9:58 am)
Howard, have you tried echo(Al3In.getPosition()) in the console? If I remember correctly even with the server/client on the same box they still maintain 2 different object collections which means the ID on the server can still be different on the client.
#24
02/29/2012 (10:31 am)
Yes from the console. So when I do the echo(Al3In.getPosition()) does it return the server side or client side? If it does not exist on the server side and the client doesn't see it does that mean it's not there.
#25
02/29/2012 (10:49 am)
That would return it from the client side. If you created a command to server function that had that echo in it then it should respond with the server side object. That would tell you for sure if it exists on the server.
#26
Thanks...
02/29/2012 (7:18 pm)
I find that hard to believe but I wrote the routines anyway. The numbers I get from a console echo(obj.getId()) is the same in all cases using a commandToServer('getidvalue',%objname) and having the server return the value to the client commandToClient(%client,'IDValue',%id). And this object still does not exist after it gets created and assigned an id value.Thanks...
#27
02/29/2012 (8:26 pm)
Hmmm, and are you adding these objects to the MissionGroup SimGroup after you create them? I was assuming you were but I didn't see you doing that in the code you posted. But if its not being added to a group then the memory manager might be destroying your objects if it can't find anything referencing them.
#28
Thanks...
03/01/2012 (6:27 am)
It is part of the mission file is where these get created like game.mis so I assume they all get added to MissionGroup since that is top of the file.Thanks...
#29
Also, you could try exec-ing your dynamic object file from within the mission file at the end of (and inside of) the MissionGroup. Don't know if it would help....
03/01/2012 (6:43 am)
If you are adding them outside of the end brace of the MissionGroup then they're not being included in the MissionGroup. Just something else to look for.Also, you could try exec-ing your dynamic object file from within the mission file at the end of (and inside of) the MissionGroup. Don't know if it would help....
#30
03/01/2012 (7:11 am)
If we are still talking about your dynamically loaded content, then you will need to add them to the MissionGroup. I would create a SimGroup in the mission file called dynamicContent and add your dynamic content to it. Then you could easily get the count of items in the SimGroup and compare it to the total items you loaded.
#31
Thanks...
03/03/2012 (5:09 pm)
I can try that. Fact still remains that mission items are the ones disappearing, not the dynamics. Engine is slow creating the mission items. I put a delay in creating the dynamics but still didn't help.Thanks...
#32
I guess the next step is to write a text file will everything in the mission then after it loads scan the list and see if it is a valid object and if not re create it. Lots of hours wasted here on engine instead of game.
03/18/2012 (7:43 pm)
Added everything to the mission file with all things named and still something will come up missing. I guess the next step is to write a text file will everything in the mission then after it loads scan the list and see if it is a valid object and if not re create it. Lots of hours wasted here on engine instead of game.
#34
04/06/2012 (11:13 am)
Are there any custom classes for objects? What is the door object's class? Are the dynamic objects calling "registerobject" in the engine?
#35
This sort of bug always frustrates me, so I feel your pain.
04/06/2012 (11:44 am)
Ok, try this. Delete that door. Make a new one in its place. Name it something besides "Al3In." Since that is the one object that is giving you fits, try replacing it with something else entirely and see if that fixes the issue or if perhaps something else disappears.This sort of bug always frustrates me, so I feel your pain.
#36
@Richard doesn't matter what the object is like one time is was a building, once a switch, a door, others. I even created 200 script objects and just assigned number to each one in a for loop and sure enough one number is missing.
remember the problem is the object gets created.. gets assigned an id number ( all onAdd functions echo the object id ) by the time my character is actually in the world the object is gone. So something in the engine is allowing the ID to be deleted. I suspect it is a threading issue or writing into a array allocation. The ID number is just gone...
Thanks for the reply
04/07/2012 (7:38 am)
@Kenan the door is from the door resource posted here and I just used it for the example, other things come up missing depending on the position in the mission file, right now I have a switch missing so any object could disappear.@Richard doesn't matter what the object is like one time is was a building, once a switch, a door, others. I even created 200 script objects and just assigned number to each one in a for loop and sure enough one number is missing.
remember the problem is the object gets created.. gets assigned an id number ( all onAdd functions echo the object id ) by the time my character is actually in the world the object is gone. So something in the engine is allowing the ID to be deleted. I suspect it is a threading issue or writing into a array allocation. The ID number is just gone...
Thanks for the reply
#37
04/14/2012 (6:31 am)
Another update. My students use version 1.2 I assigned them the task of building a city and parts of their city just come up missing. Wall here floor there, ceiling etc... It is an issue in the engine I belive...
#38
Just had this problem myself when testing performance, although the objects editor handles are still there, they arn't rendered.
04/15/2012 (1:32 pm)
Do you have more than 4096 objects in the scene? Just had this problem myself when testing performance, although the objects editor handles are still there, they arn't rendered.
#39
sim/netConnection.h
04/15/2012 (3:04 pm)
hmmm, I think I've a fix for that, Jonajoint ...sim/netConnection.h
enum GhostConstants
{
GhostIdBitSize = 14,//stock was 12 - yorks 14 = 16384!
MaxGhostCount = 1 << GhostIdBitSize, //4096,
GhostLookupTableSize = 1 << GhostIdBitSize, //4096
GhostIndexBitSize = 4 // number of bits GhostIdBitSize-3 fits into
};
#40
04/15/2012 (4:20 pm)
Yeh, cheers steve, I found that, though I set it to 16 bits. 14 is plenty, starts to get heavy on the processor with much more 10000 objects.
Associate Matt Fairfax
PopCap