v4nz666 / hairy-robot

Laseroids - Multi-player, browser-based space combat
2 stars 0 forks source link

ship failed to render properly on load #70

Closed v4nz666 closed 10 years ago

v4nz666 commented 10 years ago

I can assure you, this was a pretty bad-ass looking ship :) shipbuilder

LordMonoxide commented 10 years ago

Shit... if they're magenta, that's the default renderer. Maybe it failed to get the parts list?

LordMonoxide commented 10 years ago

Can you paste the json?

v4nz666 commented 10 years ago

@LordMonoxide - Not sure what happened... when I saved, and reloaded, this is what loaded. It seems to know where the pieces are that it's not rendering, since I can't add them where pieces should be, but that should look more like

v4nz666 commented 10 years ago

[{"id":"1","x":8,"y":6},{"id":"1","x":8,"y":5},{"id":"1","x":8,"y":4},{"id":"1","x":8,"y":3},{"id":"1","x":8,"y":2},{"id":"1","x":7,"y":6},{"id":"1","x":6,"y":6},{"id":"1","x":6,"y":5},{"id":"1","x":6,"y":4},{"id":"1","x":8,"y":7},{"id":"1","x":6,"y":7},{"id":"1","x":4,"y":6},{"id":"1","x":5,"y":6},{"id":"1","x":9,"y":6},{"id":"1","x":10,"y":6},{"id":"1","x":3,"y":5},{"id":"1","x":3,"y":4},{"id":"1","x":3,"y":3},{"id":"1","x":3,"y":2},{"id":"1","x":2,"y":2},{"id":"1","x":2,"y":3},{"id":"1","x":2,"y":4},{"id":"1","x":2,"y":5},{"id":"1","x":2,"y":6},{"id":"1","x":3,"y":6},{"id":"1","x":3,"y":1},{"id":"1","x":4,"y":0},{"id":"1","x":5,"y":0},{"id":"1","x":11,"y":5},{"id":"1","x":11,"y":4},{"id":"1","x":11,"y":3},{"id":"1","x":11,"y":2},{"id":"1","x":11,"y":1},{"id":"1","x":10,"y":0},{"id":"1","x":9,"y":0},{"id":"1","x":12,"y":2},{"id":"1","x":12,"y":3},{"id":"1","x":12,"y":4},{"id":"1","x":12,"y":5},{"id":"1","x":12,"y":6},{"id":"1","x":11,"y":6},{"id":"1","x":13,"y":4},{"id":"1","x":13,"y":5},{"id":"1","x":13,"y":6},{"id":"1","x":13,"y":7},{"id":"1","x":12,"y":9},{"id":"1","x":10,"y":8},{"id":"1","x":10,"y":9},{"id":"1","x":11,"y":10},{"id":"1","x":10,"y":10},{"id":"1","x":10,"y":11},{"id":"1","x":9,"y":11},{"id":"1","x":4,"y":8},{"id":"1","x":4,"y":9},{"id":"1","x":4,"y":10},{"id":"1","x":4,"y":11},{"id":"1","x":5,"y":11},{"id":"1","x":3,"y":10},{"id":"1","x":2,"y":9},{"id":"1","x":1,"y":7},{"id":"1","x":1,"y":6},{"id":"1","x":1,"y":5},{"id":"1","x":1,"y":4},{"id":"1","x":6,"y":8},{"id":"1","x":8,"y":8},{"id":"1","x":1,"y":8},{"id":"1","x":3,"y":11},{"id":"1","x":2,"y":10},{"id":"1","x":1,"y":9},{"id":"1","x":0,"y":7},{"id":"1","x":0,"y":6},{"id":"1","x":0,"y":8},{"id":"1","x":11,"y":11},{"id":"1","x":12,"y":10},{"id":"1","x":13,"y":9},{"id":"1","x":13,"y":8},{"id":"1","x":14,"y":8},{"id":"1","x":14,"y":7},{"id":"1","x":14,"y":6},{"id":"1","x":4,"y":1},{"id":"1","x":10,"y":1}]

LordMonoxide commented 10 years ago

Looks well-formed to me... in your database, does the hull piece's ID = 1?

v4nz666 commented 10 years ago

