logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX Areas
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Jun 29, 2009 10:22    Post subject: Has anyone managed Reply with quote

Has anyone managed to eliminate the black screen/environment issue, if they have logged in before the area is generated?


So far, Im having to get around it via generating the areas on modLoad, when a player is not going to be in.
Back to top
View user's profile Send private message
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Tue Jun 30, 2009 0:48    Post subject: Reply with quote

Does entering the blacked-out area cause your server to segfault?

The creation of my area instances must be triggered by the player and thus can't be created on ModLoad. However, my work-around at least for the time being is to just reuse the new area for that particular PC instead of destroying it and re-creating it all the time.

The first creation for each PC seems to work fine, it's the second creation/PC that seems to be causing my blacked-out areas along with segfaults.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jun 30, 2009 0:51    Post subject: more details Reply with quote

I should have been more detailed.

I am using win32 version.

No segfaults, but I have not tried the delete function.


I 'need' to make the areas on mod load, or at least before a particular player logs in.

If 1 player logs in, the areas generated before he logged in, will be ok, but if he logs in and then areas are generated, they tend to be black and no visibility.
Back to top
View user's profile Send private message
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Wed Jul 01, 2009 2:25    Post subject: Reply with quote

Ok.. this has gotten stranger and the problem seems almost random now that I'm using it in production.

Creating 100 areas on module load.. no problem..

Creating 200 areas on module load.. no problem..

Creating 1 area on player using a placeable w/30 second delay to port them to the area... sometimes a problem, sometimes not..

None of the nwnx or nwn logs give any indication of a problem.. just causes a segfault.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jul 01, 2009 10:22    Post subject: Stress Test Reply with quote

I havent tried stess testing the plugin so to speak.

I've only gegnerated 7 or so areas during ModLoad.

Way it works, is a player purchases a player owned pocket plane, and then next time the server resets, the area is generated in batch.

During the area generation, the entry portal placeable in each area, has its object reference stored, until its owner logs in, then the object reference is transfered to their character as a object variable.

Then using their pocket plane key, opens a gateway/portal, to the location of that object reference. Result is 2 way travel to and from their pocket plane.


I have not tried generating 100's of areas as of yet.
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Wed Jul 01, 2009 14:07    Post subject: Reply with quote

Quixsilver wrote:

Creating 1 area on player using a placeable w/30 second delay to port them to the area... sometimes a problem, sometimes not..


