• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Problem with vector sprites rendering

M

mu112

Guest
Hello, I need help with a problem with rendering swf vector sprites. It happens when a rotation and/or resizing is applied. In a screenshot below you can see clearly visible thin black lines going through the diagonals of some of the squares. Source swf image does not containt these lines of course so they shouldnt be there. When testing I found out that it has something to do with AA because when I turned it off the lines aren't there. But turning off AA isn't an option because then the rotated squares have really ugly lines.

Screenshot:


Source code for the example:
Code:
texture_set_interpolation(true);
display_reset(8, true);

var cycle;
for(cycle=1;cycle<=100;cycle++){
  with(instance_create(random(1600), random(900), obj_test)){
    image_xscale=random(0.2)+0.1;
    image_yscale=image_xscale;
    image_angle=random(360);
  }
}
Interpolation have no effect on the problem. The sprite was created in Inkscape then saved as svg and then converted to swf with svg2swf. Original size of the sprite is 512x512px.

Thank you for any ideas. If you need more information just ask, please.
 
M

mu112

Guest
are the squares mapped to a texture?
I'm new to Game Maker, so I'm not sure what you mean by texture. The swf square is loaded as a sprite and set to object (obj_test) as it's sprite. In the room creation code the instances of obj_test are drawn.

Edit: I tried to check "Used for 3D" in texture settings of the sprite but it didn't help. Also changing the quality slider from 50 to 100 didn't change anything.
 
M

mu112

Guest
If anyone in the future will have this problem - it had something to do with the Inkscape and/or svg2swf. I tried creating the same sprite in Adobe Flash and exporting it to swf and it is working good without the diagonal line problem. So there was probably something wrong with the file formatting or with the way Game Maker renders the file saved/converted from Inkscape/svg2swf.
 

RyanC

Member
I would just like to say that using vectors in GMS was probably the biggest mistake that I ever made! My advice would be to get out now while you still have the chance to go back to sprites.

3 months ago I hired the software from Adobe, converted all my vectors to swf and then it took two months to get them looking the same in GMS, after that I realised that GMS uses a texture page for every single vector, more than one if you have gradients. My game had over 1000 texture swaps on certain levels so I was forced to develop a system that converted them back to sprites, because I didn't have the software to re-export them.

Then after upgrading GMS They all had problems again so I spent another week fixing them, I recently began testing on Android and guess what... over 15 of them have issues again with strange lines and transparency issues! Seriously anyone using vectors in GMS is going to regret it in my opinion!

It's been about 3 or 4 months and now I'm even considering capturing them and exporting from GMS and loading them all back in as sprites.
 
Last edited:
I

Insanebrio

Guest
You can apply aa to swf with
draw_enable_swf_aa(1)
draw_set_swf_aa_level(8)
Anyway, swf files have some problems with rendering (both with or without aa), and you cant use gradients, so i never started used them
 
K

KriLL

Guest
I would just like to say that using vectors in GMS was probably the biggest mistake that I ever made! My advice would be to get out now while you still have the chance to go back to sprites.

3 months ago I hired the software from Adobe, converted all my vectors to swf and then it took two months to get them looking the same in GMS, after that I realised that GMS uses a texture page for every single vector, more than one if you have gradients. My game had over 1000 texture swaps on certain levels so I was forced to develop a system that converted them back to sprites, because I didn't have the software to re-export them.

Then after upgrading GMS They all had problems again so I spent another week fixing them, I recently began testing on Android and guess what... over 15 of them have issues again with strange lines and transparency issues! Seriously anyone using vectors in GMS is going to regret it in my opinion!

It's been about 3 or 4 months and now I'm even considering capturing them and exporting from GMS and loading them all back in as sprites.

Hi

I have built my whole game using swf and dont seem to have any of the problems that you are having. However I dont use any gradients in my game at all. I do have some transparency though but these seem to work fine even if they throw up a warning when it compiles. One thing that I found can cause issues though is strokes around vectors that are exported as flash. I had to expand the vectors to then render the stroke as a shape.
 
Last edited by a moderator:
Top