Jump to content
Eternal Lands Official Forums
Torg

Please test this patch before I commit it to CVS

Recommended Posts

I've done up a patch against CVS of some tidying of the code I've been working on. It is available here: http://el.grug.redirectme.net/tidy.diff

 

Please check it compiles with your options enabled (make.defaults has changed so you will need to update your make.conf), and look for anything wrong with either actor animations or the sounds (if you use them).

 

There are 3 major changes I've made.

Firstly, I've replaced the large number of individual elements for the cal frames with an array for the frames which is indexed by an enum (once each for actor data, weapons and attached actors).

 

Secondly, I removed some of the loops when loading samples into buffers and added a linked list of sources attached to those buffers to check when the buffers can be cleared and unloaded. This should now avoid the nasty big loop looking for an available buffer (one that is loaded but isn't actually attached to a source) that traversed the entire loaded sounds list and sources list cross referencing them.

 

Thirdly, I removed the (out-of-date) actor data dictionaries at the top of actor_scripts.c. For the most part*, they have been replaced with ID's in the XML actor defs. In doing this, I discovered 2 bugs in the XML files. The updated files can be found in this archive: http://el.grug.redirectme.net/actor_defs.zip - Note: you only need player_helmets.xml and player_weapons.xml from that archive!!

 

* There are 3 dict's that I can't remove due to no ID's for them in the XML, so rather than update all the XML files (no thank you!), I have moved the dicts to the XML. To use these external dicts, unzip all the files in the above archive into the actor_defs directory and compile with EXT_ACTOR_DICT enabled.

Edited by Torg

Share this post


Link to post
Share on other sites

Hi

 

Please don't modify any cal3d stuff for the time being, because there is a problem with the attached actors (client crashes every once in a while), so it would be better to first figure why it crashes and fix it before doing other changes.

Share this post


Link to post
Share on other sites

Oh and please tell me if there are to be any changes in the actor def files-I modify those files randomly at any given time, so I have to be the one to make the changes on my set of files which are the most up to date(which no one else has)...so let me know what the "bugs" were that you found :P

Share this post


Link to post
Share on other sites

Ok, this has been updated again. Please report anything you find, even if everything seems to work, here in this thread.

 

There is some extra code to make the actor part sizes dynamic, which means that info has also been moved to the actor defs file, so grab a new copy of the zip as well.

 

/edit: (more info)

Edited by Torg

Share this post


Link to post
Share on other sites

Hi, I did a little patch for mapeditor, to able to compile on linux again. It was some missing entries in the particle structure (loop and positional).

It isn't a big patch but I hope it helps till we wait to the new mapeditor.

 

mapeditor_patch.diff

Share this post


Link to post
Share on other sites
There is some extra code to make the actor part sizes dynamic, which means that info has also been moved to the actor defs file, so grab a new copy of the zip as well.

 

 

Are these the changes that you spoke to me about or is this something new? If it's new, can you please tell me what it is instead of just modifying the files? Like I said I may change those files at any time so I have the most up to date ones.

Share this post


Link to post
Share on other sites
Are these the changes that you spoke to me about or is this something new? If it's new, can you please tell me what it is instead of just modifying the files? Like I said I may change those files at any time so I have the most up to date ones.

This is the second part to those changes I spoke to you about.

 

I will of course always inform you of any changes to those files and provide the necessary details when it becomes applicable. This is currently under testing and not in the CVS client (yet) and because of that you don't need to update your files, as it might not ever make it into the client. This is a relatively major change to the format of the XML's which is incompatible with the current client, and hence it would be possibly confusing and a waste of time to update your files before it becomes official.

Share this post


Link to post
Share on other sites
I have now committed this code to CVS. Please let me know of any problems!

I assume I still have to grab the zip in your first post?

 

(and while I'm at it, let me shake my fist at whoever messed up the camera rotation thingy, had to change the speeds and deceleration to ~220, ~156 and 1 to get roughly 90/45 degrees normal/fine at acceptable speeds (probably will turn out it's somehow my fault so not shaking my fist too much here :) keep up the good work :P))

Share this post


Link to post
Share on other sites
I assume I still have to grab the zip in your first post?

If you are using the current CVS client without any of the defines listed under the "Testing" section, then no. However, if you are using EXT_ACTOR_DICT then you will need to update your actor defs, yes.

 

If you are testing out the ATTACHED_ACTORS define on the test server, then you will need to merge the 2 lots of updated defs. You can look at the other thread regarding the proposed changes for what changes I have made for tips on how to merge them.

 

