• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Feature Request Collision Detection during Land/Boarding Fights

Elrapido

Scurvy Seadog
Storm Modder
Ahoy, mateys! :dance

I absolutely love New Horizons, but there is one issue I'd like to solve or at least tinker around with:

The Collision Detection during Land/Boarding Fights actually prevents some action.

All your crewmembers/officers block the way when boarding or generally, when there is not much space (for example when leaving the tavern lodger room and being all blocked on the stairs by your officers, who waited all night in front of the door). :D

I would like to test, if it leads to a better combat and overall 1st person land movement experience, if the collision detection for your own officers and/or crew members is disabled.

So, my question is: How do I disable collision detection for the player character concerning officers and your own crew members in the code, so that you can just walk through them with your player character?


Best regards,
El Rapido
 
You can do that only with your sword sheathed. I've got no clue how to change that or if it is even possible.

I know what you mean though and I've definitely thought about it before.
The solution I always imagined is to move the boarding deck locators around so that the player is in the front instead of in the back.
That way, you can either do the fighting yourself, or let your crew pass you and let them do the dirty work.

The above should be possible by renaming the locators in the _l.gm files in RESOURCE\MODELS\Locations\decks .
Set VISIBLE_LOCATORS to 1 at the bottom of PROGRAM\InternalSettings.h to see which names would need swapping.
Then use http://piratesahoy.net/build/tools/Modeling Texturing/Inez Dias Tool.rar to rename the required locators.

That isn't exactly the answer you were looking for though, is it? :oops:
 
You can have a look through the Sidestep code, which does have some collision detection code added in PROGRAM\Characters\characters.c in the if(docheck) section:
Code:
bool Sidestep(ref pchar, float mag, bool docheck)
{
   if(FindLoadedLocation() == -1) return false; //if not in loc mode, return
   ref curLocation = &locations[FindLoadedLocation()];
   float x,y,z, ay;
   GetCharacterPos(pchar, &x, &y, &z); // get pos
   GetCharacterAy(pchar, &ay); // get angle
     //Logit("Pos Before: (" + x + ", " + y + ", " + z + "), " + ay);
   ay += PId2; // rotate angle to perpendicular
   /*while(ay > PIm2) ay -= PIm2;
   while(ay < 0) ay += PIm2;*/ //unneeded, cos/sin should be fine with any angle
   z += cos(ay) * mag; // add Z component
   x += sin(ay) * mag; // add X component
   if(docheck)
   {//MAXIMUS: low mag will not be recognized, by some reason - 0.8 minimum. So I made an additional check. But CheckLocationPosition only checks target point for characters - not checks patch :(
     float chkX, chkY, chkZ, chkAY, side;
     if(mag>=0.0) side = 1;
     else side = -1;
     GetCharacterPos(&pchar, &chkX, &chkY, &chkZ);
     GetCharacterAy(&pchar, &chkAY);
     chkAY += PId2; // rotate angle to perpendicular
     chkZ += cos(chkAY) * stf(side*0.8); // add Z component
     chkX += sin(chkAY) * stf(side*0.8); // add X component
     if(CheckLocationPosition(curLocation, chkX, chkY, chkZ)==0) return false; // NK 05-07-21 add check
   }
   TeleportCharacterToPos(pchar, x, y, z); // move char
     //GetCharacterPos(pchar, &x, &y, &z);
     //Logit("Pos After: (" + x + ", " + y + ", " + z + ")");
   return true;
}
However, that never really worked. The one thing it DOES do is to prevent you from sidestepping through characters.
That is again the opposite of what you want though. But perhaps it gives you something vaguely relevant to search the PROGRAM file for.

Alternatively, search for LAi_IsFightMode in the entire PROGRAM folder and see if anything shows up that is related to this.
I don't really expect it though; it's probably handled in the game engine where we cannot touch it. :facepalm
 
If you found out how it works please explain. I took a quick peak also and it seems to me it's engine side programmed, but there might be a way by changing the character settings. but I don't know for sure.
 
Due to work-related duties and a conference the earliest point in time and space at which I can look into the code will be next week.
 
No Problem. If I find something while doing some other Research I will let you know.
 
So did you find out something already?
 
So did you find out something already?

The relevant collision functions seem to be hardcoded in the engine, I fear. :(

Perhaps we could use the "push-effect" that is created while sidestepping to kinda clear the way, if more force is applied.
I am a little clueless how to improve the boarding/land combat situation right now.
 
Please take a look at characters\characters.c and look for "fightwalk".
You'll see there the different thing to do are assigned. I was thinking maybe if you add the normal walking and running to the fightwalk option you can go trough them. I'm afraid your sword wont show then but it's worth a try isn't it? Also its good to know if it does change the collision. If that doesn't change it I'm afraid to it's engine coded altough there should be some kind of paramter saying there is a fight so you can't go trough people. If you can find that one it might work.
 
This might still be worth looking into.
 
Easiest thing I would like to see for this is to have the loc0 locator on boarding locations be moved to AHEAD of the player crew.
Then for ship/fort/town assaults, at least the player has the choice to reach the enemy first.
 
Easiest thing I would like to see for this is to have the loc0 locator on boarding locations be moved to AHEAD of the player crew.
Then for ship/fort/town assaults, at least the player has the choice to reach the enemy first.
If we decide to do this, it would be nice to incorporate it into Build 14.
Any larger rewrites can wait for Build 15 as far as I'm concerned.
 
This is why I always enable side-stepping. :) I've never had a problem in taverns because when I leave the room after a night's sleep, everybody spawns onto the same place. They aren't in the way, they're standing inside me, or vice versa. Leaving some shops with restricted access, e.g. the blacksmith in Sao Jorge, does cause trouble, though - I'm blocked in front by an officer, behind by an officer, to one side by the building and to the other side by its railing. Or, if I'm boarding a ship and am looting chests on the main gun deck, there are four in total of which two are near one end, and if I've looted one of them, the officers have probably followed me and are now blocking me from getting away again. As there is no combat going on in any of these situtations it is possible to push past them, eventually, though their movements are also restricted by the scenery.

I do like the idea of moving your initial location so that you're in front. You are supposed to be the leader, after all! :dance
 
Back
Top