A New Tool Part 3

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am continuing on the path to building an anti feline century. Let’s get started.

Last week, I talked about boat port stuff, this week because I had Tango over to review that project. This last week, I actually made a contact with what I hope will be a regular, new resource for help on projects. My long term goals include getting a comments section where people can crowd solve the problem, but as of this writing, I don’t think I’ve had a comment in the first whole year. Maybe I don’t have that set up, but for now, I’m mapping the project up.

So far, I’ve gotten most of the electronics I’ll need, barring the highly specialized speaker/transducer and supporting circuitry; I’ve printed the bottom half of the case and figured on about the orientation everything will be; and I’ve started on the tutorials. Apparently, I forgot Shift-Middle-click moves the camera’s focus point around the scene.

The next step is still to finish learning Blender well enough to model the upper half of the case. Putting the hardware all together will follow after I have something to make the sound. After that, I have software development. I’ll need to research how to use OpenCV and figure out how to make it identify a cat. Once that’s reliable, I can hook up the sound and set it up for operation. Once the prototype is proving effective, I can figure out just how little power in a machine I need and I can build a final version to free up my prototype. The Pi and its camera will stay with the prototype. Any sound setup will be moved to the more permanent unit.

Potential problems include the need to reprint the case with ABS plastic for its higher temperature tolerance. After the prototype has proven itself, the cat in question will likely be scared of the case if he doesn’t challenge it.

Final Question: What possible problems am I missing that I should anticipate?

MineCraft Boat Race Port Part 7

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am presenting my work to update the Boat Race from Titaincraft Season one’s custom dimension, The Above. Let’s get Started.

If you are here from the server and spot the “Part 7” in the title, don’t worry. I’m writing this post as a fresh introduction to the project. If you’re interested in the development of the project, feel free to go back and have a read, and if I post about further development, Part 9 and above will also be available.

The Above’s boat race was originally built by Duke and  2Cubed with testing by dminer78. In the original game, players would wander into an ice cave and get teleported to the lobby where they could pick an arena to play their personal next level in. Each of the five levels has a different maze to navigate, ending with a row of gold blocks serving as the finish line. After completing the last course, the game would award the player with a Tango head, the special currency of The Above’s prize system.

The new edition used Duke’s levels but has many technological improvements over 2Cubed’s programming. The 1.13 execute command’s overhaul means that whole blocks of commands that were running all the time are replaced with one or two commands with a smaller footprint on the server’s CPU, and they only run as often as needed. A planned time trial mode would increase the replay value (besides the Tango heads). As part of this planned feature, there would also be a way to choose what level pack you want, and whether or not to shuffle the levels among other, new level tracks. And thanks to MineCraft’s introduction of functions, I decided to rebuild the game so it could be easily expandable; not only should it be fairly easy to add even more new levels but also new games as well as time goes on. For now, I’m calling it the Modular Game Center.

Working on this project, I learned a lot and overcame many challenges, many with the help of Jamcdonald120 and a few others. If you want to learn about a few of them, go back and read parts 1-6. As of this writing, the Modular Game Center still needs a little work once 1.13 gets a stable release and Spigot gets its update in turn.

Final Question: What game would you like to see added to the Modular Game Center?

A New Tool Part 2

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am continuing coverage of my new prototyping tool. Let’s get started.

I didn’t get as far as I thought I would this week. The mission this week was to get the top all printed, but that didn’t happen. The problem was that I didn’t already have all the skills to accomplish the task already, mainly proficiency in Blender. That’s my goal for next week, learn Blender well enough to finish modifying the upper half of the case.

As for what did get done, I managed to start developing the camera mount. The case I’m printing for my Raspberry Pi is based off a PacMan Ghost, printed in red. The first print, I used Blender to isolate the target eye from the rest of the 3D model, and printed it on fast. It took about 20 minutes, as opposed to a full day plus if I were doing the regular top on a respectable quality level. I drilled a hole in the printed piece and held it over the camera, using larger and larger drill bits until I didn’t see a red plastic border anymore.

For my second draft, I added a cylinder mesh in Blender and scaled one end down, forming a truncated cone. I used a Boolean filter on difference mode to cut out a hole for the lens. It didn’t fit well enough, so I printed another one with a more embellished cone.

My father taught me how to properly use a Vernier caliper. I already knew about the outside and inside edge measurement spots, but the the depth on the end of the ruler was new to me. Also new to me was the use of the Vernier scale; I never before got the idea that the extra marks on the slider were offset just a little bit. I think I had heard about the extra digit of precision, but only now did I get that only one was supposed to line up at once.

