Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post Posted: March 13th, 2017, 10:55 pm 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 372
Location: Idiot from northern Europe
Yeah that's what I meant in post above.
Haven't figured out how to make an "unload level" or just how to delete the entities


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 1:25 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3306
Location: Japan
Yumtard wrote:
Yeah that's what I meant in post above.
Haven't figured out how to make an "unload level" or just how to delete the entities


After you learn about dynamic memory, that will be easy as pie bro. BTW, I'm working on a fast loading version, maybe with alpha blending. Just to tease you :P

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 2:42 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3306
Location: Japan
Here's a little teaser ;)

binary package

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 10:51 am 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 372
Location: Idiot from northern Europe
Wow that's a lot faster! Is that using multi threading?


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 11:55 am 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 372
Location: Idiot from northern Europe
It seems like I figured out a simple way to fix the issue of reloading levels. Seems to work perfectly now :)

When the player die I used to call reset on all managers which looked like this

Code:
void DroneManager::Reset()
{
   for (int i = 0; i < nDrones; ++i)
   {
      drone[i].Reset();
   }
}


the reset for drones just reset the entities positions and states.

Now I go like this

Code:
void DroneManager::Reset()
{
   for (int i = 0; i < nDrones; ++i)
   {
   //   drone[i].Reset();
      drone.pop_back();
   }
   nDrones = 0;
}


So I delete the objects and then the level is loaded again when you start the game and the objects are created again. So you can now switch difficulty between deaths and keep playing if you die without issues


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 1:38 pm 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3306
Location: Japan
Yumtard wrote:
Wow that's a lot faster! Is that using multi threading?




Yup, putting the loading of each mp3 and animationframes object on its own task. They're also made deferred, so the program can continue even if not all resources are loaded, but it will block as soon as a resource is attempted to be used if it isn't full loaded yet. So it loads resources in the backghround of the title screen and even after you start playing.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 1:52 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2667
Location: Oklahoma, United States
Yumtard wrote:
It seems like I figured out a simple way to fix the issue of reloading levels. Seems to work perfectly now :)

When the player die I used to call reset on all managers which looked like this

Code:
void DroneManager::Reset()
{
   for (int i = 0; i < nDrones; ++i)
   {
      drone[i].Reset();
   }
}


the reset for drones just reset the entities positions and states.

Now I go like this

Code:
void DroneManager::Reset()
{
   for (int i = 0; i < nDrones; ++i)
   {
   //   drone[i].Reset();
      drone.pop_back();
   }
   nDrones = 0;
}


So I delete the objects and then the level is loaded again when you start the game and the objects are created again. So you can now switch difficulty between deaths and keep playing if you die without issues


Hey man, instead of pop_back, why not just use the clear() function?

Code:
void DroneManager::Reset()
{
   drone.clear();
   nDrones = 0;
}

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 1:55 pm 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3306
Location: Japan
omg im so triggered right now. i finally made it to the boss, and the game froze! DX

could be something with the deferred loading code is messed up for the boss sprites ; /

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 14th, 2017, 3:06 pm 
User avatar

Joined: January 19th, 2017, 10:28 pm
Posts: 372
Location: Idiot from northern Europe
@albinopapa

Either because I didn't know about the function or I had forgotten about it:p not sure which! Changed them to clear now. Thanks :)

@chili
shit you're right, your version crashes when you reach the boss :S

"Yup, putting the loading of each mp3 and animationframes object on its own task. They're also made deferred, so the program can continue even if not all resources are loaded, but it will block as soon as a resource is attempted to be used if it isn't full loaded yet. So it loads resources in the backghround of the title screen and even after you start playing."

Sheesh don't really understand this at all :p
What do you mean with deferred?
Do you think this is something I should try to figure out atm or ignore for now?


Top 
 Profile  
Reply with quote  
 Post Posted: March 15th, 2017, 6:33 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3306
Location: Japan
Yumtard wrote:
@albinopapa

Either because I didn't know about the function or I had forgotten about it:p not sure which! Changed them to clear now. Thanks :)

@chili
shit you're right, your version crashes when you reach the boss :S

"Yup, putting the loading of each mp3 and animationframes object on its own task. They're also made deferred, so the program can continue even if not all resources are loaded, but it will block as soon as a resource is attempted to be used if it isn't full loaded yet. So it loads resources in the backghround of the title screen and even after you start playing."

Sheesh don't really understand this at all :p
What do you mean with deferred?
Do you think this is something I should try to figure out atm or ignore for now?


What I mean by deferred is, the loading process is started, but it is not actually checked / completed until the first time the resource is actually requested. At that time, if the loading is finished it can be used, but if it is not finished, the program will block until the operation is complete.

Don't try and figure out this stuff yet. Definitely ignore it for now. It's not super hard, but threading/asynchronous programming isn't something you should approach half-assed either. It will wait. :P

_________________
Chili


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3, 4  Next

Board index » Everything


 
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 post attachments in this forum

Search for:
cron