Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Morgana retro Dungeon Crawler (uses Tilengine)
#51
TLN_SetNextSprite works AFTER all sprites have been drawn or must be set before drawing? (order set before drawing)
Reply
#52
When you set sprite ordering with TLN_SetNextSprite(), it has effect on next frame drawn, so first set order, and then draw at the end
Reply
#53
Thank you Megamarc and sorry for the delay.

Current topics:

- I will leave the raster effect for the painting in the todo list for now, I will try if it looks good with just per-line horizontal offseting, without vertical.
- Answering to this:

Quote:The "selected card FX" animated rainbow effect fom pixel effects is a sequence of frames, or a realtime palette animation? Tilengine allows you to create color cycle animations using just one frame and animating the palette, old-school (but very effective).

It's an animation without color cycling. I'm still infatuated by the color cycling effect, it just scares me to implement haha I promise I will try to implement it somewhere before this project ends.

Take a look:

temp.png:
[Image: temp.png]

temp.sqx: (3 times first frames + 1 time all the sequence)
Code:
<?xml version="1.0" encoding="UTF-8"?>

<sequences>
<sequence name="anima" delay="8" loop="1">
0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
</sequence>
</sequences>

Now I'm in a conundrum.

I'm refactoring code for the Pentacles Tarot Wall:

[Image: penta.png]

and when unifying the magic effect in a function...

Code:
void Tarot_Wall::draw_magic_anim(shared_ptr<Sprite>& passed_box, int x, int y){

    box=make_shared<Sprite>("./assets/animation_fx/benmhenry","temp",19,64);
    box->animated=true;
    box->loop=0;
    box->draw(x,y-16);
    box->set_blend_50();

    audio->fx(audio->magic_sound);
    box.swap(passed_box);

}

It happens that (now) all the magic animations start at the same time. This is a deeper problem than it seems. For instance, think that the player is looking at the wall, drops two cards and then rotates his view and then rotates back, or goes away and returns...

...where do I resume the animations?

I can't store the frame of each tarot slot magic animation of all the tarot walls of all the game and restore it. This would be a madness. (or hide ALL the animations of ALL the tarot walls of ALL maps in ALL game in 2000,2000 and restore back when needed). (I used to use 2000,2000 as my favorite hide spot with the C version of the project, now in C++ I'm not using it at all and try to disable always the sprite instead. I think its better practice, no?).

I thought it's better to each time player returns to tarot wall then he/she sees an animation started with a random frame in each slot.

What do you think about this?

I'm afraid you can't set an animation to start in an arbitrary frame in Tilengine, would be an useful or complicated feature to implement?

Thanks and best regards.
Reply
#54
Hi Jaume!

How are you doing?

The "temp.png" animation you use for outlines can't be done with color cycling. Pixel coverage changes between frames. Color cycling only allows changing a given color, but not changing which pixels are transparent and which ones have color coverage. However I encourage you to apply it in other places, it has its uses.

I don't have insight about your game engine, but Tilengine handles the animation of each sprite independently, so you should be able to have the same sequence running on several sprites, each one at its own phase.

Modifying TLN_SetSpriteAnimation() to have the starting frame is easy, the problem here is that adding a new parameter to a public function breaks both API and ABI compatibility -C is very strict about parameters because it doesn't have overloading nor default values for optional parameters-. I should instead add a new function to reassign the current frame so you can "jump" at any time, and this could be an useful addition. This way you would start the animation normally, and then immediatley jump to the desired frame, so the first frame you see is the one where you want to "resume" the animation. 

I'll keep you up to date when I add this functionality!

Best regards,
Reply
#55
Hi megamarc! Wow, your last post was from june :O I  can't believe it, time flies fast, sorry for the lack of progress/updates feedback.

Happy belated new year 2022.

Quote:How are you doing?

Oh man, I'm still locked in my room after a week of covid and still positive. But I'm ok. I'll start doing walks in the fields nearby for my own sanity. It's hard to be locked here even though I'm ok and have plenty of distractions. Not being able to see daughters is hard. Mother and fiancee catched it too but now are ok. I hope you and your loved ones are ok. Hopefully will get immune soon and this nightmare will end.

First thing first, here's some progress.

2 Complete Tarot Walls, dissolving them, companion slot swapping, blood fountain potion filling:



I've posted some bonus pictures in the RPG Codex and the reception is nice, please check it out if you can: https://rpgcodex.net/forums/threads/morg...753/page-3

Talking Tilengine stuff, notice how I used the rainbow animation for the companion swapping too Smile I think it looks nice.

Notice I solved the rainbow animation initial frame problem, it just resets the animation to frame 0 when revisiting in-progress completed Tarot Wall, so no problems. It looks nice.

I've completed several tarot cards too, you can check it out here, as always. There is a lot of room for improvement, though: https://pixeljoint.com/forum/forum_posts.asp?TID=26827

Could you please tell me if there's a way to mix different blend modes for a Sprite, wich is the way? I tried several ways and doesn't seem to work, maybe it can't be done?

Any news on any Tilengine update? Are you planning something interesting or any new raster effect or something?

Best regards
Reply
#56
Second progress video (only 1 video allowed per post):

Coat of Arms and Archdukal Banner. Please note how Alaphaeis and Charome is specially written in-game. I'm planning on merging my novel with the videogame. Happen in the same world but follow different events and protagonists, despite being related and the plot joining at the end of the game and at the end of the novel:
Reply
#57
Hi Jaume!
I'm glad to hear from you, cheer up with the confinement, I hope it passes soon and you are all well. For my part I can't complain, thank you Smile

I see that the progress of the game is advancing, it looks better and better, congratulations!

There is no direct way to blend two blend modes together, but you can create a custom blend function by using the TLN_SetCustomBlendFunction() function and then passing the BLEND_CUSTOM value to TLN_SetSpriteBlendMode() . This function takes as input the intensity values (0-255) of the existing image, the one that is overlaid, and returns a new intensity value resulting from applying the calculation that you want to the two original values. This method is flexible but has 2 limitations:

  1. Only one custom function can be active (you cannot define several at the same time)
  2. Every time you set a custom function with TLN_SetCustomBlendFunction(), a LUT of 65536 entries is precomputed. This has a small performance cost, so it is not intended to be changed continuously.
That is, changing the blend mode with TLN_SetSpriteBlendMode() is free -including BLEND_CUSTOM-, but changing the custom function is not. Do you think it can serve you for what you want to achieve? Let me know!

The next feature of Tilengine that I will publish -of which you already saw a preview- is the compatibility with html5 and browsers, to be able to export the games made in C to a web browser. Later directly in javascript via binding.
Reply
#58
Thank you megamarc,

Public announce:
I'm a bit of overwhelmed on the programming side in general, not a specific thing. I could use some help and a collaborator. I someone wants to jump in drop me a line to jaume.alcazo@gmail.com with a sample of your work and we can talk. I contacted some people and will publish some posts on other forums.

Cheers.
Reply
#59
Hi Jaume,
May I help? I know the engine and you already have a sample of my work  Smile Send me a private message in case you're interested. I have experience.
Reply
#60
Private sent Smile
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)