RhapsodyInGeek's Recent Forum Activity

  • Here's the damage formula I'm using for my game, in calculator mode. Basically the way it's designed is that each time a hero's attack object collides with an enemy object this big ol' calculation gets run for the two objects. It incorporates arrays in the calculator, but in my actual game it's a mix between array values and private variables.

    Linkity link link:

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

    In the calculations the elemental resistances are string values, initials. I use "FindToken" to compare the elemental resistances with the attack element. If I want to do no elemental resistances I set them to 0, and if I want to do no attack element I set it to -1, since "FindToken" does count 0 and 0 as an elemental match, since technically they are. I just use letters for readability.

    Anyway, maybe that can give you some ideas? I know it seems convoluted and a lot of events to run at once, but Construct does it all really quickly, and it works like a charm.

  • Health bars are fun. I like to set a maximum health number and then use that for a percentage calculation. Something like:

    Always set Healthbar Width to CurrentHealth / MaxHealth * MaxHealthBarWidth

    Alternatively, what you have should work just fine. The problem with it "growing" is that it's not actually growing, it really is shrinking. You have your Private Variable 'Health' set to an initial value of 0, so when Lugia gets hit by the wave he ends up with negative health. In Construct, an image with a negative size value basically just sort of mirrors/flips itself.

    Here's a "fixed" cap. Check it out!

    http://dl.dropbox.com/u/20459682/lugia.cap

    All I did was get rid of the initial "Always set Healthbar width to 65" due to redundancy since almost immediately after you set it to Lugia's 'Health'. Then I just set the value of Lugia's 'Health' to start at 70. Voila! Healthbar that shrinks as Lugia gets hit.

  • Can you post your cap? Easier to help that way.

    I tried something similar with Custom Movement and got something working pretty sweet, though in the end I've opted to go for the 8 directional movement behavior.

    The way I prevented the player from going through solids was by doing

    If Player Overlaps Solid

    --> Push Player out of Solid, Normal

    Gives mostly wonderful results. The push out of object action is a custom movement action that you can find near the bottom.

  • So I came across a discovery about five minutes ago. When using the normal Text object, setting the text to this:

    "Hey there, Max!"

    prints out this:

    "Hey there, Max!"

    Astute observation on my part, eh? <img src="smileys/smiley36.gif" border="0" align="middle" /> However, I love SpriteFont, because it's incredible. Absolutely incredible. But I've happened upon an interesting curiosity...

    "Hey there, Max!"

    prints out

    "Hey there,

    Max!"

    Upon further investigation, I've found that using a comma seems to automatically put a newline afterwards.

    "This is t,he mes,sage system!"

    prints out

    "This is t,

    he mes,

    sage system!"

    How frustrating. Did I accidentally switch on some sort of option, is it working as intended, or is it just another little bug? I know it's got some, though I've managed to work around pretty much all of them so far. Just wondering if I should just use a different character to represent comma instead.

  • You know, I think I remember that explanation before. Something about ticks versus timedelta or something, right? Which made me wonder why this formula is even working right in the first place. So I got rid of the wait functions and tested it out and it still worked fine. Which means I don't have to add the waits in! Thanks for the reminder! It's nice that Construct does actually perform the events in order.

    The updated cap, which uses an Array, which is what my game will be utilizing to keep track of stats.

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

  • So I've got a pretty spiffy damage calculation thing going on here. But it's got a couple issues.

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

    This is basically the calculator I'm going to be using for normal attacks in my game. To use it, you just input the values desired into each of the locations, and then click the "Attack!" button. Then it automatically calculates damage and shows you the values for each step of the calculation. Fun stuff!

    One thing to mention is that because of the way the elemental detection works, the Attacker Element needs to be set to -1. Which brings us to our first bug...

    BUG #1

    I'm basically trying to use Find(Enemy Elements, Attack Element) > 0 to see if there's an element match in the EnElem string with the singular AtkElem. This works fine when:

    Attack Element = "f"

    Enemy Elements = "f"

    but if we change it to

    Attack Element = "f"

    Enemy Elements = "f, w, z" or Enemy Elements = "fwz"

    it seems like it returns 0 and doesn't modify the Attack Power.

    BUG #2

    I have a Critical Hit chance set up. The calculation is

    Attack Luck >= random(1024)

    --> Attack Power * 1.5

    I've tried to rig it in any number of ways to get it to work, from trying to set the delays a little longer to making it automatically attempt to modify the damage by toggling off the Luck requirement, and no dice. At least it's not reading these dice. <img src="smileys/smiley3.gif" border="0" align="middle">

    Any thoughts, gentlemen? They would be much appreciated! <img src="smileys/smiley4.gif" border="0" align="middle">

    EDIT:

    Just noticed now none of the modifications are actually working... what am I screwing up on?

    EDIT #2:

    So I did even further examining, looking over my events, still unable to figure out what I was doing wrong in the damage calculations and discovered... I was actually doing it right and it was working as intended. The bugs were actually in the display code, where it wasn't displaying the actual damage being done, just the attack power after Step 2. So the displayed calculations don't function properly but the actual damage done works correctly. If you take the enemy HP value in the last equation and subtract the number down at the bottom (the final enemy HP) it shows the proper damage was delivered.

    Oh, oversights! <img src="smileys/smiley9.gif" border="0" align="middle">

  • My wow, that's really cool. Looking at your formula also makes me want to rework mine a bit to make it look a bit nicer. Like how you threw the base HP outside of the whole bias calculations so that it added it after. Makes it look cleaner and helps with modifying it more easily on a character by character basis. Also what'll help me on a per character basis is being able to quickly see stat values and curves so that I can use it as a reference for coming up with character growth stats. You've given me a calculator I can use!

    Plus, it's better to have an example cap by someone who knows what they're doing than someone massacring a sweet calculation. So thanks! <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Even a quarter ellipse will do. <img src="smileys/smiley2.gif" border="0" align="middle">

    I have put a name to my pain!

    Bias

    This module calculates Ken Perlin's Bias function. Given an input value between 0 and 1, it calculates an output value which is also between 0 and 1 according to:

    y(x) = x^(log(B)/log(0.5))

    where the input value x and bias B correspond to the two input ports. If B=0.5, then y(x)=x. Values of B less than 0.5 push the output toward smaller values, while values of B greater than 0.5 push the output toward larger values.

    Source: http://www.artofillusion.org/docs/texedtut/chapter4

    So I played around a bit with it and came up with:

    ceil(18 + (("level" / 99)^(log(0.15) / log(0.5))) * 881 + "level")

    Essentially what this does is force Level 1 to be 20HP, and upon every level up you gain at the very least 1 HP, and the amount grows with each level up, until Level 99, at which it will end on 999 HP. I'm not huge into the ugly fix making it a 1 HP stat growth in the beginning, but it only lasts until around Level 10 or so.

    Here's the cap with an example!

    http://dl.dropbox.com/u/20459682/levelhp.cap

    It feels a bit convoluted though, so of course, I'm still open to suggestions! <img src="smileys/smiley4.gif" border="0" align="middle">

  • So I'm trying to work out some stat formulas for my game. I'm incorporating a level up system where the maximum HP is going to be 999, and the maximum level 99. I'm trying to get a healthy curve to the stat growth, but I can't seem to make it a smooth curve. I've played around a bit with lerp, qarp, and cube, but no dice. My biggest problem is I'm rubbish at math.

    Basically, I'm trying to do this:

    <img src="http://img560.imageshack.us/img560/986/statcurvegraph.png" border="0" />

    but I'm not much of an Ian Malcolm.

    Help me Obi-Wan Kenobi! You're my only hope!

  • Thanks for the props, Mr. Snooley!

    harrio - I'm sorry. I couldn't fit more Flashback in there. But the fact that the lyric that's sung over it fits with the game pretty swell is a good consolation prize! Still, blame the composers for not allotting enough time! Oh wait, that's me... <img src="smileys/smiley9.gif" border="0" align="middle" />

    - Cool game! A different way to platform! I also liked the mine cart segment. Brought fun memories of Donkey Kong Country! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads

    My top 3 choices would be:

    1. Families

    2. Hotspots & image points

    3. Good support for tilemaps

    All the other things, while really cool in their own right, feel far less important than the first 2 choices, and the 3rd one is just something that's been asked for by lots of folks on Construct Classic.

    Also, is there a "For Each Object (Ordered)" loop in Construct 2 yet? Maybe throw that one in their if it isn't. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • What I like to do is set up a few all purpose collision objects (namely a square shape and a triangle shape) and place them where I don't want players to go (usually also on a separate layer for organizational purposes), and then have the game turn them all invisible at the start of the layout. Then I leave my scenery on "no collision" usually, unless I really really need it to be. I don't ever notice any slowdown from this technique either.

RhapsodyInGeek's avatar

RhapsodyInGeek

Member since 3 Oct, 2010

Twitter
RhapsodyInGeek has 1 followers

Connect with RhapsodyInGeek

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies