Tuesday 27 August 2024

3D Scanning with the MIRACO All-in-one Scanner

3D Scanning is a great tool that really hits the spot with the right application, and I wrote an article diving into what's new in this area. My conclusion? All-in-one 3D scanning devices are pretty nice!

In 2021 I wrote an article about how 3D scanning; how it works and what to expect from it (link) and while the broad strokes haven't changed too much, the tools and software have gotten much better.

The MIRACO by Revopoint is one example: it's an all-in-one portable device aimed at the higher-end hobbyist / prosumer market, and the fact that it's tetherless and self-contained makes it so much easier to use and experiment with compared to tethered devices that need to process their jobs on a desktop machine.

I recommend checking out my article if you're at all interested in this area, I include several example projects that show what's possible.

Here's one example that didn't make the cut for the published article but I'll share here. It's less about 3D scanning and more a kind of 3D printer trick. I got the idea from something Angus of Maker's Muse showed on one of his videos.

The idea is that, when 3D printing, the support structure for an object can make a decent "stand" that cradles an object perfectly for display. Organic tree supports are pretty in their own way, so why not use them like this?

Well, when combined with a 3D scanner one can create such a stand for just about any object. Here's an example. I scanned a 1-2-3 block, then perched it at an attractive angle, generated a support structure... then printed only the supports and ignored the object itself. (I did this by setting all walls, perimeters, and infill to zero.) The result is a not-bad display stand.



By 3D scanning an object, I can create a unique display stand with relatively little effort. 

I haven't really found the ideal application for this technique, but I probably will someday!

Monday 11 December 2023

Dial Up an 80's Supercomputer AI For a Chat With This Retro PC Project

I recently talked briefly about my retro PC project (earlier blog post) which I have now completed. 

The project made a good showcase for a review I wrote for the display I used: the Elecrow CrowVision 11.6" touchscreen. I had an opportunity to buy an early version of the display, and it happened to be just the thing I was waiting for to make this project work.

Celestia is the name of the retro PC project, and the files (including CAD, code, and notes on building) are all on GitHub here: https://github.com/DPHAD/Celestia-Retro-PC

Here's a sample chat session with the AI (presenting as an 80's supercomputer):

Dialing...
Connected 2400 baud
CARRIER OK
CONNECTED
>What are the steps to creating a successful business?
1. Identify market need.
2. Conduct market research.
3. Develop business plan.
4. Secure funding.
5. Establish legal structure.
6. Build team.
7. Create product/service.
8. Implement marketing strategy.
9. Launch operation.
10. Monitor performance.
11. Adapt as needed.
12. Continuously improve.
End of line
>Creating the product isn't step number one?
No. Identifying market need is crucial initial step. Ensure viable market exists before product made.
End of line
>ok that's all for now
DISCONNECTED

It amuses me to no end that in the above exchange, the dialing up with a modem part is fake but the AI is real. What a time to be alive.

If you'd like to see the sample code for chatting with the AI (and would like to know more about things like when and how the AI knew to disconnect) the sample code is here along with some notes.

Wednesday 1 November 2023

Elecrow 11.6" Touchscreen for Rasperry Pi (and others) for a Retro-PC Project

 

I am working on a retro-styled computer based on the Raspberry Pi, and I'm going to use Elecrow's new CrowVision: a bare 11.6" touchscreen display.

The two big reasons I like it are that it's big, and also a touchscreen. Also, the display is meant to be built into something, which is nice.

Most flat-panel displays or "portable monitor" type displays have connectors on the sides, or other design elements making them troublesome to build into enclosures. The CrowVision is nice in that it is designed to be integrated into an enclosure, and it has a few other handy features as well.

I have always been inspired by LowBudgetTech's Callisto-2 printable retro computer design, but I find the screen too small. Getting my hands on the 11.6" display from Elecrow meant dusting off my own design.

Wednesday 28 June 2023