I used the caliper to measure up the camera. The plan from there is to model up a crude representation of it in Blender and use that to design the hole before I try printing up another pass. Giving some new thought to it, I want to angle the camera such that the ghost is looking at you, instead of “using peripheral vision.”

The next step may be boring, but it’s something I need to do. This week, I need to actually watch a few video tutorials on Blender. I already want to go through the videos by Blender Guru, Link to his channel. I’ve already tried going through his videos on the basics of Blender before, but I kept getting distracted. And no wonder! I just added the length of the videos I think I’ll need, the core Blender basics and the modeling basics, and it came out to almost six and a half hours! And most of that is in 45 minute chunks. The basic tutorial includes lighting and rendering tutorials, so in theory I could skip them for now, but I really should know how to use them.

Final Question: I’m at least somewhat likely to get more than one Pi computer in the foreseeable future. What kind of case should I search for to print up for the next one?

A new tool

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I have shelved the boat race port pending review and started on a new project. Let’s get started.

My next goal is a project to keep the cat off the counter. After some early research, I came across OpenCV, an open source computer vision library. Some people have even already gotten it to identify cat faces. Keeping my long-term goal of a social robot in mind, this sounds like the direction to go, rather than a motion detector attached to a deterrent.

Now, to chose the hardware. I don’t know what the system requirements my program will need, so I decided to overshoot and make a “lab assistant” computer to help me with future small projects. A day or so of research later, taking into account Linux as a platform, system specs, community size, and likeliness of support form said community. Of note, I did try to include Fair Trade or equivalent as a criteria, but with electronics, it’s almost impossible to find a supplier who’s sure their product doesn’t include slave labor in their supply chain. In the end I narrowed it down to the Raspberry Pi 3 model B+. Also of note, the Pi is made in the UK (or China in peak times), so my guess is that at least some of the workers were more likely paid a fair living.

The assortment of starter packages is abundant. You can get the Pi alone for about $35, but starter packages tend to include other necessary things like a power cord and case. This led me to look into them and along the way, I learned that the Pi needs a micro SD card to run.

Before I even picked out the Pi for sure, I found a case to 3D print for it. In this case, it’s a Pac Man Ghost by Darren Furniss on MyMiniFactory.com. I started printing one up, but accidentally interrupted it about 10 out of 28 hours into printing the first part. No more heavy objects in front of a pressure based touch screen for me. While the second attempt was underway, the Pi itself arrived, and I set it up. A camera arrived with it, and I even managed to get a picture, though one test picture crashed the system. I haven’t gone to investigate yet.

The upper part of the case is the ghost’s head. Since I’m mounting a camera as part of the setup, I want to have the Pi look out one of its eyes (I’d need a second board to use a second camera). My first thought was to drill a hole but when I saw the narrow walls in the base with infill, I figured pulling the file into Blender and digitally drilling would be more effective. Before I do that, I need measurements so I drill the right hole and can actually mount the Pi camera correctly.

I started encountering small problems when I realized the Pi was mounted upside down in the ghost’s lower half, extending the distance the already short camera’s ribbon cable has to cover. After sundown Saturday, (I let my family have a day of peace from the printer’s constant whining during Sabbath hours) I started up a fast quality of the top. The file online said both parts were supposed to print without a support structure, but as I suspected, a short, long gap didn’t form correctly. I canceled the print, but learned a lot from the partial print.

Pulling the Pi from it’s kit case and putting it in the printed base, I discovered three things: The screw holes don’t quite line up (The case is meant for a Pi B and I have a Pi B+), and the gap in the top is necessary for port access for the power, if not the HDMI, and finally, by comparing the partial print to the 3d model, I discovered the eye does not line up at all with where the camera cable wraps around.

None of the challenges I’ve encountered so far are insurmountable. My only big concern is that the Pi will melt though the PLA case I have for it. Next week, I’m going to come up with a good 3d model for the ghost’s top where I can mount the camera.

Final Question: There is a real possibility I will need to switch to ABS for computer casings. What colors should I start with?

MineCraft Boat Race Port Part 6

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am bringing you another part to the slowing saga of the boat race port. Let’s get started!

Well, I have all the features ready to hopefully impress anyone interested in seeing it. The two landmark objectives this week were getting the teleport commands just right, and getting the boats to spin as the level starts.

The spin was an interesting story. This project is sort of a semi-secret from the rest of the server, so when I need help, I ask how to get a related problem. In the case of the spinning boats entering the level, I asked about how to make a cow spin in a tornado. I adjusted the selector (more generally: stuff I understood) to ask about actually getting a cow [boat] to spin. I ended up coming up with and refining my own solution, which in turn was unsuitable for the spinning cow.

Overall, the project is as close to the original as it’s going to get, barring some changes to reduce unwanted behavior. From this point, I’m going to be introducing new elements, making the whole experience even better.

At this point, I just need to show it off for that blind reaction I mentioned last week. It may be a while, so I think I’m going to start another project next week. Besides, I could blog about half of all the little, uninteresting optimizations I keep doing, but I’d just get bogged down and things would forever get thinner.

This project has been good for me. I cannot recall all the lessons I’ve learned along the way, but one of the newer ones is a reminder not to stop looking for a solution just because you ask out for an answer.

Final Question: What lessons from long projects have you learned?

MineCraft Boat Race Port Part 5

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am excited to announce the near completion of my project. Let’s get started.

Who would have known, not more than 24 hours after writing my last post, 12 after it went live, I would finally have the last major chunk of code working for my demo? I even made my goal of finishing before MineCraft 1.13 launched!

This week was kind to me even after my breakthrough, as I not only finished that up, but I got the other two alcove/arena combos working. Jam was helpful with getting the /tellraw commands working when he told me to just change out the old selecters.

I also worked over the end of level win condition, patching a bug where you could import a boat and cheat your way to the end. It turns out the boat would sometimes get stuck on elevators and break apart, forcing the player out of the level and resetting their progress. I made the level require the use of the original boat by setting (and checking for) an invulnerable flag on the boat. Unfortunately, I have no way of testing the invulnerable flag on glitching boats.

As it is now, I think the experience is at about 99.9% of the original. The original boats spun in air as they were summoned, and I still need to nail the /teleport commands.

I showed my work off to a few people this week. Duke, the guy who built the levels and my first guest after the workable demo, came by and helped me with a potentially embarrassing bug for when Tango (the owner of the Patreon server I play on) eventually does a blind reaction. New players need a valid score before they can enter the level for the first time. I fixed that for him and when DropDaBass, the server’s head moderator, came by.

There are still a few minor bugs. Sometimes timings don’t work out the best and you take a little damage on the way to the arena. Once in a large while, the level unloads around you without returning you to the lobby. There’s trouble with FPS (Frames Per Second) when connected over the Internet and a level unloads. There will always be something to polish.

One of my major goals for this build is the flexibility to add more games. I brought another patron over called Pendl3, who is looking to help me with my random throw away idea of a golf course. Getting the code ready for running dual games will be interesting, but I will complete the challenge.

Final Question: Simple, what games should I add? I think it would be good for me to add a few a year and they can either players or moderators swap them out with a control panel.

MineCraft Boat Race Port Part 4

Good Morning, from my Robotics Lab! This is Shadow_8472, and today, I’m almost done with my port of 2Cubed’s boat race. Let’s get started!

This week felt like progress was made in spurts thanks to both jam and Grifter, the two people from my MineCraft server helping me. About all my major accomplishments this week are in part to their command proofreading. Early on, I was working on the code to start the level. The /tp command and its supporting code was challenging to get just right. I came up with the idea to use an identifier block no player could [normally] see and reference it from commands later and jam helped me get something working. I was able to tune it in from there.

Jam once again helped me understand how the scoreboard works so I could build a level select. Long story short, imagine a spreadsheet. You have objectives at the top and entities on the side. Each cell at the intersection has a score to edit. There are no “global” scores, as much as I’d like to think that would make it easier on the learning curve. Objectives are added without attachment to an entity, but scores in those objectives are. Once I had that, I could step on a pressure plate to set my next_level objective to some level and load it with the alcove pressure plates.

Then came a day or few where nothing much happened, but with MineCraft 1.13 almost out, I wanted a workable demo by its launch date. A friend showed interest in seeing my work so far, and part way through the week, I scheduled a viewing on Friday, but I didn’t make it.

The next major hurdle after the teleport was how to tell if there were any players in the arena outside their boat and outside the starting area. After tossing the old command to jam and back (without luck), I passed the problem to Grifter, and he was awesome. He isolated a targeting selector I needed, where I likely would have figured it out in another few hours.