(and while I'm at it, let me shake my fist at whoever messed up the camera rotation thingy, had to change the speeds and deceleration to ~220, ~156 and 1 to get roughly 90/45 degrees normal/fine at acceptable speeds (probably will turn out it's somehow my fault so not shaking my fist too much here :) keep up the good work :P))

Yeah... I have problem where I have a completely grey screen half the time, which I've discovered is due to old ini files (at least afaik), so something has changed and messed up a bunch of things (I haven't changed any options code for a while so I don't think it was me).

Share this post


Link to post
Share on other sites

NOTE:

 

The actor defs for EXT_ACTOR_DICT have just been updated (after consultation with Roja about some terminology). Please check you have the updated defs ("actor_part_maximums" rather than "actor_part_sizes").

Share this post


Link to post
Share on other sites
NOTE:

 

The actor defs for EXT_ACTOR_DICT have just been updated (after consultation with Roja about some terminology). Please check you have the updated defs ("actor_part_maximums" rather than "actor_part_sizes").

Why not m,ake it so you don't have to define what the maximum is, and make it dynamic in the client? That would help prevent problems in the future if the max is exceeded.

Share this post


Link to post
Share on other sites
fails to compile without EXT_ACTOR_DICT

'actor_part_sizes' isn't declared

Probably related to this. Unmodified CVS is pretty broken right now:

actor_scripts.c: In function ‘parse_actor_shirt’:
actor_scripts.c:1972: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c:1972: error: (Each undeclared identifier is reported only once
actor_scripts.c:1972: error: for each function it appears in.)
actor_scripts.c: In function ‘parse_actor_skin’:
actor_scripts.c:2046: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_legs’:
actor_scripts.c:2116: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_weapon’:
actor_scripts.c:2350: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_helmet’:
actor_scripts.c:2477: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_cape’:
actor_scripts.c:2574: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_head’:
actor_scripts.c:2607: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_shield’:
actor_scripts.c:2689: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_hair’:
actor_scripts.c:2725: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_boots’:
actor_scripts.c:3078: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘cal_search_mesh’:
actor_scripts.c:3135: error: ‘actor_part_sizes’ undeclared (first use in this function)
actor_scripts.c: In function ‘parse_actor_script’:
actor_scripts.c:3433: error: ‘actor_part_sizes’ undeclared (first use in this function)
make: *** [actor_scripts.o] Error 1

Share this post


Link to post
Share on other sites
Why not m,ake it so you don't have to define what the maximum is, and make it dynamic in the client? That would help prevent problems in the future if the max is exceeded.

Ummm... errr.... cos that would be smart?

 

The actual problem is all the memory for the array is calloc'd in one go so it needs to know a maximum upfront. I guess it would be possible to change everything to a linked list, but that would also require changing the way the arrays are iterated over, etc.

 

I have been wanting to move some more of the sound code over to a linked list, but it is a fairly big job. I think this part of the actors code is smaller, but still fairly substantial so I'm not sure I'm going to get to it.

 

fails to compile without EXT_ACTOR_DICT

'actor_part_sizes' isn't declared

Probably related to this. Unmodified CVS is pretty broken right now:

Oh. Yeah.

 

Sorry.

 

Shall be fixed shortly.

Share this post


Link to post
Share on other sites
Why not m,ake it so you don't have to define what the maximum is, and make it dynamic in the client? That would help prevent problems in the future if the max is exceeded.

Ummm... errr.... cos that would be smart?

 

The actual problem is all the memory for the array is calloc'd in one go so it needs to know a maximum upfront. I guess it would be possible to change everything to a linked list, but that would also require changing the way the arrays are iterated over, etc.

 

I have been wanting to move some more of the sound code over to a linked list, but it is a fairly big job. I think this part of the actors code is smaller, but still fairly substantial so I'm not sure I'm going to get to it.

 

fails to compile without EXT_ACTOR_DICT

'actor_part_sizes' isn't declared

Probably related to this. Unmodified CVS is pretty broken right now:

Oh. Yeah.

 

Sorry.

 

Shall be fixed shortly.

 

Ot you track the allocated size, used size, and the pointer, if you need to add more you realloc. Yes, I know that fragments memory, just raising other options.

Share this post


Link to post
Share on other sites
Ot you track the allocated size, used size, and the pointer, if you need to add more you realloc. Yes, I know that fragments memory, just raising other options.

 

Or use an array of pointers to actor structures.

Share this post


Link to post
Share on other sites
Or use an array of pointers to actor structures.

But you would still need to redefine the size of the array of pointers, and hence still fragment memory.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×