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
Casaval
Aug 25, 2003

Newtype
I love SmileBasic even though I've never made anything worth sharing. Playing games made by others is already worth it.

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...

Adbot
ADBOT LOVES YOU

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.

magimix
Dec 31, 2003

MY FAT WAIFU!!! :love:
She's fetish efficient :3:

Nap Ghost
:captainpop:

drat, the stuff you are doing is so far in excess of anything I'm even *thinking* of trying!

homeless snail
Mar 14, 2007

Yeah, graphics operations are extremely slow, GARRAY or GLOAD to blit everything all at once should be a lot faster. Just glancing it looks like the GSAVE/GLOAD format is the same as was in PTC3, its just an array of 32-bit ARGB values. RGB/HSL can deal with them or you can shift bits into it yourself

The halfassed and extremely slow raycaster I made on the 3DS version I just drew all my textures in smiletool and GSAVEd them into arrays to do the lookups

homeless snail
Mar 14, 2007

Not that cool to look at but here's what I've been loving with this weekend.

https://mobile.twitter.com/itssnails/status/1255085100808540160

I was working on something else and realized I was going to need some GUI for it, so I dropped what I was doing and wrote a whole dang GUI library. Its immediate mode and uses GRP primitives to draw everything though so it's real slow, kind of regret it.

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

The Kins
Oct 2, 2004
SmileBasic 4 has been temporarily removed from sale in Europe due to age-rating related bureaucracy.
https://twitter.com/smilebasic_com/status/1255746406121238529

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

The Kins posted:

SmileBasic 4 has been temporarily removed from sale in Europe due to age-rating related bureaucracy.
https://twitter.com/smilebasic_com/status/1255746406121238529

Well poo poo, guess I'm not buying this after all.

EDIT: discovered another fun thing, apparently there's not a lot of keyboard layouts supported by the switch, does smilebasic have some built in way to switch layout?

organburner fucked around with this message at 14:00 on May 1, 2020

Tempura Wizard
Sep 15, 2006

spending all
spending
spending all my time
Thanks everyone for your help. Another newbie question, hopefully it will help someone else too.

I'm trying to wrap my mind around sprites versus "userchr". I know that sprites are handled using SP functions, and userchr show up by using PRINT, and they're both on the editable sprite sheet. Are userchr intended mostly for use as backgrounds? I'm assuming so since they don't have handy SP functions like hitbox detection like sprites.

Edit: for the rest of it I RTFM.

Tempura Wizard fucked around with this message at 18:19 on May 1, 2020

homeless snail
Mar 14, 2007

Tempura Wizard posted:

Thanks everyone for your help. Another newbie question, hopefully it will help someone else too.

I'm trying to wrap my mind around sprites versus "userchr". I know that sprites are handled using SP functions, and userchr show up by using PRINT, and they're both on the editable sprite sheet. Are userchr intended mostly for use as backgrounds? I'm assuming so since they don't have handy SP functions like hitbox detection like sprites.

Edit: for the rest of it I RTFM.
Yeah, previous versions had BG functions and dedicated tilemap layers, in this one they seem to expect you to use the text layers and userchr as their replacement. I wouldn't get too hung up on the fact that they default to being on the same page as the sprites, they can be stored on totally different pages if you want them to be. And if you want sprite/BG collision you have to build that yourself.

Tempura Wizard
Sep 15, 2006

spending all
spending
spending all my time

homeless snail posted:

Yeah, previous versions had BG functions and dedicated tilemap layers, in this one they seem to expect you to use the text layers and userchr as their replacement. I wouldn't get too hung up on the fact that they default to being on the same page as the sprites, they can be stored on totally different pages if you want them to be. And if you want sprite/BG collision you have to build that yourself.

Thanks! Now I'm trying to figure out how to call a specific sprite sheet I've edited. I'll edit a sprite sheet using the Gahaku tool, and it'll show up in the Smiletool when I'm looking through the userchr, however when I call it and run my program it immediately defaults back to the default sprite sheet.

homeless snail
Mar 14, 2007

Tempura Wizard posted:

Thanks! Now I'm trying to figure out how to call a specific sprite sheet I've edited. I'll edit a sprite sheet using the Gahaku tool, and it'll show up in the Smiletool when I'm looking through the userchr, however when I call it and run my program it immediately defaults back to the default sprite sheet.
Are you doing an ACLS or something? That would reset all your pages back to default. Your best bet is just to save it to a file in gahaku and LOADG it in your program, but also while you're working and going back and forth you can tell ACLS not to clear your graphics pages

Tempura Wizard
Sep 15, 2006

spending all
spending
spending all my time

homeless snail posted:

Are you doing an ACLS or something? That would reset all your pages back to default. Your best bet is just to save it to a file in gahaku and LOADG it in your program, but also while you're working and going back and forth you can tell ACLS not to clear your graphics pages

Yep, I had an ACLS at the beginning that was clearing everything out. A LOADG did the trick. Thanks again!

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.

homeless snail
Mar 14, 2007

Your Computer posted:

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.
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.

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

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

Your Computer posted:

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

IMO you need to post more tbh...

Because I can't buy this thing ;_;

atholbrose
Feb 28, 2001

Splish!

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.

pyrotek
May 21, 2004



Your Computer posted:

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

Yes, please post more. I find this interesting and am tempted to buy it and inevitably ignore it.

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:

BONESAWWWWWW
Dec 23, 2009


Every post gets me one step closer to being unable to resist dropping the $25.

Have you been looking at any games or demos from other people? Is there anything particularly notable out there?

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

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.

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:

homeless snail
Mar 14, 2007

Yeah it just goes off what layout you have setup in the Switch system settings, there aren't many choices.

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

Well that sucks.

Add nordic keyboard support nintendo you cowards!

The Kins
Oct 2, 2004
The software keyboard is a SmileBasic sub-app in itself. A post on Smilebasicsource says there's a "secret" command, UIRUN, that lets you replace it with your own app, but I don't know any further details.

ErrEff
Feb 13, 2012

organburner posted:

IMO you need to post more tbh...

Because I can't buy this thing ;_;

It's still available in the US eShop, right? You could change your Nintendo account's region. Just make sure you have no outstanding funds on your account before you make the switch. You might also run into an issue where your credit card is denied, in which case you can get some US eShop card codes.

Or make a new account entirely for just the US shop (it will have to remain on your system for DRM purposes, however).

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

homeless snail
Mar 14, 2007

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

atholbrose
Feb 28, 2001

Splish!

YC, that video made me remember something from my childhood: the Tandy Color Computer Pinball cart. A completely daft thing that doesn't play much like pinball at all, but it had an editing mode that I was obsessed with.

I'm very tempted to port my current dungeon crawler project from pv8 to SmileBasic.

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:

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

ErrEff posted:

It's still available in the US eShop, right? You could change your Nintendo account's region. Just make sure you have no outstanding funds on your account before you make the switch. You might also run into an issue where your credit card is denied, in which case you can get some US eShop card codes.

Or make a new account entirely for just the US shop (it will have to remain on your system for DRM purposes, however).

I know, but :effort:
Also I got some other poo poo to do right now so getting this isn't top priority right now.

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:

Hammer Bro.
Jul 7, 2007

THUNDERDOME LOSER

I've got a plethora of checks for things like that in my palette-swapping code on modern computing systems (which make it so much more difficult than the hardware of yore) because I've overloaded my red channel as both the color red but also the palette lookup index. Which means any given sprite can't have two colors with the same R value.

To make things worse I reserved 255 for fully-transparent pixels, so there's no pure-white either.

atholbrose
Feb 28, 2001

Splish!

As I thought, this thing is dangerous. I dug out an old netbook, charged it up, threw Lubuntu on the thing so I could have a reasonable screen to read the docs while working on the big TV. Thought, oh, I'll spend an hour or so, see if I can draw some lines and shoot some text up on the screen. Four hours later? A more than reasonable facsimile of my dungeon game, but on the Switch.

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.

Also from the docs, this thing has some crazy capabilities; it's going to be super-interesting dinking with some of them. Function libraries, automatic code generation, dynamic loading for the program slots, things like that.

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

homeless snail
Mar 14, 2007

This sure is a productive use of my time
https://twitter.com/itssnails/status/1258659153926451200

Adbot
ADBOT LOVES YOU

Your Computer
Oct 3, 2008




Grimey Drawer

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

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