You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rob <geo...@us...> - 2005-08-06 23:27:34
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18523/source/newships Modified Files: shpconho.cpp Log Message: planet didn't kill this ship; now it does. Index: shpconho.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpconho.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpconho.cpp 11 Jul 2005 00:25:29 -0000 1.12 --- shpconho.cpp 6 Aug 2005 23:27:24 -0000 1.13 *************** *** 181,185 **** } ! return Ship::handle_damage(source, normal, direct); } --- 181,192 ---- } ! crew = 1; ! Ship::handle_damage(source, normal, direct); ! if (crew <= 0) ! shield = 0; ! else ! crew = 1 + shield; ! ! return 0; } |
From: Rob <geo...@us...> - 2005-08-06 23:26:54
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18456/source/newships Modified Files: shptaule.cpp Log Message: control-override didn't stop - is now fixed I think Index: shptaule.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaule.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shptaule.cpp 21 Jul 2005 15:24:47 -0000 1.19 --- shptaule.cpp 6 Aug 2005 23:26:46 -0000 1.20 *************** *** 574,602 **** FixedAnimation::calculate(); ! if (victim) { ! if (!victim->exists()) ! { ! //victim->del_override_control(ocl); ! victim = 0; ! state = 0; ! //return; ! } ! else ! { ! //((Ship*)victim)->nextkeys &= ~(keyflag::left + keyflag::right + keyflag::thrust); ! Vector2 vv = victim->get_vel(); ! double vvv = magnitude(vv); ! ! if (vvv < 1e-5) ! return; ! ! vvv = (vvv - ((Ship*)victim)->accel_rate * frame_time) / vvv; ! if (vvv < 0) vvv = 0; ! vv *= (vvv - 1); ! vvv = magnitude(vv); ! victim->accelerate(victim, atan(vv), vvv, MAX_SPEED); ! } } --- 574,588 ---- FixedAnimation::calculate(); + if (victim && !victim->exists()) + { + //victim->del_override_control(ocl); + victim = 0; + state = 0; + //return; + } ! if (!ship->exists()) { ! state = 0; } *************** *** 607,610 **** --- 593,613 ---- victim->del_override_control(ocl); } + + if (exists() && victim) + { + //((Ship*)victim)->nextkeys &= ~(keyflag::left + keyflag::right + keyflag::thrust); + Vector2 vv = victim->get_vel(); + double vvv = magnitude(vv); + + if (vvv < 1e-5) + return; + + vvv = (vvv - ((Ship*)victim)->accel_rate * frame_time) / vvv; + if (vvv < 0) vvv = 0; + vv *= (vvv - 1); + vvv = magnitude(vv); + victim->accelerate(victim, atan(vv), vvv, MAX_SPEED); + } + } |
From: Rob <geo...@us...> - 2005-08-04 15:04:08
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32665/source/melee Modified Files: mframe.cpp mgame.cpp moptions.cpp Log Message: insignificant changes Index: moptions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/moptions.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** moptions.cpp 1 Aug 2005 10:46:33 -0000 1.18 --- moptions.cpp 4 Aug 2005 15:03:58 -0000 1.19 *************** *** 468,472 **** { d_check_proc, 200, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Synched-lag", NULL, NULL }, //OPTIONS_DIALOG_SYNCLAG, { d_check_proc, 200, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Desynch-test", NULL, NULL }, //OPTIONS_DIALOG_DESYNCTEST, ! { d_check_proc, 200, 170, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Optimize latency", NULL, NULL }, //OPTIONS_DIALOG_OPTIMIZE4LATENCY, { d_text_proc, 292, 244, 120, 20, 255, 0, 0, 0, 0, 0, (void *)"View", NULL, NULL }, { d_list_proc, 284, 264, 180, 90, 255, 0, 0, 0, 0, 0, (void *) viewListboxGetter, NULL, NULL }, --- 468,472 ---- { d_check_proc, 200, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Synched-lag", NULL, NULL }, //OPTIONS_DIALOG_SYNCLAG, { d_check_proc, 200, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Desynch-test", NULL, NULL }, //OPTIONS_DIALOG_DESYNCTEST, ! { d_check_proc, 200, 170, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Slow connection", NULL, NULL }, //OPTIONS_DIALOG_OPTIMIZE4LATENCY, { d_text_proc, 292, 244, 120, 20, 255, 0, 0, 0, 0, 0, (void *)"View", NULL, NULL }, { d_list_proc, 284, 264, 180, 90, 255, 0, 0, 0, 0, 0, (void *) viewListboxGetter, NULL, NULL }, Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** mgame.cpp 2 Aug 2005 00:20:36 -0000 1.49 --- mgame.cpp 4 Aug 2005 15:03:49 -0000 1.50 *************** *** 1073,1076 **** --- 1073,1079 ---- for ( p = 0 ; p < num_network; ++p ) { + if (!player[p]) + continue; + // sharing if (player[p] && player[p]->islocal()) *************** *** 1306,1313 **** // tracker about home many extra physics iterations are inserted; this shouldn't get too high int num_catchups = 0; ! const int max_catchups = 2; int time_start = get_time(); --- 1309,1318 ---- // tracker about home many extra physics iterations are inserted; this shouldn't get too high int num_catchups = 0; ! const int max_catchups = 3; int time_start = get_time(); + // only for debugging/testing purpose. + int debug_idle_time_animate = 50 + random(50); *************** *** 1339,1359 **** // passed, or because you need to catch up with some kind of lag... ! if ((next_tic_time <= time))//geo:physics should be independent of animation && (next_render_time > game_time)) && /*(game_ready() || game_time == 0)*/ { // note that game_time==0 is also needed, cause otherwise it'll wait for data, while no data've been generated yet. _STACKTRACE("Game::play - Game physics"); - //idle_iteration = false; - ! // int ilag; ! // for ( ilag = 0; ilag < lag_decrease + 1; ++ilag ) //+1, cause there needs to be at least 1 iteration ! // { ! // if (ilag > 0) ! // --lag_buffer; ! ! // wait till you receive signal that you can proceed to the next iteration. ! // ALL COMMUNICATION EXCEPT FOR DESYNCH TEST SHOULD GO THROUGH HERE. ! // also see the CALL and EVENT macros if (events.all_ready()) --- 1344,1356 ---- // passed, or because you need to catch up with some kind of lag... ! if (time >= next_tic_time)//geo:physics should be independent of animation && (next_render_time > game_time)) && /*(game_ready() || game_time == 0)*/ { // note that game_time==0 is also needed, cause otherwise it'll wait for data, while no data've been generated yet. _STACKTRACE("Game::play - Game physics"); ! // wait till you receive signal that you can proceed to the next iteration. ! // ALL COMMUNICATION EXCEPT FOR DESYNCH TEST SHOULD GO THROUGH HERE. ! // also see the CALL and EVENT macros if (events.all_ready()) *************** *** 1365,1375 **** int t = get_time(); ! // for (;;) ! // { NetLog *l = (NetLog*) glog; if (l->type == Log::log_net) { l->flush_noblock(); ! //glog->listen(); l->recv_noblock(); // receive stuff, if you can --- 1362,1371 ---- int t = get_time(); ! NetLog *l = (NetLog*) glog; if (l->type == Log::log_net) { l->flush_noblock(); ! l->recv_noblock(); // receive stuff, if you can *************** *** 1383,1400 **** // a pretty slow framerate. - if (!events.all_ready()) - { - //message.print(1000, 15, "events not ready"); - //xxx this happens, if you press a key !! - } - if (events.all_ready()) { idle_iteration = false; - // a short resting period. - // idle(1); - // } - // check if a player was asked to be removed here.. --- 1379,1386 ---- *************** *** 1545,1549 **** if (next_tic_time < time_current) { ! //message.print(1500, 15, "Catching up"); catching_up = true; } else { --- 1531,1535 ---- if (next_tic_time < time_current) { ! //message.print(1500, 15, "Catching up [%i]", num_catchups); catching_up = true; } else { *************** *** 1572,1590 **** next_fps_time += msecs_per_fps; fps(); ! } ! /* ! // in any case, already send the data that were calculated (don't waste time on this..). ! // if you don't have to be careful about your connection speed. ! //if (!optimize4latency) ! //{ ! if (glog->type == Log::log_net) ! { ! // this sends, if there's something to send at least ! NetLog *l = (NetLog*) glog; ! l->flush_noblock(); ! } ! //} ! */ ! --- 1558,1562 ---- next_fps_time += msecs_per_fps; fps(); ! } *************** *** 1604,1608 **** { NetLog *l = (NetLog*) glog; ! l->recv_noblock(); // receive stuff, if you can // this helps to reduce idle-time, cause it doesn't have to wait till --- 1576,1580 ---- { NetLog *l = (NetLog*) glog; ! // l->recv_noblock(); // receive stuff, if you can [not sure if this is required] // this helps to reduce idle-time, cause it doesn't have to wait till *************** *** 1622,1626 **** if (!catching_up || time >= next_render_time - msecs_per_render + msecs_per_render_max) { ! if (interpolate_frames || (/*game_*/time >= next_render_time)) { _STACKTRACE("Game::play - Game rendering") --- 1594,1598 ---- if (!catching_up || time >= next_render_time - msecs_per_render + msecs_per_render_max) { ! if (interpolate_frames || (time >= next_render_time)) { _STACKTRACE("Game::play - Game rendering") *************** *** 1628,1642 **** idle_iteration = false; - // message.print(1000, 15, "anim dt = %i render = %i t = %i", - // int(time - next_render_time), int(msecs_per_render), int(time - time_start)); - - //message.print(1500, 15, "lag-buffer = %i", lag_buffer); animate(); ! if (time - next_render_time < msecs_per_render ) ! next_render_time += msecs_per_render; ! else ! next_render_time = /*game_*/time + msecs_per_render; } } --- 1600,1615 ---- idle_iteration = false; animate(); + #ifdef _DEBUG + idle(debug_idle_time_animate); + #endif ! ! next_render_time += msecs_per_render; ! ! time = get_time(); ! if (time >= next_render_time ) ! next_render_time = time + msecs_per_render; } } *************** *** 1645,1649 **** if (idle_iteration) { ! // if nothing interesting happend in this iteration, then insert some idle time int n = 1; idle(n); --- 1618,1622 ---- if (idle_iteration) { ! // if nothing interesting happened in this iteration, then insert some idle time int n = 1; idle(n); Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** mframe.cpp 2 Aug 2005 00:21:30 -0000 1.35 --- mframe.cpp 4 Aug 2005 15:03:47 -0000 1.36 *************** *** 1339,1343 **** { NetLog *l = (NetLog*) glog; ! l->recv_noblock(); // receive stuff, if you can // this helps to reduce idle-time, cause it doesn't have to wait till --- 1339,1343 ---- { NetLog *l = (NetLog*) glog; ! // l->recv_noblock(); // receive stuff, if you can [not sure if this is required] // this helps to reduce idle-time, cause it doesn't have to wait till |
From: Rob <geo...@us...> - 2005-08-04 15:04:08
|
Update of /cvsroot/timewarp/source/sc1ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32665/source/sc1ships Modified Files: shpandgu.cpp shpkzedr.cpp Log Message: insignificant changes Index: shpkzedr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpkzedr.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpkzedr.cpp 2 Aug 2005 00:23:48 -0000 1.11 --- shpkzedr.cpp 4 Aug 2005 15:03:58 -0000 1.12 *************** *** 187,200 **** } ! void KzerZaFighter::inflict_damage(SpaceObject *other) { if (other == ship) { play_sound2(data->sampleExtra[1]); damage(ship, 0, -1); } ! if (!other->isPlanet()) state = 0; else { double a = trajectory_angle(other); translate(unit_vector(a) * -10); } return; } --- 187,208 ---- } ! void KzerZaFighter::inflict_damage(SpaceObject *other) ! { if (other == ship) { play_sound2(data->sampleExtra[1]); damage(ship, 0, -1); } ! if (!other->isPlanet()) ! { ! state = 0; ! ! if (other->isShip()) ! damage(other, 1, 0); ! } else { double a = trajectory_angle(other); translate(unit_vector(a) * -10); } + return; } Index: shpandgu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpandgu.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpandgu.cpp 11 Jul 2005 00:25:58 -0000 1.13 --- shpandgu.cpp 4 Aug 2005 15:03:58 -0000 1.14 *************** *** 47,51 **** { Ship::calculate(); ! if(specialActive && (batt == -1)) { set_sprite(shipSprite); damage_factor = 0; --- 47,53 ---- { Ship::calculate(); ! ! if(specialActive && (batt == -1)) ! { set_sprite(shipSprite); damage_factor = 0; |
From: Rob <geo...@us...> - 2005-08-04 15:03:23
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32531/source/ais Modified Files: c_wussie.cpp Log Message: improved evasion (AI) Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** c_wussie.cpp 4 Aug 2005 02:08:30 -0000 1.19 --- c_wussie.cpp 4 Aug 2005 15:03:11 -0000 1.20 *************** *** 194,199 **** shot = collider_object; ! double a = ship->trajectory_angle (shot); double da = ship->get_angle() - a; --- 194,212 ---- shot = collider_object; + + double a; + + // however, if the intercept point is close anyway, then simply stay perpendicular on its path + // whichever is closest to your current orientation + if (collider_distance < 10*frame_time*ship->vel.length()) + { + a = shot->vel.angle(); + } else { + // you should avoid the point of closest approach. + Vector2 pos_closest = shot->pos + collider_t * shot->vel; ! a = min_delta(pos_closest, ship->pos, map_size).atan(); ! } ! double da = ship->get_angle() - a; *************** *** 201,218 **** while (da > PI) da -= PI2; // angle is now between -PI and +PI // steer away from the dangerous object. ! if (fabs(da) <= 0.5*PI) ! { ! if (da < 0) ! desiredangle = a - evasion_angle_change; ! else ! desiredangle = a + evasion_angle_change; ! } else { ! if (da < 0) ! desiredangle = a - evasion_angle_change; ! else ! desiredangle = a + evasion_angle_change; ! } } --- 214,226 ---- while (da > PI) da -= PI2; // angle is now between -PI and +PI + + double a_ev = evasion_angle_change; + // steer away from the dangerous object. ! if (da < 0) ! desiredangle = a - a_ev; ! else ! desiredangle = a + a_ev; } |
From: Rob <geo...@us...> - 2005-08-04 02:08:39
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24101/source/ais Modified Files: c_wussie.cpp Log Message: AI evasion adaptation. Also added some randomness. Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** c_wussie.cpp 2 Aug 2005 13:04:07 -0000 1.18 --- c_wussie.cpp 4 Aug 2005 02:08:30 -0000 1.19 *************** *** 46,49 **** --- 46,52 ---- #define TACTIC_RANGE 4 + // for testing (graphics): + //#include "scp.h" + /*! \brief Check danger \return Max damage ship can get from his enemies *************** *** 88,91 **** --- 91,97 ---- } + // 1. waarom keren ze te snel terug op het pad? + // 2. waarom keren sommige sowieso niet ? + double ControlWussie::evasion (Ship * ship) { *************** *** 101,197 **** frac = 1.5; ! // minimum check-range is 500 pixels; but, for ships that turn slowly, you should anticipate ! // further ahead... ! check_range = 400.0 / frac; ! double closetime = 1000 / frac; // 1000 ms, scaled by more if you can respond only slowly double desiredangle = 0; Query b; SpaceObject *shot; ! int collideshot; ! double shipslope, shotslope, shottime, shiptime; ! double shipint, shotint; // double shipspeed,shotspeed; ! double xs = 0, ys = 0; ! double velship, velshot; ! for ( b.begin (ship, OBJECT_LAYERS & ~bit (LAYER_CBODIES) & ~bit (LAYER_SHIPS), check_range); b.current; b.next() ) { shot = b.currento; ! if (shot->canCollide (ship)) { ! Vector2 ship_pos, shot_pos; ! ship_pos = ship->normal_pos(); ! shot_pos = shot->normal_pos(); ! if (fabs(ship->get_vel().y) < 0.0001) ! shipslope = sign(ship->get_vel().x) * 10000; ! else ! shipslope = ship->get_vel().x / ship->get_vel().y; ! if (fabs(shot->get_vel().y) < 0.0001) ! shotslope = sign(shot->get_vel().x) * 10000; ! else ! shotslope = shot->get_vel().x / shot->get_vel().y; ! collideshot = TRUE; ! shipint = ship_pos.y - (shipslope * ship_pos.x); ! shotint = shot_pos.y - (shotslope * shot_pos.x); ! if (fabs(shotint - shipint) < 1 || fabs(shotslope - shipslope) < 0.05) ! { ! collideshot = FALSE; ! } ! else { ! xs = (shipint - shotint) / (shotslope - shipslope); ! ys = (shipslope * xs) + shipint; ! //xs = normalize(xs, X_MAX); ! //ys = normalize(ys, Y_MAX); } ! velship = ! distance_from (0, ship->get_vel()); ! if ((velship == 0) || (!collideshot)) ! collideshot = FALSE; ! else ! { ! shiptime = distance_from (normalize2(Vector2(xs, ys), map_size), ship_pos) / velship; ! velshot = distance_from (0, shot->get_vel ()); ! if (!((velshot == 0) || (!collideshot))) ! { ! shottime = ! distance_from (normalize2(Vector2(xs, ys), map_size), shot_pos) ! / velshot; ! if (fabs (shottime - shiptime) < closetime) ! { ! double a = ship->trajectory_angle (shot); ! double da = ship->get_angle() - a; ! closetime = fabs (shottime - shiptime); ! /* ! if ((angle < PI/12) || (angle > PI2-PI/12)) ! angle += PI; ! else if (normalize (angle, PI2) > ! normalize (-angle, PI2)) ! angle -= PI/2; ! else ! angle += PI/2; ! */ ! while (da < -PI) da += PI2; ! while (da > PI) da -= PI2; ! // angle is now between -PI and +PI ! // steer away from the dangerous object. ! if (da < 0) ! desiredangle = a - 0.75*PI; ! else ! desiredangle = a + 0.75*PI; ! } } } } } return desiredangle; } int ControlWussie::think () { --- 107,224 ---- frac = 1.5; ! // for ships that turn slowly, you should anticipate (much) further ahead ! check_range = 750.0 / frac; ! //double closetime = 1000 / frac; // 1000 ms, scaled by more if you can respond only slowly double desiredangle = 0; Query b; SpaceObject *shot; ! //int collideshot; ! //double shipslope, shotslope, shottime, shiptime; ! //double shipint, shotint; // double shipspeed,shotspeed; ! //double xs = 0, ys = 0; ! //double velship, velshot; ! ! // place the search-circle ahead of the ship, if you move forward that is ! double r = ship->vel.length() / ship->speed_max; ! ! static SpaceLocation center_check(0,0,0); ! center_check.pos = ship->pos + 0.5*r*check_range * unit_vector(ship->vel); ! ! SpaceObject *collider_object = 0; ! double collider_distance = 1E6; ! double collider_t = 1E6; ! ! for ( b.begin (¢er_check, OBJECT_LAYERS & ~bit (LAYER_CBODIES) & ~bit (LAYER_SHIPS), check_range); b.current; b.next() ) { shot = b.currento; ! if ( shot->canCollide(ship) && shot != ship->target && !shot->isAsteroid() ) { ! Vector2 dv, dp; ! // find time at which the 2 objects are closest ! dp = min_delta(shot->pos, ship->pos, map_size); ! //dp = shot->pos - ship->pos; ! dv = shot->vel - ship->vel; ! double a, b; ! a = dot_product(dv, dv); ! b = dot_product(dv, dp); ! ! double t = 0; ! if (a != 0) { ! t = -b / a; } ! // that's the time. ! // t is the intercept time, at which the distance between the two objects is minimal. ! if (t > 0) // if they are coming closer ! { ! double distance; ! // this minimal distance is: ! distance = (dp + t * dv).length(); ! ! if (distance < collider_distance && t < collider_t) // consider it a danger if it is this close ! { ! // you have to evade it. ! collider_t = t; ! collider_object = shot; ! collider_distance = distance; } + } } + + } + + /* + if ( collider_object ) + { + Vector2 P; + double R; + P = corner(ship->pos, collider_object->size* space_zoom); + R = collider_distance * space_zoom; + circle(video_screen, P.x, P.y, R, makecol(200,200,0)); } + */ + + + if ( collider_object && (collider_distance < evasion_base_size + evasion_ship_multiplier * (ship->size.x + shot->size.x)) ) + { + // there is a dangerous object, and it will also come quite near to your ship... so fear it !! + + shot = collider_object; + + double a = ship->trajectory_angle (shot); + double da = ship->get_angle() - a; + + while (da < -PI) da += PI2; + while (da > PI) da -= PI2; + // angle is now between -PI and +PI + + // steer away from the dangerous object. + if (fabs(da) <= 0.5*PI) + { + if (da < 0) + desiredangle = a - evasion_angle_change; + else + desiredangle = a + evasion_angle_change; + } else { + if (da < 0) + desiredangle = a - evasion_angle_change; + else + desiredangle = a + evasion_angle_change; + } + } + return desiredangle; } + int ControlWussie::think () { *************** *** 328,332 **** if (distance > 0.9*option_range[state][0]) { ! if (ship->target->vel.length() > 0.3 * ship->speed_max) { // if the enemy is too fast for you... --- 355,359 ---- if (distance > 0.9*option_range[state][0]) { ! if (ship->target->vel.length() > intercept_abort_speed_factor * ship->speed_max) { // if the enemy is too fast for you... *************** *** 361,370 **** // and what, if the enemy is facing you ? You should be really scared then ... unless ... if (t && ! (t->vel - ship->vel).length() > 0.9 * ship->speed_max && // be scared if enemy is moving away very fast ship->speed_max > 1.1 * t->vel.length() && // be scared if you are able to run away from the enemy ! (t->crew/t->crew_max > 0.3 && t->crew > 6) && // be scared if the enemy has much crew left !ship->isInvisible() && // be scared if you're visible (distance > option_range[state][0] || // be scared if you're out of firing range ! distance < 200) // or be scared if you're *very* close. ) { --- 388,397 ---- // and what, if the enemy is facing you ? You should be really scared then ... unless ... if (t && ! (t->vel - ship->vel).length() > scared_enemyship_speed_factor * ship->speed_max && // be scared if enemy is moving away very fast ship->speed_max > 1.1 * t->vel.length() && // be scared if you are able to run away from the enemy ! (t->crew/t->crew_max > scare_crew_factor && t->crew > scare_owncrew_minimum) && // be scared if the enemy has much crew left !ship->isInvisible() && // be scared if you're visible (distance > option_range[state][0] || // be scared if you're out of firing range ! distance < scare_close_distance) // or be scared if you're *very* close. ) { *************** *** 480,490 **** ! // if you're out of range anyway, then it makes sense to check for threats. Otherwise, // you shouldn't break off an attack to evade a lousy missile. ! if (distance > 0.5*option_range[state][0]) { double a; a = evasion (ship); ! if (a != 0) angle_aim = a; --- 507,527 ---- ! // and what, if the enemy is invisible ! if (ship && ship->target && ship->target->isInvisible()) ! { ! angle_aim = random(PI2); ! if (ship->batt > 0.5*ship->batt_max || ! ship->batt >= ship->batt_max - ship->weapon_drain) ! action |= keyflag::fire; ! } ! ! // THIS WILL OVERRIDE EARLIER DECISIONS. ! // if you're far away, then it makes sense to check for threats. Otherwise, // you shouldn't break off an attack to evade a lousy missile. ! if (distance > 400.0)//0.5*option_range[state][0]) { double a; a = evasion (ship); ! if (a != 0) angle_aim = a; *************** *** 492,503 **** } ! // and what, if the enemy is invisible ! if (ship && ship->target && ship->target->isInvisible()) ! { ! angle_aim = random(PI2); ! if (ship->batt > 0.5*ship->batt_max || ! ship->batt >= ship->batt_max - ship->weapon_drain) ! action |= keyflag::fire; ! } double da; --- 529,534 ---- } ! ! double da; *************** *** 605,608 **** --- 636,651 ---- + // fast ships shouldn't be targeted at great distances... + double rV, rD; + double v; + v = ship->target->vel.length(); + rV = option_velocity[state][j] / (v + option_velocity[state][j]); + rD = option_range[state][j] / (option_range[state][j] + distance); + if ( rD < rV * out_of_range_multiplier ) // out of range condition + dontfireoption[j] = TRUE; + + + + for (i = 0; i < MAX_OPTION; i++) { *************** *** 1007,1014 **** { planet_safe[k] = 75 * get_config_int ("ship", "Mass", 8); ! if (planet_safe[k] > 800.0) ! planet_safe[k] = 800.0; // let's not make it too big. ! if (planet_safe[k] < 400.0) ! planet_safe[k] = 400.0; // let's not make it too small. // note that a planet can be pretty big by itself ... } --- 1050,1057 ---- { planet_safe[k] = 75 * get_config_int ("ship", "Mass", 8); ! if (planet_safe[k] > 900.0) ! planet_safe[k] = 900.0; // let's not make it too big. ! if (planet_safe[k] < 500.0) ! planet_safe[k] = 500.0; // let's not make it too small. // note that a planet can be pretty big by itself ... } *************** *** 1059,1062 **** --- 1102,1127 ---- state = 0; } + + + // and perhaps some unique "random" settings for this ship... + evasion_base_size = 50.0 + random(100.0); + evasion_ship_multiplier = 1.0 + random(1.0); + evasion_angle_change = (0.4 + random(0.2)) * PI; + + // lower means, more cowardly + intercept_abort_speed_factor = 0.25 + random(0.1); + + // scareness: when an attack is aborted.. + scare_crew_factor = 0.25 + random(0.1); + scare_owncrew_minimum = 4 + random(4); + scare_close_distance = 150 + random(100); + scared_enemyship_speed_factor = 0.85 + random(0.1); + + // out of range (shoot or not, the further you are, the smaller the chance). + out_of_range_multiplier = 0.5 + random(0.5); + + + + return; } |
From: Rob <geo...@us...> - 2005-08-04 02:08:38
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24101/source Modified Files: ais.h Log Message: AI evasion adaptation. Also added some randomness. Index: ais.h =================================================================== RCS file: /cvsroot/timewarp/source/ais.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ais.h 11 Jul 2005 00:25:10 -0000 1.10 --- ais.h 4 Aug 2005 02:08:29 -0000 1.11 *************** *** 96,99 **** --- 96,104 ---- int tactic_state; int state; + + // some random settings to give some individuality to a ship. + double evasion_base_size, evasion_ship_multiplier, evasion_angle_change, + intercept_abort_speed_factor, scare_crew_factor, scare_owncrew_minimum, scare_close_distance, + scared_enemyship_speed_factor, out_of_range_multiplier; }; |
From: Rob <geo...@us...> - 2005-08-02 13:04:19
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25643/source/newships Modified Files: shparkpi.cpp shpgarty.cpp shpmontr.cpp Log Message: ship-bugfixes, plus AI update (added constraint so that a ship won't waste its weapons if enemy moves too fast) Index: shpmontr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpmontr.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpmontr.cpp 1 Aug 2005 10:46:34 -0000 1.12 --- shpmontr.cpp 2 Aug 2005 13:04:08 -0000 1.13 *************** *** 281,285 **** last_target = target; ! attributes &= ~ATTRIB_STANDARD_INDEX; } --- 281,285 ---- last_target = target; ! //attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shparkpi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shparkpi.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shparkpi.cpp 2 Aug 2005 00:23:40 -0000 1.15 --- shparkpi.cpp 2 Aug 2005 13:04:07 -0000 1.16 *************** *** 146,150 **** weaponArmour = get_config_int("Weapon", "Armour", 0); weaponMass = get_config_float("Weapon", "Mass", 0); ! message.print(3000,7,"weaponMass = %f", weaponMass); weaponIsInvulnerableWhenClosing = get_config_int("Weapon", "IsInvulnerableWhenClosing", 0); weaponIsInvulnerableWhenOpening = get_config_int("Weapon", "IsInvulnerableWhenOpening", 0); --- 146,150 ---- weaponArmour = get_config_int("Weapon", "Armour", 0); weaponMass = get_config_float("Weapon", "Mass", 0); ! // message.print(3000,7,"weaponMass = %f", weaponMass); weaponIsInvulnerableWhenClosing = get_config_int("Weapon", "IsInvulnerableWhenClosing", 0); weaponIsInvulnerableWhenOpening = get_config_int("Weapon", "IsInvulnerableWhenOpening", 0); Index: shpgarty.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgarty.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpgarty.cpp 2 Aug 2005 00:23:46 -0000 1.16 --- shpgarty.cpp 2 Aug 2005 13:04:08 -0000 1.17 *************** *** 237,241 **** if(((Ship*)other)->crew>1) { GRS = new GarashRepulsarStun( ! (Ship *) (other->ship ), data->spriteExtra, 64, 31, specialStunFrames); game->add(GRS); --- 237,241 ---- if(((Ship*)other)->crew>1) { GRS = new GarashRepulsarStun( ! (Ship *) (other ), data->spriteExtra, 64, 31, specialStunFrames); game->add(GRS); |
From: Rob <geo...@us...> - 2005-08-02 13:04:15
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25643/source/ais Modified Files: c_wussie.cpp Log Message: ship-bugfixes, plus AI update (added constraint so that a ship won't waste its weapons if enemy moves too fast) Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** c_wussie.cpp 2 Aug 2005 00:22:17 -0000 1.17 --- c_wussie.cpp 2 Aug 2005 13:04:07 -0000 1.18 *************** *** 124,131 **** --- 124,133 ---- ship_pos = ship->normal_pos(); shot_pos = shot->normal_pos(); + if (fabs(ship->get_vel().y) < 0.0001) shipslope = sign(ship->get_vel().x) * 10000; else shipslope = ship->get_vel().x / ship->get_vel().y; + if (fabs(shot->get_vel().y) < 0.0001) shotslope = sign(shot->get_vel().x) * 10000; *************** *** 238,251 **** pangle = ship->trajectory_angle (p); va = atan (ship->get_vel ()); ! if (fabs (pangle - va) < PI/3) { avoid_planet = TRUE; ! if (normalize (pangle - va, PI2) < ! normalize (va - pangle, PI2)) ! angle_aim = -PI/2 + ship->get_angle ();// - ! //ship->trajectory_angle (p); else ! angle_aim = PI/2 + ship->get_angle ();// - ! //ship->trajectory_angle (p); } } --- 240,260 ---- pangle = ship->trajectory_angle (p); va = atan (ship->get_vel ()); ! ! double da; ! da = va - pangle; ! while (da <= -PI) ! da += PI2; ! while (da > PI) ! da -= PI2; ! // now, -PI < da < PI ! ! if ( fabs(da) < PI/3 || ship->vel.length() < 0.1 ) { avoid_planet = TRUE; ! ! if ( da < 0 ) ! angle_aim = pangle - 0.5*PI; else ! angle_aim = pangle + 0.5*PI; } } *************** *** 543,546 **** --- 552,568 ---- } } + + Vector2 ship_unit_vector; + double target_vel;//, target_vel_relative; + + // ship orientation vector + ship_unit_vector = unit_vector(ship->get_angle()); + + // absolute movement of enemy relative to current ship direction + target_vel = dot_product(ship->target->vel, ship_unit_vector); + + // relative movement of enemy to the current ship, also measured along the ship orientation + //target_vel_relative = target_vel - dot_product(ship->vel, ship_unit_vector); + double a; int range_fire, fire_front, field_fire; *************** *** 563,566 **** --- 585,608 ---- field_fire = TRUE; + // intercept time along the ship orientation (line of sight) + double t_intercept; + if (option_velocity[state][j] - target_vel != 0) + t_intercept = distance / (option_velocity[state][j] - target_vel); + else + t_intercept = 1E6; + + // intercept distance along the line of sight + double d_intercept; + d_intercept = t_intercept * option_velocity[state][j]; + //xxx this does not take relativity into account ? + + bool weapon_in_range = (option_range[state][j] > 1.1 * d_intercept); + + // check, if the (uncorrected) velocity isn't too high for your weapon: + if (option_velocity[state][j] < 0.9 * ship->target->vel.length() && + (option_range[state][j] > 0.4 * distance || distance > 500)) + dontfireoption[j] = TRUE; + + for (i = 0; i < MAX_OPTION; i++) { *************** *** 573,578 **** if (j == 0) { ! if ((distance < option_range[state][j]) ! && (fabs (angle_fire) < sweep[j])) fireoption[0] = TRUE; } --- 615,620 ---- if (j == 0) { ! if ((fabs (angle_fire) < sweep[j]) && ! weapon_in_range ) fireoption[0] = TRUE; } *************** *** 709,713 **** if (fire_front) { ! if (fabs (angle_fire) < sweep[j] && distance < option_range[state][j]) fireoption[j] = TRUE; } --- 751,755 ---- if (fire_front) { ! if (fabs (angle_fire) < sweep[j] && weapon_in_range) fireoption[j] = TRUE; } |
From: Rob <geo...@us...> - 2005-08-02 13:03:04
|
Update of /cvsroot/timewarp/ships/sc1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25473/ships/sc1 Modified Files: shpkzedr.ini Log Message: ai change Index: shpkzedr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/sc1/shpkzedr.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shpkzedr.ini 8 Jun 2003 17:55:36 -0000 1.3 --- shpkzedr.ini 2 Aug 2005 13:02:55 -0000 1.4 *************** *** 44,47 **** --- 44,51 ---- Armour = 1 + [AI3_Default] + Special_Timer = 100 + Special = Field + [Names] NumNames = 16 |
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source/newships Modified Files: shpaktgu.cpp shpalabc.cpp shpalhdr.cpp shparkpi.cpp shpartem.cpp shpastba.cpp shpayrbs.cpp shpbahbu.cpp shpbatde.cpp shpbogce.cpp shpbubbo.cpp shpchoex.cpp shpconca.cpp shpcrore.cpp shpdajem.cpp shpducla.cpp shpdyzha.cpp shpearc2.cpp shpearc3.cpp shpestgu.cpp shpfiear.cpp shpgahmo.cpp shpgarty.cpp shpgerhe.cpp shpgeror.cpp shphubde.cpp shpilwsp.cpp shpimpka.cpp shpjygst.cpp shpkabwe.cpp shpklidr.cpp shpkoaja.cpp shpkoapa.cpp shpkolfl.cpp shpmekpi.cpp shpneccr.cpp shppanav.cpp shpphepa.cpp shpquasi.cpp shpsamat.cpp shpsclfr.cpp shpsefn2.cpp shpstrsc.cpp shptaubo.cpp shptaufi.cpp shptauhu.cpp shptaust.cpp shptelno.cpp shptrige.cpp shptulra.cpp shpvelcr.cpp shpvenke.cpp shpvezba.cpp shpvioge.cpp shpwistr.cpp shpxaaar.cpp shpyevme.cpp shpyusra.cpp Log Message: sprite_indexe updates for many ships... Index: shpdajem.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpdajem.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpdajem.cpp 11 Jul 2005 00:25:29 -0000 1.13 --- shpdajem.cpp 2 Aug 2005 00:23:44 -0000 1.14 *************** *** 429,432 **** --- 429,433 ---- tendril[i]->pointerToMe = &tendril[i]; } + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shppanav.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shppanav.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shppanav.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shppanav.cpp 2 Aug 2005 00:23:46 -0000 1.12 *************** *** 98,101 **** --- 98,102 ---- isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpvenke.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpvenke.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpvenke.cpp 11 Jul 2005 00:25:32 -0000 1.13 --- shpvenke.cpp 2 Aug 2005 00:23:47 -0000 1.14 *************** *** 383,386 **** --- 383,387 ---- powerLevel = 1; thrustSequence=0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shptulra.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptulra.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shptulra.cpp 11 Jul 2005 00:25:32 -0000 1.15 --- shptulra.cpp 2 Aug 2005 00:23:47 -0000 1.16 *************** *** 272,275 **** --- 272,276 ---- mass = ship->mass; damage_factor = odamage; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpbogce.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbogce.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpbogce.cpp 1 Aug 2005 10:46:34 -0000 1.7 --- shpbogce.cpp 2 Aug 2005 00:23:44 -0000 1.8 *************** *** 432,435 **** --- 432,437 ---- explosionFrameSize = 50; explosionSample = data->sampleSpecial[1]; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shptauhu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauhu.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shptauhu.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shptauhu.cpp 2 Aug 2005 00:23:47 -0000 1.12 *************** *** 455,458 **** --- 455,459 ---- collide_flag_sameteam = 0; collide_flag_sameship = 0;*/ + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpmekpi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpmekpi.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpmekpi.cpp 11 Jul 2005 00:25:32 -0000 1.15 --- shpmekpi.cpp 2 Aug 2005 00:23:46 -0000 1.16 *************** *** 278,281 **** --- 278,282 ---- isblockingweapons = true; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpbubbo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbubbo.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** shpbubbo.cpp 11 Jul 2005 21:57:19 -0000 1.20 --- shpbubbo.cpp 2 Aug 2005 00:23:44 -0000 1.21 *************** *** 207,210 **** --- 207,211 ---- sprite_index = sprite_index % 32; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 519,522 **** --- 520,524 ---- base_frame = 64*(random()%4); sprite_index = base_frame + get_index(follow->get_angle()); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpalhdr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpalhdr.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpalhdr.cpp 11 Jul 2005 00:25:29 -0000 1.14 --- shpalhdr.cpp 2 Aug 2005 00:23:40 -0000 1.15 *************** *** 345,348 **** --- 345,350 ---- // for debugging purpose debug_id = 61; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpcrore.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpcrore.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpcrore.cpp 21 Jul 2005 14:55:07 -0000 1.8 --- shpcrore.cpp 2 Aug 2005 00:23:44 -0000 1.9 *************** *** 234,237 **** --- 234,239 ---- blast_damage_shots = oblast_damage_shots; explosionSample = data->sampleWeapon[2]; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpfiear.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpfiear.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpfiear.cpp 21 Jul 2005 14:55:07 -0000 1.13 --- shpfiear.cpp 2 Aug 2005 00:23:45 -0000 1.14 *************** *** 256,260 **** --- 256,262 ---- // explosionFrameSize = 50; spark_counter = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } + void FierasShot::calculate() { STACKTRACE Index: shpkabwe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkabwe.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpkabwe.cpp 11 Jul 2005 00:25:31 -0000 1.16 --- shpkabwe.cpp 2 Aug 2005 00:23:46 -0000 1.17 *************** *** 224,227 **** --- 224,228 ---- isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 684,687 **** --- 685,689 ---- } + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 850,853 **** --- 852,856 ---- ididdamage = 0; spriteindextime = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpxaaar.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpxaaar.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpxaaar.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shpxaaar.cpp 2 Aug 2005 00:23:48 -0000 1.12 *************** *** 193,196 **** --- 193,197 ---- isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shptaufi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaufi.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shptaufi.cpp 11 Jul 2005 00:25:32 -0000 1.5 --- shptaufi.cpp 2 Aug 2005 00:23:47 -0000 1.6 *************** *** 232,235 **** --- 232,236 ---- explosionFrameCount = 6; explosionFrameSize = 50; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpdyzha.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpdyzha.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpdyzha.cpp 11 Jul 2005 00:25:31 -0000 1.13 --- shpdyzha.cpp 2 Aug 2005 00:23:45 -0000 1.14 *************** *** 233,240 **** collide_flag_sameteam = ALL_LAYERS; collide_flag_sameship = ALL_LAYERS; } void DyzunMissile::calculate(void) { ! STACKTRACE lifetimeTimer += frame_time; if(lifetimeTimer<coastFrames) { --- 233,242 ---- collide_flag_sameteam = ALL_LAYERS; collide_flag_sameship = ALL_LAYERS; + + attributes &= ~ATTRIB_STANDARD_INDEX; } void DyzunMissile::calculate(void) { ! STACKTRACE; lifetimeTimer += frame_time; if(lifetimeTimer<coastFrames) { Index: shpvioge.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpvioge.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpvioge.cpp 11 Jul 2005 00:25:32 -0000 1.8 --- shpvioge.cpp 2 Aug 2005 00:23:47 -0000 1.9 *************** *** 204,207 **** --- 204,208 ---- id = ID_VIOGENPLASMA; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpkolfl.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkolfl.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpkolfl.cpp 11 Jul 2005 00:25:32 -0000 1.13 --- shpkolfl.cpp 2 Aug 2005 00:23:46 -0000 1.14 *************** *** 240,243 **** --- 240,244 ---- Nanimatedflame = 4; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpsclfr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsclfr.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpsclfr.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shpsclfr.cpp 2 Aug 2005 00:23:47 -0000 1.12 *************** *** 225,228 **** --- 225,229 ---- launched = FALSE; powerLevel = 1; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpayrbs.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpayrbs.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** shpayrbs.cpp 11 Jul 2005 00:25:29 -0000 1.21 --- shpayrbs.cpp 2 Aug 2005 00:23:40 -0000 1.22 *************** *** 455,458 **** --- 455,459 ---- shotbusy = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpimpka.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpimpka.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpimpka.cpp 11 Jul 2005 00:25:31 -0000 1.14 --- shpimpka.cpp 2 Aug 2005 00:23:46 -0000 1.15 *************** *** 289,292 **** --- 289,293 ---- collide_flag_sameteam = collide_flag_anyone = bit(LAYER_SHIPS); vel = v * unit_vector(angle); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpstrsc.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpstrsc.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpstrsc.cpp 11 Jul 2005 00:25:32 -0000 1.13 --- shpstrsc.cpp 2 Aug 2005 00:23:47 -0000 1.14 *************** *** 75,79 **** void TechMissile::calculate() { STACKTRACE; - Missile::calculate(); //This used to be if(target&&!invisible()), or something like that. --- 75,78 ---- *************** *** 97,101 **** } ! sprite_index = get_index(angle); // vx = v * cos(angle ); --- 96,101 ---- } ! //sprite_index = get_index(angle); ! Missile::calculate(); // vx = v * cos(angle ); Index: shpkoaja.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkoaja.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpkoaja.cpp 21 Jul 2005 14:55:08 -0000 1.8 --- shpkoaja.cpp 2 Aug 2005 00:23:46 -0000 1.9 *************** *** 239,242 **** --- 239,243 ---- facingAngle=oangle; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpducla.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpducla.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpducla.cpp 21 Jul 2005 14:55:07 -0000 1.16 --- shpducla.cpp 2 Aug 2005 00:23:45 -0000 1.17 *************** *** 363,367 **** vel = refvel; ! sprite_index = get_index(angle); SpaceObject::calculate(); --- 363,367 ---- vel = refvel; ! //sprite_index = get_index(angle); SpaceObject::calculate(); Index: shptelno.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptelno.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shptelno.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shptelno.cpp 2 Aug 2005 00:23:47 -0000 1.12 *************** *** 214,217 **** --- 214,218 ---- sprite->general_attributes |= SpaceSprite::ALPHA; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shptrige.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptrige.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shptrige.cpp 11 Jul 2005 00:25:32 -0000 1.11 --- shptrige.cpp 2 Aug 2005 00:23:47 -0000 1.12 *************** *** 47,51 **** void TrideminTurret::calculate() { ! STACKTRACE if(!ship->exists()) { --- 47,51 ---- void TrideminTurret::calculate() { ! STACKTRACE; if(!ship->exists()) { Index: shpgahmo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgahmo.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpgahmo.cpp 21 Jul 2005 14:55:07 -0000 1.9 --- shpgahmo.cpp 2 Aug 2005 00:23:45 -0000 1.10 *************** *** 717,722 **** void GahmurPlasma::animate (Frame *frame) { STACKTRACE; ! sprite_index = sprite_index_override; ! //if there is a better way, TELL ME!!! Shot::animate(frame); } --- 717,722 ---- void GahmurPlasma::animate (Frame *frame) { STACKTRACE; ! //sprite_index = sprite_index_override; //xx ooh, this is SO wrong! Leads to desynches ! //if there is a better way, TELL ME!!! --> it's already in the ::calculate routine, so it doesn't need to be here Shot::animate(frame); } Index: shpaktgu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpaktgu.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpaktgu.cpp 11 Jul 2005 00:25:29 -0000 1.8 --- shpaktgu.cpp 2 Aug 2005 00:23:40 -0000 1.9 *************** *** 201,204 **** --- 201,205 ---- // for debugging purpose debug_id = 7; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shparkpi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shparkpi.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shparkpi.cpp 11 Jul 2005 00:25:29 -0000 1.14 --- shparkpi.cpp 2 Aug 2005 00:23:40 -0000 1.15 *************** *** 531,534 **** --- 531,535 ---- // for debugging purpose debug_id = 91; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpkoapa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkoapa.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpkoapa.cpp 23 Jul 2005 14:08:08 -0000 1.12 --- shpkoapa.cpp 2 Aug 2005 00:23:46 -0000 1.13 *************** *** 275,278 **** --- 275,279 ---- facingAngle=oangle; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpearc2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpearc2.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpearc2.cpp 11 Jul 2005 00:25:31 -0000 1.9 --- shpearc2.cpp 2 Aug 2005 00:23:45 -0000 1.10 *************** *** 115,118 **** --- 115,120 ---- explosionFrameSize = 35; explosionSample = data->sampleWeapon[1]; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpvezba.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpvezba.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpvezba.cpp 21 Jul 2005 14:55:08 -0000 1.15 --- shpvezba.cpp 2 Aug 2005 00:23:47 -0000 1.16 *************** *** 279,282 **** --- 279,283 ---- this->normal = creator->specialDamage; this->armourEfficiency = creator->specialArmourEfficiency; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpvelcr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpvelcr.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpvelcr.cpp 11 Jul 2005 00:25:32 -0000 1.10 --- shpvelcr.cpp 2 Aug 2005 00:23:47 -0000 1.11 *************** *** 329,332 **** --- 329,333 ---- relative_damage = 0; sprite_index = (int)floor( 40 * (referenceDamage - maxDamage) / (double)referenceDamage ); + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 393,396 **** --- 394,398 ---- Shot(creator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, creator, osprite, relativity) { + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpphepa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpphepa.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shpphepa.cpp 11 Jul 2005 00:25:32 -0000 1.19 --- shpphepa.cpp 2 Aug 2005 00:23:46 -0000 1.20 *************** *** 235,238 **** --- 235,239 ---- debug_id = 2; // for debugging purpose + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpwistr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpwistr.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpwistr.cpp 11 Jul 2005 00:25:32 -0000 1.13 --- shpwistr.cpp 2 Aug 2005 00:23:47 -0000 1.14 *************** *** 416,421 **** } - sprite_index = 0; - // determine which one to draw (1 orientation, but different engine graphics) sprite_index = 0; --- 416,419 ---- Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpsefn2.cpp 1 Aug 2005 10:46:34 -0000 1.10 --- shpsefn2.cpp 2 Aug 2005 00:23:47 -0000 1.11 *************** *** 330,334 **** vel = refvel; ! sprite_index = get_index(angle); SpaceObject::calculate(); --- 330,334 ---- vel = refvel; ! //sprite_index = get_index(angle); SpaceObject::calculate(); *************** *** 833,837 **** vel = hooktarget->vel; angle = hooktarget->angle + hookfixangle; ! sprite_index = get_index(angle); pos = hooktarget->pos + hookfixdist * unit_vector(hooktarget->angle + hookfixorientation); } --- 833,837 ---- vel = hooktarget->vel; angle = hooktarget->angle + hookfixangle; ! //sprite_index = get_index(angle); pos = hooktarget->pos + hookfixdist * unit_vector(hooktarget->angle + hookfixorientation); } Index: shpilwsp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpilwsp.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpilwsp.cpp 23 Jul 2005 14:08:08 -0000 1.14 --- shpilwsp.cpp 2 Aug 2005 00:23:46 -0000 1.15 *************** *** 189,192 **** --- 189,193 ---- layer = LAYER_SPECIAL; vel = unit_vector(angle) * v; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpconca.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpconca.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shpconca.cpp 21 Jul 2005 14:55:07 -0000 1.17 --- shpconca.cpp 2 Aug 2005 00:23:44 -0000 1.18 *************** *** 191,194 **** --- 191,195 ---- this->id = CARGOCRATE_ID; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 293,296 **** --- 294,298 ---- } + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpestgu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpestgu.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpestgu.cpp 11 Jul 2005 00:25:31 -0000 1.14 --- shpestgu.cpp 2 Aug 2005 00:23:45 -0000 1.15 *************** *** 155,158 **** --- 155,159 ---- isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpjygst.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpjygst.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpjygst.cpp 21 Jul 2005 14:55:08 -0000 1.16 --- shpjygst.cpp 2 Aug 2005 00:23:46 -0000 1.17 *************** *** 228,231 **** --- 228,232 ---- isblockingweapons = true; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpearc3.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpearc3.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpearc3.cpp 11 Jul 2005 00:25:31 -0000 1.15 --- shpearc3.cpp 2 Aug 2005 00:23:45 -0000 1.16 *************** *** 41,44 **** --- 41,45 ---- EarthlingCruiserMk3Shot(SpaceLocation *creator, Vector2 opos, double oangle, double ov, double odamage, double orange, double oarmour, SpaceSprite *osprite); + virtual void calculate(); virtual void animate(Frame *space); virtual void soundExplosion(); *************** *** 192,197 **** attributes &= ~ATTRIB_STANDARD_INDEX; play_sound(data->sampleWeapon[0]); ! } void EarthlingCruiserMk3Shot::animate(Frame *space) --- 193,206 ---- attributes &= ~ATTRIB_STANDARD_INDEX; play_sound(data->sampleWeapon[0]); ! sprite_index = (int)(31.99 * d / range); ! } + void EarthlingCruiserMk3Shot::calculate() + { + STACKTRACE; + + Shot::calculate(); + sprite_index = (int)(31.99 * d / range); + } void EarthlingCruiserMk3Shot::animate(Frame *space) *************** *** 199,203 **** STACKTRACE; if (exists()) ! sprite->animate(pos, sprite_index = (int)(31.99 * d / range), space); } --- 208,212 ---- STACKTRACE; if (exists()) ! sprite->animate(pos, sprite_index, space); } Index: shptaubo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaubo.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shptaubo.cpp 11 Jul 2005 00:25:32 -0000 1.15 --- shptaubo.cpp 2 Aug 2005 00:23:47 -0000 1.16 *************** *** 176,179 **** --- 176,180 ---- // attributes &= ~ATTRIB_SHOT; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 352,355 **** --- 353,357 ---- sprite_index = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpyusra.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpyusra.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpyusra.cpp 1 Aug 2005 10:46:34 -0000 1.16 --- shpyusra.cpp 2 Aug 2005 00:23:48 -0000 1.17 *************** *** 131,134 **** --- 131,135 ---- released( false ) { + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpgarty.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgarty.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpgarty.cpp 21 Jul 2005 14:55:08 -0000 1.15 --- shpgarty.cpp 2 Aug 2005 00:23:46 -0000 1.16 *************** *** 317,320 **** --- 317,321 ---- targetship = oship; targetship->set_override_control(ocg); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpsamat.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsamat.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shpsamat.cpp 11 Jul 2005 00:25:32 -0000 1.18 --- shpsamat.cpp 2 Aug 2005 00:23:47 -0000 1.19 *************** *** 309,312 **** --- 309,313 ---- isblockingweapons = false; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 614,617 **** --- 615,619 ---- ++samatra->Nspecials; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpgeror.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgeror.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpgeror.cpp 11 Jul 2005 00:25:31 -0000 1.5 --- shpgeror.cpp 2 Aug 2005 00:23:46 -0000 1.6 *************** *** 472,475 **** --- 472,476 ---- accel = scale_acceleration(7); + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 553,560 **** } - sprite_index = (get_index(facingAngle) + (int(isBurning) * 64)); Missile::calculate(); } --- 554,561 ---- } Missile::calculate(); + sprite_index = (get_index(facingAngle) + (int(isBurning) * 64)); } Index: shpbahbu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbahbu.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpbahbu.cpp 11 Jul 2005 00:25:29 -0000 1.6 --- shpbahbu.cpp 2 Aug 2005 00:23:44 -0000 1.7 *************** *** 177,180 **** --- 177,182 ---- turn_step = 0.0; fully_dropped = FALSE; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpalabc.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpalabc.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shpalabc.cpp 11 Jul 2005 00:25:29 -0000 1.18 --- shpalabc.cpp 2 Aug 2005 00:23:40 -0000 1.19 *************** *** 207,210 **** --- 207,212 ---- // for debugging purpose debug_id = 40; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpartem.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpartem.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpartem.cpp 11 Jul 2005 00:25:29 -0000 1.13 --- shpartem.cpp 2 Aug 2005 00:23:40 -0000 1.14 *************** *** 290,298 **** // for debugging purpose debug_id = 101; } void TempestWave::calculate() { ! STACKTRACE double shit_angle = angle * (180 / PI); // FIXME: Goddamn radians --- 290,302 ---- // for debugging purpose debug_id = 101; + attributes &= ~ATTRIB_STANDARD_INDEX; } void TempestWave::calculate() { ! STACKTRACE; ! ! Missile::calculate(); ! double shit_angle = angle * (180 / PI); // FIXME: Goddamn radians *************** *** 315,319 **** } - Missile::calculate(); } --- 319,322 ---- Index: shpquasi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquasi.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpquasi.cpp 1 Aug 2005 10:46:34 -0000 1.15 --- shpquasi.cpp 2 Aug 2005 00:23:46 -0000 1.16 *************** *** 92,95 **** --- 92,96 ---- vel = 0; // wait. + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 283,287 **** Ship::calculate(); ! if (!state) return; --- 284,288 ---- Ship::calculate(); ! if (!exists()) return; Index: shpyevme.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpyevme.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shpyevme.cpp 11 Jul 2005 00:25:32 -0000 1.17 --- shpyevme.cpp 2 Aug 2005 00:23:48 -0000 1.18 *************** *** 287,290 **** --- 287,291 ---- isblockingweapons = true; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 342,345 **** --- 343,347 ---- layer = LAYER_SPECIAL; isblockingweapons = true; + attributes &= ~ATTRIB_STANDARD_INDEX; calculate(); } Index: shpastba.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpastba.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpastba.cpp 21 Jul 2005 14:55:07 -0000 1.6 --- shpastba.cpp 2 Aug 2005 00:23:40 -0000 1.7 *************** *** 356,359 **** --- 356,361 ---- basilisk = creator; + + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 539,542 **** --- 541,545 ---- } + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shphubde.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shphubde.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shphubde.cpp 11 Jul 2005 00:25:31 -0000 1.9 --- shphubde.cpp 2 Aug 2005 00:23:46 -0000 1.10 *************** *** 202,205 **** --- 202,206 ---- sprite_index = 0; armour = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 213,216 **** --- 214,219 ---- } + Shot::calculate(); + t += frame_time * 1E-3; *************** *** 225,229 **** sprite_index = i; - Shot::calculate(); } --- 228,231 ---- Index: shptaust.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaust.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shptaust.cpp 11 Jul 2005 00:25:32 -0000 1.10 --- shptaust.cpp 2 Aug 2005 00:23:47 -0000 1.11 *************** *** 159,162 **** --- 159,163 ---- play_sound(s); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpbatde.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbatde.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shpbatde.cpp 11 Jul 2005 00:25:29 -0000 1.19 --- shpbatde.cpp 2 Aug 2005 00:23:44 -0000 1.20 *************** *** 582,585 **** --- 582,587 ---- spr_time = 0; sprite_index = 0; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpgerhe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgerhe.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shpgerhe.cpp 11 Jul 2005 00:25:31 -0000 1.19 --- shpgerhe.cpp 2 Aug 2005 00:23:46 -0000 1.20 *************** *** 186,190 **** { Vector2 opos; ! opos = morons->pos - 100.0 * unit_vector(trajectory_angle(target)/*morons->angle*/); hero = new GerlHero(this, morons, opos, angle, this->data->spriteExtra); morons->herobrother = hero; --- 186,197 ---- { Vector2 opos; ! ! double a; ! if (target && target->exists()) ! a = trajectory_angle(target); ! else ! a = random(PI2); ! ! opos = morons->pos - 100.0 * unit_vector(a/*morons->angle*/); hero = new GerlHero(this, morons, opos, angle, this->data->spriteExtra); morons->herobrother = hero; *************** *** 399,402 **** --- 406,411 ---- lastenemyvel = 0; + + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 915,918 **** --- 924,928 ---- crew = creator->crew; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpklidr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpklidr.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpklidr.cpp 11 Jul 2005 00:25:32 -0000 1.10 --- shpklidr.cpp 2 Aug 2005 00:23:46 -0000 1.11 *************** *** 239,242 **** --- 239,243 ---- sprite_index = 0; this->lifetimeCounter = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpneccr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpneccr.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpneccr.cpp 21 Jul 2005 14:55:08 -0000 1.16 --- shpneccr.cpp 2 Aug 2005 00:23:46 -0000 1.17 *************** *** 373,376 **** --- 373,377 ---- isActivated=0; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpchoex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpchoex.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpchoex.cpp 23 Jul 2005 14:08:07 -0000 1.15 --- shpchoex.cpp 2 Aug 2005 00:23:44 -0000 1.16 *************** *** 57,61 **** --- 57,63 ---- if (mass > 0) this->accelerate(creator, this->trajectory_angle(creator), tractorForce / (this->mass * 2), 6); + attributes &= ~ATTRIB_STANDARD_INDEX; } + void AsteroidDebris::calculate() { |
From: Rob <geo...@us...> - 2005-08-02 00:24:01
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source/sc2ships Modified Files: shpchmav.cpp shpkohma.cpp shpmeltr.cpp shppkufu.cpp shpzfpst.cpp Log Message: sprite_indexe updates for many ships... Index: shpmeltr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpmeltr.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpmeltr.cpp 21 Jul 2005 00:43:59 -0000 1.14 --- shpmeltr.cpp 2 Aug 2005 00:23:49 -0000 1.15 *************** *** 135,138 **** --- 135,139 ---- set_depth(DEPTH_SHIPS+0.5); debug_id = 1035; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 249,252 **** --- 250,254 ---- ocm = new OverrideControlMelnorme(); ship->set_override_control(ocm); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shppkufu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shppkufu.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shppkufu.cpp 1 Aug 2005 10:46:34 -0000 1.14 --- shppkufu.cpp 2 Aug 2005 00:23:49 -0000 1.15 *************** *** 22,25 **** --- 22,27 ---- weaponArmour = get_config_int("Weapon", "Armour", 0); + num_reincarnations = 0; + reborn = 0; update_panel = true; *************** *** 27,31 **** } ! int PkunkFury::handle_damage(SpaceLocation *source, double normal, double direct) { int r = iround(normal + direct); crew -= r; --- 29,38 ---- } ! int PkunkFury::handle_damage(SpaceLocation *source, double normal, double direct) ! { ! // what if it dies 2 times in one frame... you should prevent that. ! if (!exists()) ! return 0; ! int r = iround(normal + direct); crew -= r; *************** *** 37,41 **** ! if ( (random() & 1) == 0) { if (attributes & ATTRIB_NOTIFY_ON_DEATH){ game->ship_died(this, source); --- 44,55 ---- ! //if ( (random() & 1) == 0) ! if (num_reincarnations < 1) ! ++num_reincarnations; ! ! double xra = random(1.0); ! double ra = num_reincarnations / (num_reincarnations+1); ! if ( xra > ra) ! { if (attributes & ATTRIB_NOTIFY_ON_DEATH){ game->ship_died(this, source); *************** *** 73,77 **** ! add(new Phaser (this, // x - cos(angle+0) * PHASE_MAX * w, // y - sin(angle+0) * PHASE_MAX * h, --- 87,91 ---- ! physics->add(new Phaser (this, // x - cos(angle+0) * PHASE_MAX * w, // y - sin(angle+0) * PHASE_MAX * h, *************** *** 82,86 **** this, sprite, sprite_index, hot_color, HOT_COLORS, PHASE_DELAY, PHASE_MAX, PHASE_DELAY) ); ! add(new Phaser (this, // x - cos(angle+PI/2) * PHASE_MAX * w, // y - sin(angle+PI/2) * PHASE_MAX * h, --- 96,100 ---- this, sprite, sprite_index, hot_color, HOT_COLORS, PHASE_DELAY, PHASE_MAX, PHASE_DELAY) ); ! physics->add(new Phaser (this, // x - cos(angle+PI/2) * PHASE_MAX * w, // y - sin(angle+PI/2) * PHASE_MAX * h, *************** *** 91,95 **** NULL, sprite, (sprite_index+0)&63, hot_color, HOT_COLORS, PHASE_DELAY, PHASE_MAX, PHASE_DELAY) ); ! add(new Phaser (this, // x - cos(angle-PI/2) * PHASE_MAX * w, // y - sin(angle-PI/2) * PHASE_MAX * h, --- 105,109 ---- NULL, sprite, (sprite_index+0)&63, hot_color, HOT_COLORS, PHASE_DELAY, PHASE_MAX, PHASE_DELAY) ); ! physics->add(new Phaser (this, // x - cos(angle-PI/2) * PHASE_MAX * w, // y - sin(angle-PI/2) * PHASE_MAX * h, *************** *** 102,107 **** // copied from katpoly code ! Ship *s; ! s = game->create_ship( get_shiptype()->id, control, pos, angle, get_team() ); --- 116,121 ---- // copied from katpoly code ! PkunkFury *s; ! s = (PkunkFury *)game->create_ship( get_shiptype()->id, control, pos, angle, get_team() ); *************** *** 134,138 **** //add(s->get_ship_phaser()); add(s); ! s->materialize(); // materialize it s->update_panel = true; --- 148,152 ---- //add(s->get_ship_phaser()); add(s); ! //s->materialize(); // materialize it s->update_panel = true; *************** *** 158,161 **** --- 172,182 ---- } + s->num_reincarnations = num_reincarnations; + + if (s->ship != s || parent != 0) + { + tw_error("Reincarnation mistake."); + } + return r; } Index: shpkohma.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpkohma.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpkohma.cpp 11 Jul 2005 00:25:58 -0000 1.9 --- shpkohma.cpp 2 Aug 2005 00:23:49 -0000 1.10 *************** *** 207,213 **** pos += 50.0 * unit_vector(angle); debug_id = 1033; } ! void KohrAhFRIED::calculate() { sprite_index = (int)((d / range) * (double)(frame_count - 1)); Shot::calculate(); --- 207,215 ---- pos += 50.0 * unit_vector(angle); debug_id = 1033; + attributes &= ~ATTRIB_STANDARD_INDEX; } ! void KohrAhFRIED::calculate() ! { sprite_index = (int)((d / range) * (double)(frame_count - 1)); Shot::calculate(); Index: shpzfpst.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpzfpst.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpzfpst.cpp 1 Aug 2005 10:46:35 -0000 1.13 --- shpzfpst.cpp 2 Aug 2005 00:23:49 -0000 1.14 *************** *** 77,80 **** --- 77,81 ---- { debug_id = 1048; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpchmav.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpchmav.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpchmav.cpp 11 Jul 2005 00:25:58 -0000 1.15 --- shpchmav.cpp 2 Aug 2005 00:23:48 -0000 1.16 *************** *** 247,250 **** --- 247,251 ---- isblockingweapons = false; debug_id = 1028; + attributes &= ~ATTRIB_STANDARD_INDEX; } |
From: Rob <geo...@us...> - 2005-08-02 00:24:01
|
Update of /cvsroot/timewarp/source/sc1ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source/sc1ships Modified Files: shpkzedr.cpp shpsyrpe.cpp shpumgdr.cpp Log Message: sprite_indexe updates for many ships... Index: shpsyrpe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpsyrpe.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpsyrpe.cpp 11 Jul 2005 00:25:58 -0000 1.13 --- shpsyrpe.cpp 2 Aug 2005 00:23:48 -0000 1.14 *************** *** 108,111 **** --- 108,112 ---- isblockingweapons = false; debug_id = 1019; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpkzedr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpkzedr.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpkzedr.cpp 11 Jul 2005 00:25:58 -0000 1.10 --- shpkzedr.cpp 2 Aug 2005 00:23:48 -0000 1.11 *************** *** 102,120 **** int olaser_damage, int olaser_color, double olaser_range, int olaser_frames, int odrain, Ship *oship, SpaceSprite *osprite) ! : ! Missile(oship, opos, oangle, ov, 1, orange, oarmour, oship, osprite), ! air_frames(oair_frames), ! max_air_frames(oair_frames), ! laser_damage(olaser_damage), ! laser_color(olaser_color), ! laser_range(olaser_range), ! laser_frames(olaser_frames), ! batt(0), ! recharge_frames(odrain) ! { layer = LAYER_SPECIAL; set_depth(DEPTH_SPECIAL); debug_id = 1012; ! } void KzerZaFighter::calculate() { --- 102,121 ---- int olaser_damage, int olaser_color, double olaser_range, int olaser_frames, int odrain, Ship *oship, SpaceSprite *osprite) ! : ! Missile(oship, opos, oangle, ov, 1, orange, oarmour, oship, osprite), ! air_frames(oair_frames), ! max_air_frames(oair_frames), ! laser_damage(olaser_damage), ! laser_color(olaser_color), ! laser_range(olaser_range), ! laser_frames(olaser_frames), ! batt(0), ! recharge_frames(odrain) ! { layer = LAYER_SPECIAL; set_depth(DEPTH_SPECIAL); debug_id = 1012; ! attributes &= ~ATTRIB_STANDARD_INDEX; ! } void KzerZaFighter::calculate() { Index: shpumgdr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpumgdr.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shpumgdr.cpp 11 Jul 2005 00:25:58 -0000 1.17 --- shpumgdr.cpp 2 Aug 2005 00:23:48 -0000 1.18 *************** *** 97,100 **** --- 97,101 ---- umgahship = oship; debug_id = 1021; + attributes &= ~ATTRIB_STANDARD_INDEX; } |
From: Rob <geo...@us...> - 2005-08-02 00:24:01
|
Update of /cvsroot/timewarp/source/sc3ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source/sc3ships Modified Files: shpexqen.cpp shpowavo.cpp shpvyrin.cpp shpxchex.cpp Log Message: sprite_indexe updates for many ships... Index: shpowavo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpowavo.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpowavo.cpp 21 Jul 2005 00:24:30 -0000 1.12 --- shpowavo.cpp 2 Aug 2005 00:23:49 -0000 1.13 *************** *** 287,290 **** --- 287,292 ---- } else oco = 0; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpvyrin.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpvyrin.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpvyrin.cpp 11 Jul 2005 00:25:59 -0000 1.11 --- shpvyrin.cpp 2 Aug 2005 00:23:49 -0000 1.12 *************** *** 160,163 **** --- 160,164 ---- isblockingweapons = true; + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 215,218 **** --- 216,220 ---- { mass = 1000; + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpxchex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpxchex.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpxchex.cpp 21 Jul 2005 00:24:31 -0000 1.14 --- shpxchex.cpp 2 Aug 2005 00:23:49 -0000 1.15 *************** *** 141,144 **** --- 141,145 ---- ocx = new OverrideControlXchagger(); affectship->set_override_control(ocx); + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpexqen.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpexqen.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpexqen.cpp 11 Jul 2005 00:25:59 -0000 1.9 --- shpexqen.cpp 2 Aug 2005 00:23:49 -0000 1.10 *************** *** 145,148 **** --- 145,149 ---- exqship = oship; remembernumber = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; } |
From: Rob <geo...@us...> - 2005-08-02 00:24:00
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source Modified Files: sc2ships.h Log Message: sprite_indexe updates for many ships... Index: sc2ships.h =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sc2ships.h 11 Jul 2005 00:25:10 -0000 1.8 --- sc2ships.h 2 Aug 2005 00:23:48 -0000 1.9 *************** *** 169,172 **** --- 169,174 ---- int weaponArmour; + double num_reincarnations; + public: PkunkFury(Vector2 opos, double shipAngle, |
From: Rob <geo...@us...> - 2005-08-02 00:24:00
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7903/source/other Modified Files: objanim.cpp Log Message: sprite_indexe updates for many ships... Index: objanim.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/objanim.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** objanim.cpp 1 Aug 2005 10:46:34 -0000 1.9 --- objanim.cpp 2 Aug 2005 00:23:48 -0000 1.10 *************** *** 18,21 **** --- 18,28 ---- //attributes &= ~ATTRIB_STANDARD_INDEX; remember_num_frames = num_frames; + attributes &= ~ATTRIB_STANDARD_INDEX; + + int k = sprite_index >>= 6; + if (k >= remember_num_frames || k < 0) + { + tw_error("Object Animation error in animation frame !! Should have died."); + } } |
From: Rob <geo...@us...> - 2005-08-02 00:23:00
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7763/source/ais Modified Files: c_wussie.cpp Log Message: added check for possible mistake that can be made Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** c_wussie.cpp 1 Aug 2005 10:44:29 -0000 1.16 --- c_wussie.cpp 2 Aug 2005 00:22:17 -0000 1.17 *************** *** 216,219 **** --- 216,224 ---- Query ap; SpaceObject *p; + + if (ship->target && ship->target->state < -1 ) + { + tw_error("Ship should clean up its target pointer"); + } if (ship->target && !ship->target->isInvisible ()) |
From: Rob <geo...@us...> - 2005-08-02 00:21:58
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7632/source/melee Modified Files: mframe.cpp mship.cpp Log Message: some checks for common mistakes Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mship.cpp 1 Aug 2005 10:46:33 -0000 1.37 --- mship.cpp 2 Aug 2005 00:21:31 -0000 1.38 *************** *** 1107,1111 **** } ! void Phaser::animate(Frame *space) { sprite->animate_character(pos, sprite_index, pallete_color[colors[color_index]], space); --- 1107,1112 ---- } ! void Phaser::animate(Frame *space) ! { sprite->animate_character(pos, sprite_index, pallete_color[colors[color_index]], space); *************** *** 1113,1119 **** } ! void Phaser::calculate() {STACKTRACE if (!exists()) return; frame_step -= frame_time; --- 1114,1133 ---- } ! void Phaser::calculate() ! { ! STACKTRACE; ! if (!exists()) return; + + /* no... cause for the pkunk, you also need "empty" phasers... + if (!(ship && ship->exists())) + { + ship = 0; + state = 0; + return; + } + */ + frame_step -= frame_time; Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** mframe.cpp 1 Aug 2005 10:46:33 -0000 1.34 --- mframe.cpp 2 Aug 2005 00:21:30 -0000 1.35 *************** *** 19,22 **** --- 19,25 ---- #include "ais/ext_ai.h" + #include "scp.h" + #include "melee/mnet1.h" + int total_presences; *************** *** 1295,1300 **** RGB back = { frame->background_red, frame->background_green, frame->background_blue }; aa_set_background ( back ); ! for (i = 0; i < j; i += 1) { ! if (animate_buffer[i]->exists()) animate_buffer[i]->animate(frame); } return; --- 1298,1352 ---- RGB back = { frame->background_red, frame->background_green, frame->background_blue }; aa_set_background ( back ); ! ! // timing, for networking flushes ! int time = get_time(); ! ! for (i = 0; i < j; i += 1) ! { ! // test if the sprite_index doesn't change: that affects physics and can lead to a desynch ! ! SpaceObject *o = 0; ! int index = 0; ! ! if (animate_buffer[i]->exists()) ! { ! ! if (animate_buffer[i]->isObject()) ! { ! o = (SpaceObject*) animate_buffer[i]; ! index = o->get_sprite_index(); ! } ! ! animate_buffer[i]->animate(frame); ! } ! ! ! if (o) ! { ! if (index != o->get_sprite_index()) ! { ! // in this case, the physics is affected, unsynchronized. ! tw_error("Physics (sprite_index) must not be changed outside physics routines."); ! } ! } ! ! ! // every 5 milliseconds... ! if (get_time() - time > 5) ! { ! // extra: insert some extra network-flush calls in here: ! if (glog->type == Log::log_net) ! { ! NetLog *l = (NetLog*) glog; ! l->recv_noblock(); // receive stuff, if you can ! ! // this helps to reduce idle-time, cause it doesn't have to wait till ! // data are received first (namely that's what game_ready() tests). ! l->flush_noblock(); // this sends, if there's something to send at least ! } ! ! time = get_time(); ! } ! } return; |
From: Rob <geo...@us...> - 2005-08-02 00:20:50
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7457/source/melee Modified Files: mgame.cpp Log Message: update on main game loop... reducing the number of catchups cause that yields too much lag Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** mgame.cpp 1 Aug 2005 10:45:24 -0000 1.48 --- mgame.cpp 2 Aug 2005 00:20:36 -0000 1.49 *************** *** 1304,1310 **** --- 1304,1315 ---- lag_decrease = 0; + // tracker about home many extra physics iterations are inserted; this shouldn't get too high + int num_catchups = 0; + const int max_catchups = 2; + int time_start = get_time(); + try { while(!game_done) *************** *** 1532,1537 **** // in this case, you can try to have physics in a linear fashion ! if ((hiccup_margin >= 0) && (next_tic_time + hiccup_margin > /* < */ time_current)) { // trying to execute frames in a linear fashion. next_tic_time += (frame_time / turbo); --- 1537,1543 ---- // in this case, you can try to have physics in a linear fashion ! if ((hiccup_margin >= 0) && (num_catchups < max_catchups) && (next_tic_time + hiccup_margin > /* < */ time_current)) { + // trying to execute frames in a linear fashion. next_tic_time += (frame_time / turbo); *************** *** 1547,1551 **** } else { catching_up = false; ! next_tic_time = time_current; // execute as often as possible. } } else { --- 1553,1557 ---- } else { catching_up = false; ! next_tic_time = time_current + (frame_time / turbo); // execute as often as possible. } } else { *************** *** 1553,1558 **** // is nigh impossible. catching_up = false; ! next_tic_time = time_current; // execute as often as possible. } if (next_fps_time <= game_time) --- 1559,1570 ---- // is nigh impossible. catching_up = false; ! next_tic_time = time_current + (frame_time / turbo); // execute as often as possible. } + + if (catching_up) + ++num_catchups; + else + num_catchups = 0; + if (next_fps_time <= game_time) |
From: Rob <geo...@us...> - 2005-08-01 10:47:18
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/ais Modified Files: c_input.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: c_input.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_input.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** c_input.cpp 11 Jul 2005 00:25:11 -0000 1.15 --- c_input.cpp 1 Aug 2005 10:46:32 -0000 1.16 *************** *** 166,175 **** if (key_pressed(back)) r |= keyflag::back; if (key_pressed(left)) r |= keyflag::left; ! if (key_pressed(right)) r |= keyflag::right; ! if (key_pressed(fire)) r |= keyflag::fire; ! if (key_pressed(altfire)) r |= keyflag::altfire; ! if (key_pressed(special)) r |= keyflag::special; ! if (key_pressed(next)) r |= keyflag::next; ! if (key_pressed(prev)) r |= keyflag::prev; if (key_pressed(closest)) r |= keyflag::closest; if (key_pressed(extra1)) r |= keyflag::extra1; --- 166,186 ---- if (key_pressed(back)) r |= keyflag::back; if (key_pressed(left)) r |= keyflag::left; ! if (key_pressed(right)) ! r |= keyflag::right; ! if (key_pressed(fire)) ! r |= keyflag::fire; ! ! if (key_pressed(altfire)) ! r |= keyflag::altfire; ! ! if (key_pressed(special)) ! r |= keyflag::special; ! ! if (key_pressed(next)) ! r |= keyflag::next; ! ! if (key_pressed(prev)) ! r |= keyflag::prev; ! if (key_pressed(closest)) r |= keyflag::closest; if (key_pressed(extra1)) r |= keyflag::extra1; |
From: Rob <geo...@us...> - 2005-08-01 10:47:17
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/gamex Modified Files: gameplanetmission.cpp gameproject.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: gameproject.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameproject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gameproject.cpp 24 Mar 2004 23:51:36 -0000 1.13 --- gameproject.cpp 1 Aug 2005 10:46:32 -0000 1.14 *************** *** 153,157 **** // msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); // prediction = get_config_int("Network", "Prediction", 50); // if ((prediction < 0) || (prediction > 100)) tw_error ("Prediction out of bounds (0 < %d < 100)", prediction); --- 153,160 ---- // msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! msecs_per_render = int( get_config_float("View", "MinimumFrameRate", 10) + 0.5 ); ! msecs_per_render_max = 100; ! if (msecs_per_render > msecs_per_render_max) ! msecs_per_render = msecs_per_render_max; // prediction = get_config_int("Network", "Prediction", 50); // if ((prediction < 0) || (prediction > 100)) tw_error ("Prediction out of bounds (0 < %d < 100)", prediction); Index: gameplanetmission.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gameplanetmission.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gameplanetmission.cpp 11 Jul 2005 00:25:13 -0000 1.5 --- gameplanetmission.cpp 1 Aug 2005 10:46:32 -0000 1.6 *************** *** 309,313 **** set_config_file("client.ini"); msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} --- 309,314 ---- set_config_file("client.ini"); msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! msecs_per_render = int( get_config_float("View", "MinimumFrameRate", 10) + 0.5 ); ! msecs_per_render_max = 100; prediction = get_config_int("Network", "Prediction", 50); if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} |
From: Rob <geo...@us...> - 2005-08-01 10:47:17
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/games Modified Files: gdebugonly.cpp gluagame.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: gluagame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gluagame.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gluagame.cpp 24 Mar 2004 23:51:35 -0000 1.11 --- gluagame.cpp 1 Aug 2005 10:46:32 -0000 1.12 *************** *** 3,9 **** gametype to test out how Lua and C++ and Timewarp get along. Very experimental. - */ #include <allegro.h> //allegro library header --- 3,11 ---- gametype to test out how Lua and C++ and Timewarp get along. Very experimental. + (by Yurand and youbstrd I think -- geomanl + */ + #ifdef _DEBUG #include <allegro.h> //allegro library header *************** *** 175,176 **** --- 177,180 ---- REGISTER_GAME(LuaGame, "LuaTest") //registering our game type, so that it will appear in the menus + #endif //debug + Index: gdebugonly.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gdebugonly.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gdebugonly.cpp 24 Mar 2004 23:51:34 -0000 1.9 --- gdebugonly.cpp 1 Aug 2005 10:46:32 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- msecs_per_render = 1000; // draw 1 frame/second. + msecs_per_render_max = 10000; prepare(); |
From: Rob <geo...@us...> - 2005-08-01 10:46:51
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/util Modified Files: errors.cpp net_tcp.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: errors.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/errors.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** errors.cpp 11 Jul 2005 00:26:16 -0000 1.11 --- errors.cpp 1 Aug 2005 10:46:35 -0000 1.12 *************** *** 16,20 **** FILE *f; ! f = fopen(fname, "at"); if (!f) return; --- 16,20 ---- FILE *f; ! f = fopen(fname, "wt"); if (!f) return; Index: net_tcp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/net_tcp.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** net_tcp.cpp 11 Jul 2005 00:26:16 -0000 1.13 --- net_tcp.cpp 1 Aug 2005 10:46:35 -0000 1.14 *************** *** 218,242 **** # endif SOCKET new_socket; ! while (true) { ! while (!ready2recv()) if (cancel_callback && cancel_callback()) { ! close_socket(s); ! s = INVALID_SOCKET; ! return -4; } tmp = sizeof(sockaddr_in); if ((new_socket = accept(s, (sockaddr *) &other, &tmp)) != INVALID_SOCKET) { close_socket(s); s = new_socket; ! set_nonblocking(s); ! // added GEO. char *str; str = inet_ntoa(other.sin_addr); // rewrites the address into string-dotted-format strcpy(addr, str); ! return 0; - } } throw("NetTCP::listen: WTF?"); --- 218,255 ---- # endif SOCKET new_socket; ! while (true) ! { ! while (!ready2recv()) ! { ! ! if (cancel_callback && cancel_callback()) ! { ! close_socket(s); ! s = INVALID_SOCKET; ! return -4; } + + idle(10); + } + tmp = sizeof(sockaddr_in); + if ((new_socket = accept(s, (sockaddr *) &other, &tmp)) != INVALID_SOCKET) { close_socket(s); s = new_socket; ! set_nonblocking(s); ! // added GEO. char *str; str = inet_ntoa(other.sin_addr); // rewrites the address into string-dotted-format strcpy(addr, str); ! return 0; } + + idle(10); + } + throw("NetTCP::listen: WTF?"); |
From: Rob <geo...@us...> - 2005-08-01 10:46:51
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/newships Modified Files: shpalckr.cpp shpbogce.cpp shpdeees.cpp shpkorsn.cpp shpmontr.cpp shpnarlu.cpp shpquasi.cpp shpquawr.cpp shpsefn2.cpp shptauda.cpp shptauem.cpp shptaume.cpp shpyusra.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: shptaume.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaume.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shptaume.cpp 11 Jul 2005 00:25:32 -0000 1.14 --- shptaume.cpp 1 Aug 2005 10:46:34 -0000 1.15 *************** *** 31,34 **** --- 31,36 ---- virtual void calculate_turn_left(); virtual void calculate_fire_special(); + + virtual void calculate_index(); }; *************** *** 95,98 **** --- 97,102 ---- bank_position = 0; + attributes &= ~ATTRIB_STANDARD_INDEX; + } *************** *** 130,133 **** --- 134,165 ---- } + void TauMercury::calculate_index() + { + + if (bank_position > bank_max) + bank_position = bank_max; + if (bank_position < -bank_max) + bank_position = -bank_max; + + int ic = 0; + if (fabs(bank_position)>0.5) { + if (bank_position > 0) + ic = iround(6 + floor(bank_position + 0.5)); + else + ic = iround(floor(-bank_position + 0.5)); + } + + sprite_index = get_index(angle) + ic*64; + + if (sprite_index < 0 || sprite_index >= sprite->frames()) + { + int N = sprite->frames(); + tw_error("wrong number of frames in %s!!", get_identity()); + //1740 + //ic==12 + } + } + + void TauMercury::calculate() { *************** *** 169,195 **** Ship::calculate(); - if (bank_position > bank_max) - bank_position = bank_max; - if (bank_position < -bank_max) - bank_position = -bank_max; - - int ic = 0; - if (fabs(bank_position)>0.5) { - if (bank_position > 0) - ic = iround(6 + floor(bank_position + 0.5)); - else - ic = iround(floor(-bank_position + 0.5)); - } - - sprite_index += ic*64; - if (sprite_index < 0 || sprite_index >= sprite->frames()) - { - tw_error("wrong number of frames!!"); - //1740 - //ic==12 - } if (locked_rail) { --- 201,208 ---- + // it's assumed that the sprite_index is updated here Ship::calculate(); if (locked_rail) { Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpsefn2.cpp 21 Jul 2005 14:55:08 -0000 1.9 --- shpsefn2.cpp 1 Aug 2005 10:46:34 -0000 1.10 *************** *** 453,457 **** if (tmp >= 0) { ! vel += _dp * tmp / mass; if (other->mass > 0) --- 453,458 ---- if (tmp >= 0) { ! if (mass > 0) ! vel += _dp * tmp / mass; if (other->mass > 0) *************** *** 461,465 **** Vector2 nd; nd = unit_vector(dp); ! nd /= (mass + other->mass); while (sprite->collide(iround(p1.x), iround(p1.y), sprite_index, iround(p2.x), iround(p2.y), other->get_sprite_index(), other->get_sprite() )) --- 462,468 ---- Vector2 nd; nd = unit_vector(dp); ! if ((mass + other->mass) > 0) ! nd /= (mass + other->mass); ! while (sprite->collide(iround(p1.x), iround(p1.y), sprite_index, iround(p2.x), iround(p2.y), other->get_sprite_index(), other->get_sprite() )) *************** *** 1125,1143 **** int ix1, iy1, ix2, iy2; double dx, dy; ! dx = min_delta(pos2.x, pos1.x, map_size.x); ! dy = min_delta(pos2.y, pos1.y, map_size.y); ! pos2.x = pos1.x + dx; ! pos2.y = pos1.y + dy; ! Vector2 co; ! ! co = corner(pos1); ! ix1 = int(co.x); ! iy1 = int(co.y); ! co = corner(pos2); ! ix2 = int(co.x); ! iy2 = int(co.y); dx = ix2 - ix1; --- 1128,1148 ---- int ix1, iy1, ix2, iy2; + Vector2 co1, co2; + + co1 = corner(pos1); + co2 = corner(pos2); + double dx, dy; ! dx = min_delta(co2.x, co1.x, space_view_size.x); ! dy = min_delta(co2.y, co1.y, space_view_size.y); ! co2.x = co1.x + dx; ! co2.y = co1.y + dy; ! ! ix1 = int(co1.x); ! iy1 = int(co1.y); ! ix2 = int(co2.x); ! iy2 = int(co2.y); dx = ix2 - ix1; Index: shpalckr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpalckr.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpalckr.cpp 11 Jul 2005 00:25:29 -0000 1.14 --- shpalckr.cpp 1 Aug 2005 10:46:34 -0000 1.15 *************** *** 185,188 **** --- 185,190 ---- STACKTRACE Ship::calculate(); + + dial_angle += turbo_change * frame_time / (1.0 + turbo_change) * PI/180; dial_index = get_index(angle + dial_angle); *************** *** 195,208 **** int AlcheroKronos::activate_special(){ ! STACKTRACE ! double t = game->get_turbo(); ! if( t - specialSpeedDown > specialMinTime ){ ! turbo_change -= specialSpeedDown; ! t -= specialSpeedDown; } ! else { ! turbo_change += specialMinTime - t; ! t = specialMinTime; } game->set_turbo( t ); game->set_frame_time( iround(t / fps_orig) ); --- 197,225 ---- int AlcheroKronos::activate_special(){ ! STACKTRACE; ! double t_old = game->get_turbo(); ! double t = t_old; ! double tnew = t - specialSpeedDown; ! if( tnew > specialMinTime ) ! { ! turbo_change -= (t - tnew);//specialSpeedDown; ! t = tnew; } ! else ! { ! ! //turbo_change += specialMinTime - t; ! //t = specialMinTime; ! tnew = specialMinTime; ! turbo_change -= (t - tnew);//specialSpeedDown; ! t = tnew; ! } + + if (t < 0 || t > 1.0 + 1E-6) + { + tw_error("Turbo change out of bounds"); + } + game->set_turbo( t ); game->set_frame_time( iround(t / fps_orig) ); *************** *** 214,217 **** --- 231,239 ---- } + if (fabs(1.0+turbo_change) < 1E-3) + { + tw_error("Something wrong with the turbo-change"); + } + compensate( 1.0 + turbo_change ); *************** *** 219,237 **** } ! int AlcheroKronos::deactivate_special(){ ! STACKTRACE double t = game->get_turbo(); ! if( turbo_change == 0 ) return TRUE; ! if( turbo_change + specialSpeedUp < 0 ){ t += specialSpeedUp; turbo_change += specialSpeedUp; ! }else{ t -= turbo_change; turbo_change = 0; } game->set_turbo( t ); game->set_frame_time( iround(t / fps_orig) ); ! if( !up ){ sound.stop( copy_of_sampleSpecial ); play_sound2( data->sampleSpecial[1], 255, 1000 ); --- 241,271 ---- } ! int AlcheroKronos::deactivate_special() ! { ! STACKTRACE; double t = game->get_turbo(); ! ! if( turbo_change == 0 ) ! return TRUE; ! ! if( turbo_change + specialSpeedUp < 0 ) ! { t += specialSpeedUp; turbo_change += specialSpeedUp; ! } else { t -= turbo_change; turbo_change = 0; } + + if (t < 0 || t > 1.0 + 1E-6) + { + tw_error("Turbo change out of bounds"); + } + game->set_turbo( t ); game->set_frame_time( iround(t / fps_orig) ); ! if( !up ) ! { sound.stop( copy_of_sampleSpecial ); play_sound2( data->sampleSpecial[1], 255, 1000 ); *************** *** 242,245 **** --- 276,280 ---- double ov = magnitude(vel); + if( ov > speed_max) vel *= speed_max/ov; *************** *** 331,343 **** } ! void AlcheroKronos::death(){ ! STACKTRACE ! if( turbo_change != 0 ){ ! double t = game->get_turbo(); ! t -= turbo_change; ! turbo_change = 0; ! game->set_turbo( t ); ! game->set_frame_time( iround(t / fps_orig) ); ! } } --- 366,386 ---- } ! void AlcheroKronos::death() ! { ! STACKTRACE; ! if( turbo_change != 0 ) ! { ! double t = game->get_turbo(); ! t -= turbo_change; ! ! if (t < 0 || t > 1.0 + 1E-6) ! { ! tw_error("Turbo change out of bounds"); ! } ! ! turbo_change = 0; ! game->set_turbo( t ); ! game->set_frame_time( iround(t / fps_orig) ); ! } } Index: shpnarlu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpnarlu.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpnarlu.cpp 11 Jul 2005 00:25:32 -0000 1.16 --- shpnarlu.cpp 1 Aug 2005 10:46:34 -0000 1.17 *************** *** 205,209 **** } else if((cloak_frame >= 300)) { ! if (is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" { sprite->animate_character( pos, sprite_index, pallete_color[0], space); --- 205,209 ---- } else if((cloak_frame >= 300)) { ! if (!show_red_cloaker || is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" { sprite->animate_character( pos, sprite_index, pallete_color[0], space); Index: shpbogce.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbogce.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpbogce.cpp 21 Jul 2005 14:55:07 -0000 1.6 --- shpbogce.cpp 1 Aug 2005 10:46:34 -0000 1.7 *************** *** 264,272 **** BoggCenturion* bro; for (q.begin(this, bit(LAYER_SHIPS), share_range); q.currento; q.next()) ! if (q.currento->getID() == BOGEI_CENTURION_ID) { bro = (BoggCenturion*)q.currento; if (bro->exists()) links_num += 1; ! if (links_num == 2) break; } } --- 264,277 ---- BoggCenturion* bro; for (q.begin(this, bit(LAYER_SHIPS), share_range); q.currento; q.next()) ! { ! if (q.currento->getID() == BOGEI_CENTURION_ID) ! { bro = (BoggCenturion*)q.currento; if (bro->exists()) links_num += 1; ! ! if (links_num == 2) break; ! } ! } } *************** *** 291,301 **** // flame ! if (flame_count >= 0) { ! tx = sin((sprite_index+3) * 2 * PI / 64.0); ! ty = cos((sprite_index+3) * 2 * PI / 64.0); ! ix = 42 + int(35*tx) - 10; ! iy = 42 - int(35*ty) - 10; ! data->spriteExtraExplosion->draw(ix, iy, 40 + sprite_index + 64*flame_frame, bmp); } --- 296,315 ---- // flame ! int k, n; ! if (flame_count >= 0) ! { ! n = data->spriteExtraExplosion->frames(); ! k = 40 + sprite_index + 64*flame_frame; ! if (k >= n) ! { ! tw_error("Sprite index overflow in %s", get_identity()); ! } ! ! tx = sin((sprite_index+3) * 2 * PI / 64.0); ! ty = cos((sprite_index+3) * 2 * PI / 64.0); ! ix = 42 + int(35*tx) - 10; ! iy = 42 - int(35*ty) - 10; ! data->spriteExtraExplosion->draw(ix, iy, k, bmp); } *************** *** 305,309 **** // gun ! data->spriteWeaponExplosion->draw(ix1, iy1, sprite_index+64*gun_phase, bmp); --- 319,330 ---- // gun ! k = sprite_index+64*gun_phase; ! n = data->spriteWeaponExplosion->frames(); ! if (k >= n) ! { ! tw_error("Sprite index overflow in %s", get_identity()); ! } ! ! data->spriteWeaponExplosion->draw(ix1, iy1, k, bmp); Index: shpkorsn.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkorsn.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpkorsn.cpp 11 Jul 2005 18:31:04 -0000 1.1 --- shpkorsn.cpp 1 Aug 2005 10:46:34 -0000 1.2 *************** *** 139,143 **** } else */ ! if (is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[255], space); else --- 139,143 ---- } else */ ! if (!show_red_cloaker || is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[255], space); else Index: shpquawr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquawr.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpquawr.cpp 11 Jul 2005 00:25:32 -0000 1.16 --- shpquawr.cpp 1 Aug 2005 10:46:34 -0000 1.17 *************** *** 172,176 **** if((cloak_frame >= 300)) { ! if (is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else --- 172,176 ---- if((cloak_frame >= 300)) { ! if (!show_red_cloaker || is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else Index: shpquasi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpquasi.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpquasi.cpp 11 Jul 2005 00:25:32 -0000 1.14 --- shpquasi.cpp 1 Aug 2005 10:46:34 -0000 1.15 *************** *** 307,311 **** void Quai::animate(Frame *space) { ! if (isInvisible() && !is_bot(control->channel) && is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[4], space); else --- 307,311 ---- void Quai::animate(Frame *space) { ! if (!show_red_cloaker || isInvisible() && !is_bot(control->channel) && is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[4], space); else Index: shpmontr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpmontr.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpmontr.cpp 23 Jul 2005 14:07:27 -0000 1.11 --- shpmontr.cpp 1 Aug 2005 10:46:34 -0000 1.12 *************** *** 77,80 **** --- 77,82 ---- virtual void animate_predict( Frame* space, int time ); // use Missile::animate_predict + virtual void calculate_index(); + ~MonoMissile(); // frees up beacon memory }; *************** *** 264,272 **** SpaceLocation *opos, SpaceSprite *osprite, SpaceObject* otarget ) : HomingMissile( creator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, ! 0, opos, osprite, otarget ){ int iangle = (int)((angle + PI/4) / (PI/2)) % 4; angle = iangle * PI/2; sprite_index = iangle; from_beacon = to_beacon = NULL; set_up_beacons(); --- 266,280 ---- SpaceLocation *opos, SpaceSprite *osprite, SpaceObject* otarget ) : HomingMissile( creator, Vector2(ox,oy), oangle, ov, odamage, orange, oarmour, ! 0, opos, osprite, otarget ) ! { + /* + while (angle < 0) + angle += PI2; int iangle = (int)((angle + PI/4) / (PI/2)) % 4; angle = iangle * PI/2; sprite_index = iangle; + */ + calculate_index(); from_beacon = to_beacon = NULL; set_up_beacons(); *************** *** 276,286 **** } void MonoMissile::calculate() { ! STACKTRACE Missile::calculate(); - int iangle = (int)((angle + PI/4) / (PI/2)) % 4; - angle = iangle * PI/2; - changeDirection( angle ); - sprite_index = iangle; if( target != last_target ) set_up_beacons(); --- 284,300 ---- } + void MonoMissile::calculate_index() + { + while (angle < 0) + angle += PI2; + int iangle = (int)((angle + PI/4) / (PI/2)) % 4; + angle = iangle * PI/2; + changeDirection( angle ); + sprite_index = iangle; + } + void MonoMissile::calculate() { ! STACKTRACE; Missile::calculate(); if( target != last_target ) set_up_beacons(); Index: shptauem.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauem.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shptauem.cpp 21 Jul 2005 00:43:59 -0000 1.15 --- shptauem.cpp 1 Aug 2005 10:46:34 -0000 1.16 *************** *** 250,256 **** void TauEMPVirtualTarget::calculate() { ! STACKTRACE ! if (exists()) ! state = 0; SpaceObject::calculate(); } --- 250,262 ---- void TauEMPVirtualTarget::calculate() { ! STACKTRACE; ! ! if (ship && !ship->exists()) ! { ! ship = 0; ! ! state = 0; // it's removed ! } ! SpaceObject::calculate(); } *************** *** 280,283 **** --- 286,291 ---- ocm->jamkey = tgt->nextkeys; jamtarget->set_override_control(ocm); + + attributes |= ATTRIB_UNDETECTABLE; // it doesn't need to collide. } Index: shpyusra.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpyusra.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpyusra.cpp 11 Jul 2005 00:25:32 -0000 1.15 --- shpyusra.cpp 1 Aug 2005 10:46:34 -0000 1.16 *************** *** 4,7 **** --- 4,10 ---- #include "../other/objanim.h" + // this should match the data file !! + const int special_frames = 4; + class YushSpear; *************** *** 74,78 **** } ! int YushRanger::activate_special(){ STACKTRACE; double alpha = atan3(vel.y, vel.x); --- 77,82 ---- } ! int YushRanger::activate_special() ! { STACKTRACE; double alpha = atan3(vel.y, vel.x); *************** *** 90,94 **** vel = v * unit_vector( 2 * angle - alpha ); game->add( new ObjectAnimation( this, pos, Vector2(0, 0), angle, data->spriteSpecial, ! 0, 4, time_ratio, LAYER_HOTSPOTS )); special_sample = random() % 2; return TRUE; --- 94,99 ---- vel = v * unit_vector( 2 * angle - alpha ); game->add( new ObjectAnimation( this, pos, Vector2(0, 0), angle, data->spriteSpecial, ! 0, special_frames, time_ratio, LAYER_HOTSPOTS )); ! //data->spriteSpecial->frames() don't use this for an ObjectAnimation, cause that has angle-dependency as well !! special_sample = random() % 2; return TRUE; Index: shpdeees.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpdeees.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpdeees.cpp 11 Jul 2005 00:25:30 -0000 1.6 --- shpdeees.cpp 1 Aug 2005 10:46:34 -0000 1.7 *************** *** 8,11 **** --- 8,19 ---- #define DEEP_SPACE_WARRIOR_TRAIL_RATE 25 + + // these value MUST match those in the .dat file !! + // we can't use sprite->frames(), cause the sprites have both animation AND rotation. + const int ship_frames = 8; + const int special_frames = 10; + const int weapon_frames = 5; + const int extra_frames = 4; + int makecol(RGB col) { *************** *** 102,118 **** { STACKTRACE; ! if( dying ){ ! if( sprite_step < 0 ){ ! sprite_step += extraFadeRate; ! sprite_phase++; ! if( sprite_phase == 10 ){ ! sprite_phase = 9; ! state = 0; ! game->ship_died( this, dying ); } - sprite_index &= 63; - sprite_index += sprite_phase * 64; - }else{ - sprite_step -= frame_time; } return; --- 110,139 ---- { STACKTRACE; ! if( dying ) ! { ! if (!dying->exists()) ! { ! // a slow process of dying; but, if the other ship dies as well, this pointer will soon ! // become invalid. In that case, this ship should die immediately... ! ! state = 0; ! game->ship_died( this, dying ); ! dying = 0; ! ! } else { ! ! if( sprite_step < 0 ){ ! sprite_step += extraFadeRate; ! sprite_phase++; ! if( sprite_phase == 10 ){ ! sprite_phase = 9; ! state = 0; ! game->ship_died( this, dying ); ! } ! sprite_index &= 63; ! sprite_index += sprite_phase * 64; ! }else{ ! sprite_step -= frame_time; } } return; *************** *** 143,147 **** game->add( new ObjectAnimation( this, pos, 0, angle, ! data->spriteSpecial, 0, 10, time_ratio / 2, LAYER_HOTSPOTS )); hotspot_frame += hotspot_rate; --- 164,170 ---- game->add( new ObjectAnimation( this, pos, 0, angle, ! // 10 ! data->spriteSpecial, 0, special_frames, time_ratio / 2, LAYER_HOTSPOTS )); ! // do not use ->frames(), cause this is a "special" case... hotspot_frame += hotspot_rate; *************** *** 197,201 **** // - e_speed * sin( e_angle * ANGLE_RATIO ), ! e_angle, data->spriteExtra, 0, 4, time_ratio * 2, LAYER_HOTSPOTS )); } play_sound2( data->sampleSpecial[0] ); --- 220,225 ---- // - e_speed * sin( e_angle * ANGLE_RATIO ), ! e_angle, data->spriteExtra, 0, extra_frames, time_ratio * 2, LAYER_HOTSPOTS )); ! // do not use data->spriteExtra->frames(), cause this is a special case } play_sound2( data->sampleSpecial[0] ); *************** *** 346,351 **** else state = 1; ! if( trail_step <= 0 ){ ! game->add( new ObjectAnimation( this, pos, 0, angle, sprite, 1, 4, time_ratio, LAYER_HOTSPOTS )); trail_step += DEEP_SPACE_WARRIOR_TRAIL_RATE; }else --- 370,379 ---- else state = 1; ! if( trail_step <= 0 ) ! { ! // note that the sprite of the warrior, is the WeaponSprite. ! //-> 1, 4 ! game->add( new ObjectAnimation( this, pos, 0, angle, sprite, 1, weapon_frames-1, time_ratio, LAYER_HOTSPOTS )); ! // do not use sprite->frames(), cause this is a special case. trail_step += DEEP_SPACE_WARRIOR_TRAIL_RATE; }else Index: shptauda.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauda.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shptauda.cpp 11 Jul 2005 00:25:32 -0000 1.13 --- shptauda.cpp 1 Aug 2005 10:46:34 -0000 1.14 *************** *** 179,183 **** s_ind = 0; ! add(new Animation(this, pos, data->spriteExtra, 0, 10, 25, DEPTH_HOTSPOTS+0.25)); } --- 179,183 ---- s_ind = 0; ! add(new Animation(this, pos, data->spriteExtra, 0, data->spriteExtra->frames(), 25, DEPTH_HOTSPOTS+0.25)); } *************** *** 185,190 **** void TauDaggerShot::animate(Frame *space) { ! STACKTRACE ! sprite->animate(pos, sprite_index + 64 * s_ind, space); s_ind = (s_ind + 1) % 2; } --- 185,199 ---- void TauDaggerShot::animate(Frame *space) { ! STACKTRACE; ! ! int k; ! k = sprite_index + 64 * s_ind; ! int n = sprite->frames(); ! if ( k >= n) ! { ! tw_error("sprite index error in %s", get_identity() ); ! } ! ! sprite->animate(pos, k, space); s_ind = (s_ind + 1) % 2; } |
From: Rob <geo...@us...> - 2005-08-01 10:46:51
|
Update of /cvsroot/timewarp/source/sc3ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/sc3ships Modified Files: shpherex.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: shpherex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpherex.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpherex.cpp 11 Jul 2005 00:25:59 -0000 1.7 --- shpherex.cpp 1 Aug 2005 10:46:35 -0000 1.8 *************** *** 109,113 **** } else if ((cloak_frame >= 300)) { ! if (is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else --- 109,113 ---- } else if ((cloak_frame >= 300)) { ! if (!show_red_cloaker || is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[0], space); else |