Page 3 of 4

Re: Please test my game! :)

Posted: March 13th, 2017, 10:55 pm
by Yumtard
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

Re: Please test my game! :)

Posted: March 14th, 2017, 1:25 am
by chili
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

Re: Please test my game! :)

Posted: March 14th, 2017, 2:42 am
by chili
Here's a little teaser ;)

binary package

Re: Please test my game! :)

Posted: March 14th, 2017, 10:51 am
by Yumtard
Wow that's a lot faster! Is that using multi threading?

Re: Please test my game! :)

Posted: March 14th, 2017, 11:55 am
by Yumtard
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: Select all

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: Select all

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

Re: Please test my game! :)

Posted: March 14th, 2017, 1:38 pm
by chili
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.

Re: Please test my game! :)

Posted: March 14th, 2017, 1:52 pm
by albinopapa
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: Select all

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: Select all

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: Select all

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

Re: Please test my game! :)

Posted: March 14th, 2017, 1:55 pm
by chili
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 ; /

Re: Please test my game! :)

Posted: March 14th, 2017, 3:06 pm
by Yumtard
@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?

Re: Please test my game! :)

Posted: March 15th, 2017, 6:33 am
by chili
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