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
homeless snail
Mar 14, 2007


OUT NOW EVERYWHERE!! USD $25/30 €20ish~ idk*
https://www.nintendo.com/games/detail/smilebasic-4-switch/


https://www.youtube.com/watch?v=MTsfdJYd5Uo

After a long long delay, the fourth iteration of SmileBASIC/Petitcomputer is finally available worldwide. What's SmileBASIC? Good question, its the series of weirdly fully featured BASIC programming environments available for Nintendo systems. Originally these things emulated the crudity and limitations of early microcomputer programming, think like C64/MSX, but 3 and 4? Surprisingly fairly loving powerful. Now why would someone want to pay $30 to code in BASIC of all things on a Nintendo Switch, when you can do big boy programming in a real language on a real computer? No idea, but I do.

Of course, if you don't want to make stuff, it has online sharing and you can download all kinds of poo poo other people have made also. Previous versions used keys to download programs, which you had to go scrounge for on Japanese wikis and on twitter, but PTC4 features an online gallery that people can upload to, complete with searchable tags, box art, and descriptions. That's where the multiple prices for this thing come in though, the $25 package has extremely limited access to the server, iirc you can only download one user submitted thing every 8 hours, and you can't upload at all. The $30 package includes a server ticket which gets you unlimited downloading and 10 upload slots, and they sell additional tickets that give you another 10 slots for $5 each

Please use this thread to share things you find + post your own works + share information thank you :angel:

What's new?
The dialect of BASIC in PTC4 is pretty similar to 3, which is good because by BASIC standards its pretty good and modern. If you used 3 at all you should be extremely comfortable here. PTC4 is not completely backwards compatible though because architecture changed a lot in some places. Particularly in the way graphic pages work, its a much more regular system now and doesn't require you to juggle paging if you're doing weird stuff with your graphics. Full screen graphics pages and tilemaps don't even exist anymore, everything is a sprite now and full screen graphics are just arbitrarily large sprites.

Some other big things that have changed:
  • of course, its much faster than PTC3, has access to I think 4x more memory, 2x as many audio channels, etc, I honestly don't even know what piece of hardware to compare it to anymore. PTC4 performance is crazy good though for what it is
  • full mouse/keyboard compatibility, including the text editor so you don't have to tap your stuff in on a touch screen anymore!!
  • compatible with all Switch controllers, including HD rumble and IR camera support, and built in support for most of the Labo toycons
  • able to run a subprogram at the same time as the main program, which can transfer things between main/sub memory. fun fact: a lot of the SmileBASIC UI is actually written in SmileBASIC using this functionality!!
  • 4096 visible sprites, up from PTC3's 512, distributed across 8 display layers (up from 3's 4 BG layers + GRP layer + sprite layer). Since everything's a sprite now you have much more flexibility to control display priority + each layer can have filters and transformation matrixes applied so mode 7 style graphics are pretty much built in now.
  • PTC3's extremely cool PCM audio DLC is built into 4, which is a lot of fun to write synths with
  • probably other things I can't remember right now

Links
Official language reference and tech specs
Manual PDF
Pretty thorough walk through the basic syntax

homeless snail fucked around with this message at 19:51 on Apr 24, 2020

Adbot
ADBOT LOVES YOU

homeless snail
Mar 14, 2007

SmileBASIC Thread All-Stars!!
  • Sand (4PKN4WKAE) - Sand simulator!! By snail!! that's me!!
  • - your key here if you post it in the thread -

Check These Out:
  • Arcanum Stone (4N32NQPPY) - Actually good not just good-for-Petitcom good fighting game, one of my favorite PTC3 games
  • nROGUE (4KKQ3N3Q4) - Incredible looking roguelike
  • Sunrise Airport (4A2NEW24E) - Flight sim with terrain ripped from Google Maps
  • Givers P3D (4234W3QV) - 3D polygonal Star Fox type shooter
  • Spooky Maze (44ZADKEYD) - Raycasting 3D maze exploration game, now updated with gyro controls
  • The Otaka Game Collection, 3 excellent arcade ports all from the same person. Pac-Pac Slime (4KKQXSS), its Pac-Man but also with the Pac-Mania jump button, Monpara (4T44YN334), aka Mappy, and The Beginning of Legend (4DRN3K3NV) aka The Tower of Druaga.
  • The Drive (4B3XYF344) - Very nice looking pseudo-3D Outrun-like
  • MusiqA (4EKX4Q334) - Rhythm game, I think its a Chunithm clone?
  • Reflection Force (4EKE33fXF) - Incredibly polished shooter
  • Solid Soldier Collection (444S5EEF3) - Collection of Star Soldier type caravan shooters
  • Solid Gunner (45AX333QJ) - Shooter directly from Smileboom
  • Tribullet (4X8355F) - Extremely Ikaruga inspired shooter
  • Cyburst (4D34X333J) - Do you like shooters?
  • Randomaze Shooter (4NKPQV344) - Dual joystick shooter
  • GaSwitch (453PEV3QJ) - Galaga

