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

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

Mm, probably somebody adjusting the styling of the thing right now.

Hopefully, it won't be as vague as the ingame manual in some places.
 
Yeah, just to confirm, all I see is the error list on that page. I assume they're adding each part of the manual little by little and very slowly, by the looks of things.
 
I know it probably permanently damaged my eyesight, but there's something oddly satisfying about programming on the DS itself. I just spent like an hour in bed writing part of a game, using the built-in help to look up commands.

Little side note for anyone who didn't figure it out, if you want to get an input without printing a ? or a newline you should be able to do something like this:

Code:
PRINT "Enter command: ";
LINPUT SOMEVAR$

And then I think you can use the VAL() function to get a numerical value from the string if you need to, though I didn't try that.
 
Ok, here it is!

xMF8m.png

You can scroll around the whole Dragon Quest 1 map smoothly. Diagonals are a little jittery because Petit Computer is not fast enough to draw both a horizontal and vertical row of tiles in the same frame. It wouldn't be a problem if I split up the horizontal/vertical drawing between two frames but this is just a demo. :)

As it says on the pic, the program draws new tiles just off screen when it needs to scroll in that direction. If you're moving to the right, it draws the next column to the right. If you're moving downward, it draws the next row downward. When drawing columns it actually draws one extra tile on the top and bottom so it takes care of the corner tile when moving diagonally.

Took a lot of messing around but it's satisfying. I could add some more user-defined variables and make it very adaptable for any type of map array, usable in platformers etc.
 
It sounds like you're on the cutting edge of performance -- do you think it would be viable in platformers or RPGs, or only if they ran at 30 fps?

Also requiring 12 images for just the map engine kind of scares me to think what an actual game would be like. :P
 
Here's an optimization tip that works especially well for wrapping values. I noticed a lot of code going like:
Code:
BGY=OLDY+Y
IF BGY>31 THEN BGY=BGY-32
IF BGY<0 THEN BGY=BGY+32

However, since 32 is a power of 2, this can be reduced to:
Code:
BGY=OLDY+Y AND 31

I think optimizations like this can be quite substantial when contained in loops, like the above code was.
 
So, I was curious about exactly how much storage space Petit Computer offered for user programs, so I did a few tests.

I generated the largest program I could fit into memory (a little over 5000 lines of 100 characters each) and, after saving, Petit Computer lists it as taking up 535012 bytes of storage space - or about 522KB each.

I manage to store save 19 copies of that before getting an "Insufficient Memory" error. I was still able to store an additional 204824 byte file, but that was the hard limit.

The total amount of stored user data was 10370052 bytes, or about 10127 KB, or about 9.8 MB.

PetitComputer consumes 117 blocks of internal memory, and I believe that 1 MB is equal to 4 blocks of space. That means the total storage space for PetitComputer is just about 30MB, with roughly 1/3 of that space being dedicated to user file storage.
 
Here's an optimization tip that works especially well for wrapping values.

Oh snap, you're right. That's awesome. I need to think lower level, assembly-style.

It sounds like you're on the cutting edge of performance -- do you think it would be viable in platformers or RPGs, or only if they ran at 30 fps?

Also requiring 12 images for just the map engine kind of scares me to think what an actual game would be like. :P

It would easily be viable in Dragon Quest-style RPGs even running at 60 FPS, I think. The screen generally never has to scroll diagonally and there's not a lot of real time processing to do. I really don't know about platformers, where you have to process lots of different types of AI movement, bullets, particles, etc. Probably at 30 FPS. My demo scrolls a maximum of 16 pixels at a time, it would require more draw time if you needed to scroll faster because that's two rows/columns at once...but as you can see it's probably fast enough, scrolling 16 every frame is good enough for a Sonic-like game.

As for size...according to Petit Computer, the above program has a size of 28340, which means each QR code accounts for about 2361. Without the included graphic and color bank (1 of each), it's 19664, which would be about 8 QR codes. That's 365 lines of code, much of which is taken up by the map data.

Without the map and music data, it's only 4216, 192 lines of code. The size decreased so much because the data lines are so long. So just the engine and some extra code to work with it is only about 2 QR codes.

Map data in practice could be a lot smaller. A lot of NES games used a technique we call metatiles, where 1 "tile" is actually a set of 4 16x16 "tiles," which itself is a set of 4 8x8 tiles. For example, you start with tree top left/top right/lower left/lower right, but together that equals one 16x16 tree tile.

DATA 7 'ID #7 = tree
DATA 0,1,2,3 'define the 8x8 parts that make it up

Then you go one step further, and make up tiles out of that tile and other tiles:

Data 70 'ID #70 = forest tile
Data 7,7,7,7 'define the 16x16 parts that make it up

DATA 71 'ID #71 = forest with path on the right
DATA 7,8,7,8

DATA 72 'ID #72 = forest with path on the left
DATA 8,7,8,7

etc. etc. You get to the point where you could store a whole screen in 16 metatiles, and then compress that with better compression than RLE, and you can fit quite a bit more data. But of course you have to write routines that can interpret this stuff too.

Probably would want to compress text as well for RPGs, which gets complex.
 
UncleSporky, is your plan to port all of dq1? That seems like the game is too big just judging by your demo.

No, my plan was to write an engine that can scroll around maps larger than 512x512. I might work on a platformer using the engine or do some other stuff.

DQ1 would be pretty big, but there are ways to get around the 9999 line limit. Someone at another forum found it but I don't know if I can link it because it deals with hacking and possibly piracy. Basically you can use EXEC to run another program and the current variables stay intact, so you can add a hook at the start of each program to pick up where you left off based on flag variables. You could run your text storage and decompression program to fetch the next NPC's dialog, etc.
 
Basically you can use EXEC to run another program and the current variables stay intact, so you can add a hook at the start of each program to pick up where you left off based on flag variables.

I was wondering if EXEC kept variables intact -- I assumec it did as you have to manually clear them each time you break and reRUN a program, but...

I'm a tad annoyed that APPEND can't be used within a program. I had some fun ideas for that...

(Piracy? I thought DSiWare was still pretty much hack-proof...)
 
I was wondering if EXEC kept variables intact -- I assumec it did as you have to manually clear them each time you break and reRUN a program, but...

I'm a tad annoyed that APPEND can't be used within a program. I had some fun ideas for that...

(Piracy? I thought DSiWare was still pretty much hack-proof...)

The site does hacking on many different platforms.

I guess I can just post his code, credit goes to DiscostewSM.

Program named Test1:

IF RETFUNC$ != "" THEN GOTO RETFUNC$
CLEAR
PRINT "Start in Test1"
RETFUNC$ = "@RETURNME"
RETFILE$="TEST1"
EXEC "TEST2"


@RETURNME
PRINT "Returned to Test1"
WAIT 120
CLEAR
END

Program named Test2:

IF RETFUNC$ != "" AND RETFILE$ != "" THEN GOTO @FUNC2

PRINT "In TEST2"
END

@FUNC2
PRINT "Inside FUNC2 of TEST2"
Print "Returning to TEST1"
EXEC RETFILE$

Pretty cool.
 
I made a text adventure engine (choose-your-own-adventure style, no typing). Hopefully it will be helpful to new programmers who want to make something fun to share with others. There a sample "adventure" included to help show off how it works. It's extensively commented to explain as much as I could about how to use it.

 
This program really makes me long for a C/C++ compiler for homebrew. The day a major handheld company let people do that would be crazy though.
 
I made a text adventure engine (choose-your-own-adventure style, no typing). Hopefully it will be helpful to new programmers who want to make something fun to share with others. There a sample "adventure" included to help show off how it works. It's extensively commented to explain as much as I could about how to use it.

Welp, this pretty much blows what I was working on right out of the water, lol. The whole interface is much cleaner and slick than what I've been doing, so I'll be studying the code to see what you did there. Thanks!
 
This also looks neat, Petit Slash, but it's also entirely in Japanese. Action RPG-ish thing like Hydlide and Ys. A guy at Something Awful posted it and is considering translating it.

Here's the upload site they got it from, lots of stuff there but not many ways to know what you're getting unless you know Japanese.


I've been adding entries to the petitcomputer.wikia.com wiki for all the Japanese programs I've been trying out -- generally just a title, 1-2 sentence description, and a link to either the puchikon wiki page OR the download page from of of those archives.
 
Someone should tweet at Notch about this program. It seems right up his alley with 0x10c and minimalistic games. Though then again, considering all the stuff he's presumably distracted with, maybe it's not a good idea to tell him. :P
 
Okay, I never knew this...

Looking at the source code for IN THE ROOM, I found out that ? (the question mark) is an alias for PRINT.

I wish this was mentioned in the manual, lol. Unless it was, and I'm blind...
 
I finished my first game! It's pretty simple but it was a fun first project and I learned a lot doing it. It plays kind of like Snake and the object is to pilot around a ship to collect falling people while avoiding stars. I might tweak it later but I think I'm done for now.

Xe8sM.png
EFtUH.png
 
Nintendolife posted an interview with the Smilebit guy--here's the question you all wanted an answer to:

