Database up and running

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Abstrct
    replied
    Re: Database up and running

    Originally posted by YenTheFirst
    I've been having trouble with movement.

    if I try to select move(), like so:
    Code:
    select move(1775,1,null,-226,-3245);
    I get back neither 't', nor 'f', but
    Code:
    The following error occured during execution:
    ERROR: query string argument of EXECUTE is null
    CONTEXT: PL/pgSQL function "move" line 135 at EXECUTE statement
    
    The original query was:
    execute
    if I try to update the headings directly, with a speed, direction, destination_x, and destination_y, then my ships move, but after 1 tic they stop (0 speed), but have still used up the fuel. I thought that after ships accelerated to speed, they continued until you stopped them?
    I just tried to take a look at that ship and it no longer exists (a new round started today) so I can't fully debug the issue but I can give some answers about what was likely first going on.

    My hope is that the error you showed below was because of the ship no longer existing. Try to create a new ship and then issue the move command again and see if you are coming across the same issue. I will fully admit that of all the commands in the system MOVE tends to be the most buggy so please keep us posted on this issue. Any other details you can offer (ships current x,y,speed, direction) is extremely helpful for squashing bugs.

    As for the ship stopping, this is to be expected if you have a destination_x and destination_y set. Once the ship is within range of this destination, it will stop (set speed=0). If you would like to to go and never stop, update destination_x and destination_y to be NULL.

    I hope that helps. As I mentioned, if you do keep running into the issue please post again to keep me updated. There are some weird corner cases in MOVE that I would love to fix before DEFCON.


    Thanks
    -Abstrct

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    I've been having trouble with movement.

    if I try to select move(), like so:
    Code:
    select move(1775,1,null,-226,-3245);
    I get back neither 't', nor 'f', but
    Code:
    The following error occured during execution:
    ERROR: query string argument of EXECUTE is null
    CONTEXT: PL/pgSQL function "move" line 135 at EXECUTE statement
    
    The original query was:
    execute
    if I try to update the headings directly, with a speed, direction, destination_x, and destination_y, then my ships move, but after 1 tic they stop (0 speed), but have still used up the fuel. I thought that after ships accelerated to speed, they continued until you stopped them?

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    I was hoping to edit my previous message but I seem to have missed the timeframe for doing so. Instead, I have uploaded a new version of the script to my server so you can download the latest edition without me spamming these forums with large chunks of code.

    Find the latest and greatest Getting Started script here: http://schemaverse.com/GettingStarted.sql

    Does nothing you see in the script make any sense at all but your still curious about the game? Don't forget to have a glance at the game's Guide and you can always ask me questions here.

    -Abstrct
    http://defcon.schemaverse.com

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    Since starting seems to be the toughest part of this game. Here is a nice little SQL script that will set you up to start mining your home planet.

    Code:
    -- Step 1 - Create 2 ships at the location of your player's starting planet
    -- This step will cost you $2000 from your starting balance 
    INSERT INTO my_ships(name, location_x, location_y) 
    	SELECT 
    		'Home Miner',
    		planets.location_x, 
    		planets.location_y
    	FROM generate_series(1,2), planets 
    	WHERE planets.conqueror_id=GET_PLAYER_ID(SESSION_USER);
    
    
    -- Step 2 - Upgrade each ships mining ability an extra 100
    -- 100 points per ship (at $25 per point) will cost $5000
    SELECT UPGRADE(id, 'PROSPECTING', 100) from my_ships WHERE name='Home Miner'; 
    
    
    -- Step 3 - Create a fleet that will run while you're not paying attention
    INSERT INTO my_fleets(name) VALUES('My Home Fleet'); 
    
    -- Step 4 - Update the fleet to do something
    UPDATE my_fleets
    SET
     script_declarations= 'miners RECORD; ',
     script='
    FOR miners IN SELECT my_ships.id as ship_id, planets.id as planet_id FROM my_ships, planets 
    	WHERE my_ships.location_x=planets.location_x AND my_ships.location_y=planets.location_y
    LOOP
        PERFORM MINE(miners.ship_id, miners.planet_id);
    END LOOP;
    ',
      enabled='t'
    WHERE
     name = 'My Home Fleet';
     
    -- Step 5 - This will buy one minute of automated processing time per tic
    -- Total cost is $10000000
    SELECT UPGRADE(id, 'FLEET_RUNTIME', 1) FROM my_fleets;
    After you run this script, you will start to build a wealth of fuel. Use the convert_resource() function to convert fuel into money that you can then use to continue building your fleet.

    Leave a comment:


  • Abstrct
    started a topic Database up and running

    Database up and running

    Alright I am a day or two late but, as promised, a temporary database with the tournament settings is now up and running. If you are interested in participating, it will certainly benefit you to start getting familiar with the game and it will also really help me to make sure everything is running as expected.

    To create an account, head over to our "training wheels" interface at https://schemaverse.com/tw/

    Once you have created your account, you can keep using /tw/, or you can start using any client/programming language with PostgreSQL support.



    Things to keep in mind:
    -This is only for testing/learning, all game data will not be carried over to the tournament database

    -Use any client/language you please but you may want to make sure it has SSL support by the time you get to DEFCON.

    -/tw/ will likely not be running for the tournament. I haven't decided on this though.

    -The system isn't perfect. You are welcome to use this fact to your advantage during the tournament. However, if something isn't working or simply feels wrong and it's not going to help you out, please share here so that I can fix it.


    Connection Details
    host: schemaverse.com
    post: 5432
    database: schemaverse


    -Abstrct
    http://defcon.schemaverse.com
Working...