Update #1 – 15/04 -17

Sections

Different worlds

Hotkeys and actionbars

Tooltips

Items

Loot

Spells and melee damage

Monsters

Improved pathfinding

Video of update

Back to top

Different worlds

To allow for procedurally generated worlds, I have added the possibility of having different “worlds” that are not in any way connected to each other, each with individual maps. Currently only the “main” world can have NPCs, because the procedurally generated worlds are intended mainly for dungeons and such where you are faced with different challenges. In the future, I may add support for NPCs inside the other worlds as well, perhaps for puzzles of some sort.

Back to top

Hotkeys and actionbars

Consumable items and/or spells can now be added to actionbars. At this time, there is no support for custom hotkeys (right now they use keys 1 through 0), but that is something I’m looking to add in the future.

Actionbars

Back to top

Tooltips

Items and spells now have tooltips that are shown whenever the player hovers over them.

Back to top

Items

Wearable items can now be equipped, and your equipment plus total stats can be seen in a character information box. They can also have item effects such as added health and/or added mana, and more.

CharacterInformationPanel

Back to top

Loot

Monsters can now drop items in varying amounts and with different chances of dropping specific items.

LootWindow

Back to top

Spells and melee damage

Spells (both healing and damage dealing) and melee damage now use a custom formula based on the player’s level, magic and strength and the attacked creature’s defense.

Back to top

Monsters

Can now cast healing spells as well as damage dealing spells.

Back to top

Improved pathfinding

It is still an implementation of A*, what has changed is that the “closed list” is now a HashSet instead of a List. I am not yet happy with the speed of it, so it will continue to receive improvements during development.  An example of how much faster the new implementation is:

The path:

Pathfinding

Old (using List for closed list):

12 seconds for 100k iterations

New (using HashSet for closed list:

9 seconds for 100k iterations

Result:

The new one is 25% faster.

Back to top

Video

Back to top
Advertisements

SpriteFinder

Sections

What it is

How to use it

How it works

Video

Back to top

What it is

SpriteFinder is a tool that I started developing because I have a lot of spritesheets without any predefined lists of individual sprites’ location and size. Previously I had used Paint to locate the position of and figure out the size of the sprites, which was very time consuming and not that fun.

Back to top

How to use it

You start by loading a spritesheet, then going into the settings window and choosing the size of the sprites in the spritesheet. If they have varying sizes, you choose “Unknown size” and the algorithm will figure out the sprite sizes for you – though that function only works if there’s at least a 1px space between sprites in the spritesheet.

Next up, you choose how the generated sprite string should look. All that’s left to do at this point is to click “Find Sprites”, and the tool will start figuring out where the sprites are.

Now left click a sprite to add the sprite to the list of sprites, or right click and then left click to merge two sprites (mainly used if there are sprites that have spaces between them).

ExampleSprite

Back to top

How it works

The first functioning version simply split the entire spritesheet into 16×16 squares, today I finished work on an algorithm to find sprites no matter the size (it is basically a simpler version of A*). The algorithm currently only works if the sprites have at least 1 px of space between them.

At first, I had a List (Position is a struct containing only X and Y coordinates) of pixels that were part of sprites. The program worked, but checking if a list of well over 30k items contains a specific item.. is very CPU intensive.

Changing the collection that contained all the positions of all the found pixels inside all the found sprites from a List to a HashSet improved the algorithm’s speed by a lot more than > 10x.

Before the change, the tool would, after about 2 seconds, stop responding and not update the UI even though Application.DoEvents() was used. It also took long enough to finish that I felt compelled to change it.
After the change, the entire process actually looks smooth and does the job much faster.
Even spritesheets with individual sprites that contain over 30k pixels work without crashing the program (for reference, 64×64 sprites contain about 4k pixels).

Back to top

Video

Back to top

State of the game #1 – 07/04 -17

There’s a gif of the latest version at the bottom of this post.

Features at this time:

  1. Spells (WIP)
  2. NPCs (WIP)
  3. Quests (WIP)
  4. Monsters (WIP)
  5. Leveling system (WIP)
  6. Classes (WIP)
  7. Items (WIP)
  8. Shadows (WIP)
  9. Rain (WIP)

1. Spells

Currently there are area and targeted damage spells, and healing spells, with the possibility of using cursor position for area spells as well.

2. NPCs

NPCs have the ability to have dialogues with the player and the option of offering quests during dialogue.

3. Quests

To begin with, I have implemented quests with the objective of killing monsters, quests with objectives such as finding an item or a location are also in the works.

4. Monsters

Monsters have basic pathfinding AI using my implementation of the A* algorithm, which I will replace or improve in the future depending on what I see fit.

They also have the ability to use spells and/or use basic attacks to attack the player.

Walking and spells are animated.

5. Leveling system

The leveling system is really basic at this time, with levels increasing health, mana and other attributes.

6. Classes

Two classes exist today and right now the only differences between the two classes are attribute distribution when leveling up and differing player sprites.

7. Items

Consumable items like health/mana potions are already working, ones that grant temporary bonuses are not (yet).

Wearable items (equipment) is what will most likely be implemented next.

Although as of now, items only exist in the player’s inventory, my intention is for the player to be able to move items to/from the inventory as well, and of course to equip wearable items.

8. Shadows

Basic shadows are implemented just to get a basic understanding of how to implement them properly at a later stage.

9. Rain

As with shadows, this is still a very basic feature, it is not yet automated.

Update gif: