Page 36 of 39

Re: Entity 2.1.21

Posted: Tue Jul 08, 2014 7:38 pm
by troymac1ure
nvm I was completely lost. You posted that right after the Git update, so I thought you meant building Entity's code, not maps. Okay, I'll look into that too..

Re: Entity 2.1.22

Posted: Wed Jul 09, 2014 7:02 am
by troymac1ure
Okay, found my issue:

Code: Select all

                // Update all information for children
                refreshReflexiveListRecursive(
                parentReflexive,
                meta.offset
                + parentReflexive.baseOffset
                + parentReflexive.chunkSelected * parentReflexive.reflexive.chunkSize
                );
When updating children reflexives, parentReflexive.baseOffset is already calculated to contain the selected reflexives offst, so adding parentReflexive.chunkSelected * parentReflexive.reflexive.chunkSize in was doubling the offset of each reflexive. (compared mouse hover offsets of Entity new version to old version and found reflexives 0,1,2 were the same as 0,2,4).
Will send the fix down the line hopefully tonight. Just going to look into a couple of other things first.

EDIT: New version posted. Not all of what I wanted, but the last version had a couple big bugs, so hopefully the rest is just small issues and additions now.

Re: Entity 2.1.22

Posted: Wed Jul 09, 2014 6:42 pm
by XZodia
Great thanks, Does the new version fix the build problems?

Re: Entity 2.1.22

Posted: Wed Jul 09, 2014 7:33 pm
by troymac1ure
Didn't touch anything with that yet, so most likely not. I will try building DoorM4ns map through each version and see where it first broke at and analyze the changes when I get a chance next.

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 1:50 am
by XZodia
I never new that entity couldn't handle building raw data into maps with more than one sbsp.

I'm currently trying to fix this in an older source, and it is proving to be a royal pain in the ass >_>

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 2:10 am
by JacksonCougar
What's the issue?

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 12:15 pm
by XZodia
Well I've made a fair bit of progress, but atm the problem is that the BSP raw pointers are not being updated. But the really werid thing is, they never seem to get updated? Even when there is only 1 sbsp...

But the result is that the bsp viewer crashes when I try to load it, so I'm at a bit of a loss really, I'm gonna try forcing them to be updated but I feel I might be going in the wrong direction with that...

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 1:55 pm
by JacksonCougar
where is the bsp pointer?

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 2:07 pm
by XZodia
Which bsp pointer are you referring to?

I found where the raw pointers are getting written :roll: so hopefully I'll be able to make some progress now...

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 2:32 pm
by JacksonCougar
It was a serious question, I forgot where the actual pointer the the bsp model is stored lul

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 3:22 pm
by XZodia
The meta pointer is in a reflexive in the scnr.

Re: Entity 2.1.22

Posted: Fri Jul 11, 2014 10:23 pm
by XZodia
I've almost got it working, added tags, no errors, sbsp viewer works, map loads, I hear opening music for a second, then it freezes.

Any ideas?

Edit: Interesting development, when I nulled the AI, Scripts and Cinematics the map loaded...

Re: Entity 2.1.22

Posted: Sat Jul 12, 2014 8:20 am
by troymac1ure
XZodia wrote:I've almost got it working, added tags, no errors, sbsp viewer works, map loads, I hear opening music for a second, then it freezes.

Any ideas?

Edit: Interesting development, when I nulled the AI, Scripts and Cinematics the map loaded...
Hmm. A bad script? Do all three need to be disabled?

Also, a temporary patch for loading obfuscated maps until next release. Just overwrite the HaloMap.dll in the Entity directory:
HaloMap.rar
HaloMap v1.6
(215.65 KiB) Downloaded 600 times

Re: Entity 2.1.22

