• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Petit Computer (BASIC Programming Software) Coming to the DSi/3DS eShop in NA

A big boys version of this for WiiU would be brilliant.
 
What do you mean I can't use curly brackets?!

Hahaha. I'm really surprised Nintendo's letting an interpreter onto their system. Maybe this is their solution for indies? :P
 
I'm going through the command list, and noticing a few things...

1) The command list appears to let you use a single = instead of an ==, although this might be only for simple "LET A=5" types of commands... that is, "A=5" is okay, but perhaps not "IF A=(5*X)"

2) Like all good versions of BASIC, short commands are fine. ? instead of PRINT, for example.

3) BASIC itself allows you to send/receive files to local DSi/3DS units. I was a bit surprised by that -- I was assuming some sort of "menu", but...

4) Built in speech synthesizer. I'm curious how this will be implemented for English...

5) No "true" file access, annoyingly. I was hoping for the ability to import/export data from files (even with simple LINE INPUT and PRINT commands), but that doesn't exist. What's somewhat problematic about that is that, unless I'm wrong, there would appear to be no way to -save- data from within a program.

Am I missing something? It seems like there would -have- to be some sort of file writing capabilities...

EDIT: I'm using Google Translate to page through the manual, and I'm getting the -vague- impression that you can use SAVE from within a program to ... do something. It almost looks as though you can tell it to save additional data, but...

EDIT 2: Okay, using the sample programs' source, it appears you can "SAVE" and "LOAD" data from a "MEM"ory file, part of the program file package. From within a program, you appear to be able to do:

SAVE "MEM:RandomData"
LOAD "MEM:HighScores"


Assuming this works the way I think it does, it should mean we have file support after all. This will be helpful when attempting to port old adventure games, depending upon the size of the MEM area/device.

If that save/load function doesn't work there's always passwords!
 
Yeah, that's how you save things from within the program. I learned that from one of the FAQ pages at this Japanese wiki, which also has a lot of demo programs and such.

This is how they present it:

HISCORE=100
MEM$=STR$(HISCORE)
SAVE "MEM:HISC"

LOAD "MEM:HISC", FALSE
HISCORE=VAL(MEM$)
PRINT HISCORE

Also, the speech synthesizer is not in our version. There was some licensing issue with the technology, but it probably wouldn't be much use with english anyway. (Read this in a Japanese tweet)


I'm thinking of working on a set of routines to display maps larger than 512x512 pixels (the size of the BG). From watching videos on youtube, it seems that nobody knows how to do this or bothers to do this. All you do is read from map data and draw a new column/row of tiles whenever the screen scrolls. It even loops at the edges so you can just keep scrolling in any direction, drawing new tiles wherever you scroll.

I decided to use the Dragon Warrior 1 world map, and I'd rather not rewrite the whole map myself, so I googled some docs about how DW1 stores its data. Pretty simple actually, it's a format like "4 water tiles, followed by 6 grass tiles, followed by 2 mountain tiles" etc. So now I have that in hex and I have to convert it to something Petit Computer will be able to read (DATA &H41, &H3A, &HE8 etc.).
 
I programmed a few video games in QBASIC back in high school; anyone know how similar the two are? A few advanced classmates remade Final Fantasy I in QBASIC, so if we're looking at that level of capability, then count me in.
 
I programmed a few video games in QBASIC back in high school; anyone know how similar the two are? A few advanced classmates remade Final Fantasy I in QBASIC, so if we're looking at that level of capability, then count me in.

They're very similar. In some ways this is better, in some ways it's worse, but you should be able to do similar things with them. This program doesn't have lots of data types or user defined types/structures, but it makes it easier to handle sprites and graphics, rotation, scaling, collision detection etc.

can you do your own sprites or do you have to use what is built in to the system?

You can do your own sprites. It comes with editors built-in, and you can actually edit the editors if you want for whatever reason.

In fact, Smileboom has been posting some free extra graphics on their site for people to use. It looks like they want people to make their own Advance Wars!

http://smileboom.com/special/ptcm2/co_present/html_present03.php

EUWpE.png

8RPIU.png


http://smileboom.com/special/ptcm2/co_present/html_present04.php

Q8sxV.png

MTIwZ.png

Ybq6F.png

nAdmX.png


QR codes at the site, including palettes.
 
Yeah, that's how you save things from within the program. I learned that from one of the FAQ pages at this Japanese wiki, which also has a lot of demo programs and such.