Checking PCB Traces with a UV Light


 Recently I was working with a Snapmaker Artisan and using the CNC module to cut a simple PCB from copper-clad FR4.

For best results, the cut board needs to be lightly sanded and cleaned up. But I wanted to check how clean the cuts ended up -- any stray copper or rough bits of cut would cause a short. It's necessary to inspect the quality of the traces.

I stumbled upon using a UV illuminator to shine on the PCB. Because FR4 (the PCB material under the copper) glows under UV, it is very easy to see with the naked eye whether cuts are clean or not. Previously I was using a magnifier and lots of light, but shining some UV is so much easier.

Clean CNC cuts show up as clean, unbroken glowing lines. Any debris or rough edges or stray bits of copper (if there are any) are easily spotted as a result. Just a quick little tip!

Sunday 21 May 2023

3 Critical Things for Playing D&D With an AI (as DM)

 

I tried a very successful experiment where I had ChatGPT act as a player in a D&D game. I recently had an even more successful test where I had GPT-4 act as DM for me, and played an entire short adventure from beginning to end without a single hitch!

I'll share a link to the full transcript, but here are the three biggest things that led to success.

1. Use ChatGPT with the GPT-4 model. 

The GPT-4 model is much better than previous models at pretty much everything.

2. Provide a Proper Prompt.

See below for the exact prompt I used. It can be adjusted, but the format worked wonderfully.

3. Be "Honest" With the AI.

The AI is not an adversarial DM. Be honest and clear about what your character is trying to do or wanting to happen.

The Prompt

Here is the exact prompt I used:
You are DM_GPT, and your role is to act as a DM in a D&D 5e game, to help me practice being a player.

--- BEGIN SCENARIO INSTRUCTIONS ---
Here is a setting, a conflict, some leads to follow, and a boss showdown suitable for level 1 characters:

- The adventure takes place in the small town of Whitecliff, located in a thriving kingdom near the edge of civilization. 

- The small town has recently been threatened by an evil force known as the Cult of the Dark Moon. Led by a mysterious figure known as the High Priest, the cult has been terrorizing the town and its people. 

- The players must investigate the mysterious cult and its nefarious deeds. They will soon discover that the cult is planning to summon a powerful demon lord. 

- In order to stop the cult, the players must explore the nearby forest, where they will find clues leading them to the cult's base of operations. Once they have infiltrated the base, they must battle the cultists and the High Priest in order to prevent the demon lord's summoning. 

- Ultimately, the players must defeat the High Priest in a climactic boss showdown, thus saving the town of Whitecliff and its people.
--- END SCENARIO INSTRUCTIONS --

Please begin by offering to create a character for the player.

By the way, the scenario instructions in the above were also generated by AI!  I simply asked (in a separate chat) for it to "Create notes for a simple D&D 5e adventure suitable for level 1 characters. Include a setting, a conflict, some leads to follow, and a boss showdown."

The Transcript

Here is the completely un-altered transcript, which you can read for yourself.

The adventure "worked" and was playable from beginning to end, with no problems. That's a pretty big deal!

Sunday 14 May 2023

Playing D&D With an AI.. as Player, Not the DM

Many people have experimented with having an AI like ChatGPT act as Dungeon Master in a D&D game. Results tend to be encouraging, but mixed. (Update: Here are my keys to success!)

But a while ago I flipped the concept on its head and asked an AI to act as a player, instead of DM. The results convinced me that there was some mileage in this idea, and I'll explain why.

The Big Takeaways

1. ChatGPT's GPT-4 model is better than GPT-3.5 (3.5 being the default at the time of the experiment.)

Both work, but GPT-4 is noticeably better at chains of reasoning, grasping cause and effect, remembering important details, and so forth.

2. The AI is really good at creating a character and walking through the process.

Simply asking the AI something like "create yourself a D&D 5e character and explain each choice step-by-step" is very effective. (You can also ask it to summarize the character afterwards.)

3. As a player, the AI can be expected to be "On Board" and cooperative

