Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Mar 19, 2024 7:19 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Cal3D Patch v3
PostPosted: Sat Apr 24, 2010 4:36 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
And here the Cal3D animation patch version 3 (version 2 was not public):

patch: http://freeway.raydium.org/data/patchs/anim-v3.patch
media: http://freeway.raydium.org/data/patchs/models.zip

Changelog
  • Currently tested with LibCal3D 0.11.0-4 (from ubuntu 10.04)
  • New tutorial application. It can give a basic idea about the loading/usage of the models.
  • Now the models can be in zip packages. The files have to be directly in the package, NOT INTO A FOLDER. Also the config(.cfg) file must have the same name than the package (but obviously with different extension).
  • Supported .zip extension in the filename (the v2 of this patch didn't supported it.)
  • Now the default (the first one) mesh and material of the model is auto applied when creating an instance.
  • Removed all hardcoded "data/anim" paths.
  • Some functions renamed for fitting raydium
  • Fixed "Non standard variable declaration ("code before data")"
  • cfg file parsing now is doing type checking. And string in cfg files must have double quotes(currently manual editing is mandatory).
  • No more massive debugin output.
  • "EXPERIMENTAL DONT USE" changed for "Beta"
  • The test applications now uses the RAYDIUM_ANIM_RENDER_ defines.
  • Removed a lot of warnings. Still 2 warnings remain.
  • Fixed (all?) typos.
  • anim-viewer.c is no more preloading packages. You can load your own packages without hardcoding and the number of animations is autodetected.
  • raydium_anim_models_destroy() automatically destroy all the related instances.
  • indentation fixed
  • More error-proof (but not perfect, of course)
  • Should we remove the old anim (MD2) support and its demo? Yes, I think so.

Pending

  • Documentation (apart of the new tutorial app)

Instructions:

Code:
cd your-raydium-folder/trunk/
(optionally you can update your svn)
wget http://freeway.raydium.org/data/patchs/anim-v3.patch
patch -p0 < anim-v3.patch
wget http://freeway.raydium.org/data/patchs/models.zip
unzip models.zip
make clean
make


What can you try?
Thera are 3 applications ready for testing. A simple test called anim-test1.c, a model viewer called anim-viewer.c and a basic tutorial called anim-tutorial.c.
anim-viewer.c MUST add the filename of the model to load (the zip file).
Code:
./odyncomp.sh anim-test1.c

./odyncomp.sh anim-viewer.c cally.zip
./odyncomp.sh anim-viewer.c freebeast.zip (this model is rotated, press 'r' to fix)
./odyncomp.sh anim-viewer.c geisha.zip
./odyncomp.sh anim-viewer.c paladin.zip
./odyncomp.sh anim-viewer.c trooper.zip

./odyncomp.sh anim-tutorial.c


Sorry for the long delay with this feature :wink:
I'll be waiting for your comments.


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Mon Apr 26, 2010 1:54 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Don't be upset if I'm a bit slow to comment/validate this patch, I'm just away from home this week ... and this new release sounds -very- interesting from the quick preview I had.


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Mon Apr 26, 2010 6:16 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
no problem ;)


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Fri Apr 30, 2010 2:30 pm 
Offline

Joined: Sun Dec 28, 2008 1:07 pm
Posts: 3
Excellent work Vicente. I really appreciate your perseverance with this. I missed the chance to tell you on irc, but I solved the Cal3D build issue. Now everything is working just fine here. The viewer app is a nice touch, but the Animation tutorial 'walkthrough' is a superb idea. I wonder if that comes from your teaching experience? Be great to see more of these, they've got a lot of potential :).

Anyway, I'll offer more detailed feedback as I get the chance to dig into this some more, plus experimenting with the Blender exporter. Keep up the good work, and thanks again for this important feature!


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Tue May 04, 2010 11:45 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Here's a few comments about the current release of the patch, after a relatively quick review this week-end:

- About the "irremovable warning" around line 1023 of anim.c, you should cast to (void *)
- I've seen at least one non-C99 variable declaration around this line, too (declaration "in the middle of the code")
- Missing "raydium/anim.h" file. Everything is declared in raydium/anim.c and "raydium/headers/anim.h" (for defines) and it's not consistent with other parts of Raydium and leads to trouble with static compilation. anim.c should deal with code, anim.h with defines, variables and structures, and headers/anim.h with function prototypes and documentation.
- You've many "linked" variables, so it's a bit hard to read and understand how it works (hard to see if a variable belongs to models, meshes or instances, for example), so it would be a better idea to use structures, I think.
- We should update Linux configure script to test libcal3d
- Strange thing ? Tutorial (great one BTW !) crash when using "--package model.zip" on the command line, while it works perfectly with anim-test.c
- We should think about a link with ODE
- We should think about shadows
- We should think about replays
- Important question to me: can't the engine update and renders instances for me ? (perhaps related ODE link question)
- Why adding "-I/usr/include" in the Makefile ?
- anim file is not included at the same place in index.c and in index.h, why ?
- Huge static arrays in raydium_anim_cal3d_instance_render_mesh(), with hard coded sizes ! We can't keep a such thing ! :)
- I don't understand the "scale thing". Why is there an hard coded scale in anim.c ? Is the scale parameter in cfg is used ?

Most of these issues cant be addressed quite simply, but a few ones remains real issues (files .c/.h, structures, static arrays, ...) that will probably requires some more hard work before applying this patch in the main tree.


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Sun May 09, 2010 12:38 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok, but:
Quote:
- You've many "linked" variables, so it's a bit hard to read and understand how it works (hard to see if a variable belongs to models, meshes or instances, for example), so it would be a better idea to use structures, I think.
What means "linked variable"?

Quote:
Strange thing ? Tutorial (great one BTW !) crash when using "--package model.zip" on the command line, while it works perfectly with anim-test.c
Strange... anyway the tutorial don't use parameters, it's always the same.
Quote:
- We should think about a link with ODE/shadows/replays (and shaders)
Yes, of course. But that should be done in a second commit (its too much stuff for doing at once)

Quote:
- Important question to me: can't the engine update and renders instances for me ? (perhaps related ODE link question)
Wel.. it could... But I prefer to avoid including animation system with ODE system dy default. In most of the games the characters are not really integrated in the physics system, just the main character and the near ones. So, returning to the previous point, yes we have to think a lot about this.

Quote:
- Why adding "-I/usr/include" in the Makefile ?
My cal3d library is there (ubuntu 10.04).

Quote:
- Huge static arrays in raydium_anim_cal3d_instance_render_mesh(), with hard coded sizes ! We can't keep a such thing ! :)
Pointers then? They are not my best :(


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Mon May 10, 2010 9:17 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Linked variables:
By linked, I mean relative to each others. It seems that there's 3 entities: models, instances and meshes, and it not very to easy to know where "raydium_anim_material_use" belongs, for instance. It would be easier to code, (way) easier to maintain and understand to use 3 structures, IMHO. And it's probably quite simple to do, I think.

anim-tutorial.c and "--package model.zip" command line switch:
Let me explain: I've downloaded the patch and models.zip. Instead of unzipping it, I've tried to use our package feature so that Raydium deals with zip file by itself:
Code:
# these two works perfectly (despite what I've said in my last post)
./odyncomp.sh anim-test1.c --package models.zip
./odyncomp.sh anim-tutorial.c --package models.zip

But when it comes to anim-viewer, it goes wrong, since it use directly argv instead of the usual "init_cli_option" way. A simple test is to call anim-viewer with a non-existing model as argument: it creates a package with that name in the current directory. Another example is when you want it fullscreen: it creates a file named "--fullscreen".
Another small point is that, when called without any argument, you give odyncomp usage directly in source code. It's not very "multi-target" compliant :)

link with ODE/shadows/replays (and shaders):
Of course, it's not needed for this first release, no trouble with that :) But I just want to be sure that these subjects will not be "left behind" once the current patch will be added to the trunk ("big job is done, let's start something else now" syndrome). As we've seen it, animation is an important and wanted feature for users, so we must do our best to "integrate" it to the engine, and make it as easy and complete as possible to use, this is an very important (mid term) goal for the engine.

automatic update and render:
Good point about the not-so-interesting interaction with ODE, but the idea remains the same without ODE: why do I have to update all by myself ? and why do I have to render all instances one by one ?

Makefile "-I/usr/include" path:
OK, cal3d is here, but this directory is a default (where libs gets installed and where gcc will search), so there's not need to add it (and it may broke something on non Linux systems [BSD ?])

static arrays in raydium_anim_cal3d_instance_render_mesh():
Pointers, allocations, arrays declared in anim.h (currently not existing, just to be sure we talk about the same thing), whatever, since I haven't taken enough time to understand the role of these arrays. But we can't keep it as-is, that's for sure :)


Don't get me wrong, I'm not asking you to complete all this by yourself before "allowing" you to commit: I'm OK to help, and I'm ready to hear that I'm wrong on some points: you wrote this patch, so you know best ;)


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Fri May 28, 2010 9:04 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, I'm taking so long to answer cause I'm, again, involved with a project.
However I'll take a deeper look into those points this weekend. :wink:


Top
 Profile  
 
 Post subject: Re: Cal3D Patch v3
PostPosted: Mon May 31, 2010 8:54 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Xfennec wrote:
Linked variables:
By linked, I mean relative to each others. It seems that there's 3 entities: models, instances and meshes, and it not very to easy to know where "raydium_anim_material_use" belongs, for instance. It would be easier to code, (way) easier to maintain and understand to use 3 structures, IMHO. And it's probably quite simple to do, I think.
Ok, structures then.

Quote:
anim-tutorial.c and "--package model.zip" command line switch:
Let me explain: I've downloaded the patch and models.zip. Instead of unzipping it, I've tried to use our package feature so that Raydium deals with zip file by itself:
Code:
# these two works perfectly (despite what I've said in my last post)
./odyncomp.sh anim-test1.c --package models.zip
./odyncomp.sh anim-tutorial.c --package models.zip

But when it comes to anim-viewer, it goes wrong, since it use directly argv instead of the usual "init_cli_option" way. A simple test is to call anim-viewer with a non-existing model as argument: it creates a package with that name in the current directory. Another example is when you want it fullscreen: it creates a file named "--fullscreen".
So changing the argv usage with init_cli should do the trick?

Quote:
Another small point is that, when called without any argument, you give odyncomp usage directly in source code. It's not very "multi-target" compliant :)
??? I don't get it.

Quote:
link with ODE/shadows/replays (and shaders):
Of course, it's not needed for this first release, no trouble with that :) But I just want to be sure that these subjects will not be "left behind" once the current patch will be added to the trunk ("big job is done, let's start something else now" syndrome). As we've seen it, animation is an important and wanted feature for users, so we must do our best to "integrate" it to the engine, and make it as easy and complete as possible to use, this is an very important (mid term) goal for the engine.
Ok, added to the TODO.

Quote:
automatic update and render:
Good point about the not-so-interesting interaction with ODE, but the idea remains the same without ODE: why do I have to update all by myself ? and why do I have to render all instances one by one ?
About the automatic update I'm not quite sure... I have to think better about this, but initially I think we don't want to update the models always... Not sure. In the other side we could add something like "rules" that could determine if an instance has to be, or not, updated.
And we can add a raydium_anim_instances_render or all_insances_render ro something like that.

Quote:
Makefile "-I/usr/include" path:
OK, cal3d is here, but this directory is a default (where libs gets installed and where gcc will search), so there's not need to add it (and it may broke something on non Linux systems [BSD ?])
So the compilation should work without this? I'll make a try.

Quote:
static arrays in raydium_anim_cal3d_instance_render_mesh():
Pointers, allocations, arrays declared in anim.h (currently not existing, just to be sure we talk about the same thing), whatever, since I haven't taken enough time to understand the role of these arrays. But we can't keep it as-is, that's for sure :)
Weeellll.... then pointers. But they are not my best.

Quote:
Don't get me wrong, I'm not asking you to complete all this by yourself before "allowing" you to commit: I'm OK to help, and I'm ready to hear that I'm wrong on some points: you wrote this patch, so you know best ;)
Great! That will need a lot of work, specially pointers related stuff.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group