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

Replaced MOVE() with SHIP_COURSE_CONTROL() and MOVE_SHIPS() functions #8

Closed JackOfMostTrades closed 12 years ago

JackOfMostTrades commented 12 years ago

I removed the MOVE() function and replaced it with a SHIP_COURSE_CONTROL() function (which basically just sets the target speed and target direction / destination) for players and then a backend MOVE_SHIPS() function which actually handles the movement logic.

MOVE_SHIPS() is more or less built from scratch, and it correctly accounts for fuel cost performing Delta-V maneuvers (e.g. instead of it only costing 180 to turn around, it now costs 2*speed). It will also bring the ship to a halt if it reaches its destination (or will at least slow it down to the extent that it has fuel available).

There are also some misc changes/moving things around which I had to do in order to get create_schemaverse.sql to load from scratch into my test DB.

Abstrct commented 12 years ago

Thanks for putting this together! I am going to merge the commit and then work to get it all integrated into the public server. I will make an announcement on various mediums once it is up and running.