google-code-export / gummworld2

Automatically exported from code.google.com/p/gummworld2
Other
2 stars 0 forks source link

Scrollbuffer crash with too many tiles #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Load a big map a big map (1000*1000 for example) in scrollmap.py 
2.Move right or down until the program crash

Here the traceback :

Traceback (most recent call last):
  File "E:\DEV\pygame_projects\tests\gamelib\scrollbuffer\scrollbuffer.py", line 445, in <module>
    main()
  File "E:\DEV\pygame_projects\tests\gamelib\scrollbuffer\scrollbuffer.py", line 423, in main
    sbuf.render(world_map.get_tiles_in_rect)
  File "E:\DEV\pygame_projects\tests\gamelib\scrollbuffer\scrollbuffer.py", line 180, in render
    tiles = [t for t in get_tiles(dirty_world_x) if collides(t.rect)]
AttributeError: 'NoneType' object has no attribute 'rect'

Original issue reported on code.google.com by yoan.lec...@gmail.com on 14 Aug 2011 at 4:50

GoogleCodeExporter commented 9 years ago
Hi, thanks for reporting this issue. I recall this issue has been corrected, 
but the download was tagged as deprecated because it is in experimental flux. 
(The deprecated tag is now removed, you'll find it in the normal download area.)

Please try scrollbuffer01.zip and let me know if your issue is indeed fixed.

Original comment by stabbing...@gmail.com on 14 Aug 2011 at 8:16

GoogleCodeExporter commented 9 years ago
I don't have this error anymore. Now I have a memory error, because the python 
process exceed 2gb for this 1000*1000 tile map.
I guess your lib doesn't fit to my project.
But nice work :)

Original comment by yoan.lec...@gmail.com on 14 Aug 2011 at 8:53

GoogleCodeExporter commented 9 years ago
If you're hitting a memory bottleneck, you may wish to take a look at the 
tiled2 branch.

https://gummworld2.googlecode.com/svn/branches/tiled2

It has a SuperMap class that seamlessly connects (auto-load, -display, and 
-unload) multiple maps. Thus, you can make larger virtual maps out of smaller 
Tiled maps that will fit in a much smaller memory footprint.

Thanks for the compliment. :)

Original comment by stabbing...@gmail.com on 14 Aug 2011 at 11:36

GoogleCodeExporter commented 9 years ago
Seems interesting, I'll check that.

But I was wondering : a 1000*1000 tile map is 1 000 000 tiles. To occupy 2GB, 
that's 2KB per tile. It seems huge. That's because the texture of a tile is 
loaded for everty tile even if the tile is not visible on the camera? 

Original comment by yoan.lec...@gmail.com on 15 Aug 2011 at 10:19

GoogleCodeExporter commented 9 years ago
I'd be happy to assist further. I feel I don't enough information to form a 
succinct reply, and this has ventured away from the original issue. Would you 
mind continuing our discussion on the mailing list mentioned on this site's 
home page, or mail stabbingfinger at gmail.

Original comment by stabbing...@gmail.com on 15 Aug 2011 at 9:19

GoogleCodeExporter commented 9 years ago

Original comment by stabbing...@gmail.com on 15 Aug 2011 at 9:20