{"author_name":"ArmchairArmada","cat":"LD #12 - The Tower - 2008","comments":[{"author_name":"","time":"August 9, 2008 2:02 pm","epoch":1218308520,"text":"Have you tried using Soya?  It&#8217;s a 3D engine for Python that has a lot of stuff you might need already pre-built.","spam":"N"},{"author_name":"ArmchairArmada","time":"August 9, 2008 2:10 pm","epoch":1218309000,"text":"It might have been a good idea for me to use an existing 3d engine &#8230; but I wanted to try to write a simple engine from scratch.  I thought it would be fun!","spam":"N"},{"author_name":"RB0","time":"August 9, 2008 3:05 pm","epoch":1218312300,"text":"I remember doing the same thing during a Pyweek once, rewrote the code almost a dozen times. Then abandoned the idea and moved on. Ended up being just a couple things I missed really.","spam":"N"},{"author_name":"ArmchairArmada","time":"August 12, 2008 7:34 am","epoch":1218544440,"text":"I forgot to mention it earlier, but I figured out how to speed it up quite a bit.  I was using a simple 3D grid of cells for a spacial partitioning system with each cell containing the triangles that intersect with it.  A lot of the slowdown problem had to do with how Python works.  I found that dictionaries are A LOT faster than arrays, so I decided to use dictionaries as arrays.  They dictionary keys were simply [z * width * height + y * width + x].  It sounds a little stupid, but the speed increase was amazing.  I went from only being able to comfortably do about 7 ray-triangle tests per frame to being able to do around 70 &#8212; which would have permitted me to have around 20-25 moving objects (with around 3 ray-triangle tests per object).  Unfortunately, this realization came after MANY hours of frustration, leaving me no time to actually complete the game.","spam":"N"},{"author_name":"ArmchairArmada","time":"August 12, 2008 7:38 am","epoch":1218544680,"text":"You mentioned C++.  I decided not to use C++ mainly because I thought development time would have been significantly shortened with Python.  C++ requires a lot of extra typing and any change that&#8217;s made requires editing a lot of other bits of code.  With that said, however, if I used C++ I estimate I would have been able to do thousands of ray-triangle tests per frame.  Python is VERY slow.","spam":"N"}],"epoch":1218308220,"likes":0,"metadata":{"p_key":"74751","p_author":"ArmchairArmada","p_authorkey":"317","p_urlkey":"110583","p_title":"Banging My Head For What???","p_cat":"LD #12 - The Tower - 2008","p_event":"LD12","p_time":"1218308220","p_likes":"0","p_comments":"5","p_status":"UPD5","us_key":"317","us_name":"ArmchairArmada","us_username":"armchairarmada","event_start":"1218153600","event_key":"89","event_name":"LD12"},"text":"<p>I spent the past couple of hours trying to get a simple spacial partitioning system working so ray\/triangle intersection tests between game objects and the world mesh would be reasonably quick &#8230; or so I hoped.\u00a0 On my machine the frame rate drops horribly with even as few as 10 intersection tests per frame!\u00a0 I guess Python&#8217;s not a good platform to write a 3D engine in.\u00a0 <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/frownie.png\" alt=\":(\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ld12\/\" rel=\"tag\">LD #12 - The Tower - 2008<\/a><\/p>","time":"August 9th, 2008 1:57 pm","title":"Banging My Head For What???"}