This is how they present it:

HISCORE=100
MEM$=STR$(HISCORE)
SAVE ”MEM:HISC”

LOAD ”MEM:HISC”,FALSE
HISCORE=VAL(MEM$)
PRINT HISCORE
Is there a way to create the MEM/Data files -other- than the Save command within the program? The PC editor utilities doesn't seem to touch MEM files, unless I'm wrong... and what is the size limit on MEM files?

I was curious about porting some text adventure interpreters, but you need data file support...
 
Is there a way to create the MEM/Data files -other- than the Save command within the program? The PC editor utilities doesn't seem to touch MEM files, unless I'm wrong... and what is the size limit on MEM files?

I was curious about porting some text adventure interpreters, but you need data file support...

I don't know, I don't see anything about it in the manual. But personally I would not be too worried about it.

If you can make sense of this page, it shows how its file system works somewhat. MEM files are there alongside every other type of file. PRG can reach 9999 lines of code, so I bet MEM can grow pretty large as well.

It's frustrating if the only way you can interact with them is through commands, but we'll see. Looks like the main menu lets you perform some operations on them too such as renaming.

If you need to "seed" a file with data, it might be best to put it in DATA statements and write a quick program to read those and send them back out to a MEM file. But apparently loading from a file takes some time, so if you have room to use DATA statements for data that doesn't need to change, that's the best solution.
 
I don't know, I don't see anything about it in the manual. But personally I would not be too worried about it.

If you can make sense of this page, it shows how its file system works somewhat. MEM files are there alongside every other type of file. PRG can reach 9999 lines of code, so I bet MEM can grow pretty large as well.

It's frustrating if the only way you can interact with them is through commands, but we'll see. Looks like the main menu lets you perform some operations on them too such as renaming.

If you need to "seed" a file with data, it might be best to put it in DATA statements and write a quick program to read those and send them back out to a MEM file. But apparently loading from a file takes some time, so if you have room to use DATA statements for data that doesn't need to change, that's the best solution.

Actually, I see a bigger problem -- I was stumbling through the Wiki and it -seems- to say that you can only -export- programs to SD, not import them from that. All importing seems to require reading QR codes.

I was hoping for easy "open PTC file, edit, load back on SD", but...
 
Actually, I see a bigger problem -- I was stumbling through the Wiki and it -seems- to say that you can only -export- programs to SD, not import them from that. All importing seems to require reading QR codes.

I was hoping for easy "open PTC file, edit, load back on SD", but...

To be honest if it's not too hard to get it to read, I prefer QR. I'd rather not continually eject/insert the SD card, I've had a few go corrupt on me doing that, even though I try to be careful about removing safely.

Can we hold multiple sprite sheets?

4 banks of background tiles (2 are shown above) and 8 banks of sprites (4 are shown above). You can reference them at any time by number, it works out to 512 8x8 sprites and you just say "load sprite 512" and there it is.

You can also swap out banks at any time, as many as can be stored on your SD card. You just load the filename and suddenly have a new tile set.
 
OMG those Peticom Wars sprites! Ghost Soldier!!! :3

I can't program for shit but I'm buying this to support it. Hopefully importing programs is relatively easy.
 
Petit Computer has a page up on the eShop -- everyone go add it to your Wish List! (You will need to search for it, mind you.)
 
couple questions,

1. is it possible to make an RPG with this? and if so, has anyone made an RPG with petitcom yet?

2. i've never used BASIC before but i am very interested in this. is there any free tutorial program on the web that introduces the basics of BASIC?
 
couple questions,

1. is it possible to make an RPG with this? and if so, has anyone made an RPG with petitcom yet?

2. i've never used BASIC before but i am very interested in this. is there any free tutorial program on the web that introduces the basics of BASIC?

I believe you can re-create most games from the 80's with it.
 
1. is it possible to make an RPG with this? and if so, has anyone made an RPG with petitcom yet?
Theoretically, yes. I'm not entirely sure as to the limits of the game, but...

2. i've never used BASIC before but i am very interested in this. is there any free tutorial program on the web that introduces the basics of BASIC?
There should be dozens -- the problem is that each variation of BASIC is slightly different, so it might be better if there were a Petit BASIC tutorial -- especially as the graphics commands will be entirely unique to the software.
 
