Well, a first guess is that there's no mesh named 'PlayerSmile1' in your scene (on a hidden, or active layer). You might want to make all sprites, put them in a group, and simply add a group instance of them all into each game scene. It's easier than trying to figure out which sprites you might have missed, and allows you to organize your sprites easier (across different scenes and layers, for example).
By the way, by 'mesh', I mean the actual mesh - not the object itself. Make sure the >mesh< of a player smile sprite frame is named 'PlayerSmile1', for example.
This is exactly the sort of tutorial I needed. Thanks! I am also new to blender, but I'm excited by the plethora of uses for it (game development and design for rapid-prototyping, in particular); plus, I'm beginning to learn some python, so BGE is somewhat of a godsend, having sought to break into game development for some time now.
I had a quick question about how my sprite renders. Though I've untoggled mipmaps, the resolution of my sprite is severely diminished in 3d view, but it looks normal in UV mapping: https://picasaweb.google.com/lh/photo/0BGA94obE2zkgDNC6YhizrVW0DEaEXHmW_EwbO5ZCUY?feat=directlink (not my design, by the way) I thought it had something to do with scaling in 3d view, but it seems to render the same way at any scale.
Thanks for thanking me. :) The problem you're experiencing is due to the fact that the texture is not sized to a power of 2. If it's not sized to a power of 2 (i.e. 128x128, 256x256x 512x256, etc.), Blender will interpolate it oddly. I believe that you can have rectangular sheets, but the width and height sizes should still be powers-of-two.
Thanks for that. It looks like I should have dug a bit deeper though: http://blenderartists.org/forum/showthread.php?227805-Mini-Tutorial-About-Pixel-Perfect-Sprites-in-the-BGE
Sure. At the top, there's a section named "BGE Resources". In that small list, there's a "2D Sprites" entry. Click on that to find the latest entry at the top (there's only one there currently, which is the latest verrsion).
I can't seem to get it to work. I followed the tutorial exactly and have even tried using the same object and mesh names. I don't get any errors and when I used the 'print' function, it was able to find the object, yet I can't get it to animate?
Hi SolarLune, I just follow your tutorial
ReplyDeletebut terminal gives me a error every frame:
ValueError: gameOb.replaceMesh(value): KX_GameObject, requested name "PlayerSmile1" did not match any KX_MeshProxy in this scene
Any step is wrong or...?
BTW, I am running Blender 2.62 on a intel Mac.
Well, a first guess is that there's no mesh named 'PlayerSmile1' in your scene (on a hidden, or active layer). You might want to make all sprites, put them in a group, and simply add a group instance of them all into each game scene. It's easier than trying to figure out which sprites you might have missed, and allows you to organize your sprites easier (across different scenes and layers, for example).
DeleteBy the way, by 'mesh', I mean the actual mesh - not the object itself. Make sure the >mesh< of a player smile sprite frame is named 'PlayerSmile1', for example.
DeleteThanks, now it works.
DeleteThe truth, I am new to Blender
and mixed what object is and what mesh is.
Your work is really cool, and I like "Soldier".
I will try to build one like that, :D
This is exactly the sort of tutorial I needed. Thanks! I am also new to blender, but I'm excited by the plethora of uses for it (game development and design for rapid-prototyping, in particular); plus, I'm beginning to learn some python, so BGE is somewhat of a godsend, having sought to break into game development for some time now.
ReplyDeleteI had a quick question about how my sprite renders. Though I've untoggled mipmaps, the resolution of my sprite is severely diminished in 3d view, but it looks normal in UV mapping: https://picasaweb.google.com/lh/photo/0BGA94obE2zkgDNC6YhizrVW0DEaEXHmW_EwbO5ZCUY?feat=directlink (not my design, by the way)
I thought it had something to do with scaling in 3d view, but it seems to render the same way at any scale.
Thanks in advance, and keep the tutorials coming!
Thanks for thanking me. :) The problem you're experiencing is due to the fact that the texture is not sized to a power of 2. If it's not sized to a power of 2 (i.e. 128x128, 256x256x 512x256, etc.), Blender will interpolate it oddly. I believe that you can have rectangular sheets, but the width and height sizes should still be powers-of-two.
DeleteThanks for that. It looks like I should have dug a bit deeper though: http://blenderartists.org/forum/showthread.php?227805-Mini-Tutorial-About-Pixel-Perfect-Sprites-in-the-BGE
DeleteSeems you've got it all pretty well covered.
hey solarlune i cant find were the sprites module is could you please help me
ReplyDeleteSure. At the top, there's a section named "BGE Resources". In that small list, there's a "2D Sprites" entry. Click on that to find the latest entry at the top (there's only one there currently, which is the latest verrsion).
DeleteHere's a direct link, as well:
http://solarlune-gameup.blogspot.com/2012/01/2d-sprites-v182.html
I can't seem to get it to work. I followed the tutorial exactly and have even tried using the same object and mesh names.
ReplyDeleteI don't get any errors and when I used the 'print' function, it was able to find the object, yet I can't get it to animate?
Odd. Are you running the script continuously (with the true pulse setting in the Always sensor on)?
Deletetrue pulse seemed to help, looks like the script is actually running now ^^"
Deletehad a couple other errors but I've figured them out now!
4 years using blender but the game engine in it still completely throws me...
Thanks for all your help and your games and tutorials are fantasmic.
best BGE tutorials I've found.
keep doing what you're doing ^^
(PS. I miss Sparky :3 what happened to that kooky, radioactive pup?)
hiii.
ReplyDeleteUr tutorials are very impressive.
I have a man character which have armature.Can u tel me the script so that i can move my character...
My sprite is shrinking when the animation plays...any reason for this?
ReplyDelete