Now that this title is available in North America, are there any plans to release it in Europe?

We never wanted Petit Computer to be limited to just Japan and America, and we would like to see it being used all over the world. But to achieve that, we will have to deal with issues such as localization into a range of different languages. We hope that we will be able to realize our hopes and meet the expectations of the many users we think would be interested in this software.

http://www.nintendolife.com/news/2012/08/interview_smileboom_petit_computer
 
It appears someone was asking about the Hunt the Wumpus port I did, so I finally got around to QR-encoding it and putting it up on the wiki.

Before anyone gets excited, it's a really basic conversion. It's still all text and requires answers to be entered on the touch screen. If you examine the source, you'll notice a variety of labels with numeric names -- I've been experimenting with "automated conversions" of old BASIC programs, and this is one of the first few results. I still need to get it fully automated (for SIMPLE BASIC programs only), but it will save time with regards to deleting/renumbering.

Hunt the Wumpus QR Code: http://petitcomputer.wikia.com/wiki/Hunt_the_Wumpus

Wumpus_ver_1.png


(Not sure if hotlinking from the wiki works -- we'll see)
 
I finished my first game! It's pretty simple but it was a fun first project and I learned a lot doing it. It plays kind of like Snake and the object is to pilot around a ship to collect falling people while avoiding stars. I might tweak it later but I think I'm done for now.

Xe8sM.png
EFtUH.png

Fun game! Very arcade-y, twitchy and fast paced. My kind of game.


Good stuff. I killed the Wumpus on my 2nd playthrough. Even for being all text, I enjoyed it.
 
According to that interview you linked to above, the CEO of SmileBoom really wants to see the competition go worldwide, so it sounds possible that it's more open. Maybe they'll post something about it on the official website for our region, though the timing seems kinda tight.

Do you have any plans to let users share or develop programs via the Petit Computer website?
Well, in Japan, communities of users have come together to organize things like their own programming contests. If this is something that users are interested in, we would very much like to attempt something like this on a global scale.
 
Someone asked Kobayashi-san if the contest was open to NA participants on Twitter--I don't think he said "no", but I'm just going off Google Translate. Anyone wanna clarify?

https://twitter.com/notohoho/status/232783469120471041
"Thank you for your question. There aren't any particular restrictions in place, so any Petitcom user can enter. However, since the rules of the contest were written for Japanese users in particular, the threshold for entering was unfortunately made a bit high. For subsequent ones, we'll consider cooperating with GameBridge to make a more worldwide contest possible."
 
^^Someone's actually watching my twitter updates! Who knew?!

"Thank you for your question. There aren't any particular restrictions in place, so any Petitcom user can enter. However, since the rules of the contest were written for Japanese users in particular, the threshold for entering was unfortunately made a bit high. For subsequent ones, we'll consider cooperating with GameBridge to make a more worldwide contest possible."

Excellent, thankyou!
 
Many new programs on the Wiki -- anyone else have any upates? I've gotten bogged down on my dungeon crawler...
 
Nice, a programming language for 3DS/DSi... I hope it's a not a too old basic (I spend years with Basic 1.0, with no real function support (only GOSUB), I wouldn't like doing this again.

I'd rather program on computer rather than directly on DS, though.

It's Ada or nothing.
Would have been an interesting (and good) choice, but far more surprising...
 
I just got a nostalgia rush - I stated programming with an old sharp pocket computer:
PGtu0.jpg

It helped me learn how to improve in programming, basically how and why to use functions and how to save space (there was only 32kb). Created text adventures/RPGs with it and while it took like 30 minutes to get through the first game, my fifth game already had multiple dungeons and towns and I think it took my brother around 2-3 hours to get through it. I think I still have a map of it.
It's good to see that software released on the 3DS.
 
Wow, that's super impressive. I'm surprised it seems to perform that well.

Nice, a programming language for 3DS/DSi... I hope it's a not a too old basic (I spend years with Basic 1.0, with no real function support (only GOSUB), I wouldn't like doing this again.

I'd rather program on computer rather than directly on DS, though.
Are there any ways to edit a program on a PC and convert into a QR code for downloading? I would guess so...
 
Seeing the Mega Man gives me flashbacks to an unreleased Mega Man clone I made, it's making me feel nostalgic. lol Really though, with performance that great, I think I might want to try Petit Computer for myself.
 
Mega-bump to let people know Petit Computer will be out in PAL territories on July 25 for 800 Nintendo Points / 8 Euro / 7.20 GBP. I'd already given up hope, how about you?
 
Top Bottom