I need a way of checking whether every entity does not have a value. That way, I can find out whether every opponent is not hunting. That way, I can check if the game can play the normal theme again.
I now also need a way of making either a system or a plain function that accepts two entities. This would work with the collision system.
This is hurting me.
My current plans are putting in “boilerplate” functionality that might work, writing the rest of the game while pretending that the functionality definitely works, then requesting the help from the people at Lexaloffle, but I am leaning ever more towards changing the platform to ChaiLove or even the Game Boy Advance, even though the game is about done and has assets that specifically target the pico-8.
The bad news is that, in my latest commit, Re-Hoard has 47,344 bytes, while the maximum is 65,536. I feel worried about running out, though, because I am getting close to the end plus I already put in did the audio-visual assets, I feel that I could fit everything in there.
The good news is that the latest commit also uses 4,628 tokens compared to a maximum of 8,192. That is a little over half of the maximum.
The real problem is the maximum compressed size, which is 15,360 bytes. Both of eevee’s games in Lexaloffle suffered from this compression. I already know of some ways of getting under that maximum, but I would rather code in full then optimize normally then test the code before I deal with that problem.
I got a new trouble. The Fearful and Surprised opponents have independently-acting weapons, that is, weapons that are their own entities. The problem is that they are too independent; my plan is that one weapon directly corresponds to one opponent. That means that, if a Fearful or Surprised opponent uses a weapon, the same opponent cannot use a new weapon until the old one disappears. However, the way things are, an opponent makes a weapon that is not related to an opponent; there is no way of knowing to which opponent a weapon is tied. In my game, an entity acts independent of another entity. (This caused a lot of difficulty in my collision system which, at times, needs to know with what specific entity another one has collided.)
My idea of working around this is that a weapon raises a global count while an opponent cannot use a weapon if the count exceeds the number of corresponding opponents. The problem with that is that there may be a possibility of one opponent using a weapon multiple times instead of one at a time, not letting the other opponents of the same emotion use their weapons…
…though that may be moot if there are enough opponents of the same emotion because the first might be busy walking while the other sets a weapon.
I just want to rest on this problem a little more before I go back to coding.
Earlier, I mentioned that Lua’s lack of an object-oriented system was restricting me.
These days, I learned that the alternative, the entity-component system, may be itself restricting. One thing is that I do not know whether I can check if every entity that has a component does not have a component set to a certain value. Another is functions (or, rather, “subfunctions,” because they are parts of systems); some functionality some systems have can be abstracted away into subfunctions, but I am not sure if the subfunctions would work with the entire entity-component system in general or that I need to give the components’ values before the subfunctions would work first.
This has me worry if I could actually do the game in the pico-8 at all.
This is obviously very bad because I am so close. All of the art assets, which specifically target the pico-8 are there. I planned everything I could thoroughly then added stuff that I needed to plan once I went along programming. I worked a lot of the game; the end appears to be in sight. The worst part is that I had been working on the game since the latter half of 2016. Development just picked up when I decided to knuckle down and actually plan the thing thoroughly, but I am taking too much time with this game.
I am still working on the game, regardless, but a change of platform is not out of the question.
(Despite the above, this has nothing to do with my decision to look at Red or ChaiScript. These problems were forming over the days.)
Today, because I kind of forgot how everything in Re-Hoard worked so far, I decided to read my code.
Not only was the code digestible, but I also found some errors that slipped! I could fix them just fine!
I thank you so much, Clean Code!!
The collision-detection system functions similarly to an entity-component system. That means that my game currently has 2 entity-component systems! The two systems at in fundamentally opposing ways, too!
…that is not right!
Yesterday, I did something that I thought that would not happen any time soon.
I did all of the sounds and sprites that the game needed.
I think that part of the problem was that the amount of sounds and sprites needed was large. There was also difficulty in making a title screen and the music.
I already mentioned how I managed to solve the music problem. The title screen was a form of roundabout ingenuity. I wanted a title screen that has a font in this style, but I was willing to just take a bold font then “hollow out” the font. The font I ended up picking was Paytone One. I then wrote the title in GIMP (using a black-colored aliased font) then used the Perspective Tool in getting the title to look close to the perspective I wanted. I then resized the title in Paint.Net without using anti-aliasing. However, the Perspective Tool seemed to have anti-aliased the title already. I ended up manually filtering the pixels; any pixel that had at least 128 opacity was colored pure black while the lighter pixels were colored black.* I then copied the title to the Pico-8 pixel-by-pixel.
Getting the colors of the title working was difficult. I quickly realized that the text did not have the thickness that would have let me make the outlines of the font that I wanted to simulate. I ended up not drawing outlines that surrounded the inner “holes” of the title’s letters. After I made minor pixel-level adjustments in the title’s formation, I searched for the right colors. I had in mind a color scheme that used a yellow fill but suggested a castle (which is also the reason behind the high perspective), but I had to approximate, given the palette that the Pico-8 used.
After that, the whole thing was easy. After the experience in remixing the music, I made all of the sound effects in the Pico-8 tracker. I also noticed what a difference different octaves made in the Pico-8, I adjusting an earlier song that did not sound right because of the wrong octaves.
All that is left is the code. I am actually more worried that the code would actually work.
- = Only later did I realize that I could have looked for a way that transformed the title’s perspective without anti-aliasing. A bit of searching said that I could have set the Interpolation of the Perspective Tool to “None.”
Back then, when I way trying to compose the “playing theme” of Re-Hoard, I could not compose anything good beyond one loop. I since decided to go out searching for music, instead. The problem was that, though I needed a Creative-Commons music file that was either already in MIDI format or could be converted to MIDI, I had trouble finding one that had a song that actually fit the game’s mood.
The closest match was “Surreptitious”.
After converting the MIDI file to a Pico-8 format, I went to adapting the song to a version that only used 3 channels maximum. (The Pico-8 has 4 available sound channels, but I want to leave 1 channel free that can play round effects.) However, during the process, I found out that I could replace the rhythm track with the “good loop” I originally composed!
I ended up spending a few days remixing the song. Now, the song not only implements my loop and plays in up to 3 channels but also fits the mood of the game, is grouped in patterns of 4, and just sounds great. That song should be up next commit.
This is embarrassing, though. I have discriminating taste in not only a song’s euphony but also fitting a situation. I can deeply analyze songs and discover how they work. I can remix a song and make slight note adjustments. I can even compose tiny melodies. However, I cannot properly make a full song.
Maybe I have this potential, but my lack of knowledge is preventing me from bringing that potential to fruition? I never did take music theory…
During my time off from here, I took to learning the requirements and subsequently planning the logic of Re-Hoard.
I mean really learning the requirements and planning the logic. Before, I tended to go right to coding once I had even some form of logic in my head. While planning, I was always wary of any feeling I had of things being even close to being done, a wariness that paid off a few times.
I ended up planning:
- how the opponents would be placed at generation time
- how would the opponents patrol and hunt
- how the main song would go (though those plans had changed after implementing that part)
- what weapon the Joyful opponent would have
- how weapons would work
- how the Knight would respond to damage
- how the Dragon would respond to the Knight logically firepoofing the treasure
- how the game would display each round and opportunity
- what would happen during a “Game Over”
- how the title screen would work
I am still wary on declaring something “finished” here, but this is a very complete planning.
During this time, I also read Rapid Development: Taming Wild Development Schedules. Right now, I am at the 13th Chapter, but…
I knew that my going into this project without the proper planning was the reason why I spent over a year in making this game, but all the mistakes I made, especially all of the classic mistakes I made… this is unacceptable from me!
In my most recent Git commit, I added to Re-Hoard an entire song. I already extracted the song from WarioWare: D.I.Y. using the WarioWare D.I.Y. Editor, then converted the song to the Pico-8 format using MIDI2PICO. I then realigned the tracks. (I could have trimmed the song to 3 channels, which would have freed the 4th channel to sound effects, but I wanted to keep all of the source material somewhere in case I needed the original, albeit converted, song.)
The actual song in the actual cartridge is actually a loop of one track, which is itself a loop of one phrase.
The issue is that, when I played the tracks in the Pico-8, they sounded terrible! The only thing I liked was that looping phrase! I mean, that looping phrase not only sounded great, but also fit the theme of the game, whereas the other tracks have poor sound and composition while themselves sounding “tacked on” to the good track… which they were. The only reason why those bad tracks were there was because, when the good track is just one looping phrase, that track by itself would sound repetitive quickly. This is even worse in a game that can theoretically go on forever.
My embarrassment was my uploading the track publicly. At least barely anyone knows me by the time I am writing this…
Right now, I am considering making the “good” track the rhythm while I add another more varied but minimalist track. I thank my previous music study in this.