HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Terrain updating/reloading every few seconds?

View previous topic View next topic Go down 
AuthorMessage
Nefadozone

avatar

Game username : Nefadozone
Server : Fucko McShitpo
Male Posts : 176
Join date : 2011-11-11
Age : 23
Location : Satan's Asshole

PostSubject: Terrain updating/reloading every few seconds?   Mon Mar 23, 2015 6:42 pm

I've edited my titlescreen gamestate to render terrain and hide the backdrop.. but it's updating very odd. The framerate isn't even 1 fps at this point, if anybody wants to try this and see if they can find the solution I'd be honored. I am not sure how the char creator gamestate updates the terrain uniquely so that the grass/tree loaders stay in place, I admit that I haven't looked into it very far. There's proabably something blatantly obvious in the source that I'm missing/forgetting to edit.




~line 109 - magixhandler.h
Code:
case GAMESTATE_STARTSCREEN:
 if (mCamera->getCamera()->isAttached())mCamera->getActiveCamNode()->detachObject(mCamera->getCamera());
 mCamera->getCamera()->setPosition(3200, 120, 2770);
 mCamera->getCamera()->setOrientation(Quaternion(Degree(-40), Vector3::UNIT_Y));
 mSkyManager->showSky(true);
 mSkyManager->setDayTime(0);
 mSkyManager->setWeatherTime(1500);
 mSkyManager->setWeatherCycle("Snow");
 mSkyManager->update(evt);
 mWorld->loadWorld("Default");
 mCollisionManager->destroyAllPortals();
 mCollisionManager->destroyAllGates();
 mWorld->update();
 mGui->showBackdropOverlay(false);
 updateStartScreen(evt);
 break;

The best way I can explain this is:
When you exit and return to a map with random grass/trees, the objects are entirely different places. This is happening every two seconds on the titlescreen.

The sky alone shows up completely normal, no odd updates/lag.
Code:
case GAMESTATE_STARTSCREEN:
 if (mCamera->getCamera()->isAttached())mCamera->getActiveCamNode()->detachObject(mCamera->getCamera());
 mCamera->getCamera()->setPosition(3200, 120, 2770);
 mCamera->getCamera()->setOrientation(Quaternion(Degree(-40), Vector3::UNIT_Y));
 mSkyManager->showSky(true);
 mSkyManager->setDayTime(0);
 mSkyManager->setWeatherTime(1500);
 mSkyManager->setWeatherCycle("Snow");
 //mSkyManager->update(evt);
 //mWorld->loadWorld("Default");
 //mCollisionManager->destroyAllPortals();
 //mCollisionManager->destroyAllGates();
 //mWorld->update();
 mGui->showBackdropOverlay(false);
 updateStartScreen(evt);
 break;


Last edited by SET on Mon Mar 23, 2015 7:00 pm; edited 2 times in total (Reason for editing : added the code i edited)
Back to top Go down
http://wildmidnight.boards.net/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: Terrain updating/reloading every few seconds?   Mon Mar 23, 2015 7:43 pm

You're telling the game to load the world with loop
To get something like yours I'd suggest:
Code:
case GAMESTATE_STARTSCREEN:
if (!loadedOnce) {
loadedOnce = true;
 if (mCamera->getCamera()->isAttached())mCamera->getActiveCamNode()->detachObject(mCamera->getCamera());
 mCamera->getCamera()->setPosition(3200, 120, 2770);
 mCamera->getCamera()->setOrientation(Quaternion(Degree(-40), Vector3::UNIT_Y));
 mSkyManager->showSky(true);
 mSkyManager->setDayTime(0);
 mSkyManager->setWeatherTime(1500);
 mSkyManager->setWeatherCycle("Snow");
 mWorld->loadWorld("Default");
 mCollisionManager->destroyAllPortals();
 mCollisionManager->destroyAllGates();
}
mSkyManager->update(evt);
mWorld->update();
 mGui->showBackdropOverlay(false);
 updateStartScreen(evt);
 break;

Then add bool loadedOnce; after
Code:
String mDebugText;
   bool initialized;

In MagixHandler() function, remember to set loadedOnce = false;

________________________________
Retired
Back to top Go down
Nefadozone

avatar

Game username : Nefadozone
Server : Fucko McShitpo
Male Posts : 176
Join date : 2011-11-11
Age : 23
Location : Satan's Asshole

PostSubject: Re: Terrain updating/reloading every few seconds?   Tue Mar 24, 2015 5:18 am

Worked fine, except..

I edited it so that it would reset the camera position, but the terrain still shows up at the last point in the campaign? Will try moving around 'unloadworld'





Last edited by SET on Tue Mar 24, 2015 5:55 am; edited 1 time in total (Reason for editing : trying to fix it myself #2)
Back to top Go down
http://wildmidnight.boards.net/
Sponsored content




PostSubject: Re: Terrain updating/reloading every few seconds?   

Back to top Go down
 
Terrain updating/reloading every few seconds?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: