Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Your Computer
Oct 3, 2008




Grimey Drawer
I am very excited :woop: it's a lot to get into with no prior SmileBASIC knowledge though, and the software itself isn't that good at giving basic examples so I think it would be really helpful to have some super basic stuff explained (assuming it roughly follows the same logic as the previous version.) Particularly I'm having a difficult time wrapping my head around how I'm supposed to create, save and utilize custom sprites and music since the tutorial only tells you how to play or display the built-in stuff


at the moment I'm just messing around with writing stuff directly to the graphic pages (which I think are essentially frame buffers?) and making pretty colors :sparkles:

Adbot
ADBOT LOVES YOU

Your Computer
Oct 3, 2008




Grimey Drawer

ErrEff posted:

Found this, it's a helpful text guide to understand the language and syntax, with examples.
this is wonderful!

The examples are very good and one thing I've been missing with the official documentation. The reference manual only lists all the functions without any examples of how to use them, and while the in-game help function is very useful it doesn't always show how to use something and sometimes the examples are even cut off weirdly. It's a bit extra confusing because I'm not sure why some functions are called like "FUNC(A,B)" while others are called like "FUNC A,B" (no parenthesis)

Your Computer
Oct 3, 2008




Grimey Drawer

homeless snail posted:

IDK if its a weird BASIC convention or what (last time i used BASIC before PTC2 was like, the C64), but they make a distinction between functions that have return values and ones that don't. The ones with parenthesis always return a value and can only be used in an expression, and the ones without parenthesis never have return values and can't be used in the middle of an expression. There are also functions with OUT parameters that fall more in line with the latter. ee: also on the topic of out parameters, there's a couple of functions that you pass arrays to for results but aren't OUT, since arrays are always passed by reference

e: when you def your own functions you have to follow that convention also

Well! That explains it :v: Thanks!

I've got a question only tangentially related to SmileBASIC 4 - other than (obviously) buying a copy of SmileBASIC 3, is there a way to get a look at the source code of programs from SB3 with public keys (like downloading the files on a computer)? There are so many and it would be a treasure trove of ideas on how to implement certain stuff but I tried googling and couldn't really find anything.

Your Computer
Oct 3, 2008




Grimey Drawer

homeless snail posted:

You can load SB3 pubkeys into SB4 I'm pretty sure, they just won't run
well now I feel like an idiot :cripes:


I never even thought to try (it works!)

Your Computer
Oct 3, 2008




Grimey Drawer
progress :toot:



I've always wanted to try implementing a raycasting engine and this seemed like a good time. I was having a lot of problems that I just couldn't figure out until I turned on OPTION STRICT which I honestly recommend everyone use. SmileBASIC is very happy to just read whatever you write as a (new) variable so the tiniest typo or misunderstanding leads to some really tricky bugs.

e: babby's first raycaster is now working!
https://twitter.com/YourComputerSA/status/1254237340207210497?s=20

Your Computer fucked around with this message at 03:36 on Apr 26, 2020

Your Computer
Oct 3, 2008




Grimey Drawer

Casaval posted:

Has anyone ever made something like a laptop shell for the Switch? Like you slot it into the top half like a dock and the bottom half is a usb keyboard (and maybe a trackpad).

Even something like the Labo piano might be a good starting point for a goofy typewriter-style coding dock...

I've been doing something similar to that with the Hori USB Stand with a keyboard and mouse plugged in


a bit more floppy than a laptop but i've successfully coded in bed this way :v:

Your Computer fucked around with this message at 02:51 on Apr 28, 2020

Your Computer
Oct 3, 2008




Grimey Drawer
I've been kinda hooked on this :sweatdrop:

https://twitter.com/YourComputerSA/status/1255033774913359875?s=20
(twitter's compression is not kind to this... that's uh.. supposed to be a minimap on the left)

I've got some bugs I can't figure out and I'm also running into performance trouble now by calling GPSET for each pixel which is.... not a particularly great way of doing this! :v: Next thing I'm gonna do is make use of GARRAY to get the graphic page as an array and work directly on that instead, which should hopefully do the trick.

speaking of graphics, is there any information anywhere on how SmileBASIC stores graphics with GSAVE? It gives you an array with..... something but I can't figure out what. It's not GCOLOR values and I couldn't find anything about converting it to anything useful. It's not important or anything, but it would be easier if I could just load textures by using GSAVE rather than making an array and then copying each pixel into the array.

