Archive

Programming

This might not be the best time to write a DevBlog, but it’s also way overdue and having not done it is stressing me out, so I may as well get it out there. After a short vacation followed by a short cold, I finally managed to get the scripting system more or less up and running. However, whether it’s left over from the cold or because of my mood, finishing the scripting system didn’t leave me with a sense of relief or of completion, but just a sense of having reached a dead end. Now I have a potentially powerful and interesting tool at my disposal, but in order to actually use it I need to restructure my project to accommodate it, and I still don’t really know what that project is or is going to be.

In and of itself, that’s not a problem. I didn’t know what the project was before, and I have one more tool for tackling the project than I did before, so no problem, right? At worst I have a month or so of wasted time, which isn’t great but it’s hardly worse than some of the other setbacks I’ve dealt with – and, as wasted time goes, creating a parser for a scripting language is far more educational than most time wastes. The issue is more that, at the moment, I have no real drive to pursue the project, or really to pursue any project.

This happens sometimes, and maybe I just need to wait it out. Or maybe I need to do something different, or maybe I just need to figure out a new approach. I don’t know. I’ve just been very tired, and not knowing where I’m going or how I’m getting there is making me more so. The world seems exceedingly broken at the moment, and putting long-term work into a project when I can’t feel confident that anything about the world I’d be making it for is will still be the same when it is complete just feels like a waste of time. Games are generally what I’ve been passionate about, but at the moment games feel like a bit of a dead end.

In all likelihood, I’ll feel better soon enough. I’ll feel more alert, some aspect of the project will catch my interest again, and I’ll build an idea and purpose around that. In the meanwhile, I think I need to take a moment and look around. Maybe something else will catch my interest, maybe something a bit more solid. Maybe I’ll get back to work on EverEnding. I don’t know. I’m just waiting right now, and trying to rest, and trying to figure out a direction to go in. I don’t think that we really need any sort of grand calling in life, but we do need something to pursue, and right now I’m not sure what that is for me.

Oh well, this one was kind of a downer. Hopefully I’ll figure something out and next month’s DevBlog, if that’s even an appropriate title any more, will be less bleak.

Advertisements

Well, I keep on getting distracted, but the distractions are all part of the project itself. There’s a distinction between the process of making a game and the process of making the game engine, the game editor, the game tools, even though these are a prerequisite – and, clearly, I’m more willing and able to focus on those right now than I am on making the game itself. I think this is okay for the time being: Part of what I wanted to do with project is to let myself go where my enthusiasm guided me to go, and clearly right now that’s in working on the tools. Now, whether that’s just because I’m more intimidated by the idea of working on content stuff, well that’s an open question. Eventually I’m going to run out of tools to work on, so I’m not stressing out about it. Yet.

Anyway. What are these tools he keeps talking about?

Well, first, I’ve got a somewhat working version of the room creator I was talking about last time. I got the solution to the point where it did maybe 80% of what it was supposed to and then tabled it, since I didn’t want to get sidetracked for too long with nothing to show for it.

You can see that some of the logic is there, with it placing the walls and some of the tiles connecting the angles correctly, but there’s a couple of tiles that are incorrect and some that just aren’t getting placed. Part of this is just the order tiles are getting placed in right now: Since each tile has to fit with each other tile, the tiles that get placed first don’t have to meet as many constraints as the ones that get placed last, and often end up being incorrect. Obviously I have to iterate through the placement more than once, but how do I know when I’m done? How do I know which tiles I still need to match with and which are now outdated by the new placements on the second loop? This is probably a problem that’s been solved, so maybe I can look it up. That may be another reason why I set the problem aside – it didn’t seem urgent to solve any more, now that the remaining issues were relatively small and easy to describe. Most of the time, at least when it comes to programming, a sufficiently detailed description of the problem contains a solution.

