Recent posts

Development / Re: Have a 2nd hero move, atta...
Last post by Christopho - September 08, 2022, 02:27:15 PM
This tutorial covers attacking enemies with a custom entity (some fire in this example, but for any projectile this can apply):
The next version of Solarus will support multiple heroes, so maybe you can consider switching to the development version. We'd be happy to hear your feedback by the way because this is still experimental!
Development / Have a 2nd hero move, attack a...
Last post by gzuk - September 08, 2022, 10:04:02 AM
Hi, I'm trying to implement a 2nd hero for co-op gaming. It's just for laughs, and I know the engine isn't really made for that. So far, I only managed to have a custom entity walk around with the WASD keys, and spawn projectiles with the Ctrl key. However, I can only seem to make the projectiles traverse enemies, or disappear when they hit one.

How can I make the spawned projectiles hurt the enemies, as projectiles from the hero would?

Is there a way to have the enemies and enemy projectiles hurt the custom entity, like they would with the hero?

Since the 2nd hero should behave pretty much like the 1st hero, only with other keys, is there any Lua script for the hero I could copy from? Or is it all in the C++ files?

Many thanks for some hints!  :)
Development / Re: disable spin attack
Last post by Cluedrew - August 22, 2022, 12:03:09 AM
You will need game:set_ability("sword_knowledge", 0) or something. Most of the documentation is around the paired get_ability.
Your projects / Re: First Practice Project Rea...
Last post by nickfury23 - August 20, 2022, 01:22:23 AM
Thank you for playing!
Development / disable spin attack
Last post by xglichtrapx - July 28, 2022, 02:41:41 AM
How do you disable the spin attack?
Game art & music / Re: Snow flakes
Last post by kabaiakh - July 21, 2022, 05:25:28 PM
We want to animate falling snow flakes in the Solarus game engine framework.

The main screen size is 320x240 (QVGA for those from bygone days), traditionally animated using wrapping tiles.

Let's pick up a 32x24 one, because the dimensions (width && height) of one tile must be multiple of 8 under Solarus.
Put it into motion with 24 frames so the animation can loop at 40_ms delay per frame (slow snow, persistence of vision).
We get a 18.432_kpx animation (32*24*24), tiled 10x10 on the screen as shown hereafter.

One small tile

WxH   |   kpx   |   tiling
32x24   |   18.432   |   10x10


Preferring something with less -- if not without -- patterns ?
We could generate a more evenly randomized tile and ...
we would replace patterns with a grid or ...
we should try to make one single 320x240 tile.

One big tile

WxH   |   kpx   |   tiling
320x240   |   18432   |   1x1


This tile is 1000 times heavier (320*240*240=18432_kpx).
Too large / too tall for Solarus, which prefers the overall size of tiles sets
to be less than 2048 for compatibility reasons.

So, besides getting rid of patterns, we also need to limit pixels overweight in the process.
The good news is both those goals can be reasonably achieved by superimposing
two differently sized tiles so that they conceal each other's patterns.

Two differently sized tiles

WxH   |   kpx   |   tiling
32x40+40x24   |   74.24   |   2x2


Let's begin the off-putting underlying theory detailed explanations with a basic layout of two same size tiles.
Each one has its own patterns, we label them and .
When we overlay both, we obtain a new pattern, unrandomly labeled .

1 * tile #1   
1 * tile #2   

Not that good once tiled on the screen. We still see patterns.

Tile #1
WxH   |   kpx   |   tiling
24x24   |   13.824   |   13.33x8

     Tile #2
WxH   |   kpx   |   tiling
24x24   |   13.824   |   13.33x8

WxH   |   kpx   |   tiling
24x24   |   13.824   |   13.33x8

If we do the same thing with differently sized tiles as aforementioned, we get something more interesting.
Let's just take a tile of 2 patterns and another one of 3 patterns :

1 * tile #3   
1 * tile #4   

The overlay builds a 'meta-tile' comprised of 6 new patterns which then resume their cycling.
Those 6 patterns are built upon only 5: 2 from tile #3 ( and ) plus 3 from tile #4 (, and ).
Arithmetically, 6=lcm(2,3) and 5=2+3 (arrest this man, he talks in maths).
We do not 'see' 3 repeating or 2 repeating but only one larger .

Tile #3
WxH   |   kpx   |   tiling
16x24   |   9.216   |   20x10

     Tile #4
WxH   |   kpx   |   tiling
24x24   |   13.824   |   13.33x10

