Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dtishin

Pages: 1 2 3 4 5
16
All this....working 4 weeks a lot and hard on it. And then my notebook started to burn.
I am a backup guy but you know...not for the last 4 weeks though.
I cried.

Man that feels devastating! I'm so sorry it happened. A brief moment of disbelief, then a lot of swearing, quickly followed by a hollow feeling and cold sweat... Just crazy.

Have you considered using "Backup and Sync from Google" desktop app (formerly called simply the Google Drive app) to automatically sync your project folder with a Google Drive folder? 

17
Windows / Mac / Flash / HTML5 / Fireside Hero optimisation - Part 2
« on: July 03, 2020, 04:46:14 pm »
3. Use handler events for updating animations, font colour, sound etc.
Basically, instead of "Switch animation for actor..." you may want to use a custom setter "Set animation requested to...". The separate handler will then check if the requested new state is different from the current state, maybe remember the current state as "previous", check additional conditions and only then do the hauling part and actually switch the animation. Besides improving performance, it allows to easily tweak the code in one place without sifting through your whole project.
4. Pre-load sounds on separate channels if the files are large and you switch them often.
FH has a lot of sounds. Some are very short (clicks, thumps, horse neighs and such) or only play occasionally (e. g. "new day" jingle). These don't really affect performance, so I can group and play them on the same channel (e.g. all UI sounds on Channel #4, all jingles on channel #3 etc). Other sounds, specifically ambience loops for the map (forest, swamp, desert etc) are switched every time the hero moves to a different tile. In this case, consecutively looping and stopping them on Channel #0 created visible lags in movement of hero avatars on the map. Investigation with hxScout proved that the engine was retrieving the sounds from files every time, which was creating the lags. So instead of two sound channels (one main, second for fade-out of a previous loop) I introduced as many Channels as there were ambient loops (currently around 15). All these sounds are looped on individual channels while the scene initialises, are immediately paused and remain in RAM for the whole game onwards. Yes, it permanently occupies 30 MB of RAM instead of 3 MB, but the difference in UX is amazing.
(And because I had a separate "sound handler" event, changing this logic was quite quick ;).
5. Use procedural animation if possible.
I have a simple dying animation for my monsters and heroes. It erases the character image (sort of "the Infinity Gauntlet" wind effect). I initially stored these animations as actor animations (roughly 20 frames per character x 18 characters = 360 frames, 240 x 240 pixels each, with 5 default scaling variants Stencyl includes). The way Stencyl works, all of these are loaded into RAM at the start of the scene (I couldn't exclude some characters via memory atlases, because my game has procedural generation and I need all the monsters in my scene). What I did instead was: create 1 animated Eraser actor (left-to-right + right-to-left variants, 17 frames each, 120 x 240 pixels), leave only 1 static image for each of the 18 characters, and use the "clear image using image" block "every [duration of the eraser frame]". This is almost 350 sprites less than the original solution and uses 10x less RAM and disc space (at least 20 MB saved immediately).
6. Crop transparent borders from your sprites.
Texture Packer can do this really quickly and efficiently.
7. Use the native Stencyl functions to draw text (If possible).
Stencyl's text engine is extremely basic. No kerning, no grid fitting, no alignment, no text wrapping (list goes on). When it comes to Serif fonts like my main font, Eagle Lake, the look is horrible. I mean, playtesters started complaining and all. On the upside: it's fast, the glow / offset effects look great, and you can apply styles (bolding / italics etc) even when the original font file doesn't support this style.
I'm using a custom Stencyl build that can display text using the "Open Flash Textfield" blocks. It makes perfect spacing between characters, and the result looks crisp. Unfortunately it seems to come with a tiny extra tax on performance. So I ended up using the "Open Flash Textfield" blocks for big chunks of text (narrative, item descriptions, tutorial prompts etc) and use the native "Draw" blocks for UI button labels.
8. Use hxScout to monitor performance.
Detailed guidelines in Merrak's thread here. Side note: the telemetry / hxScout monitoring process taxes your memory too - so the framerate it shows is not exactly the framerate you'll have with telemetry disabled (though it's probably pretty close). In other words, you cannot measure framerate without affecting the framerate!
9. Use Visual Studio to debug runtime crashes if the native Debug mode doesn't help.
Guidelines by Justin here. If I read this thread when I started developing my game I could save myself at least a hundred hours (likely much more). I'm really perplexed why Stencylpedia doesn't have a section on properly debugging runtime crashes.
10. Avoid creating important actors in scene editor if you continue adding behaviours to your game.
While refactoring the code I ran into a bad Stencyl bug. If you add a new behaviour to an actor type, it may not get added to the actor instance you had previously placed in the scene via scene editor! It took me a whole day to figure out why my pointer stopped working, until I found that the pointer instance didn't show a new behaviour I recently attached to the pointer actor type. As soon as I removed the pointer from the scene and created it procedurally at scene start, the issue was fixed. Note it's a confirmed issue planned for fixing in future Stencyl releases.

18
Unofrtunately thats part of the development :)
And getting better FPS can also be fun if you see the result.

I wrote down some thoughts a while a go which might be helpful:
http://community.stencyl.com/index.php/index.php?topic=28359.msg301552#msg301552
Cheers!

True story, thanks for the link!
Actually, your more recent post about Goldspace optimisation nudged me to write this devlog ;)