After getting that sort of working-ish, I focused on creating the entity editor. Once I can build levels and place entities, I basically have everything I need to create a game. However, there’s a huge range in what constitutes a level and what constitutes an entity, and some big decisions need to be made in order to meet those simple requirements. Up front, though, I had a pretty good idea what an entity was supposed to be: I want an entity to be an object with, most of the time, a position, dimensions, and behaviors in the game world. With a bit of shuffling UI around, I came up with this entity editor:

The top bar is a toolbar where I can drop any entity I want to use more than once and save it for later. The top-right is an editing window where I can rewrite any of the entity’s scripts, and the bottom right a selection window that I can use to look at and edit any of the entity’s properties. What is going to be interesting as this progresses, I think, is that any one of the entity’s properties could be a script, could be a script that rewrites another property to be a script, could be a script that copies another entity into a variable which gets used by another script to spawn versions of that entity, and so forth. What I want here is a system that eradicates as many barriers as possible between creating, editing, and scripting entities. To begin with, I used an XML-based scripting language since that saved me a lot of the trouble of parsing the scripts, since I could just use Haxe’s built-in XML parser. However, I’ve decided instead to roll my own scripting language – after some misadventures in using a very full-featured Haxe parser, which I guess we’ll just consider research now, I decided that my needs were simple and specific enough that I should really just make my own.

While I initially considered making a new simple animation system, I decided that too much good work had gone into the EverEnding animation system to discard it completely. However, the rendering paradigm I used for that project was completely incompatible with the standards used in OpenFL – one of the big reasons I wanted to step away from that project for a while, since bringing it up to those standards was a huge logistical pain in the ass. This was, therefore, an excellent opportunity to work on something that could benefit both projects. The necessary approach was so different that, in the end, I had to fork the class, but when it comes time to work on EverEnding again I can work on integrating both versions together in a way that captures the strengths of both. For now, I have a fast and efficient way to render every entity I want to the screen.

Aside from this stuff has been some minor progress in other areas, like making decisions on what the tileset should look like, fixing bugs in the collision code, and making a rough character sprite for use in testing. However, if you’ve been following the project, you might have noticed streams abruptly ceased a couple of weeks ago, which is rather contrary to my original concept of the project as something which I worked on entirely on-stream. Unfortunately, I came to a point where a few aspects of my life and this project came into conflict with one another: As I alluded to in my Problem Machine blog post a couple of weeks ago, I tend to have sleep patterns which could be generously described as ‘erratic’. I’ve been trying out ways to restructure the way I live and work in order to help address this issue, and one of the biggest changes I’ve made is to try to get a few hours of work done immediately after waking up, before taking a shower or eating breakfast or anything. So far I find this approach tremendously beneficial, starting my day off on a good precedent and ensuring that even if later on I do end up feeling fatigued or depressed I still have a few good hours of work done, relieving much of the pressure to do work that was keeping me up later and later at night. Unfortunately, while it’s a bit stressful to stream myself work, and it’s a bit difficult to get used to waking up and working right away, the idea of waking up and streaming working right away is just too much to countenance at the moment. With time, this may be something I can approach – it may be helpful to get away from my conception of streaming as something where I need to have a constant running commentary, for instance. Or maybe I can just eventually get to the point where I’m more comfortable vocalizing my thoughts immediately after waking up. At the moment, though, trying to do two things which aren’t readily in my nature at the same time just felt like too much. Hopefully, in time, the dev streams will return. In the meanwhile I’ll probably continue streaming gameplay a few nights a week, though this past week I have been remiss due to fatigue.

That just about does it for this month’s update. Next, I plan to finish this scripting system, fix the remaining issues in the room generation code, and probably start building out the first few rooms and entities and some more finished looking art. I think by next update we may be able to start getting into actual content, rather than tools – but who knows what rabbit holes I have left to fall down?

The new project is underway. I frequently miss working on EverEnding, and so far I haven’t gotten to do the sorts of things I really came to this project for, but I’m also getting really excited about some of the ideas I have for the future while I lay the necessary groundwork to proceed.

So, what have I been working on? There’s a lot, really. I got the basic collision system up and running, though that part is still glitchy as hell. I’ve created a simple but potentially very flexible scripting system which I’m going to use for all entity behavior in the game, which is going to make modifying entities in the editor largely a matter of literally copying and pasting the behaviors I want between entities and should make saving and loading pretty straightforward. However, the bulk of my time so far has been taking up on developing tiles, tools and editors for using them, and an understanding of how they’re going to be implemented in the game.

This is the tileset I’m testing with right now. It’s pretty ugly and rough around the edges, but right now I’m just trying to figure out a way to make all the tiles that I need for the game world fit into the minimum possible amount of space in a format that makes some degree of visual sense. If you do any art yourself, you may have noticed that the perspective here is, to put it mildly, kind of messed up. I’m working off the model established in the tilesets of the early Legend of Zelda games, particularly Link to the Past. The angles don’t really fit together or make sense, but it still creates a cohesive space for the player to navigate without obscuring anything the player needs to see. In the long run, the Escher-esque nightmare presented by this kind of world design may work in my favor, since I want the world to seem kind of surreal – but more on that later.

The big issue I’m facing at the moment is creating a tool to automatically fit these tiles together. There’s a small immediate and a big future reason I want to do this: The small reason is that figuring this out will allow me to build tools into the level editor that let me really quickly make rooms and connect them in a way that looks natural without having to individually place a bunch of tiles. The big future reason is that eventually I want to be able to generate rooms entirely using code using the same algorithm, and create procedural environments for the player to navigate.

That segues nicely into what my plans are for the project. Actually, none of these are plans yet, these are just ideas for now – plans will mostly wait until I have a playable chunk of game and can begin making hard decisions about what works and what doesn’t, what’s feasible and what isn’t. The setup I want to explore, here, is being trapped in a big creepy house – there are other people here, and it’s a bit up in the air how long they’ve been here. Some of them talk like they’ve been here a few days, some of them seem like they might have been here for centuries. Everything is blocked off in different ways though, bricked and boarded up, papered over, hidden behind secret passageways, and in order to begin to find your way out you need to explore and find tools both to open up passageways and to fight off the creatures that have taken over parts of the house.

That’s the basic idea. Let’s call that tier 1, where I just make a little Zelda clone and call it a day.

Here’s a more interesting version of that idea that I’ve been playing with. There aren’t monsters in the house, but in order to actually make progress you find different beds to rest in. Each bed you rest in puts you into a dream where you play as whoever the bed belonged to, and in reliving their story you can perhaps change it, and by so doing change the state of the house. Or maybe you just find the tool you need in the dream and bring it back directly, or perhaps you are able to recruit an NPC by telling them something they’d forgotten a long time ago. The dreams, of course, are infested with weird nightmare monsters, and you need to be able to defend yourself in the dream, so procuring equipment is still necessary.

That’s tier 2. This would be a much more substantial project, but I think there’s room to do some interesting things here.

I have an even bigger idea, though, and this is one that could get really out of hand. Take tier 2, but each dream world contains other beds, and you can keep pursuing nested dreams deeper. Past one or two levels, dreams begin to be procedurally generated, but the resources you get in each dream can be brought out of them and used to progress through the next. The game becomes an adventure game containing a roguelite, where progressing through the roguelite sub-game allows you to progress naturally through the world of the main game. Eventually, perhaps, getting lost in these many nested dreams could become a genuine danger.

Tier 3 is fun to think about, but for now I have to focus on tier 1 – or, really, tier 0, which is building the toolset that will allow me to build tier 1. That’s where I’m at right now, but if progress continues at this rate I should be able to have my toolset done by the time of the next devblog and can really start building out the most basic version of the game.

Oh well this is awkward.

Effective, um, like 5 days ago, the EverEnding project is going on hiatus. For how long? I’m not sure! I’m pretty confident it’s not permanent, but I’m also pretty confident it’s going to be for at least a month or two, and maybe as much as a couple of years depending on how those next couple months go.

The natural question to ask at this point is: Why? Good question! I’ve been feeling for a while that, while I still feel passionate about this project, I also have it backwards. I really feel that the optimal game development process is about getting a simple version of the game up and running and then iterating on that and navigating by your artistic sense towards the most interesting version of that game. However, with EverEnding, I’m constantly stopping and planning and designing and concepting before I even have part of the system up and running. This is still true even now when, OpenFL port notwithstanding, there’s nothing stopping me from getting the game playable and iterating on that bit by bit and improving it that way, rather than constantly trying to make Big Design Choices and Sweeping Revisions. I keep thinking about the forest that will grow here someday and forgetting to plant the trees.

Which segues naturally into what I’m going to do now: I haven’t decided. Or rather, I’m specifically avoiding deciding anything but the most basic generalities of the project. It is going to be a game, and I’m going to be streaming its creation – I dunno if it’s a stream anyone will be interested in watching (so far it seems not to be, judging from the 4 streams I’ve done already) but these streams are just as much for me as for any hypothetical audience. The streaming is to keep me honest, keep me focused on the task at hand for a couple of hours with no web browsing or procrastinating. It also provides a way to document the history of the project, so I can see exactly how much progress I’ve made in a week or a month or a year from now.

Now, while I’m trying to avoid deciding as much as possible, I know this much about the project: First, it’s a top-down adventure game in the vein of the Zelda series. Second, it takes place in one big area instead of discrete dungeons, probably a mansion, possibly haunted. Third, I want to fill it with secrets and details, most of which I’ll figure out on the fly as I work on it. Right now the working title for the game is The Third Story, as a slight play on words both for a large mansion and for uncovering the stories contained therein, but that’s likely to change any time I think of something better. For the time being I’ve been mostly just laying the foundational code – which is mostly pretty tedious to watch, likely one reason the streams haven’t been popping. However, as the project progresses I want to do all of the scripting and level-building within the game itself – so, once I reach that point, the streams will be a lot more level editing/scripting and a lot less walls of code.

That’s all in the future, though! For now, the game is just blocks that move around and spit text at each other – no graphics, no collision, no sound. I intend to keep up the monthly DevBlogs here, but the contents will be related to the new project. I don’t want to rule out the idea of doing more work on EverEnding, though: Since I’m developing this new thing in OpenFL, I should be accumulating a lot more familiarity with how things work in that API, and this may give me exactly the energy and confidence I need to finish the port and get the project up and running again. Also, just looking at and listening to the materials I’ve created already makes me a bit homesick for the EverEnding project, so I’m not sure how long I want to stay away… But I’m confident this is the right thing to do. For now.

I already feel tremendously better morale-wise, just being able to work on a project where I feel like it’s always moving forward. If nothing else, I’ll be able to apply some of the methodology I’m picking up here – not just in terms of OpenFL and game development, but also in terms of livestreaming and documenting development and using that process to bolster my creative energy.

It feels good to be seen – even when no one’s watching, just to be willing to be seen is worth a lot.

I’ve been procrastinating on writing this post, since it’s always galling to admit this: Very Little progress has been made on the project over the last month.

This is not to say I haven’t been working on it – though between a week-long trip and focusing on more immediate work to pay rent I have perhaps not been working as much on it as I ought to. The issue is more that most of the work I’ve been doing has involved slowly revising the code base to work in OpenFL, which really doesn’t give me a lot to show.

It can be discouraging sometimes when the project is in this state. In general I kind of enjoy the work of refactoring, streamlining, and optimizing that goes into revisiting an existing part of the code base like this. However, particularly when it comes to a major restructuring like this, it means there’s a long period of time where the game as a program that can be run and experimented with ceases to exist. Right now, when I want to work on EverEnding, there is precisely one part of the project available for me to work on, and that’s this programming work. Not even especially interesting programming work, at least for now – once the fundamentals are in place I’ll also have a job of making sure the drawing routines are optimal and testing/improving the replacement displacement map filter code I wrote (as it turns out shader programming wasn’t necessary to create it, but I may look into creating a version implemented that way once I have this version working).

