Friday, September 20, 2019

Branching Out: the Growth in Tree Quality

Ah, trees... Believe it or not, they've been in Mary's Magical Adventure since its development began, in World of Kirbycraft v0.75! There's some cool things to talk about that I've been developing just within the last couple days, but first, let me tell you a story about the history of these leafy things...
(This post has an AI-generated voice reading video available. To hear it, play this video and read along!)

Out of Place Cutouts

In the beginning, trees were pretty basic. In fact, they were just like the trees in Doom, a game from over 20 years ago at this point! Just like in that game, they were paper-thin images that rotated to face you. The only thing that made these trees unique was the code ran upon each tree spawning, which gave it a random tree image. I would say these trees were fine, but really, there were two problems with them...

Ripped from Reality

World of Kirbycraft, even back in those days when the game looked pretty bad, still had some form of a cartoony "art style" in it. These trees completely contradicted that, looking like pictures of real trees cut out and glued to the ground, like the game's world is just something a kid and their parent threw together by cutting out pages of magazines... I don't believe I was going for that style, but looking back, it's like looking at early 3D games that intended to look realistic. They were fine then, but now look like a joke compared to unrealistic games.

No Originality

You may think I was just experimenting, seeing what worked and what didn't, but no. I started development of World of Kirbycraft while I was still making Doom II: The Monster Invasion's last iteration (which in my opinion was the worst).

When I needed things like objects and code, I'd grab it from that mod and slap it into World of Kirbycraft, and that's exactly what happened with the trees and grass.

While the "realistic" trees worked mostly fine in Doom II: The Monster Invasion, they completely clashed with World of Kirbycraft's style. Unfortunately, I didn't know any better until years later...

The Crappy Image Legacy


In World of Kirbycraft v1.4, Hell City was introduced. As it was a complete ripoff of Kirby Air Ride's City Trial map, one area was a forest with many trees. Predictably, those were the same exact trees used in every previous version. There's not much to say other than just how out of place they still look.
Just when World of Kirbycraft got renamed to Mary's Magical Adventure in v1.6, the trees were thankfully changed to use better images. Mind you, they still didn't completely fit, but were more cartoony. The best one was the one on the right in the screenshot above, which came from a Terry WAD. It was just too pretty of a tree sprite for me to let it get wasted in a stupid waste of time like that!

Despite getting these new, better images, unfortunately these trees were only used in two places:
  • Hell City's island - In the park
  • City Street Run - Around road corners
Apologies for the short section, but I really thought I did more with these better trees. However, neither version can beat what I've done to the trees lately!

The Perfect Trim

Am I...seeing things? Are these really 3D? Nature finally looks right!
When Mary's Magical Adventure's next version is released, oh, are people in for a massive tree upgrade! For once, trees actually feel like they belong in the game's world, with more 3D, detailed designs that are actually interactive! Let's show what makes these new trees really cool, one point at a time!

"3D Graphics!"

Only a video could do this justice, so...just watch this video of both new trees and admire how 3D and believable they are now. Don't question the weird music, I like messing with Guitar Hero songs' individual channels.
Yes, you're not seeing things. Mary's Magical Adventure's trees are made like more modern games now; The tree itself is a 3D (voxel) model and 2D leaf cluster sprites are placed on top of parts of it, giving it a 3D look voxels alone couldn't give. This is seemingly the same thing a lot of games do for trees, like Oblivion and Sims 3(?), bringing Mary's Magical Adventure into a more modern time, unlike...some things.

I said these are interactive above, and you might not expect all that you can do with these trees. For one, you can knock leaves off of the trees with nearly any attack. If you hit leaves with a hammer, they will scatter and float through the air, but hitting them with a fireball will catch them on fire, making the leaves turn brown, drop to the ground, then turn into flames. It looks good in motion and is satisfying to do. In the future, there will be more of a reason to randomly become a pyro.
Only you can prevent wildfires...if you can resist the urge!
If burning leaves isn't good enough, how about the whole tree? Yes, if you damage the tree itself enough, it'll lose all of its leaves at the same time then collapse. Burn it enough and instead, every single leaf will start burning, then the tree dramatically falls down. If either of these events happen, the tree stays gone, even if you leave the area.

