It’s Friday! I missed yesterday’s devlog, so here it is.
Over the last week, I added motion and collisions. I am mostly happy with the way the physics works, with the exception of non-rectangular collisions. Even after implementing angle-sweep collision reconciliation, it’s very easy to get stuck on elliptical or otherwise irregular collision masks. Unsure of a fix, I’ve put it off for the future when it will matter more. I also drew a tree sprite.
I started work on implementing combat by creating little goblins with axes that can chase you around, as shown in the above gif. Combat, like I mentioned in the previous part, will be turn-based. So, the idea was that when you bump into an enemy, it spawns a grid/board over the world, and becomes a battle that other players can watch in real-time, like the way combat works in Wizard101. I haven’t actually started on combat yet, I mostly focused on adding more art to the game.
I began work on designing some of the items and skills that I wanted featured in the game. The ones I chose to focus on first were mining and smithing. I first came up with a list of all the metals I wanted in the game, how to make them, and what they would look like. Then, I set out to draw ores for all of them, item icons for those ores, and finally item icons for the smelted bars for each metal. The only thing I did not draw was carbon, which is needed for steel.
|Level Range||Metal Type(s)||Smelting Recipe|
|1 – 10||Bronze||Copper + Tin (2:1)|
|11 – 20||Iron|
|21 – 30||Steel||Iron + Carbon (4:1)|
|31 – 40||Electrum||Silver + Gold (1:1)|
|41 – 50||Platinum|
|51 – 60||Titanium|
|61 – 70||Cobalt|
|71 – 80||Laudium|
|81 – 90||Venutian, Erisian|
|91 – 100||Astril, Essil|
Level range is the expected range of levels that players might use weapons and armor made out of that material. I might not actually use levels in the game, but it’s a rough idea of the order of appearance and the strength of each metal. If a metal has a specified smelting recipe, it means it is created out of bars/ingots of other metals, or other ingredients such as carbon. I might add other types of materials that could be used in smithing, such as obsidian glass, gemstones, etc. in the future, but this is plenty for now.
Venutian and Erisian will be complements, where players will likely choose to focus one or the other. They will probably have distinct characteristics that make you want to choose one. The same goes for Astril and Essil. They are both equally strong but will have varied characteristics.
You might have noticed in the gif above that the goblins are able to render before or after each other and the trees. This is because I created a renderer object that handles the draw order of entities manually. I used a clever trick to encapsulate the creation and destruction of entities so the renderer can know about them without ever needing to couple the logic. You can find a snippet of that clever trick called Event Bus on the GML page. I also added an “EntityMoved” event that the renderer can listen to, so it can update the render priority of only the entities that moved each frame. This greatly optimizes the rendering speed. One last optimization I made was to pre-sort the entities once in the Pre-Draw event by duplicating the render priority, popping all of its contents into an array, and persisting that array through each draw event type. Now, sorting only happens once per frame.
I actually initially implemented a Binary Heap in the game using structs, but found it difficult to create a custom Priority Queue structure on top of it that had all the features of the built-in priority queues, so I just used those.
Over the next week, I will try to get more of the core skills into the game, at least the art for them. I will also try to design the mini-games each skill will use. I think the next one I will do art for is Fishing. I might also start working on actually implementing combat. See you next week.