For now, there’s not much to say. I don’t know, a lot of the time I feel like I might just be wasting my time here, like I don’t know how to access the kind of discipline and productivity to make a project of this scope feasible, at least not in my current living situation. I wonder a lot if a different project might be a faster or better way to achieve the expression I have been straining towards with EverEnding, or if there’s some way to scale back or streamline this game conceptually which would allow me to work on it in a more effective and productive fashion. It is always difficult to tell which doubts are warning signs to be taken seriously and which are just self-sabotage.

Regardless, I am nearing completion of the changes I’ve made to the Particle System to make multi-threading stuff entirely self-contained within the system itself so I don’t need to negotiate that in the game program, as well as I guess in any other games I hypothetically make with the same tool in the future. There’s definitely a hint of programmer-itis there, where I find myself creating a more general purpose and fool-proofed tool than is actually needed – after a certain point I just gotta accept that sometimes I take the long route just because I feel that it’s more proper, even if it’s less pragmatic. Within this week sometime I think I’ll be able to get back to more interesting work on the project. It sucks getting stalled, but it doesn’t last forever – and, regardless of my doubts about where all this will eventually go, I think I can pursue it with no regrets as long as I enjoy and believe in my process.

It’s been a bit of a weird month. I haven’t worked deeply on much, but made a lot of slight progress on different things, and have also made some substantial revisions to the game design.

Well, first things first, I made this piece of background art:

I like how this one turned out, but I also need to make an alternate version of it for a special effect I have planned and that one is proving to be a bit difficult. A lot of these background images are almost technical problems, where I need to figure out a way to depict the idea I have in my head without getting bogged down for hours and hours, and also to depict an area that makes some sense relative to the actual navigable portion of terrain the game takes place in. This background already has taken far more time than any of the others, and the potential for an even more detailed and time-consuming version has me a bit concerned, so I’m trying to figure out a clever way to approach it..

With these concerns in mind, I decided to drop the background work for a bit and work on some animations. I began creating animations for one of the other early-game enemies, the Crawler:

This is one of very few enemies in the game what does damage on contact rather than having to do a particular attack, and is more or less completely unaggressive and minds its own business – an obstacle as much as an enemy, really. The animations aren’t quite complete yet, with the turn animation in particular being a bit of a troublesome obstacle, but it’s coming along. Once this and the mask enemy are complete, there’s only one more enemy type planned for the first couple areas of the game, so I’ll have pretty much everything I need in place to finish building out the early areas. I also spent some time building out some of the animations I’ll need for the other variations on the mask enemy, such as the stone throwing and spear throwing types, but nothing finished as of yet.

There were some other minor side-lines – a system for making it possible to modify a value from multiple locations without overwriting each other’s modifications, building a special ‘alternate reality’ effect for the second area, roughing out some of the level designs… near the end of the month, though, I realized, or perhaps merely acknowledged, a number of substantial design flaws that were threatening to undermine the game. These had to do with the upgrades I had planned, when you were likely to find them in the game, and how useful and interesting they would be. The biggest problem that emerged was that I had come up with the idea of this attack using the sling and, when I thought about how it would feel in action, I realized it was completely unsatisfactory. Essentially I was planning this whole ability which didn’t really have any role in what the player was doing – it would be the only ranged attack available, sure, but in a game where ranged attacks weren’t really necessary to succeed, and it would totally clutter up the control system.

I spent a few days thinking about this, and eventually came up with a whole new system, with a set of 4 elemental attacks and alternate forms of each attack, along with a system of special attack ‘charges’ that get restored whenever the player gets hit. I think this is a pretty good idea! But it also presents a lot of issues with, again, when the player finds upgrades and what role those upgrades play in the overall flow of the game. I’m still not 100% there with this design, but the missing pieces will probably be small things that I can fit into place as I go rather than massive gaping holes that I need to invent whole new game systems to fill.