Now, don't worry if you like trees; You don't have to destroy fictional vegetation, but if you want to force all leaves off of a tree without permanently destroying it, just hit it with a cold attack like an Ice Ball and it'll start shaking then jump as it loses all leaves. When this happens, the tree survives and will re-grow its leaves back when you move far enough away from it.

This video shows all three tree deaths:
Now, all of this interaction comes with a cost, and that's a sprite render time increase of 0.02 per tree rendered in "high quality", which is what was seen in the videos. To counter this potential beauty turning into a lag source, all trees are drawn as a single image at far distances, just like the older trees. This results in the game rendering a single image instead of many leaf clusters plus a 3D model, and this is what saves the 0.02 sprite render time mentioned above.

This is actually something games do, more common on games with a continuous open world like Oblivion. I came up with the idea to do this before watching that video, so I had no clue it handled things the same way as my game. Oh well, I guess I can say I did something like Bethesda now. Whether that's good or bad's up to you, because...oh no, does this mean now I'll leave many game-breaking bugs in the final release? I hope not!

Anyways, if you don't like the trees abruptly changing between images and 3D models, you can adjust the distance by changing the r_objdrawdistance CVAR, which is a multiplier that defaults at 1.0. Increasing this will change the distances at which many decorative objects switch to lower quality, though it changes everything, not just trees. If on a lower-end system, it's recommended to decrease this to 0.5 or similar, given you can tolerate more obvious object pop-in.

Anyways, that's the latest update! There's more changes, but the new trees deserved their own blog post.

Thursday, September 5, 2019

Magical Mary History #2 - v0.75 Part 2 (Early Monsters and Unused Oddities)

World of Kirbycraft's original monster lineup. Some may look familiar from Mary's Magical Adventure...
Welcome back! Last time, we looked at the intended but very flawed gameplay that I thought was fine back when I developed this version, plus the "test levels" in the game. This time, we're going to look at list of monsters that are in this version. Yes, I said there were none in normal gameplay, but oh, there's a small list fully programmed into the game at this point in development.

The Bestiary

Though not a single monster appears in this version, there are some programmed in /Decorate/kmonsters.txt, Some are from the Kirby series for obvious reasons, but others aren't. Here's the full list, in order of when they appear in the text file, from top to bottom:
"Mouse!" Silence this noisy thing and it'll become worse...

Scarfy (KDog1/KDog2)

Just like in the Kirby games, this innocent creature happily shows its true "dog" form when you hit it once. The only way to avoid seeing the "dog" is by dealing a lot of damage at the same time. This isn't considered a monster to the game until it transforms, so if you can resist the urge to shut it up, you have one less to worry about.


Gordo

Another common Kirby enemy, a spikeball with eyes. If you get near it, it will start flashing. Touch it, and it will yell "Mouse!" at you and send you flying away! This enemy is indestructible, so your best bet is to avoid it.







Wheelie (KWheel)

A wheel with an eye at its center that somehow maintains orientation while it rolls around. Wheelie is a dangerous and unpredictable enemy, slowly moving until it gets into the perfect position to run over you! Its speed (and really bad weapons in this version) make it pretty dangerous, taking three hits from Arthas's hammer to make this wheel's rubber explode!







Cyclops Troll (Troll)

This big, blue cyclops may look intimidating, but he's only a threat up-close, conveniently the only distance your weapons work at! When approached, the troll raises his arms then slams the ground below him, which causes damage to everything in the area. Compared to his appearance in Mary's Magical Adventure, he isn't as powerful here, plus doesn't have random arm-brace colors.

Huge Troll (HugeTroll)

This larger, red-colored variant of the Troll may look like he should be able to hurt you from longer distances, but in reality, he's nearly the same as his normal-sized counterpart, only 3¼× bigger! Unless you cheat or team up with a friendly monster, you will be here all day with this big pain.








Tiger

