Skip to content

Core/Transport: some improvements #5330

Closed
wants to merge 1 commit into from
@wilds
wilds commented Feb 20, 2012
  • fix script hook
  • fix BuildStartMovePacket and BuildStopMovePacket cause desync client-server
  • generate waypoint using spline
@QAston
QAston commented Feb 20, 2012

Looks good, but I'd like to some people to test this to make sure it works as intended before merging this PR. Thanks.

@Amit86
Amit86 commented Feb 20, 2012

what are the ingame effects of this fix?

@wilds
wilds commented Feb 20, 2012

@Amit86

  • Transport client-server position is a little more accurate and synchronized;
  • Arrival and departure events can be used with more precision;
  • hooked scripts are called correctly;
  • if you need to start/stop the transport, BuildStartMovePacket and BuildStopMovePacket works correctly now
  • source code more clean and clearly
@Subv Subv and 1 other commented on an outdated diff Feb 20, 2012
src/server/game/Entities/Transport/Transport.cpp
return true;
}
-struct keyFrame
+struct CommonInitializer
@Subv
Subv added a note Feb 20, 2012

Isnt this already defined somewhere else in the spline code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Subv
Subv commented Feb 21, 2012

:)

@eilo
eilo commented Feb 21, 2012

This is what i really need, i was unable to improve some of this behavior packets, besides, implement another functions to complement another functions aswell, very good, ill test it.

@Aokromes
TrinityCore member

This can fix the issue where some transports are seen at some random places outside route?

@Ka0z
Ka0z commented Feb 21, 2012

I believe that this fix the problem related to npc position in the transport desync? (client-server), or am i wrong?. Thx.

@kandera
kandera commented Feb 21, 2012

so will this fix the thing with the ship in the tunnel? :D

@Subv
Subv commented Feb 21, 2012

@kandera lol, that ship....LOL

@wilds
wilds commented Feb 21, 2012

@Aokromes Yes, it can
@Ka0z You are right
@kandera "thing with the ship in the tunnel"?

@Aokromes
TrinityCore member

wilds kandera means the same i mean :)

@kandera
kandera commented Feb 21, 2012

but i love getting ss from people who qq about not being able to ride teh tram

@Subv
Subv commented Feb 22, 2012

Has anyone tested it?

@FilipLukac

Ill gime a day maybe two

@Subv
Subv commented Feb 26, 2012

so...

@wilds wilds commented on an outdated diff Feb 26, 2012
src/server/game/Entities/Transport/Transport.cpp
{
- if (tFrom <= 30000)
- {
- d = 0.5f * (tFrom / 1000) * (tFrom / 1000);
- }
- else
- {
- d = 0.5f * 30 * 30 + 30 * ((tFrom - 30000) / 1000);
- }
- d = d - keyFrames[i].distSinceStop;
+ bool teleport_on_this_node = (point_Idx == spline.last() - 1 ? teleport : false); //if is the last node of segment -> teleport
+ teleport_on_this_node |= (point_Idx == path.size() -1 ? !never_teleport : false); //if is the last node of path, teleport if teleported at least one time
@wilds
wilds added a note Feb 26, 2012

teleport_on_this_node |= (node_Idx == path.size() -1 ? !never_teleport : false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@wilds wilds Core/Transport: some improvements
 * fix script hook
 * fix BuildStartMovePacket and BuildStopMovePacket cause desync client-server
 * generate waypoint using spline
08f3c4d
@wilds
wilds commented Feb 26, 2012

I tested it myself, there are synchronization issues that range from 0 to 15s in some paths, but other paths are correct.

@Aokromes
TrinityCore member

On what paths?

@Warpten
TrinityCore member
Warpten commented Feb 27, 2012

about the ships in tunnel bug, sometimes you will some transports gobs spawned as transports in tunnels-like places, they wont be moving. leaving the area then re-entering it would fix the issue.

I'D suggest to take a look at Shauren's fork of trinitycore. http://github.com/Shauren/TrinityCore There's lots of good stuff, but his changes cause high uptime lag (tested with only one player) and some transports seem not to have any gravity force field.

@wilds
wilds commented Mar 10, 2012

@Aokromes path fom storm to borean tundra has 15sec of desync. But gunship sync is ok ;)

@Expecto
Expecto commented Mar 11, 2012

enum{ REPLACE TO

enum
{

@click
TrinityCore member
click commented Apr 1, 2012

@wilds - did you figure out the reason for the desync?

@wilds
wilds commented Apr 6, 2012

sorry, my job takes me too much time and I have no free time to develop. I think that the solution for desync issue is related to acceleration, the first node is almost synch, in the second the desynch increases, and so on

@teyrnon teyrnon commented on the diff May 11, 2012
src/server/game/Entities/Transport/Transport.cpp
+ float u = 1.0f;
+ int32 seg_time = spline.length(point_Idx, point_Idx + 1);
+ uint32 time_passed = time_step;
+ do {
+ if (seg_time > 0)
+ u = time_passed / (float)seg_time;
+ if (u >= 1)
+ break;
+
+ Location c;
+ spline.evaluate_percent(point_Idx, u, c);
+
+ if (path[node_Idx].actionFlag == 2)
+ t += time_step / accelRate; //deceleration
+ else if (node_Idx > 1 && path[node_Idx-1].actionFlag == 2)
+ t += time_step / accelRate; //acceleration
@teyrnon
teyrnon added a note May 11, 2012

in both cases time increases oO
t -= time_step / accelRate maybe?

Maybe i'm wrong, but where is the code that detects the case when transport accelerates to maximum and velocity no more grows?

@Null45
Null45 added a note May 19, 2012

if (path[node_Idx].actionFlag == 2)
t -= time_step / accelRate; //deceleration

ofc.

@teyrnon
teyrnon added a note May 19, 2012

@Null45 deceleration increases total movement time

@Null45
Null45 added a note May 19, 2012

Ohhh. Sry, needs to sleep:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Shauren
TrinityCore member
Shauren commented Jun 1, 2012

192241 Not boardable - Horde gunship patrolling above Icecrown ("Orgrim's Hammer") 1424158 2730879 1306721 91.7539
192242 Not boardable - Alliance gunship patrolling above Icecrown ("The Skybreaker") 1051387 1770464 719077 68.3932
181688 Menethil Harbor, Wetlands and Valgarde, Howling Fjord ("Northspear") 445534 553189 107655 24.1631

entry | name | retail period | calculated period | difference | percent error
As you see, your generated times have up to 90% of error rate, which is completely unacceptable. Closing this.

@Shauren Shauren closed this Jun 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.