mysql> select * from space_ships where id = 3\G *** 1. row *** id: 3 space_user_id: 15 name: dralthi json: [{"id":"1","x":8,"y":6},{"id":"1","x":8,"y":5},{"id":"1","x":8,"y":4},{"id":"1","x":8,"y":3},{"id":"1","x":8,"y":2},{"id":"1","x":7,"y":6},{"id":"1","x":6,"y":6},{"id":"1","x":6,"y":5},{"id":"1","x":6,"y":4},{"id":"1","x":8,"y":7},{"id":"1","x":6,"y":7},{"id":"1","x":4,"y":6},{"id":"1","x":5,"y":6},{"id":"1","x":9,"y":6},{"id":"1","x":10,"y":6},{"id":"1","x":3,"y":5},{"id":"1","x":3,"y":4},{"id":"1","x":3,"y":3},{"id":"1","x":3,"y":2},{"id":"1","x":2,"y":2},{"id":"1","x":2,"y":3},{"id":"1","x":2,"y":4},{"id":"1","x":2,"y":5},{"id":"1","x":2,"y":6},{"id":"1","x":3,"y":6},{"id":"1","x":3,"y":1},{"id":"1","x":4,"y":0},{"id":"1","x":5,"y":0},{"id":"1","x":11,"y":5},{"id":"1","x":11,"y":4},{"id":"1","x":11,"y":3},{"id":"1","x":11,"y":2},{"id":"1","x":11,"y":1},{"id":"1","x":10,"y":0},{"id":"1","x":9,"y":0},{"id":"1","x":12,"y":2},{"id":"1","x":12,"y":3},{"id":"1","x":12,"y":4},{"id":"1","x":12,"y":5},{"id":"1","x":12,"y":6},{"id":"1","x":11,"y":6},{"id":"1","x":13,"y":4},{"id":"1","x":13,"y":5},{"id":"1","x":13,"y":6},{"id":"1","x":13,"y":7},{"id":"1","x":12,"y":9},{"id":"1","x":10,"y":8},{"id":"1","x":10,"y":9},{"id":"1","x":11,"y":10},{"id":"1","x":10,"y":10},{"id":"1","x":10,"y":11},{"id":"1","x":9,"y":11},{"id":"1","x":4,"y":8},{"id":"1","x":4,"y":9},{"id":"1","x":4,"y":10},{"id":"1","x":4,"y":11},{"id":"1","x":5,"y":11},{"id":"1","x":3,"y":10},{"id":"1","x":2,"y":9},{"id":"1","x":1,"y":7},{"id":"1","x":1,"y":6},{"id":"1","x":1,"y":5},{"id":"1","x":1,"y":4},{"id":"1","x":6,"y":8},{"id":"1","x":8,"y":8},{"id":"1","x":1,"y":8},{"id":"1","x":3,"y":11},{"id":"1","x":2,"y":10},{"id":"1","x":1,"y":9},{"id":"1","x":0,"y":7},{"id":"1","x":0,"y":6},{"id":"1","x":0,"y":8},{"id":"1","x":11,"y":11},{"id":"1","x":12,"y":10},{"id":"1","x":13,"y":9},{"id":"1","x":13,"y":8},{"id":"1","x":14,"y":8},{"id":"1","x":14,"y":7},{"id":"1","x":14,"y":6},{"id":"1","x":4,"y":1},{"id":"1","x":10,"y":1}] created_at: 2013-10-28 23:24:10 updated_at: 2013-10-28 23:24:10 1 row in set (0.01 sec)

LordMonoxide commented 10 years ago

Can you give me a dump of the ship_parts table as well?

v4nz666 commented 10 years ago

select * from space_parts; +----+--------------------+------+--------------------------------+------+--------------------------------------------------+------+ | id | space_part_type_id | name | desc | mass | render | cost | +----+--------------------+------+--------------------------------+------+--------------------------------------------------+------+ | 1 | 1 | Hull | A 64x64m² section of hull | 1 | ctx.fillStyle="magenta";ctx.fillRect(0,0,16,16); | 0 | +----+--------------------+------+--------------------------------+------+--------------------------------------------------+------+

v4nz666 commented 10 years ago

This likely has something to do with it... when I remove pieces.. even in a not so ridiculous way, it doesn't reload correctly

before after

LordMonoxide commented 10 years ago

Take a look at the console when it's loading that ship... all kinds of "piece too far away"s. I'm guessing pieces aren't getting added in order so pieces that have gaps between them refuse to add

v4nz666 commented 10 years ago

yeah, you got it... sorry I didn't just paste that in :/

v4nz666 commented 10 years ago

Nice! dralthi

LordMonoxide commented 10 years ago

That looks pretty awesome, but for some reason you have the magenta rendering code in your part row. Shit, did I forget to tell you to artisan db:seed? It'll delete your ship, but you can just copy/paste the json code into a new row once it's created

v4nz666 commented 10 years ago

oh, that's much better :) rockets!