Jump to content
Eternal Lands Official Forums
Fedora

Horses v2.0

Recommended Posts

Here is another patch (already discussed with Ent and Roja) about horses.

We can now range and fight on them.

 

Patch & actor defs (put them under actors_defs dir and make backups first)

 

- there is a #horse command to get a client side horse (it disappears when your actor is sent again)

- animations are not correct yet (apart from barehanded horse fighting). New .caf are needed.

- you can range and fight and the horse *should* behave correctly

 

<animation details>

Each actor has a xxxxx_held_frame where xxxxx is one of the fighting involved frames (enter in combat, leave_combat, att_up, att_down).

The _held_frames are used for actors on a horse instead of the normal ones. For horses (and mounts in general) they are played if they have a horseman. This way we can have orcs on horses, goblins on ferans and whatever nasty mount-mounter coupling you can think of.

 

For each weapon animation there is the corresponding _held_frame used for the horseman. When the horseman is barehanded the horse does the attacking, when he is armed the weapon animation is played. However this needs server adjustments since when wielding weapons the horses should turn a bit to let the horsemen fight face to face (side to side from the point of view of the horses).

 

The _held_frame are there for ranging animations too.

</animation details>

 

My assassin horse:

horsefight.jpg

horserange.jpg

 

 

Please test this patch doing the nastier things you can think of (multi fight changing opponent fast, interrupt ranging in the worst moments, trigger resynchs and so on). Indeed I had to code some dirty tricks in order to make horses work, there might be some cases I did not cover. They usually are pretty evident, since you end up riding the air with the horse few tile behind you :P

If you find bugs, please report the console output you get (a list of command codes) at the moment of the bug.

Edited by Fedora

Share this post


Link to post
Share on other sites

Thanks a ton for this patch! I know horses will definitely be much more usable soon because of this.

Share this post


Link to post
Share on other sites
Thanks a ton for this patch! I know horses will definitely be much more usable soon because of this.

Who needs horses when you can have hawk-mounted sprites! :P

Share this post


Link to post
Share on other sites

Great stuff ;)

 

off-topic: can horses run 2x speed if you use speed hax potion on them? would be cool ;) (provided we don't get speed increase with horses in some other way)

Share this post


Link to post
Share on other sites
Great stuff ;)

 

off-topic: can horses run 2x speed if you use speed hax potion on them? would be cool ;) (provided we don't get speed increase with horses in some other way)

All gameplay-related decisions are still to be taken (by Ent); for now, we have support in the client. It is also possible that there will be various experiments and changes about what and how you can ride, what advantages and disadvantages you get because you are mounted, what you can't do or where you can't go, etc.

Share this post


Link to post
Share on other sites

lol, yes, I missed cal_types :) now should work

 

EDIT:

here are the source files for Roja to compile the client while waiting for the patch to be committed. EMOTES flag must be on, some code is shared.

 

EDIT2:

bugs found :icon13: don't commit yet

Edited by Fedora

Share this post


Link to post
Share on other sites
lol, yes, I missed cal_types :wub: now should work

 

EDIT:

here are the source files for Roja to compile the client while waiting for the patch to be committed. EMOTES flag must be on, some code is shared.

 

EDIT2:

bugs found :whistle: don't commit yet

While you're still working on this patch, is it work adding an additional #def, may be MORE_ATTACHED_ACTORS or something like that. Also, as ATTACHED_ACTORS had been in the client for a release it may be time to remove that one anyway.

Share this post


Link to post
Share on other sites
lol, yes, I missed cal_types :P now should work

 

EDIT:

here are the source files for Roja to compile the client while waiting for the patch to be committed. EMOTES flag must be on, some code is shared.

 

EDIT2:

bugs found :pickaxe: don't commit yet

While you're still working on this patch, is it work adding an additional #def, may be MORE_ATTACHED_ACTORS or something like that. Also, as ATTACHED_ACTORS had been in the client for a release it may be time to remove that one anyway.

 

Ok, I rewrote the whole thing, this time without bugs hopefully :o

The new code is #def'd with MORE_ATTACHED_ACTORS and should not break anything as long as EMOTES is defined too.

 

For testing purposes I modified the #send_cmd <actor_name> <cmd> to accept a list of space separated command codes.

 

test, test, test and report.

 

For Roja, here is the code. You also need to add "FEATURES += MORE_ATTACHED_ACTORS" in make.defaults.

Share this post


Link to post
Share on other sites

Patch committed (including a make.defaults entry and the data files) but not enabled in build. Nice work Fedora. :D

Edited by bluap

Share this post


Link to post
Share on other sites

I commited some new code related to horse fighting. It's almost done, unless huge bugs pop out :confused:

 

