Petit Computer Wiki:Chat/Logs/25 September 2013

 [11:56]  you missed some things, I guess I'll point out the line numbers when I see them [11:56]  AHA I found them. [11:56]  Y on line 179 [11:56]  First succesful rotation [11:56]  Y on line 188 [11:57]  COLLY as well [11:57]  you found another I was missing [11:57]  that's why the walls didn't draw right [11:57]  omg [11:57]  this so so awesome [11:57]  I think SLICE should be floating-point, but that's not important right now [11:57]  you got it working? [11:57]  somewhat! [11:58]  I'll post the working code [11:58]  Congratulations! [11:58] <GimmeMoreCoinz> still can't walk foreward but the 3d rotation kind of works [11:59] <Calc84maniac> by the way, line 110 should be J=I+Q if you don't want those weird spaces [11:59] <Calc84maniac> and you can set Q=1, since speed's not really an issue [11:59] <GimmeMoreCoinz> calc [11:59] <GimmeMoreCoinz> http://pastebin.com/2niuQ6N0 [11:59] <GimmeMoreCoinz> you can directly paste this into the playbasic [11:59] <GimmeMoreCoinz> and it should work with some rotation [11:59] <GimmeMoreCoinz> I dont know what else i'm missing it seems off [11:59] <GimmeMoreCoinz> but it renders again no more black screen [12:00] <Calc84maniac> okay, next let's make DIST floating-point [12:01] <GimmeMoreCoinz> kay [12:02] <GimmeMoreCoinz> omg that caused the corners of walls to show up [12:02] <GimmeMoreCoinz> WOO [12:08] <GimmeMoreCoinz> okay calc I changed this so that Slice is a float and it messed up some of the walls so they draw entirely white. T=(T+SLICE# )*8 [12:08] <Calc84maniac> the walls are already messed up :P [12:08] <Calc84maniac> hold on, let me paste you something with much simplified texture code [12:09] <Calc84maniac> http://pastebin.com/Y7HvkXLZ [12:09] <Calc84maniac> no reason not to loop now that we have speed on our side [12:11] <GimmeMoreCoinz> cool [12:11] <Calc84maniac> hmm, I think MOD isn't what we need in this case [12:12] <Calc84maniac> since it's supposed to work with integers only [12:12] <GimmeMoreCoinz> oh [12:12] <GimmeMoreCoinz> I see. [12:12] <GimmeMoreCoinz> also i'm trying to figure out why movements not working it renders fine now (sort of) [12:12] <GimmeMoreCoinz> how did movement work in the raycaster you made? [12:14] <Calc84maniac> uhh... I modify the position based on which direction you're facing [12:14] <Calc84maniac> oh [12:14] <Calc84maniac> I see the problem [12:14] <Calc84maniac> "and" is not what you should be using [12:15] <GimmeMoreCoinz> ohh [12:15] <Calc84maniac> that turns the assignment expressions into conditional expressions, lol [12:15] <Calc84maniac> (I think) [12:15] <GimmeMoreCoinz> the AND operator doesn't assign :/ [12:16] <Calc84maniac> that's why sometimes it's nice to have the different = and == operators, lol [12:16] <Calc84maniac> SMILEBASIC would call you out on that [12:16] <GimmeMoreCoinz> yeah. [12:16] <GimmeMoreCoinz> The And operator performs a logical (bitwise) And on the two specified operands. [12:16] <GimmeMoreCoinz> [12:16] <GimmeMoreCoinz> that's what the help says about AND in playbasic. I like their help files system. [12:18] <GimmeMoreCoinz> ok makes sense I see now [12:19] <Calc84maniac> also, I suppose the proper alternative to MOD(COLLX#,1) here is COLLX#-FLOOR(COLLX#) [12:21] <GimmeMoreCoinz> http://pastebin.com/YpFCXjmM [12:21] <GimmeMoreCoinz> there we go. movement sort of works? it seems finicky or buggy though. [12:22] <Calc84maniac> yeah, *something* is still really weird with the rendering though [12:22] <GimmeMoreCoinz> yeah. [12:23] <Calc84maniac> hmm, line 163 needs a COLLY# [12:25] <GimmeMoreCoinz> yeah i fixed that on mine once thanks for seeing it [12:25] <GimmeMoreCoinz> ugh I dont know what else is wrong. [12:26] <Calc84maniac> lol, line 159 you put an =1 instead of =0 [12:26] <Calc84maniac> though that doesn't seem to fix much [12:28] <GimmeMoreCoinz> does VElZ have any importance [12:29] <Calc84maniac> ? [12:29] <Calc84maniac> oh, VELZ [12:29] <Calc84maniac> that's for jumping [12:29] <GimmeMoreCoinz> I changed this btw... it seems to have smoothed out some movement [12:29] <GimmeMoreCoinz> IF MAP(ABS(X#),ABS(Y#)) THEN RETURN [12:29] <GimmeMoreCoinz> CAMX#=X# [12:29] <GimmeMoreCoinz> CAMY#=Y# [12:29] <GimmeMoreCoinz> RETURN [12:30] <Calc84maniac> o_o [12:30] <Calc84maniac> wouldn't that be more like preventing crashes? [12:30] <Calc84maniac> X# and Y# shouldn't be negative anyway [12:31] <GimmeMoreCoinz> abs only returns positive integers it wont return a float [12:31] <GimmeMoreCoinz> here were trying to access the array using whatever value [12:31] <GimmeMoreCoinz> and playbasic wont automatically change those to absolute whole integers [12:31] <GimmeMoreCoinz> on it's own i dont think [12:32] <Calc84maniac> yes it will [12:32] <Calc84maniac> the whole raycast routine depends on that [12:34] <Calc84maniac> also, ABS doesn't have to return an integer [12:34] <Calc84maniac> it does only return positive values though [12:34] <Calc84maniac> (or zero) [12:35] <GimmeMoreCoinz> here I found for T=0 to - [12:35] <GimmeMoreCoinz> For T=0 to 0 [12:35] <GimmeMoreCoinz> is that meant to be something else in the loadtex [12:35] <Calc84maniac> no, since there's only one texture [12:36] <GimmeMoreCoinz> oh ok [12:36] <GimmeMoreCoinz> I see. hmmm [12:36] <Calc84maniac> hmm, you know, I almost want to start this all over again using mainly integers :P [12:36] <GimmeMoreCoinz> I noticed were using box commands would there be a way to just draw the entire image offset by a value? [12:37] <GimmeMoreCoinz> ah [12:37] <GimmeMoreCoinz> well that'd be fun [12:37] <GimmeMoreCoinz> the texture can be stored as an image [12:37] <GimmeMoreCoinz> you know [12:37] <Calc84maniac> can PlayBasic draw scaled images? [12:37] <GimmeMoreCoinz> yeah [12:38] <GimmeMoreCoinz> I have some functions for that written already to [12:38] <GimmeMoreCoinz> but it's kind of [12:38] <GimmeMoreCoinz> wierd. [12:38] <GimmeMoreCoinz> I have a window drawing function [12:38] <GimmeMoreCoinz> where you pass it if you want the image the window uses sclaed or not [12:38] <GimmeMoreCoinz> scaleD* [12:38] <GimmeMoreCoinz> and it renders a windowframe with border and an X button [12:38] <GimmeMoreCoinz> and it will scale the image to the window size if you want as well [12:38] <GimmeMoreCoinz> you could omit the border [12:38] <GimmeMoreCoinz> and pass the window X and Y and window border size [12:39] <GimmeMoreCoinz> but easier to do is scaleimage imagename, scalepercentX, scalepercentY, type or something [12:39] <GimmeMoreCoinz> ScaleImage ImageNumber, ScaleX, ScaleY, ScaleMode [12:39] <GimmeMoreCoinz> [12:39] <GimmeMoreCoinz> [12:39] <Calc84maniac> yeah, well the main idea would be to split each texture into a bunch of images 1 pixel wide [12:40] <Calc84maniac> and select which image to get using SLICE [12:40] <GimmeMoreCoinz> Mode 0 = (Scaler Mode) Makes ScaleImage use the SCALE X &amp; Y parameters as multipliers of the images current width &amp; height. (ie. NewWidth=OldWidth * ScaleX, NewHeight=OldHeight*ScaleY) [12:40] <GimmeMoreCoinz> [12:40] <GimmeMoreCoinz> MODE 1 = (Absolute Mode) Makes ScaleImage use the SCALE X &amp; Y parameters as the images new size. [12:40] <GimmeMoreCoinz> [12:40] <Calc84maniac> and scale it to the correct height [12:40] <GimmeMoreCoinz> now the thing is [12:40] <GimmeMoreCoinz> you'd have to isolate this into a function [12:40] <GimmeMoreCoinz> otherwise your source image will be scaled [12:40] <GimmeMoreCoinz> and all instances of drawing it will stay the same size [12:41] <Calc84maniac> hmm, that's annoying [12:41] <GimmeMoreCoinz> no not really .. it's pretty simple because you could also [12:41] <GimmeMoreCoinz> have a target copy and an original [12:41] <GimmeMoreCoinz> then each time you use copyimage before scaling [12:41] <GimmeMoreCoinz> to overwrite the last instance of the scaled image you drew [12:41] <Calc84maniac> hmm, maybe DrawRotatedImage could also work [12:41] <Calc84maniac> it has scale parameters [12:41] <GimmeMoreCoinz> or just do it inside the function because it wont be permanent [12:42] <GimmeMoreCoinz> yeah. [12:42] <Calc84maniac> just use no rotation [12:43] <GimmeMoreCoinz> that'd work. [12:43] <GimmeMoreCoinz> brb drinkgetting time :3 [12:46] <BonChoi> Hello all [12:47] <BonChoi> Hello? [12:48] <BonChoi> HELLO?! [12:48] <Calc84maniac> HELLOOOO [12:48] <BonChoi> Hi [12:49] <GimmeMoreCoinz> hiii [12:50] <BonChoi> My friend says I have CAR [12:50] <Calc84maniac> a long, long time ago [12:50] <Calc84maniac> in a galaxy far away [12:50] <BonChoi> I have CSD* [12:50] <Calc84maniac> I wrote a variable-height raycaster in Python [12:51] <BonChoi> The only coding I do in a real computer language is me messing with my school's website in web developer [12:51] <BonChoi> In HTML [12:52] <Calc84maniac> hey, it's still on an old flash drive! I thought it died with my old laptop [12:52] <BonChoi> cool [12:52] <Calc84maniac> oh wait. it's in a similar folder on my computer already :P [12:53] <BonChoi> Calc do you know C or C++? [12:53] <Calc84maniac> yes [12:53] <BonChoi> Cool I gtg [12:53] <GimmeMoreCoinz> i'm making tea bbiam [12:58] <GimmeMoreCoinz> hey calc any luck [01:04] <Calc84maniac> oh, haven't really been working [01:05] <GimmeMoreCoinz> a program to emulate petit computer programs is seeming less feasible now atleast in playbasic considering how difficult it is to port a simple raycaster [01:05] <GimmeMoreCoinz> :/ [01:06] <Calc84maniac> I can't really see how that can be compared [01:06] <Calc84maniac> I mean, an emulator would be designed to work with Petit Computer source code directly [01:07] <GimmeMoreCoinz> because I don't know how to interprete some commands for instance. I can't get the petit computer raycaster to work properly so that would mean I wouldn't be able to emulate some of it's codes. Also another dilemna i've noticed. [01:07] <GimmeMoreCoinz> Since Petit computer doesn't differentiate between floats and integers how would I determin what is a float and what is not. [01:08] <Calc84maniac> nothing is a float [01:08] <GimmeMoreCoinz> I suppose I'd have to do some testing on instances of the variable found and whether it may end up containing by chance, a floating point value. [01:08] <GimmeMoreCoinz> Hm [01:08] <Calc84maniac> Petit Computer uses fixed point values [01:08] <GimmeMoreCoinz> Then that makes it kind of easy. [01:08] <GimmeMoreCoinz> fixed point [01:08] <GimmeMoreCoinz> so for example 0.4 [01:08] <GimmeMoreCoinz> ? [01:08] <GimmeMoreCoinz> o.0 [01:08] <Calc84maniac> fixed point meaning the decimal point is at a constant location in the number [01:09] <Calc84maniac> Petit Computer uses a format with 20 bits above and 12 bits below the decimal point [01:09] <Calc84maniac> which is really more of a modified integer format than anything [01:10] <Calc84maniac> basically the value 1.0 in Petit Computer is represented by 4096 [01:10] <Calc84maniac> and the values 1-4095 are "fractional" values [01:11] <GimmeMoreCoinz> weird.. [01:11] <Calc84maniac> fixed point is very good for speed, I'd say [01:11] <Calc84maniac> and I'm considering we might want to do the raycaster using it [01:12] <BonChoi> Back [01:13] <BonChoi> Somebody should port SMB to PTC right? [01:13] <Calc84maniac> *shrug* [01:13] <Calc84maniac> it's already on NES VC [01:14] <BonChoi> Yeah but it would be a cool project. [01:23] <GimmeMoreCoinz> hey calc [01:23] <GimmeMoreCoinz> I sort_of cleaned it up it runs a bit smoother but has some issues still [01:36] <GimmeMoreCoinz> calc you know what you could do. you could try opening the WOLF3D example that comes with playbasic [01:42] <Calc84maniac> I don't think that's even a raycaster [01:43] <Calc84maniac> hard to tell though since the code is so cryptic :P [01:45] <GimmeMoreCoinz> ahaha [01:46] <GimmeMoreCoinz> the how raycasters work example you sent me doesn't compile because QuickCG.h could not be found [01:46] <GimmeMoreCoinz> lol lol lol lol lol [01:46] <GimmeMoreCoinz> I have VC++ 2010 [01:46] <GimmeMoreCoinz> I don't know about the quickcg library but it seems to be able to draw images and stuff. [01:48] <GimmeMoreCoinz> this quickCG library seems useful for making games in the faster C++ language o.o and it wraps SDL. so wonderful I have to get SDL now and quickCG [01:48] <GimmeMoreCoinz> :/ [01:49] <GimmeMoreCoinz> although I was originally thinking of using microsoft XNA :/ omg [01:50] <GimmeMoreCoinz> I wonder if I should work on a terraria style game o.0 hm [01:50] <GimmeMoreCoinz> xD [02:02] <PTC Wikia Bot> I think I'm going to request for someone else to be an admin. [02:02] <PTC Wikia Bot> Calc, you want to be an admin instead of me? [02:03] <PTC Wikia Bot> Please? [02:04] <Calc84maniac> wait what [02:05] <PTC Wikia Bot> Do you want to be an admin instead of me? [02:05] <PTC Wikia Bot> I can't do this... I'm just not good with confrontation [02:05] <Calc84maniac> I don't know if I could handle it, haha [02:05] <PTC Wikia Bot> Ehh I'm sure you could. But if you don't want to, I understand [02:05] <PTC Wikia Bot> It's not like I'm forcing you or anything lol [02:08] <PTC Wikia Bot> Well, anyway... sorry for bothering you both earlier and now. [02:11] <Calc84maniac> oh, no problem