Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / One animation for hundreds of models

Author
Message
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 11th Sep 2009 18:24
Hello,
In my game, there are a lot of humans walking around.
To avoid that one human looks like the other I want to generate them random.

So I need to create for example 5 pairs of legs, 5 heads, and 5 torsos.

But how do I weld these models together and how can I use one animation for all these generated humans?

In the documentation I find the following groups of functions:
Quote: "CONSTRUCTION COMMANDS

LIMB COMMANDS

MESH COMMANDS"

In which group can I find the functions I need to weld the separate parts together?

I know how to work with boned animation in 3D Canvas, is there something comparable in DarkGDK?
In the end, I want to mix those animations (for example drinking and walking).
This would save me a lot of trouble; Otherwise I would have to animate every model manually...

Regards
MES

http://www.Computer-Masters.de
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 15th Sep 2009 19:33
Maybe I didn't describe my Problem correctly.

In the end, I want several models looking like humans that use the same animation.

A good example for a existing solution for this Problem is Half Life 2:
http://www.youtube.com/watch?v=mMENMAyNXHM

Here every human model uses one animation and animations for one model can be mixed (e.g. drinking and walking).

Is it possible to realize that with DarkGDK?

Regards
MES

http://www.Computer-Masters.de
zaphos
15
Years of Service
User Offline
Joined: 29th Mar 2009
Location: The forest moon of Endor
Posted: 16th Sep 2009 14:20
http://darkbasicpro.thegamecreators.com/?f=enhanced_animations

I think you should take a look at the enhanced animations plugin. It might be what you are looking for.
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 19th Sep 2009 13:26
Thank you for your answer.
Quote: "DarkBASIC Professional 6.5 + is required."

But I'm working with DarkGDK.

Now I experimented around with some of the Limb-Commands.
I'm sure it will work with that, but my problem is, that I do not really know what those Limb-Commands exactly do.
In the documentation they are all described, but I don't know how to start.
Is there a tutorial anywhere?

Regards MES

http://www.Computer-Masters.de
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 19th Sep 2009 13:39
You should try this:
dbChangeMesh ( int iObject, int iLimb, int iMesh )

And 'Enhanced Animations' works with DarkGDK, too!

They say it's better to burn out, than it is to fade away...
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 22nd Sep 2009 17:53
@ _Pauli_
Ok, that's one of the functions I can use to solve the problem.

But I need more than that, because I want to know step-by-step which function comes first, second, .... .

Can anyone post a code example, for a simple creature with e.g only one limb?
I haven't found tutorials yet...

Regards
MES

Visit: [link="http://www.Computer-Masters.de"]http://www.Computer-Masters.de[/link]
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Sep 2009 20:45
code example

MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 22nd Sep 2009 23:55
@ pcRaider
Thank you for the Code-Example. It works an I now understood the concept.

But there's another Problem with 3D Canvas:
I cannot open the file Colonel-X.X correctly with 3D Canvas (Pro). It's only a triangle visible.
When I open it with the DirectX Viewer, it works.

And how can I animate a model with 3D Canvas (Pro), that it has limbs like Colonel-X.X? Neither Google nor the 3D Canvas help are helping...

Regards

MES

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 23rd Sep 2009 08:55
According to the documentation, 3D Canvas can export animation and bones in DirectX format but it cannot import them, so even if you can open the colonel file, you won't have access to its animation frames.

http://www.3d-canvas.com/3DCanvasDocumentation/miscimportexport.htm

As to using limbs in 3D Canvas, I have no clue but maybe you can ask in the 3D Canvas forums as well.

I'd like to offer some help with your earlier question, how to weld limbs together in Dark GDK. Have a look at my Hangman program on the first page of the Coding Challenges thread. In the MakeScene function, you will find a series of commands that build a simple figure by putting parts together. That's about all I know about limbs but it can be a start.

I like very much your idea of making models from parts to increase variety.
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 26th Sep 2009 19:51
Thank you for the hangman code example.
I enjoyed playing it and I tried to understand the code with the limbs.
So i tried to program my own example, but the problem is, it doesn't work.

The programm runs and I can see the torso and the arm model in the scene, but the arm is not rotating.

What did I wrong?

regards

MES

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Sep 2009 14:36 Edited at: 27th Sep 2009 14:38
Since I don't have your X files, I tried the program by creating two "primitive" objects with the dbMakeObjectBox command, and it works, the limb is rotating. I don't know why it doesn't work with the X models you load, but if you post the models here, I can try to help figure it out.

The code is OK except that you should initialize r before using it, the compiler even displays a warning for uninitialized variable. The other thing is that it would be good to limit the value of r to the 0-359 range, otherwise it will overflow if the program is running for a long time. (I know it's just a test so it doesn't matter but I thought it's good to mention.)



P.S. I'll try to create some X models with 3D Canvas and see if I can make them work.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Sep 2009 15:29 Edited at: 27th Sep 2009 15:29
So, I created two simple X files, loaded them with your code and it still works.

What if you try to rotate the limb around another axis? Any change?
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 27th Sep 2009 15:51
Hey, thanks for your help.
I now have a solution:
I do not have to put the parts together, I can call the bones I created in 3D Canvas as limbs and rotate them.
So I just have to put the bones to every model and then can animate it with DarkGDK.

The problem then is, that I don't have the flexibility anymore I wanted at the beginning (mixing 5 torsos and 5 legs random).
But I think that would be too complex and I want the game to be ready in less than one year

I still don't know why the code is not working with my objects, but it doesn't matter anymore. The new solution is, I think much more comfortable.


Thank you for your help!

Regards MES

Login to post a reply

Server time is: 2024-10-01 14:34:08
Your offset time is: 2024-10-01 14:34:08