Tools + Resources:
  • Redbox (4N3EKNDBS) - Full music sequencer that exports MML files you can use for your own projects
  • Pics Limited (4N32KXD2Y) - Very nice and expressive "realistic art" package
  • Petit Converter (4V3X8442S) - Compatibility patcher for PTC3 software
  • P3D Tools (422KWWKHV) - The 3D graphics engine and model editor used for Givers, all the documentation is in Japanese but it includes sample programs
  • GCL Sonic demo (4Z3DA3XD) - Demo from a game creation course held earlier this year, includes a bunch of Sonic sprites for you to use. Limited time release

Misc:

homeless snail fucked around with this message at 01:48 on May 23, 2020

BONESAWWWWWW
Dec 23, 2009


I never heard of this in the era of my 3DS, but I had a lot of fun tinkering with PICO-8 stuff on my computer. This looks similar.

I enjoyed both making and playing games, but one thing that I disliked about the P8 was that its limitations were too severe to make a fully fledged "game." It was mostly tech demos and art. Is this more of the same? Or does it allow (as far as we can tell so far) someone to start-to-finish make something for real? How did the last version do with this?

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:

homeless snail
Mar 14, 2007

BONESAWWWWWW posted:

I never heard of this in the era of my 3DS, but I had a lot of fun tinkering with PICO-8 stuff on my computer. This looks similar.

I enjoyed both making and playing games, but one thing that I disliked about the P8 was that its limitations were too severe to make a fully fledged "game." It was mostly tech demos and art. Is this more of the same? Or does it allow (as far as we can tell so far) someone to start-to-finish make something for real? How did the last version do with this?
I like PICO-8 a lot also, but its definitely something that intentionally has artificial constraints set up to make it interesting to work in. Petitcom 2 was kind of similar in that it really was going for a PC-88 kind of vibe, and it also had a lot of the limitations in memory access and palettes and stuff that you'd expect from a computer of that era, and also the BASIC dialect was way more archaic. Starting from 3 they shifted priorities into making into much more of a chill general purpose programming environment than A Challenge, and 4 (From what I've seen) goes even further to streamline the architecture and make it even friendlier to work in.

IDK if it really makes sense to spend a lot of time making full games in SmileBASIC though, and a lot of stuff you see does probably have similar scope to P8 projects ultimately. Its totally possible though, and big things do come out occasionally. Here's the Switch port of one of my favorite PTC3 games, Arcanum Stone
https://www.youtube.com/watch?v=HunOUyRhShQ

homeless snail
Mar 14, 2007

Your Computer posted:

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:
Its all a little different from 3 so I'm still wrapping my head around some of it, but also I've been glaring at the Japanese documentation for this for about a year so I have a decent grasp I think..

The dead basics of the graphics on this thing though, are that you have 6 GRP pages, indexed 0-5, which are yeah pretty much just 2048x2048 framebuffers. The default spritesheet gets loaded in on GRP4, and also most of 5 is used to store the system fonts. You can load your own graphics files into memory with LOADG, then you use SPDEF to make sprite definitions that reference at what coordinates your sprites are, and finally use SPSET to instantiate sprites based on the definition numbers you picked. By default there's also a full screen sprite mapped to GRP0, which is why the graphics commands work without having to set anything up, but you can turn that off, all the graphics pages are completely general purpose.

Out of the box, if you press F10 or hold ZL/ZR on the softkeyboard and hit smile tool #2, you'll load up Gahaku, the default image editor. You can edit all the graphics pages and spdefs in there and save them out to files which takes a lot of the pain out of the process imo

Music, I don't think this comes with a tool for that, there are a few in the catalog but they're all in Japanese of course. If you're using the BGM channels though its not too tough to do it without a tool, all the songs are written in MML

homeless snail fucked around with this message at 08:45 on Apr 24, 2020

homeless snail
Mar 14, 2007

Pretty good twitter thread full of pubkeys
https://twitter.com/gosokkyu/status/1253349847085862913

Bruteman
Apr 15, 2003

Can I ask ya somethin', Padre? When I was kickin' your ass back there... you get a little wood?

I'm a sucker for stuff like this - never used any of the earlier versions. Will probably mess around with it for a few hours and then never touch it again.

On the other hand, maybe I'll try and port some 80s BASIC programs I played a long time ago, I mean how advanced can this thing -


:negative:

magimix
Dec 31, 2003

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

Nap Ghost

:stare:

If I can make flashing lines and crunchy noises, then I'll at least have nostalgically relived some of my ZX Spectrum owning youth.

Outside of what is already in the OP, are there any newbie-tier resources that people might recommend?

Also, *man* am I glad I managed to dig out a spare keyboard and mouse!

PepsimanVsJoe
Nov 16, 2007
I picked this up last night and it's really cool!

While I've no interest in programming, there are lots of neat creations to download.

Hammer Bro.
Jul 7, 2007

THUNDERDOME LOSER

Ugh I would've flipped my lid as a kid if I'd had this.

Even as it is I'm kind of tempted even though I've already got a commercial gamedev project kinda stalling and plenty of game engine satisfaction.

ErrEff
Feb 13, 2012

magimix posted:

Outside of what is already in the OP, are there any newbie-tier resources that people might recommend?

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

magimix
Dec 31, 2003

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

Nap Ghost

ErrEff posted:

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

Good find! That should totally be added to the OP.

I don't know exactly why, but thinking about what ideas to play around with for this had me nosing through decades old code, from when I used to have a website that hosted a number of games implemented as Java applets.

Magimix Sokoban will return... (Because I'm assuming I can't just stick the assets for Magimix Mahjongg on my switch, and gently caress drawing all those tileset myself)

homeless snail
Mar 14, 2007

magimix posted:

Magimix Sokoban will return... (Because I'm assuming I can't just stick the assets for Magimix Mahjongg on my switch, and gently caress drawing all those tileset myself)
There are ways to copy files from the PC. If you have 3DS SmileBASIC you can use PetitModem and import it over, or if you have a couple of Arduinos you can build a Petit4Send rig.

Argue
Sep 29, 2005

I represent the Philippines
How easy it is to port from PICO-8 to SmileBASIC? I originally thought that the two were related somehow, because I played the original Celeste on SmileBASIC, and I thought that they were the same thing, but I only recently found out that the SmileBASIC version was ported over from PICO-8; it wasn't just a paste job.

homeless snail
Mar 14, 2007

Argue posted:

How easy it is to port from PICO-8 to SmileBASIC? I originally thought that the two were related somehow, because I played the original Celeste on SmileBASIC, and I thought that they were the same thing, but I only recently found out that the SmileBASIC version was ported over from PICO-8; it wasn't just a paste job.
A lot of the PICO-8 API has direct analogs in SmileBASIC so it wouldn't be too bad. Biggest things off the top of my head is palettized graphics take some doing ever since they moved to direct color, and also they took out BG layers so you would have to write some code to build tilemaps

I think most of it would be pretty straightforward though, pretty much all your sprite code and game logic would be fairly 1:1

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)

Beve Stuscemi
Jun 6, 2001




Does this support bluetooth keyboards? I guess a bigger question is if the switch supports BT keyboards?

homeless snail
Mar 14, 2007

Jim Silly-Balls posted:

Does this support bluetooth keyboards? I guess a bigger question is if the switch supports BT keyboards?
No, you need to use a wired keyboard, or one with a usb dongle

homeless snail
Mar 14, 2007

Your Computer posted:

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

homeless snail fucked around with this message at 00:13 on Apr 25, 2020

homeless snail
Mar 14, 2007

Seems like I was wrong, there's still something like BG layers, by printing your character graphics to the text layers with the text functions?? Unicode characters 0xE800-0xF7FF are mapped by default to the top right corner of page 4, but you can change the mapping with TPAGE. And you can look at the tile mappings in the F9 SmileTool under the USERCHR tab

It seems kinda archaic compared to how it worked in version 3, but there's your tilemaps

https://twitter.com/notohoho/status/1253833936242765828

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.

homeless snail
Mar 14, 2007

You can load SB3 pubkeys into SB4 I'm pretty sure, they just won't run

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!)

homeless snail
Mar 14, 2007

Actually I should say, there are a few programs in the catalog that are titled like Puchikon 3-4 converter so maybe you can get then to run idk. I haven't tried those so I don't know if they're patchers or how automated they are or anything

e: actually it works really well on most of the stuff I've tried so far, including the SB3 port of Celeste, 4V3X8442S it even has an English translation

