• 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!

[RESOLVED] 3d doom sprite space time distortion graphical error thingy

S

siggi

Guest
Hello world! (moslty gamemaker forums)

im using the old fps tutorial mark overmars wrote to make a short 3d adventure game, but pretty much every graphic is just that sprite-on-a-wall-facing-the-camera trick, aka doom sprites. iv done this in earlier versions of gm and it worked, but theres this weird graphical error im getting with this one (standard v1.4 with the green and black 1337zorz color scheme) - when facing one of these wall doom thingy sprites (the moving player bit is already coded) from the "front" or "back" (one direction, 180 degrees) theres a black box around it that blocks sprites behind it. from the other direction it behaves normally, no extra box block, just whatever pixels it has. all sprites are custom 8x8/16x16 stock color deliciousness, with the used for 3d box checked, centered origin, i dont know what of this could be turning my little pixel people into continuum warping aberrations of gml. the room has views unchecked; im keeping an activate/deactivate instance field active around the player at all times, former slightly smaller than latter; fps is smooth, im just totes stumped. any help is appreciated, and sorry for the big@$$ wall of text. have a nice day/night :)

Edit:
Code:
d3d_draw_wall(x-(sprite_width/2)*global.ss,y-(sprite_width/2)*global.cc,sprite_height,x+(sprite_width/2)*global.ss,y+(sprite_width/2)*global.cc,0,sprite_get_texture(sprite_index,image_index),1,1);
code in afflicted sprite thingy
 
Q

Quackertree

Guest
Have you turned shadows off (d3d_set_lighting(...))? Fog could also be an issue here (although it really shouldn't, but just might be).

Other than that: No clue.
 
S

siggi

Guest
lighting on/off, fog on/off - still the evil black box of blindness persists! thank you though :)
 
R

renex

Guest
You need to sort these instances so that the ones furthest away draw first.

try adding this to the step event of them.

Code:
depth=point_distance(x,y,<<camera object>>.x,<<camera object>>.y)
Replace <<camera object>> with the handle to your camera object.
 
S

siggi

Guest
soz for late reply, haha it worked! isnt that what "perspective_enable" should do or something? thank you so much for the help!

def not my bug squashing victory dance

my first gif yay
 
S

siggi

Guest
hello again world sincerest apogees for raising this long-rotted and awful-gif-infested thread from the dead but on rereading the overmars fps tutorial behold

"There is one important issue. As the edges of the sprite are partially transparent (by smoothing them) we have to be careful with the order in which objects are drawn. Partially transparent (alpha blended) sprites are only blended with objects that have been drawn earlier. To get the required effect alpha blended sprites must be drawn after all other objects are drawn. This can easily be achieved by giving the plant objects (and others ones) a negative depth. The result of adding some plants looks like this:"

tested and works perfectly, no black boxes blocking anything from any direction! the depth of the wall needs to be less than the camera/projection-handling objects depth methinks; though this doesnt seem to be a common problem round these parts it seemed worth posting for a cool boost to any yall's doom clones' fps c:
 
Top