At least one person has worked on an RPG for it, it's possible. Though if it's been your lifelong dream to make an RPG and you think this is the perfect opportunity to make one, it probably isn't. Making an RPG on this platform is going to be a lot more restrictive than on PC and will be played/seen by far fewer people. It might be easier to learn how to work with RPG Maker. It supports programming but is a lot more drag-and-drop and will ease you into some programming concepts better.

As for good free BASIC tutorials online...there are probably hundreds of them. I wouldn't know what to recommend to you other than to Google it. Any given version of BASIC is not going to be exactly the same as in this program, but learning any programming language will help you learn and use others too.
 
Text RPGs will be easier than graphical ones. I'm not even going to touch the graphics part off BASIC...
 
Text RPGs will be easier than graphical ones. I'm not even going to touch the graphics part off BASIC...

Petit Computer has built-in commands for accessing the DS 2D graphics hardware (tile background layers and sprites), so you don't need to bother with programming the drawing of individual pixels. You can easily load and move/rotate/scale a sprite around the screen.
 
Petit Computer has built-in commands for accessing the DS 2D graphics hardware (tile background layers and sprites), so you don't need to bother with programming the drawing of individual pixels.

Oh, I know -- I'm just saying I am unlikely to do that. I'm more likely to tinker with text mode, perhaps tossing some graphical imagery up as a tiny enhancement.
 
thanks for the responses guys. what about graphic adventure games like Snatcher?

Edit: sorry, one more question. how big can the games be in petitcom?
 
I'm skeptical that you'd have enough memory/storage to do that, but the genre should be possible.

The 4 banks of BG tiles are 256x256 pixels worth of graphics. The DS screen is only 256x192, so you could display a full screen background image and have half a bank of tiles left for other stuff. If you did some other tricks like reusing tiles for sky/walls/etc. and using a smaller visual area in the middle of the screen (HUD below it, black bar on top), you could get a couple screens worth to scroll between like the Monkey Island games.

Sprites could be used for animated elements on the screen, or heck, even further parts of the background. The biggest sprites can be 64x64, so you could make one full screen out of BG tiles and the screen next to it could be 12 massive sprites using the same palette as the BG. :)

Really I don't know if there is a limit on graphics, just the size of your SD card, so you could possibly make a nice little adventure game for it. I'd be more worried about the best way to store the text, since programs can only be 9999 lines...though you can load other program files from within your program, but I don't know what that does.
 
Really I don't know if there is a limit on graphics, just the size of your SD card, so you could possibly make a nice little adventure game for it. I'd be more worried about the best way to store the text, since programs can only be 9999 lines...though you can load other program files from within your program, but I don't know what that does.

Now, I could be entirely wrong, but I had the impression from the Wiki that you can't actually ACCESS anything on the SD -- that the only support the program has for SD is to -export- programs for use with the QR encoder. It sounded like all program data had to be in the DSi internal memory.

If this is true, it would place a fairly hard limit on loading "images".

(I had the impression that "loading other programs" just means you can essentially RUN another BASIC program on the fly. This would get around program size limitations, although not storage ones.)
 
It's possible. I guess we'll find out in a few days.

DSi's internal memory is 256 megs which is still quite a bit for these types of simple programs. Or if you mean we only have access to DSi's RAM, that's only 16 megs...but I think we've got access to more than RAM. Some videos of Petit Computer games show brief loading screens, and the manual also warns of load times when you use save/load commands. If it was all in RAM, I'd expect loading to be faster.

One bank of sprites from Smileboom's site is 5 QR codes. The maximum amount of data a QR code can hold is 3 kB, meaning each bank is 15 kB at most. This means you could fit 68 banks of custom graphics in 1 meg, enough for a lot of cool stuff even if we were only limited to DSi's RAM.

An earlier version of the game in the above video is only 20 kB, according to its creator. Of course it uses default graphics.


On another note, I found out something else too: MEM files are literally just one string of up to 255 characters in length. This just means we have to be a little smarter about saving data. You could store multiple numbers one after the other, separated by comma, for example. You can convert your numbers to hex in order to save a few characters (65535 = FFFF). If you don't need numbers over 255, you can convert them to characters and save up to 255 numbers from 0-255. This is probably what I'd do. Convert strength/constitution/dexterity/wisdom/intelligence/charisma to characters (which will look like $x#2|R or something), then reverse the process when loading.
 
Now, I could be entirely wrong, but I had the impression from the Wiki that you can't actually ACCESS anything on the SD -- that the only support the program has for SD is to -export- programs for use with the QR encoder. It sounded like all program data had to be in the DSi internal memory.

If this is true, it would place a fairly hard limit on loading "images".

(I had the impression that "loading other programs" just means you can essentially RUN another BASIC program on the fly. This would get around program size limitations, although not storage ones.)

A 3DS version would be amazing since there would be no such restrictions. It would make it possible to send/receive programs via SpotPass or even have an online gallery, like Colors 3D does.
 
I'm buying this day one almost entirely on the assumption that if a ton of other people do this they'll make a 3DS version.
 
I was just searching around youtube and seeing what people are making with this thing and wow, some amazing stuff out there.

This guy built a music synthesizer. There's like, almost 60 QR codes on his webpage. Here's a video demonstration, it looks awesome: http://www.youtube.com/watch?v=OUtNzLg1OeU

Wow, I had no idea we could even use the lower screen for our programs to have touch screen controls, as everything I've seen so far was just the program running on the top screen.
 
I have an idea in mind already, but it may be beyond both my skills and the scope of the game . . . we'll see. It does look more and more like we're strictly limited to a 10,000 line program, a few graphic banks, and 1 byte "save files".
 
I have an idea in mind already, but it may be beyond both my skills and the scope of the game . . . we'll see. It does look more and more like we're strictly limited to a 10,000 line program, a few graphic banks, and 1 byte "save files".

The limitations are the whole point of it, I think: roughly replicating the experience of writing BASIC programs in early home computers. It's not supposed to make SNES games, as example and part of the fun is figuring out how to get the most out of it despise the limitations, kinda like writing 64K demos, as example.
 
The limitations are the whole point of it, I think: roughly replicating the experience of writing BASIC programs in early home computers.
I'm just annoyed as it may be more limited than my old Atari XEGS.

The graphic/drawing program on the official site carries a notation about drawing backgrounds for adventure games -- I'm curious about limitations for storage.

(Yes, I have work-arounds in mind, if necessary...)
 
The more I see about this, the more excited I become! Going to have to brush up on my programming skills, and maybe buy a book.
 
I have an idea in mind already, but it may be beyond both my skills and the scope of the game . . . we'll see. It does look more and more like we're strictly limited to a 10,000 line program, a few graphic banks, and 1 byte "save files".

255 byte save files. :P A single string of that length with every character being 1 byte.
 
It would seem like you ought to be able to get around the limit by segmenting your data across multiple files.

Is there a limit to the number of MEM files for a given program?

That was my thought. In my searches on Japanese sites I came across a program with at least 7 MEM files.

I think the only limit is storage space. You can name them anything you want up to 8 characters.
 
There is no INT command. FLOOR is basically INT (or they tell you to use it that way). But FLOOR is typically a round down command, and I don't see a way to round up. It'll require some testing when we get our hands on the real thing.

EDIT: I seriously don't see a command to round up. On the "basic math" page they list FLOOR, RND (random numbers), ABS (absolute value), and SGN (returns ±1 or 0). You'll just have to write a subroutine for it. If FLOOR(X + 0.5) > FLOOR(X) then X = FLOOR(X) + 1.

Round up (as in CEIL) can be done with -FLOOR(-X)
Round nearest can be done with FLOOR(X + 0.5)
Not too hard at all.

I'm buying this day one almost entirely on the assumption that if a ton of other people do this they'll make a 3DS version.

I doubt they would do that, because it would split their userbase completely (different screen resolutions, and who knows if the 2D graphics engine even works the same way as the DSi's)
 
I don't think Nintendo would want to allow a 3DS version. They already know people can do DS homebrew anyway, so they'd probably rather have people doing it this way where it's somewhat limited and they at least get a cut of the money, but there is no 3DS homebrew, and I'm sure they'd rather keep it that way.
 
The more I see about this, the more excited I become! Going to have to brush up on my programming skills, and maybe buy a book.

I could use something like that. I literally haven't programmed anything since BASIC, but now I kinda wanna get back into it.

I guess over in Japan they have a book dedicated to programming in BASIC for Petit Computer. I wonder if we'll see an English equivalent anytime soon.

Wait, you can split your program data across multiple QR codes?

That's certainly what it appears to be. I noticed this with other Petit programs that I've found as well.
 
I'm super happy this is coming to the DSi store. This may be the first thing I've ever bought on it. :D And some things people have made are crazy impressive!
 
Top Bottom