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.

DarkBASIC Professional Discussion / The Bone Animation Thing - A Query

Author
Message
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 17th Mar 2012 20:12
Hello,

The Game Creator's website states that Dark Basic pro supports bone animation.

Can I move or manipulate the skeleton of a rigged mesh on a per bone basis ( I mean I want to move each bone individually using code at run time according to my desired fashion) at run time using dark basic pro ?

If yes, then is there any tutorial for that ?

Thanks,
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 17th Mar 2012 20:45
Quote: "I move or manipulate the skeleton of a rigged mesh on a per bone basis"

yes

Quote: "If yes, then is there any tutorial for that ?"

bones are just like a regular limbs so have a look at position/rotate/scale limb commands

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 17th Mar 2012 22:11
Hello Brendy Boy,

Thank you for pointing me to the right track. I will be looking into those commands and come back here if I get stuck somewhere.

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 18th Mar 2012 11:47
Hello Brendy boy,

Somebody in the forum gave me this piece of advice -

One limb per object. DBP hates limbs. Have 100 objects with 10 limbs each? Get an extra perfomance hit up to 1000% (depending on your effect system)! You can ignore this issue only if your effects is like in DB Classic (yeah, ghosting is my favorite )
Bones are pain in the ass.

What is your opinion regarding bone animation ? Is smooth skeletal animation possible or not possible in Dark Basic Pro without the above said 1000% performance hit.

Thanks,
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th Mar 2012 17:51
Skeletal animation works fine in DBPro. In carnage I have 32 animating skeletons, sometimes all on screen at once, in the region of 2000 polys with lots of joints, and it runs fine. You need Enhanced Animations to get good control over transitioning between frames though, because DBPro doesn't provide sufficient control over blending between animations.

This whole catastrophic problem of DBPro with limbs and multiple objects is a load of rubbish too. Yeah, it's slower with many objects, or objects with many limbs, but it's not like it's some sort of impossible barrier. In the early days, DBPro had a big problem with a high number of objects, and then Lee released an update which solved that. You can have thousands of objects without a problem.

As for hundreds of limbs per object, I can't say I've ever had the need to render objects with loads of limbs. If there is indeed a performance hit, you can work around it. I mean, what object needs hundreds of limbs and can't be carved into separate models? For large levels, for example, I would always have separate models for different secors and exclude/include them as necessary to maximize speed.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 18th Mar 2012 19:19
Hello Fallout,

Thank you for giving your view points. It has given me courage to continue further with the dark side ....

100 limbs or more per object may become necessary if we trying to animate a big gigantic creature ( not human of course ).
I just visited your game demo link on youtube -
http://www.youtube.com/watch?v=6CnnPj1aO4Q&feature=player_embedded

The game looks professional and bots animation is looking all right.
But I think it would have been far more interesting if you did not place the camera top - down. A third person camera position like in role playing games or a first person camera position would have given the user (human player) more thrill. At least if there was option for changing the camera modes / view angles the user would have the option to set the camera himself or herself according to his or her own preference. Among the effects, I liked how you implemented the fire with smoldering smoke.

What is your opinion about - STYX, Dark Clouds, Dark Imposters, Dark Lights, Dark AI and Dark Physics.
Do I really need these to make a game like Unreal Tournament I or II or III or is there workarounds to avoid these plugins.
How good is dark physics in your opinion. Does it give appropriate realistic results ? I will request you to give opinion about the plugins you are experienced with. It will help me determine which are absolutely necessary and which are not.

Thanks,
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th Mar 2012 21:11
Hi Juggernaut,

There is a difference between limbs and joints, although the difference in DBP isn't always clear. If you have a single mesh, with 100 joints, I believe the entire mesh will be treated as 1 limb and rendered at the same time. DBP will pass all the joint rotation matrices with the mesh vertex data and it'll get rendered at the same time. It'll be slower, because lots of different rotation calculations are happening on different vertices, but it'd be slower in any engine. That's the draw back of skeletal animation.

Any issues with multiple limb rendering slow down will be when you have separate meshes in 1 object. DBP will probably swap textures, render limbs separately and various other things. None of us really know how it works behind the scene, but for your giant creature, if he has 1 mesh with 100 joints, it probably won't cause DBP any slow down that it wouldn't cause another engine. I've never seen a 100 joint model in any professional game though, and there's probably a reason why .... it'd be really slow! You've got to be realistic with your crazy inventions!

