プレイ日記
*J.P.* DEV NEWPICY3
whut ok so i wanted to know if anyone was willing to teach me raycasting as ive wondered a long time about this.. just the way it works and how it works in fairly simple terms, thanks guys! also how have i not heard of this?!
3そうだね
プレイ済み
返信[1]
親投稿
Aaron Krondelo
Just a heads up, RayCasting is extremely complex for a beginner, and requires some fairly high level math.
0そうだね
プレイ済み
返信[2]
親投稿
Darkcon SGMXZYDarkcon354
doom, 3d nukem, nice day for games major leap then but it was heavy on 286, 386 and 486 systems, am i that old...you was lucky if it ran on a 286, the nintendo 3ds is a super computer for that timeline!
1そうだね
プレイ済み
返信[3]
親投稿
Darkcon SGMXZYDarkcon354
if i remember does n3ds use a arm processor or maybe i'm thinking of my cellphone?
0そうだね
プレイ済み
返信[4]
親投稿
Stewart segludian1
Ok, to start with, raycasting like in Wolfenstein-3D or Spooky Maze isn't really 3D, it just looks 3D. For this type of game, the world is a two dimensional grid. Each location on the grid is either one of various wall types or an empty section of floor. Each wall type has a texture/image. Easy so far, I hope. The player is at a point in the game world and is looking in a direction.
0そうだね
プレイ済み
返信[5]
親投稿
Stewart segludian1
The player has a field of view. It is how much they can see to the left and right. Normally this is 60° or 90°. The algorithm works on columns. You scan from the players location and angle minus half the field of view to the players angle and location plus half the field of view. For each column you figure out how far a ray would go from the player's location along the calculated angle for the col
1そうだね
プレイ済み
返信[6]
親投稿
Stewart segludian1
along the calculated angle for that column before hitting a wall. In fact you need to figure out where on that block it would hit. From the location on the block you can figure out which column of the block's texture/image to draw. Using the distance you can figure how big to scale it. Then draw the scaled column of the block's image/texture with a ceiling color above and a floor color after.
0そうだね
プレイ済み
返信[7]
親投稿
Stewart segludian1
If you can find it, chapter 6 of 1994's Tricks of the Game Programming Gurus by LaMothe, Ratcliff, Seminatore, and Tyler covers it extensively in DOS C code.
0そうだね
プレイ済み
返信[8]
親投稿
Stewart segludian1
Or you could just look at the spooky maze code. The author kindly made a raycating library to help you make your own 3D-ish games. Doom actually uses something else called a BSP tree. Not sure if you can do that in SmileBasic with no pointers, but it allows for non-grid geometry. However it wasn't really 3D either, but Quake was.
0そうだね
プレイ済み
返信[9]
親投稿
*J.P.* DEV NEWPICY3
ah thank you! but btw @Aaron im not a beginner, ive been coding for a while now and have learned a lot, just saying.
1そうだね
プレイ済み
返信[10]
親投稿
Darkcon SGMXZYDarkcon354
wow i never thought it was done with binary space partitioning tree.... :)
0そうだね
プレイ済み
返信[11]
親投稿
Darkcon SGMXZYDarkcon354
thx for correcting me on how dos version of doom was made stewart
0そうだね
プレイ済み
返信[12]
親投稿
*J.P.* DEV NEWPICY3
hmm.. so I have more questions. the walls and objects, are they sprites? or are they bg tiles? also how do they bend to the grid used; ive tried to bend sprites in certain ways but I have never found out how to bend them in a way that turn certain angles.. but ill be reading the thingy now thanks!
0そうだね
プレイ済み
返信[13]
親投稿
Aaron Krondelo
Sorry, I know it sounded that way. I know you've gotten pretty good with SB, I didn't even know all that, what Stewart said. I've seen on YT vid a while back, for using ray-casting in a top down 2-d for lighting and stealth detection. It was pretty advanced, way over my head math wise.
0そうだね
プレイ済み
返信[14]
親投稿
*J.P.* DEV NEWPICY3
so i learned a lot about it and now i was wondering if theres a way to make it full screen like in spooky maze because my current one is like this. also im feeling very good to it and teally wanna learn more, might make a demo game with it.
0そうだね
プレイ済み
返信[15]
親投稿
Jacob KulcakKid4
Wow, just wow. How did I not see this?
0そうだね
プレイ済み
返信[16]
親投稿
*J.P.* DEV NEWPICY3
I honestly don't know
0そうだね
プレイ済み
返信[17]
親投稿
crazy pro Jakob13009
this is my raycast thingy
0そうだね
プレイ済み
返信[18]
親投稿
*J.P.* DEV NEWPICY3
ok.
1そうだね
プレイ済み
返信[19]
親投稿
Aaron Krondelo
lol.
0そうだね
プレイ済み