To use it:

 

- enable MORE_ATTACHED_ACTORS & compile

- unzip the animations in your EL *test* directory under /animations

- unzip the actor definitions in your EL *test* directory under /actor_defs (crossbows not included, only bows)

- run the client and get/remove a horse by typing: #horse <your_name> 200

- only the horse with id=200 works, the other are missing frames in thei def files (I'm lazy)

 

 

Currently, when a fight starts while on horse a 45 degrees counterclockwise rotation is performed to put fighters face to face. I'm not sure if 45 is nice looking..I tried 90 and it is too much, maybe 60 is ok...however it can be changed in actors.h at line 450.

 

I tried fighting on horse against hordes of invaded rats and horse/actor animations never went out of timing...it's a good start, but please test this more, it's subtle code :pirate:

 

*warning

the whole commit should be #ifdef'd, but while coding it I found something weird. At line 1086 of actor_scripts.c there were a "index+=18" used to get the frame corresponding to the current attack command for non enhanced actors. Looking at cal_types.h (line 44), since index starts from 0, the selected frame for attack_up_1 ends up to be cal_actor_combat_idle_frame, which is wrong. I changed the line to "index+=19" and it seems to work...either this is a bug or I deeply misunderstood some code :w00t:

 

*warning 2

There is a massive amount of debug messages (may slow things down)

Edited by Fedora

Share this post


Link to post
Share on other sites
Currently, when a fight starts while on horse a 45 degrees counterclockwise rotation is performed to put fighters face to face. I'm not sure if 45 is nice looking..I tried 90 and it is too much, maybe 60 is ok...however it can be changed in actors.h at line 450.

Maybe random_min_max(35,75) would be a solution?

Share this post


Link to post
Share on other sites

The animations can only have 1 angle unless in the code the bones are moved. So we can't have multiple angles.

Share this post


Link to post
Share on other sites

Ok after several testings and animation changes due to the angle, it doesn't look that bad! Originally I thought that it would be either the horse attacking(player has no weapons), or the player attacking only, but combining them is a good idea...it's not perfect as the horse isn't really attacking straight at the monster but it's not really bad looking.

 

One thing though that does need to be done is to have the player use that other set of fight animations for when they have no weapons on them(the player would not attack without a weapon), and for the horse to face the monster as well in this case.

 

I did notice some player/horse sync issues too, but maybe it's just because it's the "fake" horse..i'll test more with a real one and see what happens.

Share this post


Link to post
Share on other sites
The animations can only have 1 angle unless in the code the bones are moved. So we can't have multiple angles.

Of course only one angle, set before the rotation starts. But a random angle.

Share this post


Link to post
Share on other sites

That wouldn't work because the animations are made to a specific angle in the animation file, not the code.

Share this post


Link to post
Share on other sites
That wouldn't work because the animations are made to a specific angle in the animation file, not the code.
Currently, when a fight starts while on horse a 45 degrees counterclockwise rotation is performed to put fighters face to face. I'm not sure if 45 is nice looking..I tried 90 and it is too much, maybe 60 is ok...however it can be changed in actors.h at line 450.

Share this post


Link to post
Share on other sites

No Florian, you don't understand. Did you try the patch? Did you see what the player character looks like? That's what i'm talking about, the REAL animations, not the rotation that is given to both models as a whole.

Share this post


Link to post
Share on other sites

Patch updated:

 

* Download again the actors definitions from the link above *

 

- in player_weapons.xml there is a new parameter "turn_horse" used to specify if the weapon requires the horse to rotate duting a fight (1=yes, 0=no)

- when a weapon is equipped the horse now turns (60 degrees) and lets the knight fight, if unequipped the horse turns back and fights directly

- a horse/knight synchronization has been corrected (may be some others around)

 

 

To test single actor commands or sequences of them you can use #send_cmd your_name x1 x2 x3... where x is a command code.

For reference, 18 is enter combat, 19 is leave combat, 38 to 45 are rotations, 5 is pain, 46 to 51 and 60 to 73 are attack frames.

 

Pls test :D

Share this post


Link to post
Share on other sites
No Florian, you don't understand. Did you try the patch? Did you see what the player character looks like? That's what i'm talking about, the REAL animations, not the rotation that is given to both models as a whole.

Well, then we're talking about different things. I don't like the static 45/60/whatever angle. All players look exactly the same then, and that's boring.

See my bag variety patch, a small change to the bag position adds a lot of variation, and that's more vivid, more real.

Share this post


Link to post
Share on other sites

Sure having the same rotation for everyone does get a little old looking. But there really is no other way unless a ton of programming is done and our animation system probably changed a lot.

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.

×