WxH   |   kpx   |   tiling
48x24   |   23.040   |   6.66x10

With this second tile example, the meta-tile is 48x24 (from a 16x24 tile and a 24x24 one).
Tiny compared to 320x240 but the bigger the meta-tile, the fewer patterns.
So what would be the best ratio for our screen (smallest tiles for biggest patterns-concealing) ?

That would be scann'd and dimensioj-kalkuli is here to enumerate all the possible combinations;
among which two in particular attract attention.

   |    meta-tile    |    tile set    |    W / H    |    H / W    |   
sizes A    |    160    |    1280    |    40    |    32    |   
sizes B    |    120    |    960    |    40    |    24    |   

Since 32 is 1/10 of the screen's width and 24, 1/10 of its height,
let 32 be the width for tile #5 and 24, the height for tile #6.
We get a 160x120 meta-tile. 1/4 of the screen. Shiny.

There is also another scheme: 40x32 + 24x40.
Unfortunately, 40*32*32+24*40*40 = 79.36_kpx when 32*40*40+40*24*24 = 74.24_kpx only !

Now is time for kahelo-animi to (slowly) generate images magically.

Tile #5
WxH   |   kpx   |   tiling
32x40   |   51.2   |   10x6

     Tile #6
WxH   |   kpx   |   tiling
40x24   |   23.04   |   8x10

WxH   |   kpx   |   tiling
32x40+40x24   |   74.24   |   2x2

Compared with the first two one-tile solutions, lightest * 4 but heaviest / 250.
Totally worth it, as it prevents eye bleeding. Judge yourself.

One small tile
WxH   |   kpx   |   tiling
32x24   |   18.432   |   10x10

     Two differently sized tiles
WxH   |   kpx   |   tiling
32x40+40x24   |   74.24   |   2x2

     One big tile
WxH   |   kpx   |   tiling
320x240   |   18432   |   1x1



Remains to be applied to Solarus:


My God !
It's full of stars.
And, voila ! solarus-vetero.tiles.png solarus-vetero.dat
Crystal bits of snowflakes all around my head and in the wind.

The scenery provides its own patterns hiding as shown below
(customary animated GIF everywhere for compatibility).


Foreground flakes
Are sparse, scattered and fast.
Could also be big and bright.

Background flakes
Are numerous, tight and slow.
Could also be tiny and dark.

Of course, the principle is not tied to two tiles top, it would work well with way more.
Needless to say, laziness can grasp even the most motivated ...

Similar to the context-free chaos theory, this method should be quite ecumenical
and could theologically theoretically be applied to animations other than snow: mist, rain, swell  ...
It might as well already exists, just like this ancient 'differential scrolling' was indeed a mere parallax.
Game art & music / Re: Snow flakes
Last post by kabaiakh - July 21, 2022, 12:36:06 AM
Be reassured, I ain't no ser spammer.
For demonstrating purpose, I made use of CSS to overlay images.

Thank you for your exlpainations, this thread won't rot unanswered.
I'm working on a conversion into something that can be displayed here.
Your projects / Re: Minish Cap Maps in Solarus
Last post by Max - July 20, 2022, 02:07:09 AM
Looks really cool! Nice work : )

Most people don't post here that often haha, so you're in good company. Almost all Solarus activity is on the discord. Although there's probably some usefulness to having forums, since they work as searchable archives of scripts and stuff that are posted.

I don't think you'll be able to use the tilesets for animated water, if they still are like they were when I last looked at them. You'll probably need to set up new water yourself. Maybe check the Spriter's Resource for tiles? Something I've done at times is looked at Youtube videos of Minish Cap, paused them, and stepped through from by frame (usng the < and > keys) to check each frame of an animation. Maybe you can recreate Minish Cap's tiles that way. Good luck!
Game art & music / Re: Snow flakes
Last post by Max - July 20, 2022, 02:00:47 AM
Hi! The forum get some suspicious spam posts sometimes and this looks a lot like one! Sorry if it's not.

However, you ought to explain more what your link is pointed to and what you want feedback about.
Game art & music / Snow flakes
Last post by kabaiakh - July 19, 2022, 09:01:21 PM

I've recently finished some work of mine and I thought some of you might be interested in.
AFAIC, I would appreciate feedbacks: understandability and/or prior existence of the technique, optimisations for weight at run time within the Solarus engine, incorrect spelling ...

Enjoy ! ;–)