My focus sort of drifted to the win condition. Sure, it took me a while, but I eventually realized I could do it with a single command. Getting that command was another topic. I did most of the work in assembling it, and jam got me a snippet that gave me a working theory. The commands were a bit stubborn, but after I got something almost working, another chat with jam and it’s working.

The most recent challenge was targeting “cheating” players. The old game used scoreboards for almost everything. Something about a cheater tag showed up if you stood up and you weren’t in the start area. I wrote a command, finished by Grifter after hours of me doing trial and error, that spammed the word “hi” at any “cheating” players in adventure mode. And that’s where I am now. The next step is to replace the /say command embedded within the /execute with a function command to clean up players who might be done with a level.

I guess I have been making more progress than I thought this week. Before those last two breakthroughs on Sunday evening, I was all ready to make a big speech on progress and how a lack of success doesn’t mean you aren’t making any. Thomas Edison comes to mind with his brute force work on the electric light bulb. Once you know something doesn’t work, you don’t try it anymore. My difference here is that I’m documenting my progress with personal messages.

Final Question: I’ve now doubled my original project estimation time. I don’t really care. I’m getting working results on a semi-regular basis, and I might just get my 1.13 deadline. Even if I don’t make that one, I’d still like to get it working before my server updates. Have you ever worked with multiple deadlines for the same project?

Minecraft Boat Race Port Part 3

Good Morning from my Robotics lab! This is Shadow_8472, and today, I am bringing you another short chapter in the history of my port project. Let’s get started.

Work is still slow. I have a fairly solid idea of what the structure of the final product is supposed to be, but it’s coming along. Jam and I weren’t exactly able to work on it constantly, but he did help me with a few ideas and get the teleport command for entering the level.

I really hope I can do a demo for next week encompassing the original experience for the boat race. In the meantime, I can finish fine tuning what I have and showing my progress off and comparing it to the last time I showed it off to someone. Early on, I showed it off to my self, playing the levels just for old memories’ sake. That was just the levels loaded into a field after aligning them correctly. Later, I had a friend over where I loaded each level half in manually. After that, I demonstrated how I only needed to load one half, and it would load the other automatically. Another step toward completion let me show someone else how I had the structure blocks correctly placed to load the five available levels. This week, I provided my mother with an experience one step closer to completion when I played interface between the pressure plate and loading the level; the level now teleports its players to its own starting point.

Right now, I can think of two remaining challenges: I need to do the interface between pressure plate and level loading, and I still need to do the level end functions. Other than that, I still haven’t even looked at the original celebration commands.

Final Question: The teleport command came to me after goofing off all day. Have you ever gotten a critical idea in a similar fashion?

MineCraft Boat Race Port Part 2

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am updating my progress on the boat race. Let’s get started.

The race still isn’t playable. I managed to get the levels loading correctly from the command block room, special effects and all. All I’m just waiting on the completed functions back from jam.

In the meantime, my vision of this project has expanded. I’m now calling it the “Modular Game Center.” Basically, someone will be able to come in, flip some switches and play one of a number of games. Let’s say I have the expanded boat race and a golf course packed in there as well. The hardest part was programming for that eventual possibility.

Other than that, I showed off my work for last week’s post to a lot of the people involved in making the original boat race as well as my server admins. There’s word of the server resetting soon, so I’m hoping it will be done by then.

Once again, team building is the lesson up for learning here. This is a non-paid position, so if I don’t hear back from jam within a few days, I’m going to start figuring out how to do the functions myself. It will likely take a bit longer, but I found a great tutorial on how to build the commands.

Final Question: It’s a lot harder to write about writing software than building hardware. I don’t have as much to say this time… MineCraft kept crashing… Have you dealt with the pre-releases?

MineCraft Boat Race Port Part 1

Good Morning from my Robotics Lab! This is Shadow_8472 and today, I’m starting a new project in MineCraft. Let’s get started!

A couple years ago, the MineCraft server I sometimes play in, Titancraft, had a special mini-game built for it where a player gets into any one of three arenas and plays through a series of five courses and gets an award at the end. Any of the arenas would load the player’s next level, but that was about it from a technical aspect, as far as I’ve figured out. I want to port it to MineCraft 1.13. (As of this writing, the MineCraft is on 1.13 release 3, updated in the middle of this week).

First, I contacted one of the moderators, GrifterMage, and got his blessing on the project. Then, I started setting up a server as close as the target software as possible. I understand the server runs on Spigot, and that they had been making 1.13 pre-release snapshots… which I couldn’t seem to compile. I setup a vanilla server thinking this project is likely to take either two or three weeks.

