プレイ日記
Stewart segludian1
I tried adapting some raycasting code I found at lodev•org/cgtutor/raycasting•html Unfortunately I have some bugs, the view falls apart when looking from certain angles. Not sure what I did wrong.
3そうだね
プレイ済み
返信[1]
親投稿
Stewart segludian1
This is a picture from a broken angle.
0そうだね
プレイ済み
返信[2]
親投稿
*J.P.* DEV NEWPICY3
oh cool, is it possible to go higher or make the walls taller?
0そうだね
プレイ済み
返信[3]
親投稿
Stewart segludian1
It is nothing fancy, very basic. Here is a shot of me trying to debug things. Seems at a certain point it just doesn't see walls anymore. Must be something with stepping from block edge to block edge.
0そうだね
プレイ済み
返信[4]
親投稿
SıмΞоп SimeonW
Stewart It took me about 20 minutes I copied the .C file to Notepad++ and used REGEX repeatedly to convert it all into SB code And sent it through PetitModem and it worked immediately
0そうだね
プレイ済み
返信[5]
親投稿
SıмΞоп SimeonW
Without VSYNC or WAIT it runs at roughly 30fps I'll send you guys the code The only modifications I did were give it GPAGE buffering The code is the exact same as the websìte, all comments were preserved I'll send you guys the code so you can use it for whatever I'm just suprised it uses only GLINE to draw, that could be sped up extremely, by turning it into GFILL, and making the step size > 1
0そうだね
プレイ済み
返信[6]
親投稿
SıмΞоп SimeonW
I'll delete this key eventually [N34KV4LX] But I hope I could help
0そうだね
プレイ済み
返信[7]
親投稿
SıмΞоп SimeonW
Oh and I just realized on line 120, VAR RED,GRE,BLU doesn't reset their values to 0 So it should be VAR RED=0,GRE=0,BLU=0 to prevent some blocks from randomly changing color
0そうだね
プレイ済み
返信[8]
親投稿
Stewart segludian1
Thanks!! That was a big help! It looks like my problem was a side distance y that I mistyped as side distance x. Copy paste strikes again. Now I have a question, is it me, or is the display mirrored? This is what I think it should look like.
0そうだね
プレイ済み
返信[9]
親投稿
Stewart segludian1
And here is my debug map. Where I un-mirrored it. I start scanning at red.
0そうだね
プレイ済み
返信[10]
親投稿
SıмΞоп SimeonW
Mirrored? Hm I don't know Yours seems to work really well though
0そうだね
プレイ済み
返信[11]
親投稿
SıмΞоп SimeonW
I guess you're right It must be backwards Strange
0そうだね
プレイ済み
返信[12]
親投稿
Stewart segludian1
Was getting ready to try texture mapping with 400 sprites when I generated this trippy image, thought I would share.
1そうだね
プレイ済み
返信[13]
親投稿
*J.P.* DEV NEWPICY3
oh wow cool. i have a question though, is it possible to make a map that builds itself as it goes BUT rebuilds in the same way when going back see im am working on a map generator which is going well, so it spawns items then it builds itself by deleting the prior map parts and spawning new tiles, but im wondering what i can use to make it biuld back the same way when going back.
1そうだね
プレイ済み
返信[14]
親投稿
*J.P.* DEV NEWPICY3
because right now it just builds itself differently when you go back making it always different.
1そうだね
プレイ済み
返信[15]
親投稿
Stewart segludian1
Now with textures! I actually expected the sprites to be faster than the line draws in the flat color version, but it is a little bit slower.
0そうだね
プレイ済み
返信[16]
親投稿
Stewart segludian1
It sounds like you are building the map based on a random number generator. Right? I am assuming SmileBasic is using something like a Merssenine twister for it's random number generator. In something like that, the next random number is based on the last one generated. You can however seed the random number generator with any starting value you like with randomize.
1そうだね
プレイ済み
返信[17]
親投稿
Stewart segludian1
So, if you reseed the random number generator with a given seed you should get the same random numbers out each time (assuming nothing else in the game uses them before you get to them). That does mean you have to keep track of a seed per re-creatable area. I wouldn't try it with small of slices. SmileBasic isn't too memory poor it should be able to generate pretty big worlds.
1そうだね
プレイ済み
返信[18]
親投稿
Stewart segludian1
I would try generating the world into an array then copying things into the bg pages as needed. Then you only have to generate things once. Even without a memory buffer you should be able to fit several screen fulls of data into the bg pages. Then you can use bgofs to scroll around.
0そうだね
プレイ済み
返信[19]
親投稿
Stewart segludian1
Lighting based on wall distance. An attempt anyway.
1そうだね
プレイ済み
返信[20]
親投稿
SıмΞоп SimeonW
You should made a background Sprite for the sky and ground Solid colors are boring Mode 7 on the ground maybe?
1そうだね
プレイ済み
返信[21]
親投稿
SıмΞоп SimeonW
Make*
0そうだね
プレイ済み
返信[22]
親投稿
SıмΞоп SimeonW
LOADING... to answer your question You need to use either perlin noise or the simplex noise algorithm You could try building your pen implementation of turning a 1 dimensional number generator into a 2 dimensional one But why do that, NOISE(X,Y,Z) is already on smilebasicsouce it smooths out the noise too, depending on how small x and y and z change
0そうだね
プレイ済み
返信[23]
親投稿
SıмΞоп SimeonW
own* not pen
0そうだね
プレイ済み