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

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

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.

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

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

homeless snail
Mar 14, 2007

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

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

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

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.

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

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

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

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.

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.

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

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.

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.

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

homeless snail
Mar 14, 2007

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

homeless snail
Mar 14, 2007

Famicom emulator spotted
https://twitter.com/otya403/status/1257918634246066178

homeless snail
Mar 14, 2007

Finally got off my rear end and wrote the controller support for this thing, performance is not good though. Drops down to 30fps at around 2000 particles iirc, depending on what those particles are. Got some optimization work to do

https://twitter.com/itssnails/status/1263717203452420096

homeless snail
Mar 14, 2007

In the little bit of profiling I've done, it turns out array accesses are a killer, if you're doing a couple thousand of them a frame at least. Range checking or something I guess

homeless snail
Mar 14, 2007

Yeah, there's no way to export constants. Best you can do is put all your consts and enums in one big block and copy them over, and hope you never have to change them

homeless snail
Mar 14, 2007

I don't think it's universal, but most of them seem to

homeless snail
Mar 14, 2007

overeager overeater posted:

Have SmileBoom said anything about when this is going to be available in Europe again?
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

homeless snail
Mar 14, 2007

The circumstances with SB3 were a little different, because they actually had to do the localization and stuff in that time, where its already all done with SB4 they just had to pull it for whatever the deal with the ratings was. Smileboom is a small company though and the EU release might not be their top priority

homeless snail
Mar 14, 2007

https://twitter.com/smilebasic_com/status/1272803013439000578

English translation is a little improved, and they did some wild poo poo to the data reading functions

Adbot
ADBOT LOVES YOU

homeless snail
Mar 14, 2007

https://twitter.com/smilebasic_com/status/1272953964686794753

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