In Carnage, the animation is quite ropey. I don't used Enhanced Animations, because that demo was put together very quickly. The animation is one of the weakest points of the demo, so don't use it as an example of what DBP is capable of. With Enhanced Animations, you can do much better, and that's what I'll be using for the full game.

As for the top down camera, that may change in the full version, but as indi game devs, we have to accept the fact we will never compete with the AAA games. We can't possibly produce their quality and quantity of media, and my feeling is that you have to find a niche if you want to stand out. Since there are countless gorgeous looking third person games, it'd be very hard to compete with them. By making Carnage more top down, I add to it's uniqueness and help it to stand out. I would never make an FPS game, for example, because it'll always be compared to AAA FPS titles, and never be successful. By pushing the top down vantage point, among other things, I can at least try and stand out a little more.

With regard to the plug-ins you mentioned, I have used very few of them. My thoughts are plug-ins generally allow you to implement a technical concept very quickly and easily, but ultimately do it more slowly than you could do it yourself, because they have to do it in a generic way that works for every scenario. Either that, or they are limited in functionality and you find yourself having to code additional content anyway to achieve the result you need. I only buy/use plugins that offer me something I can't code myself.

So the plug-ins I've used are:
EZ Rotate (Essential for complex 3D rotation calculations that are beyond my maths ability/patience)
Enhanced Animations (Essential for complex animation scenarios and blending, and I couldn't write this plug-in better myself, so why try?)
Sparky's Collision DLL (This is an old freebie, and still widely used, for simple but fast collision which is way better than the built in DBP collision commands, and another area of maths I'm not great at)

As for Dark Physics, I've used that a few times, but never rigorously. I made some quite cool things with it. I started making a hover racing game years ago when it was release. I remember that being quite easy to make, as I just used a series of rolling cylinders. The cars was more driving than hovering, but it was quite fun to control ...