Just to second that (in case it's GCC version specific) we have the same issue when entering a second instance of an area after a first one has been created and destroyed. Curiously you can query the area such as iterating through any objects in that area before jumping to a point in there.

I did add a delay in there to see if it was timing specific but didn't try as much as 30 seconds tbh.

Details in case they are relevant:

Ubuntu 8.10
gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Jul 01, 2009 15:39    Post subject: Reply with quote

DestroyArea hasn't been really tested, and I know at least one particular bug that can cause this.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 09, 2009 11:55    Post subject: AddMapToCreatures Reply with quote

Code:

void AddAreaToCreatures(CNWSModule *pModule, dword nAreaID)
63 {
64         if(!pServThis) InitConstants();
65         CGameObjectArray *pGameObjArray = CServerExoApp__GetObjectArray((void *)pServThis);
66         if(!pGameObjArray) return;
67         for(int i=0; i<=0xFFF; i++)
68         {
69                 CGameObjectArrayElement **pObjects = pGameObjArray->Objects;
70                 CGameObjectArrayElement *pElement = pObjects[i];
71                 if(!pElement) continue;
72                 CNWSCreature *pObject = (CNWSCreature *) pElement->Object;
73                 if(!pObject) continue;
74                 if(pObject->Object.ObjectType == 5)
75                 {
76                         if(pObject->AreaMiniMaps)
77                         {
78                                 pObject->AreaMiniMaps = (void **) realloc(pObject->AreaMiniMaps, pModule->Areas.Count * 4);
79                                 void *pMinimap = new char[0x80];
80                                 memset(pMinimap, 0, 0x80);
81                                 pObject->AreaMiniMaps[pModule->Areas.Count - 1] = pMinimap;
82                                 CExoArrayList_unsigned_long___Add(&pObject->AreaList, nAreaID);
83                                 pObject->AreaCount++;
84                         }
85                 }
86         }
87 }



This function in the linux source code. Does it rebuild the minimaps for players?

Eg - Avoids the black environment issue.

If so, would this function be portable to the windows version, I don't think I see it in the win32 version.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jul 09, 2009 21:15    Post subject: Reply with quote

It was a fix for crash issue, but it might fix the black screen as well.
Windows version will be available later (no ETA at this time).
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jul 09, 2009 23:10    Post subject: cool Reply with quote

Cool,
No rush.

The way I've implimented the plugin onModLoad makes it so the black screen error doesnt happen for me,but getting rid of the black screen issue altogether would be great, would mean resets would not be required for players to get their housing.
Back to top
View user's profile Send private message
spider661



Joined: 21 Sep 2006
Posts: 3

PostPosted: Sat Oct 10, 2009 19:20    Post subject: Reply with quote

any new news on the windows version?

or is 2.2 working and ready to go atlest as far as the linux one is.
Back to top
View user's profile Send private message MSN Messenger
Mycohl



Joined: 21 Oct 2006
Posts: 8

PostPosted: Mon Dec 28, 2009 11:17    Post subject: Reply with quote

Does this plugin still work?

I've tried calling LoadArea a couple of times in mod_load, and also in mod_enter, and nothing seems to actually happen. I've tried both the nwnx_easy version and built my own from SVN. The log for nwnx_areas does not show any errors, but no areas show up in the DM chooser list, no matter how long I set a delay for or how many times I log in and out with the DM client.

Code:

NWNX Areas version 0.2.4 for Linux.
(c) 2006-2009 by virusman (virusman@virusman.ru)
pServThis = 00000000
Creating area 'customize'
Loading area 'customize'
AreaID=00000006
Creating area 'customize'
Loading area 'customize'
AreaID=0000000D


I read earlier in the thread about how the function does not return a valid object, and I've tried the GetObjectByTag method, but since the area never gets created, it always returns the original area. Is there something that I'm missing? There isn't any documentation that I've found with nwnx_easy or the latest SVN build. What is the significance of the AreaID in the log? Is that the internal object ID that LoadArea should be returning? If anyone can offer any tips on just getting an area to actually be created, I would be eternally grateful.

EDIT: This is strange. Looking at the log for nwnx2 itself, I find:
Code:

* NWNX2 activated.
name='NWNX!INIT'
INIT(S): valid ret=0x082041ec
name='NWNX!ODBC!SPACER'
* Library ODBC!SPACER found: B73EC4C0
name='NWNX!AREAS!CREATE_AREA'
* Library AREAS!CREATE_AREA found: B73F2080
name='NWNX!AREAS!GET_LAST_AREA_ID'
FAILED: NWNX!INIT(O) has not been initialized.
name='NWNX!AREAS!CREATE_AREA'
* Library AREAS!CREATE_AREA found: B73F2080
name='NWNX!AREAS!GET_LAST_AREA_ID'
FAILED: NWNX!INIT(O) has not been initialized.
name='NWNX!AREAS!CREATE_AREA'
* Library AREAS!CREATE_AREA found: B73F2080
name='NWNX!AREAS!GET_LAST_AREA_ID'
FAILED: NWNX!INIT(O) has not been initialized.


But I am setting NWNX!INIT, as you can see from earlier in the log. Looking at the source, it appears that this error is logged when some returrn address does not match or does not exist. I have no idea how to debug that, or even if this is a mistake on my part. (Does nwnx_areas require a seperate INIT or spacer or something?)


Last edited by Mycohl on Mon Dec 28, 2009 19:39; edited 1 time in total
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Mon Dec 28, 2009 18:55    Post subject: Reply with quote

Hi,

Yes it does work and quite well to (albeit with some issues destroying areas mentioned above). The object returned by the LoadArea() call can be used as normal for any area related functions. You may not see the area listed in the DM client depending on when it is loaded but you have yours on modload so I guess it should be.

Also the object returned (at least with the SVN version) is a valid object and can be verified with GetIsObjectValid(). Try jumping to a waypoint in the area after using the GetFirstObjectInArea() using the new area's object just in case you are finding the original as mentioned (or are you using the nNth arg to skip through them with your GetObjectByTag() call?).

Cheers,

Paul
Back to top
View user's profile Send private message
Mycohl



Joined: 21 Oct 2006
Posts: 8

PostPosted: Mon Dec 28, 2009 19:43    Post subject: Reply with quote

Thank you for the information.
On my system, the LoadArea() always returns OBJECT_INVALID.
GetFirstObjectInArea() naturally returns OBJECT_INVALID for an invalid area.
GetObjectByTag() does not seem to work either.

The area never shows up in the DM client, even if I log in half an hour after LoadArea() has been called. It is not actually being created.

I think that I may have something misconfigured, as you can see in my edit to my first post. I am getting an error "FAILED: NWNX!INIT(O) has not been initialized."
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Dec 28, 2009 21:25    Post subject: Reply with quote

Yes, you have to initialize GetLocalObject hook:
GetLocalObject(GetModule(), "NWNX!INIT");
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 4 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group