Your Computer
Oct 3, 2008




Grimey Drawer

magimix posted:

:captainpop:

drat, the stuff you are doing is so far in excess of anything I'm even *thinking* of trying!
just to be clear, I am neither smart nor good at programming and all I'm doing is porting and tweaking the code from this well known article on raycasting :v:

that said, I fixed some of the bugs I had and added floors and ceilings. Even using the buffer like I mentioned previously, it chugs along at ~5 fps
https://twitter.com/YourComputerSA/status/1255094577448382466

without the floors and ceilings it's running a lot better however
https://twitter.com/YourComputerSA/status/1255094681852997632

Your Computer
Oct 3, 2008




Grimey Drawer
is there some neat way of storing a collection of data similar to a struct? I've found this is honestly the thing I'm missing the most so far :v:

if I'm just storing floats I realize I can simply use an array, but if I'm saving a variety of different data types it becomes a bit more complicated and I'm not sure what the "smart" way of handling it is in BASIC.

Your Computer
Oct 3, 2008




Grimey Drawer

homeless snail posted:

No, not really. You're pretty much stuck using multiple arrays if you have to store things of different types. One thing in your favor though is that if you explicitly type stuff they can all have the same name, array# and array% and array$ don't collide and imo that makes it a little more clear that they're storing related stuff. For stuff of the same type, I used multi dimensional arrays a lot in SB3 to make lovely structs

If its data that's associated with a sprite, you're almost always better off storing them in spvars, at least.

Thanks! I've been using SPVAR a bunch and it's very convenient, but I'm starting to make some non-sprite objects and I realized that I need some other way to store things :v: I didn't know that about the explicit types so that's gonna come in handy for sure! One other idea I've toyed with is making enums for the different "structs" to make the code a bit more human-readable, like say I have a sphere "struct" with values like x,y,z,r etc. I could make an enum with x=0,y=1, and so on and then access values using the enum, like sphere[y] or sphere[r]

Your Computer
Oct 3, 2008




Grimey Drawer
I realize I already have half the posts in this thread but I'm just having a lot of fun

currently toying with pixel-based collision detection using a collision map. It's not quite there yet but the results are pretty promising for a single night of work!
https://twitter.com/YourComputerSA/status/1256622576064851971?s=20

Your Computer
Oct 3, 2008




Grimey Drawer

atholbrose posted:

Ah, hell. I had no idea about this. Got it just now; it's way too cool to ignore! Thanks for bringing it up over in the Making Games thread, Your Computer.

I followed the same raycaster tutorial recently, working on a thing in Pixel Vision 8, but could not get the textures working correctly. I'll have to try again -- or, if you don't mind sharing your code?

I just ordered a USB keyboard for the Wii, for Animal Crossing, and I went specifically for the smallest one I could find without a mouse. Turns out that might've been a mistake. Sigh.
:toot:

I wouldn't mind sharing the code, although I don't know if there's a good way to do it? It's quite a bit of code (330 lines) I tried going through the uploading thing but apparently that is a proper publish thing that has to go through reviews and stuff? I just backed out of it. If there's anything you're wondering about I'll gladly help though!

also FWIW I've barely used a mouse at all. I do use the touchscreen a bunch though, even when I'm using a keyboard.

organburner posted:

IMO you need to post more tbh...

Because I can't buy this thing ;_;
I'm sorry :( Despite never having used SmileBASIC before I jumped on it the moment it launched and I guess that was a good idea after all. Here's hoping they fix their issues ASAP!

as for posting more, here's the update to the previous gif. 2D pixel-based collisions using a normal map!
https://twitter.com/YourComputerSA/status/1257009424763285504?s=20

is it clever or dumb? I don't know, but I just had the idea and needed to see if it worked! :pram:

Your Computer
Oct 3, 2008




Grimey Drawer

organburner posted:

I do have one question, can you change the keyboard layout in the game? The switch has poo poo keyboard layout support and trying to program without knowing where symbols are is a pain in the poo poo.
not that I have found and it's probably my biggest problem (and also one of the reasons I use the touchscreen so much)

that said, I'm starting to get used to where a lot of the symbols are despite not being able to see them :v:

Your Computer
Oct 3, 2008




Grimey Drawer
so although the normal map idea was way flashier, it turns out you can also just use a grayscale bitmap and map the 0-1 value to the angle of the surface and that's probably gonna be a lot easier to draw v:shobon:v

