Is there any game created with irrlicht (Source code)
Is there any game created with irrlicht (Source code)
Is there any source code of a game created with irrlicht
There are a lot:
Just look at the Project Page: http://irrlicht.sourceforge.net/phpBB2/ ... um.php?f=6
Just search for one with source code include.
Just look at the Project Page: http://irrlicht.sourceforge.net/phpBB2/ ... um.php?f=6
Just search for one with source code include.
As your ship is going down
ll stand by and watch you drown
ll stand by and watch you drown
you could search google for save/load tutorials on how to do it - or you could wait until someone has done something like this which you can just copy&paste ... your decision.
but it should not be too hard, just store all information about the current level and its objects/entities in a file and read it out again.
example:
object: entity
type: monster
health: 100
armor: 100
position: 100.0; 0.0; 100.0
scale: 1.0
then make a function which writes this information to a file like this:
"OBJECT entity TYPE monster HEALTH 100 ARMOR 100 POSITION 100.0;0.0;100.0 SCALE 1.0"
then you save this as savegame.sav.
to load it, you just parse the whole file line-for-line and save each line in a string.
so basically like this:
1. open file
2. scan how much lines there are.
3. create an array if strings and store the lines in it.
4. then scan the lines for the information that they hold and re-create your objects with the information you got out of the files (which is stored in strings)
this is sure not the best method, but its easy and it actually should work like this. the only condition is that you have to keep track of all your objects, maybe you can make an IObjectHandler class which stores all objects you create in a list, so you can easily save their information later - i hope you get what i mean.
good luck
byebye!
but it should not be too hard, just store all information about the current level and its objects/entities in a file and read it out again.
example:
object: entity
type: monster
health: 100
armor: 100
position: 100.0; 0.0; 100.0
scale: 1.0
then make a function which writes this information to a file like this:
"OBJECT entity TYPE monster HEALTH 100 ARMOR 100 POSITION 100.0;0.0;100.0 SCALE 1.0"
then you save this as savegame.sav.
to load it, you just parse the whole file line-for-line and save each line in a string.
so basically like this:
1. open file
2. scan how much lines there are.
3. create an array if strings and store the lines in it.
4. then scan the lines for the information that they hold and re-create your objects with the information you got out of the files (which is stored in strings)
this is sure not the best method, but its easy and it actually should work like this. the only condition is that you have to keep track of all your objects, maybe you can make an IObjectHandler class which stores all objects you create in a list, so you can easily save their information later - i hope you get what i mean.
good luck
byebye!
You cand find a tutorial here : http://www.gamedev.net/reference/articl ... le1289.asp
The procedure is like Gfxstyler said. Grab information, write to file, close file. And to load you open the file and read information, write to objects.
The procedure is like Gfxstyler said. Grab information, write to file, close file. And to load you open the file and read information, write to objects.
As your ship is going down
ll stand by and watch you drown
ll stand by and watch you drown
like i said, you need to keep track of _everything_. thats why a "loader" or "manager" for every type of objects would be best since you can easiely save the things which you created, so for example a ParticleManager where you create a particle.Anonymous wrote:ok i agree what u said
but now if i want to save whole level how can i, urs only aplied to game database. I m saying about whole level including particles info or any animators info and then loading them.
just create a particle class (abstract all the irrlicht stuff - this is even useful without save/load ... everyone should do that) and let the ObjectManager create it, for example:
IParticleClass* particle = ObjectManager->createParticle(blablabla);
now you ask yourself, why do you need to load it with ObjectManager->? its because the objectmanager has to do this:
when ObjectManager->createParticle is called, you create an IParticleClass instance in ObjectManager and save it in a list, then return that instance of IParticleClass so your IParticleClass which you initially wanted to create will be loaded.
example code how you could handle it for a particle class (this is a basic example and you should try to do it yourself, i only write this to give you an idea on how to do it)
Code: Select all
// in IObjectManager class
IParticleClass* IObjectManager::createParticle(blabla)
{
//this function should only be callable from IObjectManager (otherwise it wont keep track), so make IObjectManager class a "friend" of IParticleClass (you know what i mean when you use classes)
IParticleClass* Particle = new IParticle(blabla);
//you need to create a function like this (this is the important part - this will keep track of the particle you created)
addToParticleList(Particle);
return Particle;
}
//in IObjectManager class again
void IObjectManager::addToParticleList(IParticleClass* Particle)
{
//this is a std::list<IParticleClass*> ParticleList
ParticleList.push_back(Particle);
}
feel free to ask any questions
byebye!
ok i don't want this in detail , when we talk about scene serialization then we want to save info for every thing might be neede. I m using XML to save levels. But i m currently facing a problem . I want to save the info about animator. I m able to get the information but there is a problem with loading it , When i load the animator it starts from it initial position , but i want to start from the position i saved it. How do i pause and resume an animator in a scene
so its bad to use an animator in ur level if u r not able to save/load it.
I m able to save everything but the hell is there is an entity wants to be animated with animator how can i use the feature in game i m not able to use the save load feature for this animtors.Bcoz if animator has to saved it must be loaded at the correct position and not from the start.
I suppose "GFXstyLER" , u also created a game , have u not used animators and if used have u not saved thier info , and if so how come u load it at correct position (just similar to pauing and resuming an animator)
I tried Virtual Editor where "ETcaptor" stored levels using xml , but the bug remains there . I created a scene with it , added an entity and attached a fly circle animator , i saved it when entity wz at pos "x" , but when i load it
the animator makes entity move from its starting pos not from "x" pos
I m able to save everything but the hell is there is an entity wants to be animated with animator how can i use the feature in game i m not able to use the save load feature for this animtors.Bcoz if animator has to saved it must be loaded at the correct position and not from the start.
I suppose "GFXstyLER" , u also created a game , have u not used animators and if used have u not saved thier info , and if so how come u load it at correct position (just similar to pauing and resuming an animator)
I tried Virtual Editor where "ETcaptor" stored levels using xml , but the bug remains there . I created a scene with it , added an entity and attached a fly circle animator , i saved it when entity wz at pos "x" , but when i load it
the animator makes entity move from its starting pos not from "x" pos
well animation/movement in my app is a "little" different.
basically i have an ObjectManager like i told in my other post above where i add the objects in a list and then call ObjectManager->update(); in the main loop.
the update() function does this:
1. iterate through all lists that are available and call (*iterator)->update() for every object that is in the list. all my objects have an update() function that gets executed then. and in the update() function i can just do my movement code (which uses timing but it should also work without it). thats basically the same what animators do, but i just a bit reinvented the wheel because i need to adjust that and i also want to put other functions in the update() function.
so instead of having an animator that moves a node i just have a function that moves a node that gets called every frame through the ObjectManager (so you dont have to define the objects in the code, they just get added/removed from the list, very handy) :
its a bit hard to understand but when you get it you can implement it yourself, its really useful
good luck!
basically i have an ObjectManager like i told in my other post above where i add the objects in a list and then call ObjectManager->update(); in the main loop.
the update() function does this:
1. iterate through all lists that are available and call (*iterator)->update() for every object that is in the list. all my objects have an update() function that gets executed then. and in the update() function i can just do my movement code (which uses timing but it should also work without it). thats basically the same what animators do, but i just a bit reinvented the wheel because i need to adjust that and i also want to put other functions in the update() function.
so instead of having an animator that moves a node i just have a function that moves a node that gets called every frame through the ObjectManager (so you dont have to define the objects in the code, they just get added/removed from the list, very handy) :
Code: Select all
//in IObject class
void IObject::update()
{
//this is just an example
vector3df nodepos = node->getPosition();
nodepos.x += 123;
node->setPosition(nodepos);
}
good luck!
well unfortunately i dont have any "app" or project at the moment because my damned computer screwed up (a lot of smoke coming out of the case ... omg) and i just wiped out linux from my notebook - thus i dont have any backup on my notebook and my other computer is not able to boot up anymore.
but i think only the power supply thingy is damaged and not the harddisk. im away for two weeks now anyway so iam not able to get the data, damn
but i may do a re-write of everything i had this far because know i know a lot more how the different things work and i know c++ better, so the new result should be much cleaner/nicer/less bugs.
but thats off topic!
but i think only the power supply thingy is damaged and not the harddisk. im away for two weeks now anyway so iam not able to get the data, damn
but i may do a re-write of everything i had this far because know i know a lot more how the different things work and i know c++ better, so the new result should be much cleaner/nicer/less bugs.
but thats off topic!
Yeah thanx anyways , currently i m developing an in game editor for which i asked u this ques. THere i also used the same aproach as u did , I took a class holding a list of object pointers and these all update functions are caleed by list pointers.
Now one more ques, i m reframing a little bit, if i want to add a sound support , i looked at different libraries i found Audiere the best and easiest , can i use to produce 3d sound.
Now one more ques, i m reframing a little bit, if i want to add a sound support , i looked at different libraries i found Audiere the best and easiest , can i use to produce 3d sound.