19
Keep up the good work!
Just curious, had you had any wishlists on Steam before release? How many of those eventually converted into purchases?

20
Windows / Mac / Flash / HTML5 / Re: Reset World
« on: June 16, 2020, 08:46:19 am »
This game is really unpredictable but in a nice way.
Love the colour palette, too!

21
Windows / Mac / Flash / HTML5 / Re: Reset Co.
« on: June 16, 2020, 08:40:34 am »
Well done guys. A cute puzzle game!

22
Nice puzzle, reminds me of The Incredible Machine!
But please don't reset the puzzle after the player hits "simulation".
Often I only need to slightly adjust one element, but instead end up tediously dragging every block again and again from the toolset. 

23
Looks great, though too hardcore for me :) Reminds me of VVVVVV.
I'd love more colours, too. Red is a bit depressing. Yellow would be nice at least for a change :)
Also I didn't figure out what's with the green levels. What is their function?

24
What I liked:
- Nice old-school looks
- Pleasant music and SFX
- Dynamics
- Combination of enemies with different behaviours

What frustrated me:
- Difficuty curve. The first level is basically chill-out, the second is a hardcore nightmare. Made me drop the game after a dozen attempts.
 - Controls. Moving with AWSD and turning with the mouse felt awkward. You may improve this if you constantly turn the avatar to follow the pointer. Currently there's no way to know where it's looking (and in what direction it's going to shoot).

Overall, a nice game, well done! 

25
No programming experience + First solo project = Horrible code, guaranteed.

Fireside Hero turned 1 in early May 2020 and got a Steam page. A good milestone to look under the hood, I thought, and pulled a Hydra from the engine compartment. The Hydra told me my framerate sucked. It could drop to an average of 3 frames per second when a hero was travelling over the map - picking items, gathering resources, boosting skills and fighting monsters. Basically, it dropped to 3 FPS when anything exciting was happening! Not good.

6 weeks and 14 build versions later, job done. Kind of. The new average is somewhere between 20 and 30 FPS, which is not ideal - but I like the results and hope they'll get me through the year (and maybe to release?) Also note most of the drops in performance happen when there's little or no movement on screen (e.g. an item has been released into an inventory slot, hero has moved onto a map location, etc) which will go unnoticed. And, to be honest, the thought of more debugging makes me sick, so I'll pass for now and swing back to gameplay, features, UI and other fun stuff :)
Some optimisation observations I made:

1. Unless you're making a physics-based game, absolutely do disable collisions.
You can do it via game settings and via settings for individual actor types. Since I wanted to be absolutely sure I disabled everything, I set the global physics settings from "Normal" (Box2D) to "Simple" and individual actor type settings from "Normal" to either "Simple" (for actors that need to receive updates and execute behaviours) or "Minimal" (for purely cosmetic actors e.g. rivers, landscape transitions and such). Unfortunately, most of my pointer interactions (clicking buttons, selecting heroes, managing inventory etc) and hero interactions (visiting map locations etc) were based on collision events... Replacing map collisions with coordinate checks posed few challenges, as FH is tile-based and everything fits nicely into a grid. Pointer collisions, on the other hand, turned out trickier, as windows (and buttons) can overlap on different layers. Such as when you open a "hero details" window then click an item, which opens the item details window with its own "Sell" or "Use" button. Checking a-z layer order inside the coordinate check behaviour generally solved this issue.
Of course, the precision of irregular collision shapes was sacrificed in the process - all buttons effectively turned into rectangles, even if their sprites were diamonds, circles or whatnot. But from UX perspective I found it doesn't make a difference.

2. Replace "Always" events with "Custom" (one-off) events if possible.
Not only it saves the engine from unnecessary calculations, but it also helps you structure the logic and better control what is triggered when. I'm really puzzled why official Stencyl documentation claims "Always" events to be the meat of any game. In my opinion, they are more like the nerve system - listening to inputs and relaying commands to other parts of the body (i.e. actual "meat"). So instead of a few dozen events in separate behaviours all checking same boolean conditions and listening to the same mouse releases, I made one master event for all mouse clicks in the game, which triggers respective custom events in various scene and actor behaviours. Same goes for triggering hero collisions with map objects or programming combat logic. If making a one-off event is not an option, at least consider switching to "Do every N sec." That's how text is now refreshed for hero stats (prowess, charm, knowledge etc). It creates a small lag but you get used to it pretty quick.

To be continued...

26
Chit-Chat / Re: Castle Pals console launch!
« on: June 09, 2020, 02:31:55 am »
Consoles publishing is such a complicated process. While obviously it's possible in some way, actually getting a game through the QA process of each store and even having the connections to leverage to release at all, would be difficult to do without a publisher.

I know what you mean! And as I understand, currently porting to consoles means redoing the game from scratch in a different engine. This takes resources on part of the publisher - which is extra leverage in publishing negotiations, unfavourable to the developer.

Anyway, you guys have gone a long and hard way, congratulations!

27
Ask a Question / Re: How to import animated tilesets?
« on: June 04, 2020, 12:59:53 pm »
Any reason you can't use that image you attached to your post as a background with multiple frames instead?

Ease of level design / flexibility.
I intentionally moved away from the animated background to a tileset to be able to make / edit maps in scene editor, rather than drawing them externally and importing.

Performance.
A 1920 x 1080 background takes four times as much memory as a tileset with 40 tiles.

28
Ask a Question / Re: How to import animated tilesets?
« on: June 04, 2020, 09:38:30 am »
While I don't know about importing entire tilesets with animations for each one, you can add multiple frames at once for each tile set, and you don't need to create separate image files for each one. I reckon that would be easier than your method. Attached a gif showcasing how it is done.

I know I can import multiple animation frames for each tile, but it doesn't help my case.
In your example you have 3 frames for the same tile in one spritesheet, one after the other. It only works fine when your objects are tile-sized (e. g. for my animated volcanoes, windmills and such).

When I'm drawing a river fragment (or seashore etc) I draw a whole image that spans multiple tiles.
Then I add animation to the whole image (e. g. in the attached example I change opacity of the shorelines).
Even to prepare this asset for import I need to run some sort of a script that would pack all A1 tiles into one spritesheet,  all A2 tiles into another spritesheet, etc. Then I'll have to import 40 spritesheets each containing 3 frames of one tile.
That's not saving a lot of time, plus I don't have a script that would extract sprites with the same coordinates and pack them into animation strips :(

29
Ask a Question / Re: Text
« on: June 04, 2020, 08:31:36 am »
I enabled text wrapping- and disabled the original draw block which was appearently the cause of the text going off screen. Oops.
However, now I don't have any text at all. Am I using Lables wrong? So far I've:
Created an actor with no animations
On the events of that actor, attached label to self,
set lables text to (text)
set lables allignment to left (also tried center)
and enabled text wrap, using width 100.

Only thing I can think of is setting labels font, which I'm not using because it shows "no fonts for this game", but the draw command doesn't need you to set a font for it to write so I don't think this is the problem.

You need to set a font in Dashboard -> Fonts, then use the "Set label's font" block for your label. 

30
Ask a Question / How to import animated tilesets?
« on: June 04, 2020, 08:26:20 am »
Hi everyone, how do you import animated tilesets?

There is a functionality for importing animation frames for separate tiles, but not for the whole tilesets, which is really frustrating. E. g. I have a "shorelines" tileset with approx. 40 tiles in Fireside Hero, and each tile has 4 animation frames.

So I had to:
- import 4 sprite sheets (one for each frame) as 4 separate tilesets
- manually copy frames with the same coordinates (e. g. A1) from 3 temporary tilesets into the main tileset.
- repeat for each tile in the set.
- delete 3 temporary tilesets.

This consumes huge amounts of time.
Currently I'm not reimporting my river actors as tiles for this very reason (there are 12 different river fragments, each has 4 orientations, each orientation has 2 frames, and each actor is the size of 2-8 tiles - in total about 150 tiles in the target tileset), even though reimporting would improve my game's performance...

Any suggestions how to optimise this?

Pages: 1 2 3 4 5