Wednesday, June 20, 2012

Editor and allacrostian work

Hi all,

I've lately been working on several things (again):

First of all, I took care of a long time wish, check whether the allacrost demo could work with the newest engine version. It's now done! The HeroOfAllacrost branch is now up-to-date again. You can try the former game demo by compiling this branch now. :)

It was quite a good proof of concept to make someone else's work function with the scripting language changes I've put. And I'm a bit reassured about the current engine state now. ;)
It also permitted me to fix two bugs related to invalid halo images and context inheritances.

I also kept on working on the editor to further easing the pain of map making. There is still work to do, but you can now create layers, and move them up or down as long as they stay contiguous by type. E.g.: A ground layer cannot be displayed after a sky one.
You can also hide/show a layer; the editor will hint you about what layer is visible or not using an eye icon left to its name.

What is left to do is to add the possibility to remove a layer, and to change its type or name.

The editor, now ported to QT4 and with some new options for handling the layers.


With all that, I should have a basic yet sufficient base to keep mapping a bit, and look at what tool could help me next.

I also thank qubodup for pushing to add support to boost 1.49. I guess he gave the right little nudge at the right time, as it now done. :)

Till next time!

Thursday, June 14, 2012

Some pixel art

Hi,

Lately, I've been busy at putting in shape tilesets and other sprites for what will be next in game.

Ruins exterior tileset beginning - from Daniel Cook's free graphics.


A new npc character has made her entering (by finishing some of Jetrel's work), and I made several adapted to be tileable additions from the Circle 2D free graphics from lostgarden.com

Lilly (I only made the left and right walking frames)

I also added a draft of a new map (which is veeery ugly atm.) and I must say that I'll tend adding several (even unfinished) maps simply to be able to test the scripts and what's next in the story before entering the polishing phase.

While on it, I came back on working on the editor which is still in need of a lot of love. For now, I simply removed the texture smoothing there (wasn't helping when looking at tiles transitions.), and ported it to QT4.


Best regards,

Thursday, June 7, 2012

Outline fix (Hurray!)

Hi,

I'm happy to say that the outline of magnified (enlarged) sprites is now fixed. As that one took much more time to fix that I thought (since I've been on this point since several weeks now.), I'm quite happy to say that those white artefacts are now an old story.
For some odd reason, I wrongly thought it came from the coordinate system used for the map mode, and I've trying workarounds and fixes in that area for some time already, without realizing that the smoothing method (GL_LINEAR) was simply using the RGB values of the nearest transparent pixels, leading to those white and grey edges on sprites borders. Here is the result:

If you look carefully, you'll notice the white outline on the left, black on the right.

Might sound simple for some OpenGL experts out there, but I'm pretty glad to see this fixed.

Best regards,

Tuesday, June 5, 2012

Shop & Co.

Hi everyone,

My computer broke two weeks ago and it was kind of painful to put it all back in shape before starting development again. Fortunately, I didn't lose any data regarding Valyria or not, thanks git and thanks backups. :)

So here are some news from all what happened since my last post:

- I added several new tilesets, and characters sprites set up out of mockups gently given by Jetrel.
You can see the mockups here if you're interested: http://www.http://wesnoth.org/jetrel/Allacrost/
I take the opportunity thanks him warmly for letting me use his work and keep on working on and with it.

To sum up, I gathered all the props in one tileset, added small ground variations for the harrvah, and the mountain landscape, and added the wood, snow, and desert house tilesets. (some of which still have WIP parts).

This will permit to finally add the first game "dungeon", but I'll come back at this part later.

The Wood tileset, 95% based on Jetrel's mockups.
- I also had a fair amount of work on the shop mode, which seemed to be in a not quite good shape after all.
A bit of word about it, if you allow me to:
When analysing the code, and the overall logic done throughout that mode, the main design drawback leading to crashes and display flawed logic was the fact that the deal types (weapons, items, ...) were computed against the items to buy, while those were also used for the items the player can sell.
All this was tricky to sort out, even on a higher level, as several piece of code were initialized once and set in stone, even when the items present there had changed.

To make it cleaner both in my little head and in the code readability, I had to separate the items to buy and to sell, their own deal types, and to make sure they would not be mixed again (as for the readability), I put the deal types in their respective interfaces, since there were only used there.

In the end, the shop is starting to look good, even in the memory management there needs some improvements. I don't know yet whether the text or some other memory management objects are in cause, but again I'll see that later.

The Shop mode, not crash-prone anymore (hopefully) and with the character's sprites display for equipment.

Now that the main parts of the games are, if not fine for a bigger project, functional, my next priority will be to add more space to the three-maps sandbox the game is, atm, and why not reach the state where the first battles can be encountered! :)

