Jump to content
Banner by ~ Ice Princess Silky

Rikifive

Support
  • Posts

    3,454
  • Joined

  • Last visited

Blog Entries posted by Rikifive

  1. Rikifive
    It's Rarity's day... I'm really having mixed feelings lately... There are some good things to mention, and there are some ... the other ones...
    Oh everything didn't go as I planned... 
     
    I wanted to make a game I mentioned a year ago for that day[ REFERENCE ], but looks like it will be delayed (if released at all), because something else took way longer than I expected.
    The Plan
     I had 2 weeks of vacations last month (5-18 August) and I wanted to use that time free from job to make two things:
    make a silly video for lols
    I was thinking of making something like this for a long time, just to see how it goes, have some fun and basically upload something to my YT channel after a long time of its inactivity. It was supposed to be just a silly small project, that I thought I'll get done within a week.

    start that game project and release it on Rarity's day
    This is something I planned a year ago. Rarity's day last year gave me an idea - the inspiration to make a game for her day and incorporate it with forum events for you all to (hopefully) enjoy. It was supposed to be a match-three puzzle game, that would involve dresses designed/drawn by you, members[ BASED ON THIS EVENT ]. I thought, that I'll have a full week without my job to focus on that and then half a month to polish and finish it.
     
    That seemed doable, so I was pretty optimistic about it.
    However... Nothing went as I planned. 
     
    The Result
    the silly video
    That not only took the whole vacations, it also took an extra week, making it 3 weeks in total. 3 weeks of work to get a silly video with only almost 8 minutes of content. It felt really bad, but I didn't want to give up - I wanted to finish it at all costs to finally have something done.
    And though it took a lot of time, I got it done, so... at least that's something good, right? 
     
    the game
    Now that's something, that didn't go well.  When I realized I had only 2 weeks to make this a thing, I decided to give up and focus on other things instead. Buuuuuuut in the end, on 3rd September, I decided to at least give it a try to see how it goes. And with that, the project has been created at ‎Tuesday, ‎3 September ‎2019, ‏‎04:50:06 (24HR; GMT+2), but I went to sleep soon after that, as it was almost 5AM for me, so practically I started working on it the next day.  
    Today, after 5 days of development I managed to program the basic mechanics. Well making the game work took me a day or two, the next ones went into polishing and fixing bugs.  Heh, the amount of logic and predicting that has to be coded is mind-blowing.  The game was playable, but there were some minor glitches here and there, like things not always being properly registered and stuff. Nothing serious, but it didn't really look well in the end. I kept adjusting things until it all started working perfectly.
    ... But does it actually work perfectly?
    I'm not sure, but for the first time, I've managed to hit 100.000 points mark during testing, without bumping into any weird things. Getting there gives few minutes of testing and everything seemed to work fine... unless I'm just lucky. Either way, even if there will be any glitches, I believe and hope, that there will be only tiny ones. 
    So... Here's some early gameplay preview, though note, that the game currently has no goals and the gameplay is meh-ly simple. There will be bonuses and other fancy things in the future. Also, there aren't any sound effects yet. Also also, the numbers all over the place are there for debugging purposes, don't mind these. 
    Wait 'till the end for an epic prank the game threw on me. 
    A potential question you may ask - "Couldn't you start working on it earlier?"
    Yeah, yeah, I could. I had other things to work on though, plus, the home renovation I currently have (it's going so slow, but it should be finally over soon) doesn't make it any better. Literally, currently I have a mess, there's dust everywhere lul, so it's harder to focus. I was just doing random things like playing games. Now though, I'm sort of determined to do something productive.
    Though... the real reason why I wasn't working on it before is... That as some of you might know, months ago I decided to cancel this project, while it still was just an idea. The reason was me suspecting, that I won't be here anymore (a kinda long story, but in the end even that failed to some degree lol). 
     
    Summarizing
    I'm afraid I won't be able to post the game in time and that itself is fine I suppose. But.. That time is kind of limited.
    The show's ending gets closer each day and once the English release will see the light of day, spoilers will start randomly appearing all over the place, because these won't be considered as spoilers anymore, after some time, that is. I already got spoiled soooooooooooooo many things about the show, but new characters, races/species, facts like some new buildings (if you get what I mean) aren't that destructive, so it's okay-ish to live with.
    - - - But the ending is one and only and I'd love to catch up with everything before seeing or hearing anything about it.
    For that reason I'm afraid I might leave the forums. I don't think it will be permanently of course, but I suppose it will take few months for me to catch up with that, if not longer.
    But ultimately... I absolutely don't know what to do and where to start, hence these mixed feelings of mine. I suppose I'll see how it goes and then I'll be thinking. For now I aim to release at least that puzzle game in this century, heh. 
     
     
    So uh, yeah, if you managed to get though that wall of text, thanks for visiting!
  2. Rikifive
    I've bumped into something - I'll need to place BOSS HP BAR somewhere, but the current HUD gave me a bad time organizing the layout.  
    Sooooo yeah, I've been thonking on the HUD again, because why not.  
    For a reference, this is how it looked like so far:

    I was trying to put it somewhere to the right, but the screen was getting somewhat clogged up.
     
    ...So I've tried to place is somewhere at the bottom - the spells were on my way.

    Also I was toying with the general design (see the top-left corner). Red for the HP Bar seems to work better, considering that other bars have colors based on the icons attached to them.  The green was out of place there. 
     
    But getting back to the BOSS HP Bar---
    I've tried to move the spells to the top, to have everything in one corner...

    ...and here made some more science as well, to make it all more compact.
     PLEASE KEEP IN MIND, that IN ALL DESIGNS the breath bar disappears once Twi leaves water.  You won't see that bar most of the time, hence why it doesn't have to be nicely attached to the rest of elements.
     
    Also I was thinking on the spell icons - maybe instead of these little bars representing energy, they could have that in their backgrounds? That seems to be making it easier to tell how much energy do the spells have.  
     
    ...But it still appears kind of messy, doesn't it?  So I took a suggestion I got ages ago into consideration - that Twi's face isn't needed there. I tried simplifying the design...

    ...and was checking if fancy boss hp bars would be a good idea... Looks cool!  -I think, but it's too distracting, so I believe going with minimalist design will work better.
    As for the rest--- hmm... not sure, maybe trying something different?
    Let's flip some things!

    There,
    It looks really simple, but it doesn't cover that much of space. It's just practical and considering, that there may be many things happening on screen, I think this is what I'll go with, at least for now, hah; Pretty sure I'll be adjusting things again in the future.
     
    So yeah, this is what I got lately. What do you think about these funny designs?  
     
    That's all for now! Thanks for visiting!
    Also I'm terribly sorry for my grammar and English in general, it's past 7 AM and I'm really, really tired. Going to sleep now.  
  3. Rikifive
    It's been a while ~ As you may know, I've been working on the pause menu. When it was ready, I was able to configure/update existing features, as well as add new ones to make it all work properly.
    So now I have bunch of updates!
    First of all, let's start with that Pause Menu I've been working on for a while
    I believe everything there is self-explanatory.
    If you're wondering how many languages will be supported - by 'default' I aim into supporting these two: English and Polish.
    However! I'm programming the game in a way, where all the text is stored in external .ini files and visuals are adjusted based on the text's real width where necessary, which should make it less painful to translate, so if anybody would be ever interested in translating the game to another language, there always will be that possibility. ------ but that all will come in the right time... or not... I'll see how it goes.
     
    The next thing, related to the Pause Menu is Spell Enhancing.
    In short, you get some-kind-of-magic stars through leveling up. These stars are used to enhance (upgrade) spells.
    Enhancing may:
    - increase damage
    - amount of projectiles
    - their duration
    - their speed
    - their size
    - "Area of Effect"
    - add special effects
    - or even change spell behavior
    - etc..
    Each spell is different, so are their upgrades.
    For example, I've prepared a some kind of a tier table for the basic spell, the magic projectile:
     
    And now the recent thing I've been working on... Leveling UP now raises stats and stuff.
    Previously leveling up wasn't doing anything other than increasing your "Level" value. Now it does have an effect, as seen below:
     
    I also did some smaller adjustments in meanwhile, like optimizing the code here and there (including collisions ... again -- and I'm sure I'll still have to adjust these once again in the future..) ~ but that's something you won't find interesting.
     
    Oh and I also started working on the Everfree Forest. It's too early to show anything though, but sooooomething is happening there.
     
    And that's all I think...
    Well for some testing I also made Tom

    ...If Tom could throw a party, it would ROCK!  
    An amazing addition, I'll throw it in the title.

     
    So now it's all I think.  
    Thank you for visiting!

  4. Rikifive
    Hmm.. so after few days of wondering on how things will work like, I think the pause menu will look like this:

    Of course the ABCDEF thing will be replaced by proper description of highlighted option/item/spell.
     
    What these  below spells are? These determine the spell's tier. Basically you'll be able to improve them along with progress, sometimes it will be a slight change, sometimes a major difference in behavior and whatsoever.
    To give you an idea on how more or less it will work like, here's the table I've prepared for the basic spell:

     is TIER I
     is TIER II
     is TIER VI
    -and if someone is wondering what "A-F SPD" means, it stands for Auto-Fire Speed. This spell doesn't have auto-fire, hence [ - ]. This is what Element of Laughter specializes in, for example.
    Anyway, as you can see, not much changes there, as basically it's a 'default' spell. It gains damage, speed and size, but still behaves as a normal straight projectile.
     
     Note, that things may be changed in the future, as I suspect I'll keep re-balancing things over and over again along with progress (development-wise). I probably won't be updating this, nor posting more tables, because nu spoilers for you. It is meant to be discovered on your own. 
     
    Thank you for visiting!  
  5. Rikifive
    Hello everypony!  
    Finally the HUD has been reprogrammed! 

    ~And length of the HP bar increases along with maximum HP!

    For some reason I always like that little feature in games, because that makes increasing max HP more interesting --- especially checking if you can go off-screen with this.
     
    I thought it all will take few hours, but it ended up taking two days, heh.
    Why it took so long? I had to replace most of the HUD graphics in game files and reprogram the HUD in general, mostly spell icons, due to their new switching animation. I also have optimized the code, now it's shorter, organized better, thus more efficient & readable. I also have added some script functions that will come in handy when programming features in the future. 
    ...Also I discovered, that previously there were two typos in the code.  It wasn't a big deal, as things still worked in the end without crashing the game, nevertheless it's of course better to not have any of this floating in the code. 
     
    I guess this design will do, at least for now.
    And as always, thanks for visiting!  
     
     
  6. Rikifive
    Hello everypony!  
    It's been a while, hasn't it?  Last year turned out to be kind of busy for me, but hopefully this one won't be like this!
    I've been wondering on which project I should be working on and to this moment I have no idea. I've decided to poke this one first, but I think I may be switching between this one and MLP: The Game, as I'd really love to get these two done. My priority project will always be the first one I have ever started - MLP: The Game, but it's good to work on different things once in a while to avoid getting bored. I'm also having 999 other ideas for games and I'm trying my best to not distract myself with these.  
    Okay, so let's get to the point.
    Mooooonths ago in one of the updates, @HereComesTom mentioned moving things in HUD: For a reference, here is how it looked like so far:

    The 'mana bar' he mentioned is the energy bar with Elements of Harmony seen to the right.
    For me it looked fine as it was, as I kinda didn't want to throw everything into one corner... until I realized how inconvenient it was in practice. You see, switching spells was confusing when these were on the right side, due to the order of them appearing mirrored. I thought players will eventually get used to that, but I couldn't really get used to it myself. Switching spells wasn't a big issue, but whenever I looked at HUD, it was confusing me. The order of icons wasn't really readable and I imagine it could get worse when more spells would become available. There was one thing I was sure of... That these have to be on the left side.
    So today I've been working on redesigning the HUD ... the whole day. 
    I was moving things around and finally came up with this:

    SOME OTHER CHANGES I'VE MADE:
    - HP bar is now thicker, because I wanted to make it stand out more, to make it more noticeable even without really looking at it.
    - HP bar's length now grows along with maximum HP.
    - Spell icons have less details in order to save some space and make the HUD less spammy.
    - Spell icons have thicker energy bars, because I removed the long energy bar and used numbers only. I wanted to give those little bars more highlight and make these more readable.
     
    ...Though I had a feeling, that something was wrong. It seemed so... clogged. One of my fellow devs suggested me this:
    ---and that made me realize, that it's all messy indeed. Colorful bars and icons, big numbers-- all over the place, yet so close to each other.
    So I got to this again and decided to get rid of some details, as well as using smaller numbers to make it all look neater:

    Now only HP has big numbers, as it's the most important part of the HUD.
    I think it looks fine now, though knowing me, I'll probably end up redesigning it over and over again along with development.
    I was also thinking of something like this:

    --- buuut decided to have it all in one place.
     
    What are your thoughts? 
     
    And as always, thank you for visiting!  
  7. Rikifive
    Remember when I said, that the "Art of the Dress" event with @Rarity and all the amazing dresses members have drawn filled me with inspiration?
    I mentioned a puzzle game (click my reply above for more information) and I kept thinking about it.
    Soooo... I couldn't resist! I've drawn a concept art showing how more or less it could look like.  

    Disclaimer: Carousel Boutique background, all the gems, elements of harmony, spool of rainbow thread and the Rainbow's dress sketch weren't made by me. I've made hourglass, menu scroll, cursor and the rest.

    Now the general idea is, that Rarity would be sewing a different dress for each level. The first levels would take place in Ponyville, where Rarity would make the dresses for the Gala, nothing fancy.
    There would be some cutscenes and some other basic stuff.
    With progress, she'd be moving to different places, where dresses would follow different styles.

    Levels 2-X would take place in Manehattan.
    Levels 3-X would take place in the Crystal Empire.
    Levels 4-X would take place in Canterlot. Busy and demanding ponies - fits great for more difficult levels, that require more work in less amount of time. Rarity's Boutique would be such a great location.
    (and perhaps more...)

    Now talking about some inspiration from that thread and event altogether--- I'd like to mention something, that gave me that one more sparkle.
    I haven't seen many -- actually I don't really recall seeing any dresses inspired by the Crystal Empire. I have to say, that @bornAgainEquestrian's dress is absolutely great.
     
    As for the game itself - there would be some bonuses, that would impact the field by destroying things here and there; there would be upgrades to these to give that feeling of progress/improvement.
    Also, this time I'd totally go for Full HD resolution as the default one!  As much as I love pixel art, I think this one would perform better with high-resolution smooth art.  
     
    If I'd knew about that event sooner, perhaps (with a huuuge question mark) I'd attempt to create that game, or at least come up with a demo for that event, like it was with Twilight's day. The huuuuuge question mark is because I suspect that game would take way longer to program, so I'd probably need a lot of time. 
    These events made me think of a possible idea of making a game/minigame for each pony from the mane six and I happen to have some more ideas already, but I won't reveal these yet!
    The Bookhorse               Minigame            
    Art of the Dress            Puzzle Game         
    ????????????????            ???????????         
    ????????????????            ???????????         
    ????????????????            ???????????         
    - not sure yet -            -----------         
     
     
    Oh I wish I wouldn't have to be bothered by my job - There are so many exciting things to do!  
    Either way, that's all for now;
    Thank you for visiting!  
  8. Rikifive
    Hello everypony!  
    I've made some very little, tiny progress.  
    I plan to implement slopes for more natural looking environment, rather than have a completely blocky world, where you need to jump all over the place, even on stairs.  And possibly few other features... 
    For that, I had to improve the coding behind the whole movement system first, optimize it a little, fix some minor imperfection related to collision, reprogram it to use more variables, that I'll be able to manipulate etc. etc..
    While the main plans are still before me, I've added a little detail, making sinking more accurate.  
    Obviously, Twi's head is lower when she's ducking, so it felt kind of weird still being able to breathe while having her head submerged.
    But not anymore!  
    And better don't idle in there!  
    Though I wonder if preventing her from sitting down while in water wouldn't be better.  Though it's so cute, that it's worth sinking!
     
    Either way, after I'll be done with movement, I'll start working on the Ponyville. I've made a plan for the layout, I'll be working on the graphics and whatsoever next. This is what I have now:

    Not sure of that design to be honest; We'll see.
    After the Ponyville will be ready, I might release a playable alpha demo without any objectives - just to let you see how the game plays etc., if anypony would be interested, that is.
     
    I hoped to make much more progress, but I have tough times at work this week. It takes almost all of my free time, due to working for ~12-13 hours/day. Better luck during weekend hopefully!  
    Thank you for visiting!  
  9. Rikifive
    Hello everypony!
    Made some progress! Things are getting more... DESTRUCTIVE!
     
    - MAIN CHANGES -
     + NEW SPELL! ~ Element of Laughter
    Be just like Pinkie Pie and throw streamers at everything!

    For some reason I want to yell "AT THE GALAAAA!!!"      + NEW SPELL! ~ Element of Honesty 
    No jokes with that one! I HONESTLY love that spell! Wreck everything!

       + Enemies Can Now Drop Elements of Harmony SEE ABOVE
    These refill energy of the elements (spells). Extend the fun!
     + Enemies Can Also Drop Hearts
    Not only these recover your strengths, they also look kind of cute.
       + Along With New Spells; There's Something New in the HUD
    As you may have noticed, spells have their icons in the upper right corner, but did you notice, that they show their remaining energy even when they aren't selected?
    It is for your convenience! x3
    You don't have to scroll through these to see which one can still be used; just take a quick look! c:
      - MINOR CHANGES -
     + Twilight Cannot Cast Spells When Her Horn Points to the Wall
    If your horn is 'in the wall', there's no point to waste energy just to throw some particles. It is also to just make it visually better, as the particles were spawned in the wall and getting stuck there.
    Exception are Area of Effect spells, such as Element of Honesty. These still do their job there.
     + Lowered Amount of Particles Generated by Element of Laughter
    Initially that was actually kinda too spamy.

    And that's all I think...  
    As always, here's a longer gifv with some gameplay.
     
     
    Thank you for visiting!  
  10. Rikifive
    Slowly everything starts to work!
     + Added Enemies
    By enemies, I mainly mean their mechanics. They have HP, can take damage and can be defeated. Such an amazing feature, isn't it?
     + Added Damage Popups
    Whenever you or enemies take damage, there's a little popup showing how much damage was dealt.
     + Added Enemy Life Bars
    Along with damage popup, for a short time you can see how much HP enemies have.
     + Added Drops
    Enemies drop items, mainly experience stars.
         + Added Experience Gain Popup Same as for damage, but it displays how much experience you have gained from stars.    + Added LEVEL UP! Popup When you'll get better, you'll have a chance to see this shiny popup! c:      + Low Life Warning & Low Oxygen Warning When things will not be going well, you'll surely notice it. Be careful!    + More Particles! Experience Stars throw sparkles from time to time. ...And they're bouncy in general!
       BUG FIX Fixed collision issue, where Twilight was 'teleporting' to the other wall when standing up while holding the key in another direction after ducking near a wall. That was pretty convenient, but illogical and unfair, sorry speedrunners.        Here's a gifv showing all the new features: CLICK ME!
  11. Rikifive
    Hello everypony!
    Next day full of progress!

     -{ *gasp* I didn't notice that before - fancy doors! )
     + Implemented Movement Between Rooms
    Now Twilight can go out and explore!
     + Programmed the HUD in the upper right corner
    Now you see these amazing spells, that Twilight knows!
     

     + Implemented pretty basic room transition
    Still better than fade out and in I suppose.  
     
    But what's there? Where did that water come from?

     ++ Implemented Water System™
    There's water!  Swimming in liquid slows down movement, allows to jump higher and lets you SINK!  
    Also - splashy splashy particles!  
     + Added Oxygen Meter to HUD
    You obviously need to know when to come out...  
     

    Jumping around and stuff. I already love the platforming aspects of the game.  
     
    Now my favorite- All in one - The full playthrough of the game!  
     CLICK TO VIEW
  12. Rikifive
    I always pay attention to even the littlest of details - particles are the details, that make the game look more alive.  
    Now even shooting at the wall is interesting enough!  

    (simplified level design for better view - plain background, that is)  
  13. Rikifive
    So much progress!!!  
     
    + Implemented Camera Movement
    Twilight finally can see more! Now we can talk about true exploration. 
    + Implemented In-Game HUD For Main Parameters
    Because in previous gifs it was a fake, but *shush*! 
    + Slightly Improved HUD Design For Spells And Designed Few Other Things...
    Though it's not visible below, as it's not implemented yet.  upper right corner is a blank flank!  
    + Some Other Progress in Programming
    ..that you can't see.  
     

     
    I swear it's already fun to play! ...even if there's pretty much nothing to do at the moment.   
  14. Rikifive
    Hello everypony!
    At first I didn't think I'll push that project that far-- that fast-- But it turned out, that I really enjoy working on it and I do love how it nicely goes.
    So... it's about time to share the updates in a better way, rather than just randomly put these in the statuses, heh.
    In order to keep things organized; I want to include the status updates I've made back then - in this blog, so I'm shamelessly going to repost these here.  
     
    Sooo.. Let's get back to the beginning, shall we?
     
    STATUS UPDATE from May 12
    I've been having a yet another idea for a game...

    A ponified adventure platformer shooter.  
    Basically what the game would be about is -- hmm.. actually I won't be saying much at the moment. All I can say is, that along with progress, you'd have more elements of harmony available to use. Now what these do - each element is a different spell; think of having few guns and collecting some ammo here and there. As can be seen in the top right corner, these contain their own magic energy (as mana/ammo) and Twilight can switch between them. That non-element-of-harmony spell is Twilight's basic projectile spell, that doesn't require energy. So... That would be one of the features. The rest of things visible in the image above are pretty much obvious.  
    The game would be called "My Little Pony: Shattered Harmony" ... or at least that's the first thing that came to my mind... (MAY BE SUBJECT TO CHANGE)
  15. Rikifive
    Step by step, I'm slowly finishing the status screen.  
    I've added things here and there and now it starts to look like a legit thing!  
     
    A thing, where I got stuck for a little moment was: How to write a single line of text with multiple colors,
    that will be centered like this?  
     
    And turns out, that it is kinda messy to achieve and there were some maths behind that one as well, because why not!  
    First of all, again, I'm not sure if I approached that in the best way, but well, it works!  
    The thing with coloring text is, that I had to set the font color before drawing the text- so to make it have multiple colors, I had to split it into parts and basically draw each word/part separately, with correct positions to make it all be drawn next to each other in one line. 

    The tool that was helpful there was a function, that calculated the width of the string (text).
     
    So as I've mentioned ages ago, I wanted to do this:
     
     
    First thing first, I needed to calculate the width of each part to know how much space it will take. 


    To show how that does look like... let's take the second possible number as for example:

    That part contains [ +3 ]
    First, I needed to get the value form the character.
    var value = actor.eq_bonus_mhp This will store the character's MAX HP bonus from equipment into a variable.

    Then, since [ + ] isn't drawn by default, but [ - ] is, I had to put an 'if statement' to check if that value is above or below 0 and add [ + ] if above 0 or leave it without symbols when below 0.
    if value > 0 { sym = "+" } else { sym = "" } If the value is greater than 0, store [ + ] in a [ sym ] variable. Otherwise leave it empty.
     
    and now merging things together...
    that [ +3 ] will be a string:
    string = sym + value where sym either has [ + ] or nothing; value is a number.
    Now the last part, just get its width.  
    value_width = string_width(string) This will store the string's width in a [ value_width ] variable.
     -{ Well that was complex, wasn't it? )
     
     -{ But what if the character wouldn't have any bonus? Is there any need to draw "+0"? )
    ( Of course not you silly! }- 
    For that let's use another 'if statement' before merging stuff:
    if value == 0 { string = ""; value_width = 0 } else { ... Putting that before merging will simply check if the value equals 0. If it does, it will leave the string empty and we manually can tell, that the width will be just 0, thus basically skipping that part.
     
    And now we have one part configured...

     
    Now do the same for the others...

    And you probably got your own lame code  
     -{ This looks funnier, doesn't it? )
    So as you can see, I specified the center value - 344th pixel (horizontally) then calculated widths of the parts and merged it all in the end.
    The last line sums everything up ~ divides the result by 2 to make it centered, by moving the 50% of the text to the left. The rest 50% will go to the right.
     
    Now the drawing method is simpler, simply put the part in the result we got, then add its width to a variable, then put the second part in the result+width; add its width to that variable; draw 3rd part in the result+width and so on...
     
    So now that you've read (or not) that boring wall of text, let's head to the results.  
    Note, that it's still a work in progress.

  16. Rikifive
    Today I've been wondering how could I draw something within a specified area like this:

    That bubble is sneaky! Be careful! 
     
    And of course, there seem to be multiple ways to achieve that, yet I've picked a pretty much basic one. My favorite!   
    So besides obvious x and y position of the image bubble, I had these variables available:
    - left offset (basically cutting the left part)
    - top offset (same, but vertically - it cuts the top)
    - width (the lower the value, the more cutoff from the right side the image bubble is)
    - height (same, but vertically - it cuts the bottom)
     
    After doing some visual representation, maths and silly mistakes, to help me imagine the situation better:

    I came up with this code:
    ///draw_self_rect(rect.x, rect.y, rect.w, rect.h, x, y) // 0 1 2 3 4 5 var spr_x = round(argument[4]); var spr_y = round(argument[5]); //--------------------------------------------- // Don't draw if the sprite is outside the rect //--------------------------------------------- // left border // x < rect.x - spr.w if (spr_x < argument[0] - sprite_width) { exit }; // right border // x > rect.x + rect.w if (spr_x > argument[0] + argument[2]) { exit }; // top border // y < rect.y - spr.h if (spr_y < argument[1] - sprite_height) { exit }; // bottom border // y > rect.y + rect.h if (spr_y > argument[1] + argument[3]) { exit }; //--------------------------------------------- // Cut-off the sprite to fit it in the rect //--------------------------------------------- // left = rect.x - x = horizontal-left cut (0 ~ spr.w) var left = clamp(argument[0] - spr_x, 0, sprite_width); // top = rect.y - y = vertical-top cut (0 - spr.h) var top = clamp(argument[1] - spr_y, 0, sprite_height); // width = rect.w + rect.x - x = horizontal-right cut (0 - spr.w) var width = clamp(argument[2] + argument[0] - spr_x, 0, sprite_width); // height = rect.h + rect.y - y = vertical-bottom cut (0 - spr.h) var height = clamp(argument[3] + argument[1] - spr_y, 0, sprite_height); //--------------------------------------------- // Draw! //--------------------------------------------- draw_sprite_part(sprite_index, image_index, left, top, width, height, spr_x+left, spr_y+top); Calling this script basically cuts the sprite if it goes beyond the specified borders, eventually doesn't draw at all if there's no point in making further calculations.
     
    And voila! There are some bubbles within a specified area!  

    You're trapped, ya silly bubbles! 
     
    I'm pretty sure, that soon it will turn out, that there was a much better way and I was just unnecessarily over-complicating all of this, just like always.  
     
    So YAY! Some progress is finally being made!  
    Oh it all would be done ages ago if not the job.  It goes sooooo slowly.  
  17. Rikifive
    And the blog starts with maths... 
    Shush, I have no idea how to blog!  
    *ahem*
    Welcome class! It's time for your favorite thing! MATHS! Isn't that awesome!? It's like the number one thing!  Get it? Number...? ONE..? Maths??? No?  Alright then, let's get to the lesson!  Run away while you can.
     
    Joking aside~~
    So yeah, some time ago I've posted a status update mentioning some maths to achieve this effect:


    Long story short;
    I wanted a formula, that raises as gets closer to a certain point, then decreases along with the distance.
    The first thing, that came to my mind was a quadratic function, because their graphs seemed to be similar to what I was looking for. You may have seen these parabolas, where it was raising to some point, then going down. Just by that image my mind suggested me something...

    "Hey, what if the top of the parabola would be the center and then the value would be decreasing the further it goes from that point? Wouldn't be that what you're looking for?"
    And I was like
    "Yeah! That should work!"  
     
    Even though I was thinking of some other possibilities, that would be even better (we'll get to this later), I decided to stick to my very first thought. (silly me, told ya I tend to unnecessarily make things more complex than they should  )

    So I've started thinking of a formula, that would do what I want and after some time I came up with this:

    >>> Putting into game...

     
    What this formula does is to get the "Y" value from the function based on the icon position.
    So point x=38 on the graph is where I want to put icons. Now I'd like to give them a smooth floating animation. To do that, I've decided to move them up and down by up to 6 pixels away from the center. It could be achieved in a really simple way, like move it up with a constant speed, then bounce it back and forth, with the same speed. Heh, that's actually what I did in my previous design ages ago...


    That doesn't look bad, that's true. Thanks to very low distance (6 pixels in total; 3 from center), it's not really noticeable. It's just few pixels up/down after all.
     
    Now that I'm working with a larger resolution, it would be nice to make it actually smooth and that's what the formula does. As you can see, the further the icons move from the center (x=38 on graph) the lower the value gets, which is what I needed.
    So I've used that fancy calculation then moved the icons by the returned amount, eventually changing their direction when getting far enough.
    That was a success.
    The formula did exactly what I wanted.
    However, there was a much simpler and more automatic way to achieve this. There is a similar graph, but instead of parabola, there's a wave.
    Now since the wave doesn't end and goes up/down through positive and negative values all by its own, it could be easily used to replace a pretty big chunk of code.

    Now guess what that wave is... Have you ever heard of sines?

    Sounds like another silly thing to learn during math classes, but turns out these actually have some usage!  
    It pretty much follows the same idea-
    The horizontal line showing point 0 would be the center. Now as seen in the graph, it goes up and down with time.
    At this point I could forget about the previous 'if' statements and all that stuff and just use the time and some maths of course.
    I wanted to see how it all behaves in the software I use, so for some testing I've created a thingie, that draws the waves based on thrown formula, so brace yourselves, I present you the SINE SIMULATOR 2018! (also supports other functions, but who cares)  
    Let's try the simplest one- the one shown in the image above.

    Oh that's sooooooo coooool! It lacks of ponies though, I should have put some...  Everything works.   
    Also some other example (suggested by fellow developer in chat)

     -{ Uuuuuh fancy! )
    I know, right?  Still lacks of ponies though, perhaps in future updates of that useless program-thingie...
     
    Okay, so all I had to do was to follow the damn train, CJ - not this again, my bad!  --- Was to use these values for the icons.
    For that, I came up with a pretty much the same formula as before, but using sines this time.
    icon[i].y = 38 + 6 * sin(icon[i].timer); icon[i].timer += 0.05 So basically:
    38 - is the center
    6 - is the amplitude - the maximum distance they can travel from the center
    and then the timer (0.05) - basically represents the x position increment in each frame - the higher the value, the faster it goes.
     
    So yeah, the code has been shrunk to only two lines and it gives an extremely accurate result!  

     
    The only one question is... Why did I waste the whole weekend on toying with this!  Such a relatively simple thing, a tiny piece of code, yet I had to do science for hours anyways...  
     
    Well, either way... 

     
    And with that being said, you're free to go now!  If you haven't run away already.  
  18. Rikifive
    Programming Pause Menu in progress...

    > also implemented 'pause' --- , so that everything stops while the menu is opened. 
    > also added background && shading to Twilight's Profile Pic in the menu --- now it doesn't look that plain. 
    > also configured fonts --- now that was time-consuming, I had to nicely align each character, then load that to the project properly. For example, here's my hand-drawn font for GUI with just few characters:

    The font used in the commands however, uses small and large cases, numbers and all the potentially needed characters for dialogues and such...

    It is also hand drawn, for the most part at least. I used an existing font to start with. ...Comic Sans turned out to be pretty good for a pixel font.
     
    Well, that's all for now!  
    Thank you for visiting!
×
×
  • Create New...