Simultaneous actions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Aleyer
Posts: 17
Joined: Thu Dec 14, 2006 9:03 pm

Simultaneous actions

Post by Aleyer »

Well, I want to create a scene with a moving camera and some animated objects using Irrlicht. What I currently can't imagine is how can I control all of these things. The camera is going to have a certain route and should move from one point to another, and then to another according to the time passed or to some triggers (it won't be controlled manually). And will follow one moving animated mesh. The mesh,it will be a snowman, will move, stop sometimes and animate. So, as I understand, I need something like three (at least) subprograms, running simultaneously: one should control camera, anoter the snowman, the third a car that will pass by and so on... I've already had an experience with scripting in Operatin Flashpoint game. There all seemed to be easy - you create some scripts, load it during the game, and they do what they should. What do I need to create a similar-looking system in Irrlicht? A scripting language, IrrLua, some functions in C++ or what?

Thanks in advance, Alexey.
stef_
Posts: 53
Joined: Tue Apr 18, 2006 9:39 pm
Contact:

Post by stef_ »

I would have to suggest you to read something related to concurrent
programming. There are two types of concurrency:
cooperative and preemptive

For beginners (but not only) game coders cooperative is better, pseudocode:

Code: Select all

while(1) {
   job1();
   job2();
   job3();   
   render();
}
Bye
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah it's really not too hard. In fact a lot of it may be mostly done by using Irrlicht's built in functions like followSpineAnimators for the camera to follow a certain path, and either that or flyStraightAnimators for the 3d models in the scene.

Like Stef said you could just, each frame, move the camera a bit, move the snowman a bit, move the car a bit. That way when it runs it will move each of the things a bit each frame which will make them all move at the same time.. sorta thing...

Possibly not the best explanation though!
Image Image Image
sober
Posts: 21
Joined: Tue Nov 29, 2005 9:23 am

Post by sober »

I may sound alittle harsh but at the moment, I think in nearly every third thread here: Why are you all start Programming (Scripting is not programming) and do your first C++ experiences with 3d Stuff.
Sure, 3D Programming and making Games is fun and really cool, but even if you get your questions answered here, you won't have fun with gamecoding for long, as you will get stuck very fast. Befor you start a game, you should at least understand programming, basic programmlogics and know how to compile your programm, how to compile libs and how to include them into your app.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I started with 3D and I didnt find it a problem. I am not exactly pro but I find no need to ask silly questions like these :P Anyway Aleyer anything simple like this is possible with general C++ programming. Going a little further ahead it iiis recommend you incorporate a scripting langauge so your game is more well "put together" later on but with your current level it may be a headache so try doing it in C++ first than incorporate a scripting language.

I think for your purpose Irrlicht has some form of spline following technique, look at the demo for irrlichts source code, where the camera is moving, and copy that, then release the scene node you are following moments before camera so they are on the same path.
Aleyer
Posts: 17
Joined: Thu Dec 14, 2006 9:03 pm

Post by Aleyer »

JP wrote:Yeah it's really not too hard. In fact a lot of it may be mostly done by using Irrlicht's built in functions like followSpineAnimators for the camera to follow a certain path, and either that or flyStraightAnimators for the 3d models in the scene.
followSpineAnimators is what I need, thanks!
sober wrote:Why are you all start Programming (Scripting is not programming) and do your first C++ experiences with 3d Stuff.
It's not my first C++ experience! :P But I don't know much theory...
And in Pascal I'm one of the best 16-year-old in my city :D
BlindSide wrote:I am not exactly pro but I find no need to ask silly questions like these :P
Question is silly, but the answers helped me a lot. Asking silly questions makes me understand better what I need...
BlindSide wrote: Anyway Aleyer anything simple like this is possible with general C++ programming. Going a little further ahead it iiis recommend you incorporate a scripting langauge so your game is more well "put together" later on but with your current level it may be a headache so try doing it in C++ first than incorporate a scripting language.
I realise that you are right. I'm gonna do it in C++, certainly it's easier
stef_ wrote:For beginners (but not only) game coders cooperative is better, pseudocode:

Code: Select all

while(1) {
   job1();
   job2();
   job3();   
   render();
}
I think it should look like this, shouldn't it?

Code: Select all

while(device->run && elapsed_time < 3000) {
   jobs();  
   render();
}
some_other_jobs();
while(device->run && elapsed_time < 10000 && elapsed_time > 3000) {
   jobs();  
   render();
}
and so on...
Aleyer
Posts: 17
Joined: Thu Dec 14, 2006 9:03 pm

Post by Aleyer »

If I would have any other silly questions I would ask them here... :)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hehe that is correct, the man who asks a silly question seems ignorant for 5 minutes, but the man who doesnt is ignorant for a lifetime :lol: Btw your plan is very good.
Post Reply