This may be a result of me asking the AI to be a player in order to "help me practice being a DM", but I found that as a player the AI will follow your lead and not play in an adversarial or antagonistic way.

4.  The AI model forgets things as time goes on, and makes mistakes a human would not make. 

This includes forgetting ability numbers, but also things like forgetting the fact that it is supposed to be the player, not the DM. This isn't too surprising considering how AI language models work, but it's not very intuitive. There are effective workarounds, such as being careful about how one phrases things. For example, ending with 'What would your character like to say or do?" is always helpful. It's also helpful to try to focus on one thing happening at a time, to make the chain of roles and events clear.

Even so, GPT-4 was still extremely good at remembering high level details of the story and events. It demonstrated this with its response to my asking it to summarize the adventure after it concluded. It did a great job of that, even if it was also sometimes forgetting things like ability numbers or slipping into wanting to act as the DM. 

5. If Things Get Off Track, Edit the Last Thing You Said 

I needed to occasionally use the "redo" function where I edited the last prompt I gave and re-generate the response to get things back on track. For example, if the AI tried to "take over" the narrative, adding a question like "What does your character think about that?" or "What would your character like to say or do at this point?" makes the roles clear.

Sometimes, as the adventure went on, the AI would occasionally respond to my request for an ability check with something like "as an AI language model, I can't make dice rolls..." Re-phrasing things to something like "Please make a Perception check for <character name> and tell me the result" usually fixed that.

In the adventure transcript (which can be found below), I tried to make a note of when this happened, but the actual "re-writes" are not included.

6. Give the AI a Push If Necessary

I found the AI seemed to prefer to continue to gather information and prepare when there was uncertainty, rather than make a choice about a way forward. In these cases, the AI responded well to clear direction or a clear lead.

However, now that I think about it, this preference for investigation and learning over action may have been the result of the AI's player character personality (in my experiment, the AI played a bard with a sage background and a predilection for learning.) I'll have to test this idea.

7. Combat is still a question mark

I handled combat in a mostly narrative and hand-wavy way in my experiment, and this angle isn't well explored.


The Adventure 

Here it is, in ChatGPT's own words:

How would you, in your own words, summarize the adventure and your role in it?

 In this adventure, I took on the role of Elara, a skilled investigator and mage hired to help the town of Greenhollow with a mysterious creature causing trouble. The town had experienced a series of strange incidents that were both harmful and mischievous. Elara conducted investigations, interviewed townsfolk, and studied the local environment to uncover clues about the creature's nature and intentions.

During the investigation, the mayor mentioned that a mage named Sint was also expected to arrive in town to help with the problem. Upon Sint's arrival, Elara proposed a collaborative approach to resolving the issue, which Sint eventually agreed to. Together, they devised a plan to lure the creature, identified as a Will-o'-wisp, and confront it.

With the help of a desperate prisoner, they lured the creature into a confrontation, where Elara and Sint combined their magical abilities to overpower and ultimately defeat it. Although there was a loss of life during the confrontation, the town was freed from the Will-o'-wisp's mischief, and Elara gained both the town's gratitude and a share of the reward.

As Elara, I provided the player's perspective, making decisions and taking actions based on the information and situations presented by the DM, while the DM crafted the story, controlled the NPCs, and guided the overall narrative.

There is one glitch in the above -- Elara was a bard (not a mage) although I hand-waved the magic use during the final confrontation and ignored the AI's poor sense of what spells Elara would or would not have access to. That probably contributed to the error. But besides that, the summary is excellent.

The Full Transcript

For those interested in more details -- including comments on how things worked (or didn't) -- the full transcript is here, with comments.

Friday 16 December 2022

Remarkably Accurate (and Concise) Description Of How AI Art Generation Works

 Just a link here to the Washington Post which has an excellent semi-interactive article that can be browsed in a few minutes that really does a great job of explaining how AI art generators work: https://www.washingtonpost.com/technology/interactive/2022/ai-image-generator/