I also used it in a zombie game I don't have a video of, for hinged doors and general sliding collision and character controllers. It worked well, and the doors could be kicked off their hinges. But I remember I wasn't able to get Rag Dolls to work correctly back then (joint limitations didn't work properly). I personally would require that from any physics engine I used now. I will probably look at other physics engine when I start on the full version of Carnage in DGDK.

Woah ... this is a mammoth reply. But anyway, yes, you could make an FPS game without using any of those plug-ins. It's all down to your own abilities as a coder, and specifically with the complex algorithms and maths involved in things like AI, collision and physics.

Hope my massive rant helps somewhat!

Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 18th Mar 2012 23:09
Quote: "Hello Brendy boy,

Somebody in the forum gave me this piece of advice -

One limb per object. DBP hates limbs. Have 100 objects with 10 limbs each? Get an extra perfomance hit up to 1000% (depending on your effect system)! You can ignore this issue only if your effects is like in DB Classic (yeah, ghosting is my favorite )
Bones are pain in the ass."

It's a good advice. But that isn't the limitation of dbpro only, it's DirectX limitation. Draw calls are in general more expensive than actual rendering. AAA titles get around that limitation by combining all the static objects with the same textures/effects into one.

Quote: "What is your opinion regarding bone animation ? Is smooth skeletal animation possible or not possible in Dark Basic Pro without the above said 1000% performance hit."

By using default dbpro rendering it is very slow. At my old system I used to get 50% fps drop with every character.
But there is a fix for this. Lee made a shader that moves all the bone matrix operations from cpu to gpu so if you have good graphics card the performance hit of every added character is negligible. Limit of this shader is 60 bones per character.
You can find that shader in "compiler/effects" folder and it's called "stencilshadowbone.fx". If you don't need shadows you'll have to remove shadow part of the shader code.

Quote: "What is your opinion about - STYX, Dark Clouds, Dark Imposters, Dark Lights, Dark AI and Dark Physics.
Do I really need these to make a game like Unreal Tournament I or II or III or is there workarounds to avoid these plugins.
How good is dark physics in your opinion. Does it give appropriate realistic results ? I will request you to give opinion about the plugins you are experienced with. It will help me determine which are absolutely necessary and which are not."

STYX - Lots of functionalities can be recreated in dbpro code. Some of them are available in numerous free plugins so you don't really need this.
Dark clouds - some people have problems with this because it seems that is unfinished. It would be best to read Dark clouds thread at this forum first and then decide.
Dark imposters . if you plan on having scenes with lots of objects and huge draw distances then this may come in handy
Dark lights - the easies way to enhance visual appearance of your game. It doesn't give good results with curved objects such as rocks/terrain. In most AAA titles this isn't used. Instead the improve visuals with screen space ambient occlusion shader and dynamic soft shadows.
Dark AI - good if you don't know any AI programming.
Dark Physics - unfinished and buggy. I suggest you to look at Newton wrapper by Tiresius or Dark Dynamix (nVidia physics wrapper made by Matty H. )

cyril
18
Years of Service
User Offline
Joined: 6th Aug 2007
Location: 7 miles away from big ben
Posted: 18th Mar 2012 23:54
Quote: "By using default dbpro rendering it is very slow. At my old system I used to get 50% fps drop with every character.
But there is a fix for this. Lee made a shader that moves all the bone matrix operations from cpu to gpu so if you have good graphics card the performance hit of every added character is negligible. Limit of this shader is 60 bones per character.
You can find that shader in "compiler/effects" folder and it's called "stencilshadowbone.fx". If you don't need shadows you'll have to remove shadow part of the shader code."


You can try to modify Stencilshadowbone.fx or you can use fastbone.fx which was released by Van B and Lee for DBpro:

http://forum.thegamecreators.com/?m=forum_view&t=127395&b=1

It is basically the same thing but without the shadow.

There's bumpbone.fx which does bump and specular mapping but that is licence to Dark Shaders and FPSC users only.
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Mar 2012 20:02
Thank you Fallout, Brendy boy and Cyril for all the important advice.

"AAA titles get around that limitation by combining all the static objects with the same textures/effects into one." - you mean they create one .x file containing all the meshes - so the loading of models is done only at once (reducing the "load objects" calls) ?
Is there any caching mechanism in Dark Basic Pro ? I mean like the resources once loaded - do not need "load objects" again - something to reduce the CPU overhead ?

And Fallout - do you consider Dark GDK more suitable than Dark Basic Pro ?

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Mar 2012 20:06
Does Dark GDK has the same drwabacks / bottle necks as in Dark Basic Pro ? Or is it much better in every respect including the bone /skeletal animation thing ?

Thanks,
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 19th Mar 2012 20:27
Quote: "you mean they create one .x file containing all the meshes - so the loading of models is done only at once (reducing the "load objects" calls) ?"


What he means is, they're all rendered at the same time. Every time you change something in the rendering pipeline, you slow stuff down. So a AAA engine will probably throw all the polygons using a specific texture at the rendering process at the same time. It's the type of low level control you don't have in DBP, but having said that, I think DBP may render objects in texture order. Not sure! Either way, it pays to avoid multiple textures per object where possible.

Quote: "And Fallout - do you consider Dark GDK more suitable than Dark Basic Pro ?"


DGDK is better, because you have the power and flexibility of C++, while keeping the ease of use of the library. All your own code will be faster, but I think I'm right in saying all the library calls and the rendering will be the same speed as DBP. Maybe someone else knows for sure?

DBP served me well for 10 years though, and my limitations/motivation/time were always a fail point long before DBP was. So if you're new to game dev and aren't already proficient in C++, there is no harm at all in using DBP. Carnage is DBP, and I'm only now switching to DGDK because I want extra CPU cycles for AI and the flexibility to use other C++ libraries if I need them.

DBP still rocks.

Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 19th Mar 2012 20:41
Quote: "you mean they create one .x file containing all the meshes - so the loading of models is done only at once (reducing the "load objects" calls) ?"

This:
Quote: "What he means is, they're all rendered at the same time. Every time you change something in the rendering pipeline, you slow stuff down. So a AAA engine will probably throw all the polygons using a specific texture at the rendering process at the same time. It's the type of low level control you don't have in DBP, but having said that, I think DBP may render objects in texture order. Not sure! Either way, it pays to avoid multiple textures per object where possible."


Quote: "Is there any caching mechanism in Dark Basic Pro ? I mean like the resources once loaded - do not need "load objects" again - something to reduce the CPU overhead ?"

Dbpro sorts the triangles by their texture and using SET OBJECT CREATION commands you can tell dbpro to share object vertex buffers where possible. That is some sort of an optimization. But if you were doing everything in C++/DirectX you would have even more control of how your objects are grouoed together and optimization would be much better.
So, to conclude, dbpro has some optimizations but that's far from optimizations AAA titles use

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Mar 2012 19:47
Brendy Boy and Fallout:

Can you please direct me to links in the forum where alternatives to the commercial plugins are free. I have come across many but I am confused since I have seen multiple plugins developed for the same functionality ..... just cannot decide which one is time tested performance and with best features.

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Mar 2012 19:57
Quote: "What he means is, they're all rendered at the same time. Every time you change something in the rendering pipeline, you slow stuff down. So a AAA engine will probably throw all the polygons using a specific texture at the rendering process at the same time. It's the type of low level control you don't have in DBP, but having said that, I think DBP may render objects in texture order. Not sure! Either way, it pays to avoid multiple textures per object where possible."

Ok if to mimmic this in DBPro, if I load all the polygons/meshes/objects in a scene sequentially one by one using a common low-res texture and use different codes to re-texture them at run time - depending on their visibility / nearness to the camera - will it give me an overall performance boost ?

Furthermore if take another root. I do not do any kind of re-texturing - but instead use shader code to do the work of texturing , since the shader code runs in GPU - it should be a lot faster ..... giving overall performance boost ?

Will this work or is it just layman's words ?

Thanks,
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 20th Mar 2012 21:27
Quote: "Ok if to mimmic this in DBPro, if I load all the polygons/meshes/objects in a scene sequentially one by one using a common low-res texture and use different codes to re-texture them at run time - depending on their visibility / nearness to the camera - will it give me an overall performance boost ?

Furthermore if take another root. I do not do any kind of re-texturing - but instead use shader code to do the work of texturing , since the shader code runs in GPU - it should be a lot faster ..... giving overall performance boost ? "


Erm ...

Quote: "or is it just layman's words ?"


Yes.

Re-texturing objects is fine, but it's slow. So say your character gets shot, and you want to retexture him with a shot texture, that's fine. It's once every now and then. Retexturing a lot of objects every loop is very slow. People get around this by scrolling UV data. So if you have an explosion texture, you have 8x8 (64) different images for the explosion on 1 texture, with the UV coordinates mapped to one of these 64 frames. You then move the UV coordinates for each frame of the explosion animation. Retexturing multiple explosion objects with 1 of 64 different explosion textures is slow.

I doubt you can speed up DBP in any significant way by doing more work yourself to by-pass it's 'faults'. The trick is to understand how it works and work with it, to give it the best chance. So with regard to textures, just use as few as possible. Combine multiple textures into single textures, so different objects UV data are actually mapped to different areas of the same texture file, and then let DBP do it's thing.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Mar 2012 21:42
WOW - "Combine multiple textures into single textures, so different objects UV data are actually mapped to different areas of the same texture file, and then let DBP do it's thing"

Very intelligently thought out indeed. Are you a professional game developer or just an enthusiast. Did you do any courses in game development in the university/institute ? Your answers sound very professional as compared to a hobbyist. Though you use Dark Basic Pro .... you seem to know the tricks of the trade that AAA class titles use to get the job done. Nevertheless I must admit you people are helping me a lot. I visited other free c++ based engines irc channels and there I either get ignored or get scolded for asking foolish questions.

Another point - have you been able to sell any game made with Dark Basic Pro commercially with success ?
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Mar 2012 21:55
One more thing - will you please list here all the names of the techniques/tricks that AAA titles use to get their job done (including the names of shader techniques ) ? I need to learn about them - before - I can talk with other guys. Like in the other thread - "A question to Gods and Godesses .... " Brndy Boy just told me that what kind of culling I want to have - he named three different culling techniques - the whole thing is becoming overwhelming ..... I need to do some home... seriously ...... learn about all these terms .... before I ask for anything to anybody .... otherwise I appear dumb even to myself.

So please give me a list that I need to work on.

Thanks,
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 20th Mar 2012 22:26 Edited at: 20th Mar 2012 22:27
Quote: "One more thing - will you please list here all the names of the techniques/tricks that AAA titles use to get their job done (including the names of shader techniques ) ?"

google is your friend

gpu gems 1
gpu gems 2
gpu gems 3

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 20th Mar 2012 23:41
Quote: "Are you a professional game developer or just an enthusiast. Did you do any courses in game development in the university/institute ? Your answers sound very professional as compared to a hobbyist."


There are lot of really experienced developers here. You've had some experience rich answers from others in this thread too.

I've just been making games for a long time. I started using DB back in 2000 when it was new. I've learnt most of my stuff from other people on here and from experimenting along the way. I've also made two successful Android games and done some native OpenGL coding, which is where I learnt a lot about the rendering pipeline at the low level. It's all a little confusing until you've done that, and everything about DBP makes more sense afterwards.

I've never even tried to sell a DBP game before, because I've never completed one to a commercial standard, but the StarWraith games are a good example of commercially successful DBP games. I believe one part of the series is DBP and the other is DGDK, but I'm not sure.

Quote: "So please give me a list that I need to work on."


You need to work on a game. It's all good stuff to learn how to get things to render as quickly as possible, but what's the point in having a high FPS rate for a rubbish game? You can always optimise the rendering process of a finished game once it done.

Don't get bogged down in these things. Ask yourself why you're interested in the engine anyway? Is it because you like messing around with technical stuff, or is it because you have a game you want to make?

I just think it's better to start trying to make a game, find out you have performance issues and learn how to solve them along the way, rather than learning to solve problems you've never experienced. That way you'll be making your own list of necessary techniques and be learning how to make a good game along the way.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Mar 2012 08:56
Thank you Brendy Boy for those valuable links.

@Fallout: Is there any template / design pattern available for Dark Basic Pro ? I mean time tested program structures / constructs to follow ? Or should I just dive in like this -

1.Separate the core functionalities under different functions grouped and located within separate file names.

2.Include those functions in the main file and call the functions as when required from within the game loop.

Is that all ? Or do I have to consider other things ?

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Mar 2012 09:26
Another thing that comes to my mind - how much physical RAM should I target for my game - 512MB or 1GB ? For the game itself. I do not have multiple pcs with various configuration/hardware spec (both old and new) to test my code. Is shader model 3 widely supported on most boards and video cards now (both on board and slot) ? What are your suggestions ?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 21st Mar 2012 10:11
DBPro's uniqueness is in it's library calls and functions. Apart from that, it's pretty much the same as any programming language. So all best practices for coding and good design approaches apply to DBP. Any articles you find on the net on the subject can be applied to DBP, but really every coder has their own style.

I get the impression you're a bit of a perfectionist though with a strong preparation ethic. All very admirable, but there is too much to learn in game programming to get all the theory in place before you start. You've gotta just force yourself to dive in and learn as you go.

Forget about system requirements for your first few games. Just make them run well on your own machine so you can learn about putting them together. Designing game to run on as many machine specs as possible is a more advanced requirement to worry about later on.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Mar 2012 15:14
OK ... Fallout ..... I guess I learn Dark Basic Pro itself by heart first ..... before going for industry standard perfection thing ....

It will take some time ... next few months .... or so .... but still I will have to do it to convert the words into deeds ..... thank you.
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 28th Mar 2012 18:26
Hello,

How to do the bone animation actually ?

1.Create the model using blender or some other software and then create the skeleton using the rigging process.

2.Then I guess, I will have to create limbs following the skeleton hierarchy ? But how do I relate each limb with each bone in the skeleton structure of the model ? Does Dark Basic Pro recognize that hierarchy automatically as I load the .X file of the model and create the corresponding limb structure ? Or do I have to do the limb -> skeleton(bone) relationship manually ?


Thanks,
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 28th Mar 2012 19:18
It does it automatically and you use the various LIMB commands to control the model. If you have a model with multiple meshes but no skeleton, the LIMB commands relate to each mesh. If you have a model with a skeleton, the LIMB commands relate to each joint. The hierarchy is setup automatically.

Good luck with the manual rotation though. Rotations are cumulative, so if you rotate a shoulder in a funny way, and then an elbow in a funny, trying to get the wrist to rotate how you want to is very confusing. You better be good at rotational maths.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 28th Mar 2012 20:14
Hello Fallout,

Thank you for explaining the underlying mechanism. I was a bit set a back thinking I will have to set the model bones -> limbs correspondence manually by using the limb commands. My head was spinning - when I tried to think about the number of lines of code that I will have to write for a skeleton structure of 30-40 bones!
But it is very much refreshing to know that the whole process is automatically handled by Dark Basic Pro - I am very glad to hear that.

Quote: "Good luck with the manual rotation though. Rotations are cumulative, so if you rotate a shoulder in a funny way, and then an elbow in a funny, trying to get the wrist to rotate how you want to is very confusing. You better be good at rotational maths. "


I know what you mean and I will try to be careful by brushing up college level mathematics.

Thanks,

Login to post a reply

Server time is: 2026-07-10 00:26:39
Your offset time is: 2026-07-10 00:26:39