Depending on my time and luck on it, I'll also have to review the map display code to finally sort out the bad tiles offsetting seen in the map mode (which was there from the beginning, as for me.), and see whether I can have a go at removing the white edges around the sprites, when the images are enlarged.
Fun to come indeed. ;) Would I fail on this task, I would then look at putting a map view making me out of these kind of problems. (The worse, the better sometimes, eh).

Till next time! :)

Monday, May 21, 2012

Dependencies and path-finding.

Hi everyone,

The last week-end, I spent a bit of time in changing Valyria's Tear dependencies.
Just like anything sensible, the dependency problem is something tedious one has to take care very softly.

To be honest, and since Allacrost already used SDL, I took the way of adding the SDLImage dependency that will take care from now on to load the image data.
Since the SDL Image library is made by specialists and tested by a lot of people, it will ease the pain of testing libpng direct calls for that case.

More importantly, I've also been working on the collision detection algorithm.
After a lot of pain and struggle with the existing system, I simply took the step to rewrite it from scratch, and it came out much more simply than I thought.
The previous algorithm was splitted into about four functions, each containing their own limitations and historical bugs, making it all a nightmare to debug.
The new implementation is much smaller and permit to fix most cases, uncluding pathfinding and sprites untangling, and permit also not to block the player or a NPC when it is walking diagonally against a wall, by making it fall back to the free straight direction in that case.

I guess a big final step forward as been made in this sensible area, as you can see, and the only blocker left to make a first complete episode so far (art excepted) is the rewrite of the shop mode :)

Stay tuned ;)

Tuesday, May 15, 2012

Visual debugging

Hi,

Lately, I've been still working on several little things:

I Merged the sprite position and offset into one float, both in scripting and in the inner API.
I left proper pixel perfect rounding where necessary, to keep avoiding the flipping seen because of the map mode view point and technique chosen.

Based on that, I'll be aiming at using float based path coords for path move events and collision detection which should all in all simplify a bit everything.
To start with something helping, at least IMO, I added a debug view in the map mode showing the different collision types in a visual way:

The blocking area can be displayed for debugging purpose.


I also removed the fringe layer support in both the game and the editor, and made other minor fixes.
I guess that pathfinding apart, the engine is quite in a good shape to go further in the story now. :)

Friday, May 11, 2012

Scripting system simplifications and other fixes

A lot of behind-the-scene work has been done to the scripting engine lately, as told before, and I must say I'm quite happy with several of the schortcuts added. :)

Namely, the Event and dialogue Managers are the one important pieces there, cleverly thought by Tyler, IIRC.

In a first row, I added mostly support for several shortcuts, using handlers as parameters, instead of Ids.
Permitting to avoid this :

local character = ...
...
local character_id = 1
local dialogue = hoa_map.SpriteDialogue(1)
local text = "My Text";
dialogue:AddLine(text, 1);
DialogueManager:AddDialogueReference(dialogue);
character:AddDialogueReference(1);
...

Imagine now a map with 15 npcs, two important characters, and I didn't speak about events there, yet.
Do you think you can still remember the id used there without making a bunch local variable retaining the important ids?

The equivalent code is now:
local character = ...
...
local dialogue = hoa_map.SpriteDialogue()
local text = "My Text";
dialogue:AddLine(text, character);
DialogueManager:AddDialogueReference(dialogue);
character:AddDialogueReference(dialogue);
...
No more ids, in that case. Same philosophy for events. And it does seem to work quite well so far. :)
Don't worry, I still left the former way of doing it, so that one can go back using it when needed.
EDIT: Note that events still have ids, but they are now string based, and I do think it more readable so far.

The second problem I had to fix is the event chain handling, which appear to not handle chain breaking, and delayed event pausing. This is now done, and permitted to make the hero's mother to stop waking here and here, and come and speak to him when he tries to get out of his house. Sounds quite a simple case, but believe me, that one gave me some hard times.

The hero's mother can now come and speak before he can leave the house.


I, then, started to rework on the maps, and fell on the context handling, which was currently only handling the base context inheritance, which is fine in itself.
As I'm a little bit crazy, and saw that the editor was semi-prepared to welcome the feature of context inheritance for something else than the base context, I hopped on finishing the feature, both in the game app, and in the editor, and while on it, I made the context and its inheritance be declared in the same table in the map files. The context data is still declared at the usual place, but I guess it's fine in the loading logic for now.

With all that so far, we (yes we were two on this.) worked on the three first maps corrections and finally added inhabitants in the village map. (Hurray!)

The village feels less empty now.