This aggressive animal is more complex than any other enemy in this version. Once it sees you, it changes its behavior based on your distance. Get up close and it'll prefer to try pouncing on you, but run away and it'll really speed up to catch you! Your best bet fighting this beast is to stand near it, wait for it to pounce, then strike it while it's down!

(Interestingly if you look at its back foot, it looks like I erased some pixels of the sprite without noticing all this time... This is probably still in the latest version.)


For those that want to see fights against all of these enemies, here's a video I recorded.

Strange Unused Content

All right, time for the really technical things that literally can't be gotten to in-game. These are mainly just sounds, but these sounds alone give a big impression that I really didn't know what I wanted from World of Kirbycraft back then, as if the whole game didn't give that away with its generic grassland level...

Inside wok_x.pk3's sound folder, a bunch of unused voice samples and "music" can be found. In the voices/Monsters subdirectory, enemy and player sounds are stored, but take a look at that directory's contents. See those WOKGUY sounds? Those were intended for common enemies that didn't deserve custom sets of voice samples. The tiger uses the last set, but every sample above that isn't used!
  • STOCKAHH - Interestingly, this is the stock scream heard in games like Twisted Metal 3 and 4! I'm not sure why it's here, as no enemy ever used it. The Wilhelm and Howie screams were used in Doom II: The Monster Invasion's second version for zombies to use at random, so perhaps a similar thing was planned for World of Kirbycraft...
  • WOKGUY set 0 - I love reversing songs with lyrics because they usually break down into hilarious nonsense, such as the notable "Can't Help Mice!" and "No No Heat". However, in this case, I think I used my laptop's microphone to record something, possibly an iPod or something, playing a Red Hot Chili Peppers song, which I then spliced and reversed for these samples. Most of them suck, but I like sample #4, where he sounds like he's saying "Stop that...!", which is assigned as a pain sound.
  • WOKGUY set 1 - For this set, I think I recorded myself talking, then reversed and slowed down the recording over an unknown song. Parts of this overall larger sound were used as the samples here. I think this set was meant for strong, mysterious enemies like flying enemies firing magic projectiles at the player. In the end, it was never used, though it fails to sound threatening with lines like "NOM NOOOOOM~!" and "Pandora... PANDORA...!" (Yes, I listened to Pandora, that's why that's randomly here.
  • WOKGUY set 2 - This, like set 2, is just my voice reversed, but with no speed adjustment. In this set, it sounds like a man who thinks the player is a mouse (like the Kirby enemies) and even yells "A MOOOOUSE!" sometimes upon seeing you. This was briefly used for the Fighter enemies in Mary's Magical Adventure until I recorded their proper samples.
The other subdirectories are arguably stranger, so here's another list:
  • weird - This is, contains, fittingly, the weirdest two samples in the game, which sound like very slowed-down beeps with their bass increased a lot. I think these were supposed to be used in scary areas to mess with the player's head, like those "beats" I can't think of the word for that make you get certain feelings.
  • dynamic_music - Hey, all of the cool games do it, but it's a a shame ZDoom isn't capable of dynamic music, which picks different parts of a song based on in-game activity. It didn't stop me from trying using ACS in a test level that I haven't found in any version of World of Kirbycraft yet.

    This folder contains four WAV sounds that play different sections of a basic song, which would be chosen based on where the player was located in the test level. It would've been cool to keep this, but due to ACS being limited to the tic-rate of ZDoom, I could only use tempos that were synced up well enough with it, which would've limited how varied my music sounded.
  • ambient - "Wait, the ambient sounds were planned from the very beginning, Xane?" Sorta. The sounds in this folder are weird ModPlug Tracker recordings that used a strange, "organ-like" instrument. The first three are the raw recordings while the latter three have a reverb effect on it.

    I think these sounds would've come from an organ in a castle level, but clearly that never came to be as the sounds were removed after this version, and my plans changed by the time Mary's Magical Adventure became the game's new name...
This video plays most of these unused sounds, minus the "weird" ones, since those are barely audible without editing. Since I forgot to include it in the first post, Mary's voice acting is included here as well, specifically the lines that never got used or were removed in later versions due to the removal of beams and cup-based weapons. Apologies for how long it took to finish this post, which was supposed to be done months ago!