homeless snail fucked around with this message at 06:14 on Apr 25, 2020

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

homeless snail
Mar 14, 2007

Yeah option strict is absolutely essential, I should probably put that in the op or something. defint was also something I used a fair amount on the last version, where everything was floating point unless you specifically declared variables otherwise, the type system seems a little bit saner in this one though so there's probably no benefit anymore

The Kins
Oct 2, 2004
Gonna recommend the games by Yoshiharu Takaoka, the designer of PC Engine game Coryoon. They're remakes of arcade games mostly using Smilebasic's pre-made RPG-style sprites, but there's some neat little additions and gimmicks that keep things interesting.

https://twitter.com/freeman_hal/status/1141884073897426945
https://twitter.com/freeman_hal/status/1168750387907555328
https://twitter.com/freeman_hal/status/1221827060022202368

The last one requires some Japanese knowledge to read the between-level hints, though...

The Kins fucked around with this message at 08:21 on Apr 26, 2020

homeless snail
Mar 14, 2007

Yeah, Monpara is an extremely good version of Mappy, definitely a pro-download. I forgot to mention I edited a bunch of pubkeys into the second post, its mostly all stuff you'll see on the top rankings in the published section though.

Tempura Wizard
Sep 15, 2006

spending all
spending
spending all my time
It’s page one and I’m very excited!
Here are some basic questions I haven’t been able to figure out because I’m a chowderhead:

Is there a command for direct mode to clear the screen of all graphics and text loaded previously?

Is there a way to put line breaks in a string for the PRINT command or do I need a new PRINT for each line of text?

ErrEff
Feb 13, 2012

Tempura Wizard posted:

Is there a way to put line breaks in a string for the PRINT command or do I need a new PRINT for each line of text?

This should work (can't test it right now):
code:
PRINT "This line is"+CHR$(10)+"split in two"

This line is
split in two
Input for CHR$ is the entire UTF-16 table from 1-65535, and decimal value 10 is "newline" or Line Feed or the dozen other names it has.

homeless snail
Mar 14, 2007

Tempura Wizard posted:

It’s page one and I’m very excited!
Here are some basic questions I haven’t been able to figure out because I’m a chowderhead:

Is there a command for direct mode to clear the screen of all graphics and text loaded previously?

Is there a way to put line breaks in a string for the PRINT command or do I need a new PRINT for each line of text?
ACLS clears everything and reloads the default sprite and font sheets

Argue
Sep 29, 2005

I represent the Philippines
So uhh, the response of my keyboard is really slow. I can't code anything like this, with it skipping letters unless I type very slowly, like 2 characters a second at most. Is that normal, or should I look into getting a better keyboard (which I can't really do because my city is on lockdown)? I haven't had trouble with that keyboard on my PC.

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

This looks kinda interesting but would probably require I get a usb hub for my switch, I assume any generic one would work?

Argue
Sep 29, 2005

I represent the Philippines
Your dock has two USB ports.

homeless snail
Mar 14, 2007

Argue posted:

So uhh, the response of my keyboard is really slow. I can't code anything like this, with it skipping letters unless I type very slowly, like 2 characters a second at most. Is that normal, or should I look into getting a better keyboard (which I can't really do because my city is on lockdown)? I haven't had trouble with that keyboard on my PC.
Wireless? Mine gets like that if I get too far from the Switch, I'm assuming there's interference from being right next to the wifi or something. Otherwise its fine

organburner
Apr 10, 2011

This avatar helped buy Lowtax a new skeleton.

Argue posted:

Your dock has two USB ports.

uh, pretty sure it has 3 but I got all of them plugged already and I am lazy enough I'd rather just get a hub.

Argue
Sep 29, 2005

I represent the Philippines

homeless snail posted:

Wireless? Mine gets like that if I get too far from the Switch, I'm assuming there's interference from being right next to the wifi or something. Otherwise its fine

Nope, it's wired. Ugh, okay, so it's not normal then.

The Kins
Oct 2, 2004

homeless snail posted:

Wireless? Mine gets like that if I get too far from the Switch, I'm assuming there's interference from being right next to the wifi or something. Otherwise its fine
Smileboom are also not officially supporting wireless keyboards or mice.

Adbot
ADBOT LOVES YOU

homeless snail
Mar 14, 2007

The Kins posted:

Smileboom are also not officially supporting wireless keyboards or mice.
I think that's mostly just to cover their rear end in case Nintendo fucks up HID support on their end or something, pretty much anything that plugs into a USB port and follows the standards should work. The official Smileboom keyboard is extremely cool though

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