now my project is a game have many roles, the number of role in the game is 40~50 but some type of roles have the same animation, the only different between them is their appearance, which could be modified by picture path changed. the number of this type is only 5~10. But my problem is the picture path changed is on the low-level of the orx structure, changing it need to change all up-level structure, include all anim and animLink. Thus, for every role not one type role, I have to write all anim sections. And the content in the section is almost the same except the name of section. the game could run normal but the performance and the storage and memory occupied will be increased.
after I read your code,I believe it could be solved but my solution to it seems a little complicated, and not sure accessible. the procedure is like that
when create an object
1. build a new animset name and copy all content into the section
(since animset won't be created when it has a same name of animset created)
2. change the path of some graphics.
after creating the object
3. restore all graphic path
But is there any better solution to it?
the attachment is the configs of two roles belong to the same type. you can see that too many dunplicated data in it. (it may contain some Chinese but it won't influence reading)
Thanks in advance. https://forum.orx-project.org/uploads/legacy/fbfiles/files/MovieDevConfigs.zip
And in the CreateAnimSetFromTemplate, I'd use the skeleton you'd write once in config and create one with the right tags at the right place for this object.
Of course if you think it'd take too much space in config (which should be ok, I think), you can then clear the created sections when you don't need to create anymore objects of this type.
Here's a part of the content of the config skeleton:
And now the pseudo code of CreateAnimSetFromTemplate:
for my idea I mentioned in the thread, I don't know whether it could work normal. And if it functions well I tend to choose this option.
could you give me some advice to help me choose?
I planned on adding a profiler for memory and CPU use but didn't have the time to do it yet.
And again, when all your objects have been created, you can easily delete all the config data that you created this way. But I would only bother doing so if the memory use was really consequent.
Otherwise your idea would work, but depending on how many objects and how often you create them, it'll use CPU time. It all depends on which unused resources you have in your project.
therefore, gen the orx configs like I sent to you in this thread is not a difficulty. but too many configs in the packet are still very hard to manage.