Since then, I’ve just been reworking the way attacks are programmed to make room for this system. The new attack system is far more flexible than before, though there are probably still some ways I could improve it that I may have to consider.

This month will probably have more work on creating enemy animations, a little bit more design work figuring out what the flow of upgrades and specific properties of special attacks will be (along with whether I want to have, say, special objects that the player can interact with using said special attacks), and perhaps laying the groundwork for creating the special attacks themselves – though they are mostly a low priority for a moment, since most of them are planned to be found later in the game than the first chapter, which is where I am currently focusing my development effort. If I don’t feel like that stuff then creating assets and level details for the first couple areas, finishing the mentioned background image, or building improving tilesets are also strong possibilities for productive work to do next.

 

Well it’s not quite the 10th, is it? Ah well, it keeps rolling around to the next month and I want to have something more impressive to show for the time I’ve spent and it just makes me fall further behind. This has not been a month of great strides, but of small but significant ones. And, as I look back now, I see I actually have several interesting things to show off, if only because I have been remiss about showing some of the things I’ve been working on in the past.

First, I think I should probably show what the water effect looks like in action now. The effect is basically constructed, but there’s still obviously a lot of little improvements I can make if I go in and take the time to later:

Right now the ripples made by entities entering the water move absurdly quickly and don’t really spread out the way they should, and there probably should be something in between no splash at all and the substantial splash that’s made on exiting or entering the body of the water, and maybe the surface of the water should be a bit blurry or should be a bit wavier, but the bones of the effect are all constructed now and I can tweak it at my leisure later. Oh, also there’s that weird stray splash particle up on the upper left — that’s the particle that’s getting cloned to create the splash effect, but I’m not sure why that one is just sitting there.

I also did some more work on painting backgrounds. A couple of these are really complex, and aren’t really ready to be shown since they’re taking a while, but I also decided that I didn’t like the way the caves background looked and set out to improve it, as well as creating a secondary caves background for some of the other rooms.

Some of the stone ended up looking a bit woody, kind of like tree trunks or roots, but I don’t think that’s too much a bad thing. I can always tweak it later if it causes confusion, anyway.

The last major thing I’ve been working on is one of the core components of the game, the harvest system. The way this game will work (mostly) is that whenever you defeat an enemy they are basically put in stasis while the spark that keeps their spirit going flies out and about, in the shape of a moth. Once you gather that the body dissolves, but if you wait too long (say, because you’re being attacked by other enemies) it will return to their bodies and they’ll activate again. Once you harvest all the enemies in an area that area stays dead and empty, so you only need to fight the same enemies twice if you fail to clear an area. That means that I need to be able to individually track every enemy the player has harvested and make sure that data gets saved with all the other game data. It also means I need to have effects for when the enemy is defeated, when the moth is absorbed, when the enemy is dissolved, etcetera. I architected most of the former a while ago, and this past month I made big strides into the latter.

Actually, a lot of the work I put in here emerged directly from the work I earlier put in with rendering those water effects. The weird hazy effect I’m using now for enemies fading away after defeat is a combination of a scrolling displacement map, a blur filter, and a standard transparency fade-out: I really love the way these look together, and I don’t know if I’ve ever seen anything quite like it in another game before. As with the water, I still feel the effect can be improved upon, but I’m really happy with what I’ve got so far here, and I will probably use something extremely similar for the final game.

In reality, most of this stuff was pretty close to its current state as of about 10-15 days ago. Most of the past couple weeks has actually been taken up by extremely uninteresting-to-talk-about debugging of some problems with the drawing functions of my animation class that only manifested when I started rendering these special effects. As annoying as it is to not do work that feels like progress, my animation class is one of the bits of programming I’m proudest of, so I’m always pleased to get the opportunity to improve it.

This next month will probably be more background drawing, polishing up this basic enemy to fix the weirdness in animations and behavior, and getting started on building out some of the other enemies and variations on this enemy.