I'm aiming to make a simple 8-bit pinball game (always loved them in all their jank) and although the Switch is perfect for pinball when held vertical I'm kinda debating what to go with. Most people either don't have a flip grip or play primarily docked which would make a vertical-only game kinda unplayable, and it would be a lot more annoying to program/draw too. In addition to this I feel like the split board is one of those things that kinda make 8-bit pinball games what they are? maybe I'm just making up excuses

anyway I got the collision stuff to work fine across multiple screens so that's cool :toot:
https://twitter.com/YourComputerSA/status/1257401611783147523?s=20

Your Computer
Oct 3, 2008




Grimey Drawer

homeless snail posted:

Don't forget you can just rotate the sprite your board is drawn to, so for tate you can draw it to grp memory the exact same way as regular
oh I know, but it still makes things a lot more complicated :shobon: Rotating the (visual) board is on is one thing, but I can't easily rotate the GARRAY with the collision map, which is what I'm using for collisions simply by checking the values against the player x,y position. It also means changing all the x's and y's which gets confusing, and it's a pain to program since I have to flip the switch over any time I want to test what I'm doing (since I don't think SmileBASIC has a vertical mode?)

it's hard enough for me to wrap my head around these grayscale values as polar coordinates in the first place, having to draw everything sideways would just be too confusing :v:

Your Computer
Oct 3, 2008




Grimey Drawer
so uh, the downside of doing the grayscale collision map......


I just spent over an hour trying to figure out why my collisions were behaving oddly against some new collision geometry I had painted in. It made no sense. The problem? Turns out there were rogue 253,253,253 pixels among the white background pixels because the GAHAKU default palette is devoid of pure colors and even black/white aren't actually pure black/white :downs:

Your Computer
Oct 3, 2008




Grimey Drawer

atholbrose posted:

And I can't stop thinking about what to do with it next. There's just something about BASIC, calling back to the earliest programs I ever wrote -- a lot of them games -- that is really appealing to me.
heck, I never programmed in BASIC before now but there's still something incredibly appealing about it. Not sure how I'd describe it, but the relatively low level of it just really resonates with me and is a ton of fun to work with.

speaking of which, progress!

e: fixed an issue, I was applying the force the wrong way around oops!

https://twitter.com/YourComputerSA/status/1258383707515138048?s=20

Your Computer fucked around with this message at 14:12 on May 7, 2020

Your Computer
Oct 3, 2008




Grimey Drawer

aw man, I loved playing with those simulators as a kid :allears:

Your Computer
Oct 3, 2008




Grimey Drawer
honestly my biggest hurdle right now is that GAHAKU is garbage and creating sprites is therefore a massive pain :v:

are there any better pixel art tools yet, or some way to transfer images?

Your Computer
Oct 3, 2008




Grimey Drawer

Tempura Wizard posted:

Looked like there were some editing tools uploaded by users, last time I checked. Can't say if they're any better or worse than Gahaku, but it's worth a shot.
yeah I tried out a couple, but most of them are kinda hard to wrap my head around (and also they're all entirely in Japanese)

of the ones I tried, TH_GED easily seemed like the most capable and I'll probably spend some more time trying to understand it.


also, I'm still working on the project!
https://twitter.com/YourComputerSA/status/1259512053955301377?s=20

drawing the collision map is an extremely tedious process with no proper image editing tools, so it's a lot of trial and error :v:

Your Computer
Oct 3, 2008




Grimey Drawer
the project is coming along nicely so I don't feel too bad about doubleposting

https://twitter.com/YourComputerSA/status/1260778956375986177?s=20

I've revised the physics and added a ton of stuff. Once I've added switches and scorekeeping I'll probably draw the board and consider it done :toot: What you're seeing in the clip is the pure collision data, and although it's a massive pain to draw all of it in GAHAKU I'm starting to get the hang of it.

Your Computer
Oct 3, 2008




Grimey Drawer
I'm making a futile attempt to generalize my code a bit and make it easier to reuse, but I've hit a wall - is there really no way to make a const/enum accessible to other programs? :(

Adbot
ADBOT LOVES YOU

Your Computer
Oct 3, 2008




Grimey Drawer

homeless snail posted:

Not that I've seen. You're probably better off getting it from the US or Japanese store, because I don't have much faith that they're gonna navigate whatever issues they had with the ratings any time soon. With SB3 it was like two years between the NA and eventual EU release

it's that bad? :stare:

goodness, I'm glad I got this at launch

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply