Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 2:31 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Tileset too large error
PostPosted: Mon May 02, 2011 3:08 pm 
Offline

Joined: Mon May 02, 2011 3:00 pm
Posts: 16
Hi, when I tried to load the game after making a simple map in tiled it starts to run, comes up with a black screen, then crashes with an io error.

Attempt to allocate a texture to big for the current hardware

I have a pretty decent computer, and it should have no problem loading this. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2011 3:44 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
this is a pretty easy one, obviously your GraCa can't make a texture (probatly the tileset you are using) which is "insert size here".

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2011 2:55 am 
Offline

Joined: Mon May 02, 2011 3:00 pm
Posts: 16
I am new to slick2d and have only used it for two days.

What is my "GraCa?"

I shrunk down the tileset and made it extremely small. The map itself has been shrunk down. Same problem. I am also having a problem getting the correct size for my sprites, were each frame is 32x32 on a 128x128 sheet. This means that is should be 4x4. But this isn't tiled so I will make help for that elsewhere.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2011 8:43 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
I think your graCa is your Graphic Card :D

About your problem: can you post stacktrace of your error?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2011 2:58 am 
Offline

Joined: Mon May 02, 2011 3:00 pm
Posts: 16
GraCa is a weird way to say Graphics card. I think the issue is not clearly my graphics card. I made the image quite small (like 400x800) and I have 512mb gpu(a shorter and more clear way of saying graphics card).

Here is the complete error netbeans is giving me. I believe this is the stack trace, but I am not sure. I think my teacher told me this was what was happening with the stack during class one time.

Code:
Tue May 03 21:55:00 CDT 2011 INFO:Slick Build #274
Tue May 03 21:55:00 CDT 2011 INFO:LWJGL Version: 2.0b1
Tue May 03 21:55:00 CDT 2011 INFO:OriginalDisplayMode: 1440 x 900 x 24 @50Hz
Tue May 03 21:55:00 CDT 2011 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Tue May 03 21:55:00 CDT 2011 INFO:Starting display 800x600
Tue May 03 21:55:00 CDT 2011 INFO:Use Java PNG Loader = true
Failed to open device (/dev/input/event8): Failed to open device /dev/input/event8 (13)

Failed to open device (/dev/input/event7): Failed to open device /dev/input/event7 (13)

Failed to open device (/dev/input/event6): Failed to open device /dev/input/event6 (13)

Failed to open device (/dev/input/event4): Failed to open device /dev/input/event4 (13)

Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)

Failed to open device (/dev/input/event2): Failed to open device /dev/input/event2 (13)

Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)

Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)

Linux plugin claims to have found 0 controllers
Tue May 03 21:55:00 CDT 2011 INFO:Found 0 controllers
Tue May 03 21:55:01 CDT 2011 ERROR:Attempt to allocate a texture to big for the current hardware
java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Tue May 03 21:55:01 CDT 2011 ERROR:Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
org.newdawn.slick.SlickException: Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
        at org.newdawn.slick.Image.<init>(Image.java:199)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Caused by: java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        ... 8 more
Tue May 03 21:55:01 CDT 2011 ERROR:Failed to parse tilemap
org.newdawn.slick.SlickException: Failed to parse tilemap
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:480)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Caused by: org.newdawn.slick.SlickException: Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
        at org.newdawn.slick.Image.<init>(Image.java:199)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        ... 6 more
Caused by: java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        ... 8 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2011 6:29 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
LegendHoly wrote:
GraCa is a weird way to say Graphics card. I think the issue is not clearly my graphics card. I made the image quite small (like 400x800) and I have 512mb gpu(a shorter and more clear way of saying graphics card).


No it's complety "legal". The first to syllables of the 2 words oO

Quote:
Here is the complete error netbeans is giving me. I believe this is the stack trace, but I am not sure. I think my teacher told me this was what was happening with the stack during class one time.


Don't get me wrong, but you should know something basic like that^^
And if you not sure what the stacktrace is (yes this one here is one) you probatly have errors in your code.

Code:
Tue May 03 21:55:00 CDT 2011 INFO:Slick Build #274
Tue May 03 21:55:00 CDT 2011 INFO:LWJGL Version: 2.0b1
Tue May 03 21:55:00 CDT 2011 INFO:OriginalDisplayMode: 1440 x 900 x 24 @50Hz
Tue May 03 21:55:00 CDT 2011 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Tue May 03 21:55:00 CDT 2011 INFO:Starting display 800x600
Tue May 03 21:55:00 CDT 2011 INFO:Use Java PNG Loader = true
Failed to open device (/dev/input/event8): Failed to open device /dev/input/event8 (13)

Failed to open device (/dev/input/event7): Failed to open device /dev/input/event7 (13)

Failed to open device (/dev/input/event6): Failed to open device /dev/input/event6 (13)

Failed to open device (/dev/input/event4): Failed to open device /dev/input/event4 (13)

Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)

Failed to open device (/dev/input/event2): Failed to open device /dev/input/event2 (13)

Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)

Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)

Linux plugin claims to have found 0 controllers
Tue May 03 21:55:00 CDT 2011 INFO:Found 0 controllers
Tue May 03 21:55:01 CDT 2011 ERROR:Attempt to allocate a texture to big for the current hardware
java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Tue May 03 21:55:01 CDT 2011 ERROR:Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
org.newdawn.slick.SlickException: Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
        at org.newdawn.slick.Image.<init>(Image.java:199)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Caused by: java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        ... 8 more
Tue May 03 21:55:01 CDT 2011 ERROR:Failed to parse tilemap
org.newdawn.slick.SlickException: Failed to parse tilemap
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:480)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
        at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
        at jarclipseclient.client.init(client.java:60)
        at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
        at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
        at jarclipseclient.client.main(client.java:44)
Caused by: org.newdawn.slick.SlickException: Failed to load image from: /home/james/likenstuff/graphics/tilesets/1.png
        at org.newdawn.slick.Image.<init>(Image.java:199)
        at org.newdawn.slick.tiled.TileSet.<init>(TileSet.java:113)
        at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447)
        ... 6 more
Caused by: java.io.IOException: Attempt to allocate a texture to big for the current hardware
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:293)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:231)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        ... 8 more


Well there are a lot of errors. So i guess there errors in your code. an maybe your "decent" graphic crad does not support texture above 512x512 ;)
[/quote]

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2011 12:30 am 
Offline
Regular

Joined: Sun Dec 07, 2008 5:22 am
Posts: 238
Location: Vancouver, BC, Canada
Sounds like a problem with the maximum texture size.
The following code will tell you what the max texture size is.
Code:
System.out.println(GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE));

That being said TiledMap should maybe refractorred to use BigImage

_________________
If at first quads don't succeed tri tri again.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2011 1:43 am 
Offline

Joined: Mon May 02, 2011 3:00 pm
Posts: 16
Ok, I found out how to do a stack trace using some code after talking to my teacher. My teacher has just never used that term, which I guess is not a good thing considering I graduate next year and have been coding in java for a couple of years now.

I will test what the maximum is that I am allowed. How do I know what the size of the texture is?

The size it says that is allowed is 3379.

This is however after changing the code snippet given to
Code:
System.out.println(GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE));


Edit: Also, I copied and pasted in some code to test from a tutorial. I am going to go ahead and write my own and see if I still end up getting the same problem when loading maps. If I don't have this problem then I guess I won't need the help.

Could someone still explain how to check a texture size? Thanks, LH


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2011 6:41 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Okay it looks like you lack a lot of ground in OpenGL right?

texture size is always a power of 2 like 2^8 = 256x 256. An image is always set in a texture with a pow 2 size.
the code chrono posted should give you the MAXIMUM texture size your graphic card supports.

The size you posted can't be right... it's not even a power of 2 o.o that's strange to tell the truth.

also update your LWJGL as fast as possible. you have 2.0 and there is 2.7.1 already^^

Could you post a bit of the code your using (and where you use it), and the tileset you are using for the map.

btw, your teacher does not use the word stacktrace? It's just the way the exception goes ( the methods it passes until it reaches a catch or the main method). Hope that explains it as simple as it actually is :D

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2011 8:12 am 
Offline

Joined: Mon May 02, 2011 3:00 pm
Posts: 16
Yes, that does help. I talked to him today and he explained what it was to me, so I know now.

Ok, I will update LWJGL. Also, for some reason, my own code and not the sample code works, really well too. I got the sample code from this site https://thejavablog.wordpress.com/2008/ ... te-a-game/.

It is from 2008 so perhaps that helped cause problems? I made my own map with my own tileset, and created my own sprite. And I got the error.

Thanks for your help guys. I will say that this is solved now. Sorry to trouble you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2011 9:04 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Try to use always your own code, and if you just can't make it work, just ask here or use the Slick Wiki as reference. Also have an I on the source Code. it often helps to understand HOW the underlying System works :)

That's the way I work. Tho I also have a tiny little skill in OpenGL^^

The Tutorial is old and very very heavy written. using Image Arrays just for the Animation and so on (SpriteSheet is way better).

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group