I started looking into installing structure block files. They had changed for 1.13. Now, they are part of something with a steeper learning curve, but have all the more power once you get the idea of them: datapacks. Following the trend of going from texture packs to resource packs, datapacks are a new series of files that organize simple modifications to the game. All I know about them so far is that they contain both functions and structures, which before now were more free floating in their own folders, and that the packs themselves can be switched on and off.

With a vanilla server and a bit of ambition, I set about making a “Hello World” function. I asked for some help on the server’s Discord channel, and a user by the name of DrHenchman was helpful in pointing me to the correct way to structure a datapack; I sent him a bunch of screenshots as I debugged my way to victory.

Structure block files can save and load sections of the world up to 32 blocks in each of the three directions, so I made four test levels of 32×32 blocks and got them to load from a datapack on the server.

When I started thinking about the actual levels, I started looking for any videos someone may have had with footage of when the map was originally operational. I found acg1000’s posted livestream from when the custom dimension containing the boat race was opened, but two hours seemed a bit much for a just-adequate-for-YouTube WiFi connection when I needed to skip around a bit. After I skimmed it using my PC, low quality, and 2x speed. He didn’t have it…. Later, GrifterMage managed to scare up the original structure block files for me to work on. Another mod, DropDaBass, apparently had a copy. They are both awesome for that.

The files are two years old. A lot of things have changed since then. First of all, from 1.12 to 1.13, structure files no longer accept capital letters in their file names. Even though I was cautioned against it, I tried copying the files directly into 1.13 and changing the names and dropping them in the correct place to load them. I don’t remember exactly what happened, but they didn’t work correctly. I ended up having to load them all up in 1.12 and re-save them.

Which brought me to another challenge. One of the levels features floating water blocks. Before, they were simply “still_water”, a feature removed for 1.13. As a side effect, the now-regular water blocks flooded the level. As a step in the correct direction, I put a repeat command block out to continuously clean up the drips. The seizure alert results should have been expected. I then messed around with using “structure_void” blocks to hold up the water, since they look the same as air when you’re in adventure mode. Structure_void blocks are about the one block structure blocks cannot copy. So I set my commands to filling each level with them as soon as it was loaded. The next command replaced any leaked water blocks, in case of any lag Grifter pointed out there may be. Ultimately, I’m opting to just use a crazy block, like diamond ore blocks, to contain the water until they can be replaced when the level loads.

Around this time, I poked into loading the actual arena building, including the lobby and thee arena floors above it I gutted two of the three arena command blocks and started installing the hardware for my port. The existing logic no longer functioned, in either 1.12 or 1.13. After an hour or two, I found the credits to three people who originally worked on it. TheDukeMinecraft, listed as Project Manager, Designer, and Builder; 2CubedTech, listed as Tester and Command Writer; and dminer78 listed as Tester and Food Eater.

I reached out to the only original designer still present on Titancraft’s Discord server, Duke. He was eventually able to put me in contact with 2Cubed. Both seem excited that their old project is getting some love, but I got the impression both are busy with their own endeavors.

While I was waiting for messages back from Duke and later 2Cubed, work continued on the design. One of my priorities is minimizing load on the server. This means as few repeat command blocks running their contents every tick as possible. (Another reason why the blinking water was a bad idea). All I really need is two end conditions listening for if the player is standing or if his boat is at the goal, a line of three gold blocks. To make things more interesting, I wanted the ability to load one of two maps for each level, one classic or one newly built for the grand re-opening. While I still don’t have the logic figured out, I have a comment version of it in the server files. These are very likely to get rethought and scrapped.

I looked out in the vast, 30×30 room that was the command block room. It is so big! There’s room for a lot more than just a few levels. I mocked up some structure blocks and found that each arena can hold up to 4 separate games of 5 levels each, with 6 variants of each level. And then I did one better. After working with the levels themselves, I produced a version that loads both halves from a single structure block. Now that that 4×5 corridor can hold even more levels. Plenty of room for expansion.

This week, my lesson has been about building a team. My skills don’t quite encompass the full spectrum of tasks that need to be done. As I was starting my writeup, a fellow Titancraft member, jamcdonald120 just agreed to help with the scoreboard commands. As soon as I get the files transferred over to my server computer, I’m looking to have him help me with those.

Final Question: Did you know that, even though it will work and act all normal, MineCraft 1.13 pre-releases don’t seem to like dashes in their file names?