Posted: Sat Jul 12, 2014 12:32 pm
by XZodia
troymac1ure wrote:Hmm. A bad script? Do all three need to be disabled?
The odd thing is, I haven't changed the scripts, ai or cinematics.
I thought maybe the xbox was running out of memory so I spoke to xbox7887 he gave me a script which would free up some memory but it didnt help.

However, I ran the map through uber anaylse and its a mess, ive got coco model in my bsp raw, so I'm amazed it even loads lol....I think this maybe my problem.

Edit: After closer inspection it appears that entity doesn't handle coco model, as it only appears in singleplayer maps.

Re: Entity 2.1.22

Posted: Thu Jul 24, 2014 2:45 pm
by XZodia
I don't know if you've already fixed this Tory, but there is/was a bug pre-loading the unicode strings.
Because it happens on a background thread, it would often confuse the rest of the program giving errors because the map is already open.

Re: Entity 2.1.22

Posted: Thu Jul 24, 2014 5:16 pm
by troymac1ure
Not sure. I never had issues with that, but there is a chance if you open a map and very quickly load the Unicode box it may cause some errors due to the strings not finished being loaded. What version(s) did you experience the errors with?

Re: Entity 2.1.22

Posted: Thu Jul 24, 2014 5:18 pm
by XZodia
2.1.22, Mostly it happened when I was debugging, but it happened a few times normally as well.

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 5:36 am
by troymac1ure
Looked into this. The String loading never opens the map. It uses the already loaded map to build the strings selection form while the MapForm is being created. At this point the map has already been closed and both threads are just accessing information from the Map class. Are you sure it's the MEStringsSelector that is causing the error?

Also, a known 'bug' is that in debug mode: I have a routine that turns reflexives of 1 byte size into a textbox in the parent form (Used for looking at stuff like scripts that are otherwise just visible in byte form). In large reflexives (such as SBSP, MOPP Data) it will run out of memory and not show anything.

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 7:55 am
by troymac1ure
viewtopic.php?f=10&t=1019&hilit=PMI#p11932
JacksonCougar wrote:Does this have a PMI?
JacksonCougar wrote:I'll fork it and write the code in and you can merge the fork back in: how's that sound?
Image

:roll:

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 11:31 am
by XZodia
troymac1ure wrote:Looked into this. The String loading never opens the map. It uses the already loaded map to build the strings selection form while the MapForm is being created. At this point the map has already been closed and both threads are just accessing information from the Map class. Are you sure it's the MEStringsSelector that is causing the error?
Fairly sure, the error occurs because LoadStringsBackgroundWorker and OpenMap run at the same time or something...

I believe this piece of code is to blame:

Code: Select all

                
                // Wait for up to 10 seconds for map to close (if open) to avoid conflicts)
                int count = 100;
                while (map.isOpen)
                {
                    Thread.Sleep(100);

                    // If time has elapsed, just forget the pre-loading of strings
                    if (count-- <= 0)
                        return;
                }

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 12:01 pm
by JacksonCougar
@Troy
That's bad source. I'll fork in the builder in my new project once I sort out some things.

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 8:14 pm
by troymac1ure
What's bad about the code? I never work with threads.
The map should be closed by the time this is run, but just in case I have a max 10 second wait. if it still doesn't load, then it just waits until the first time MEStringSelector is accessed.

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 9:14 pm
by XZodia
Well put simply, yes it will work 95% of the time. Unfortunately, threading is more complicated than that.
Its also a really bad idea to access the same stream in different threads, in case they both try to read from it at the same time.

Really, there shouldn't be any need for a thread here anyway, or the thread should be launched after you read the data from the map on the main thread...

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 10:02 pm
by troymac1ure
From what I quickly looked at last night, I think that neither threads access the stream after this is initiated. The String loader takes previously loaded strings and builds a form and listbox from the strings. I am going to look again to make sure that it's not accessing the stream.

Re: Entity 2.1.22

Posted: Fri Jul 25, 2014 10:25 pm
by XZodia
The bsp viewer garbles AI Squads >_<