Abstrct / Schemaverse

The Schemaverse is a space-based strategy game implemented entirely within a PostgreSQL database. Compete against other players using raw SQL commands to command your fleet. Or, if your PL/pgSQL-foo is strong, wield it to write AI and have your fleet command itself!
schemaverse.com
PostgreSQL License
356 stars 39 forks source link

ship_course_control pushes my ship past it's max speed. #26

Open chandeeland opened 11 years ago

chandeeland commented 11 years ago

i set target speed to be the documented max, because I upgrade the ships whilst they are in transit.

Notice ship.id = 6183 has a max_speed = 2500 and an actual speed = 15587

max_speed = max velocity max_fuel = max acceleration right ?

schemaverse=> select last_value as tic, s.id, action_target_id, target_speed, speed, max_speed, max_fuel, current_fuel, range, (p.location<->s.location)::numeric/s.max_speed as best_tics, (p.location<->s.location)::numeric/s.speed as real_tics from my_ships s join planets p on (p.id = s.action_target_id), tic_seq where speed >0 order by action_target_id, id;\ tic | id | action_target_id | target_speed | speed | max_speed | max_fuel | current_fuel | range | best_tics | real_tics -----+------+------------------+--------------+-------+-----------+----------+--------------+-------+---------------------+--------------------- 80 | 6183 | 1640 | 800000 | 15587 | 2500 | 3200 | 0 | 300 | 94.5459466890920000 | 15.1642308797542824 80 | 5941 | 2546 | 800000 | 8920 | 7110 | 7920 | 0 | 570 | 25.1660747599427567 | 20.0595057783848655 80 | 6203 | 2546 | 800000 | 9840 | 11070 | 7920 | 0 | 570 | 16.6622201056822945 | 18.7449976188925813 80 | 5959 | 3368 | 800000 | 16286 | 4100 | 6400 | 0 | 324 | 71.9562068294734146 | 18.1149728601769004

Abstrct commented 11 years ago

This is definitely a bug. Likely either in move_ship() or one of the my_ships view rules. I will figure out what is up and get it sorted out. Until then, enjoy the hack :)

chandeeland commented 11 years ago

i'd like to contribute, but it looks like the source here is different from the running game.

can we see an update?