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:

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

Connected 2400 baud
>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

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.

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.

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:

Thursday 8 December 2022

My Inter-dimensional Camera Takes Photos of an Alternate Reality

I had an idea recently that I quickly prototyped: The Interdimensional Camera.

The idea is that the camera takes images not of the reality directly in front of the lens, but from a neighboring dimension (or parallel universe, if you prefer.)

It uses the Dall-E API from OpenAI to turn what the camera sees into an alternate-reality version that is kind of close, but also entirely different.

The original image -- what the camera ACTUALLY sees -- is actually never shown to the user, which feeds the narrative that the camera is somehow seeing into an alternate reality.

What keeps this from just being a crappy snapchat filter knock-off is the fact that it works on ANYTHING. Not just people, not just faces, but ANYTHING including objects, scenery, animals, plants, etc.

Check out the code and details if you're interested.