mystazsea's Recent Forum Activity

  • Hmm this is a really good question....Thanks for asking it....let me have a little think...

    First things first..

    You need to factor in an Level CAP....

    What i mean is a hard limit on the number of levels the player is allowed to have..

    eg: 80 or 100 levels total

    If you try to calculate anything without factoring in a level cap it wont work properly at all

    This would also mean that you need a HARD limit on XP ...

    say 250,000 or something

    The reason for this.... is that without a hard limit any calculations you make will be compounding a problem..

    By limiting the XP to a Hard limit...you can calculate the players current XP as a percentage of the available XP in the game..

    which could also be a problem if you have unlimited enemies or xp gains..as this would throw out any calculations

    The width adjustment of your XPBAR would at best be a guess if you dont have a hard limit on your XP that the player can earn.

    So first i would make a choice as to having unlimited XP levels or hard capped xp levels..

    if you dont hard cap your xp then you may not be able to accurately determine the width of your XPBAR pixel adjustment per level increase..

    If you do a hard capped level you can easily calculate the pixel width adjustment of your XPBAR

    by expressing it as a percentage of the entire XP earned divided by the Ratio of MAXXP to XPBAR overall width.

    I know its very easier for you to just make a capx to show this...but understanding why is good too

    This way more people can see how its done...which is what these forums are about...everyone learns..

    I dont claim to know the only way to do this and yes..i could be way off and a much simpler method exists

    but your question is very specific...its not just a simple health bar ..what you asked for is a calibrated display using a fixed width Bar to represent multiple levels of variance in values that are mostly arbitrary...

    its possible...but your specific request is slightly more complex than you might think..

    lets get into it.

    In addition to knowing the HARD LIMIT values of your earnable XP

    I would use 2 variables to keep track of the XP earned in the game....

    "XP_Current"

    " XP_Total"

    In addition to your MAXXP variable

    You also need to know the absolute, precise and constant value of your XPBAR screen width

    what i mean here is the overall unchanging width of the border of the Bar even if its not visible ..

    you need a fixed width for this on screen..

    Only the XPBAR itself changes width but we need to know the overall dimensions it its FULL or Maxxed initial width.

    The MAXXP values would need to be fixed and set in relation the XP_TOTAL and the Total earnable XP

    next..

    The XP Bar would be connected to XP_Current and this is what you would use only to represent the change in the Ingame XP increase....when it reaches the MAX setting that you determine through the XP_TOTAL..

    Eg: 200 for level 1

    400 for level 2 etc

    or whatever you want each level to be..

    I would just make a comment in your Event sheet to keep in mind the differences in Level increase..

    So ....when your player gains XP you would add the XP earned to the "XP_Current" and the "XP_TOTAL" at the same time

    ..but seeing as only the Bar's size is determined by XP_Current...

    The next step is to check XP_Total..when XP_Total is at 200 or 400 or whatever you want to change a level

    then you would reset XP_Current and reset your bar ...

    or...

    .. if the XP bar width is always set to XP_Current it should auto update...

    You can then place any level up effects/events that you like as Actions

    XP_Total does not reset ..it just tallys and keeps track of how much the player has over all and never resets....

    This way you can still keep track of the total amount of XP earned and relate that to the Hard capped XP limit..

    and have events occur for that if you wish..

    In regard to increasing the amount of XP per level...

    You need to scale the bar with according to a ration of pixels to value...

    so what i mean is....

    If the bar is say 1000 pixels width over all and your MAX XP is 200 for level 1 the ratio of bar width adjustment is based on that ratio for each level

    (Keeping in mind a "Ratio" is a rounded down representation of integer value...Look up "Integer" in the manual if you need to know how to do that..)

    The following is an example but keep in mind your values will be different for your Game

    For level 1 ....

    1000(XP BAR WIDTH in pixels)

    to

    200(XP MAX VALUE lvl 1)

    is going to break down to 5:1 pixels per XP point

    So for every XP point gained your XP bar width would increase 5 pixels

    and level 2 1000(XP BAR WIDTH in pixels) to 400(XP MAX VALUE lvl2) is going to break down to 5:2 pixels per XP point

    in this case every XP point gained your XP bar width would increase 2.5 pixels not really possible so you would make the XP width change 1 pixel with every 2 points of XP...etc etc

    Does that make sense?

    If you keep your level increase "MAXXP" to percentages or decimal amounts in relation to the fixed over all width of your XP BAR and or the HARD capped XP limit .... it will be much easier calculating the width adjustment each level

    Ideally this would all be done with a single event to minimize processor use in game..

    but ill leave that up to you to figure out

    the key to it is RATIO's but it needs to be relative to your XP BAR overall width..

    hope that helps

    There may be other ways...but using ratios is really what i think it comes down to...a ratio is a simpler way to express two or more values and their relation to each other numerically..

    so a simpler way of saying all that above would be..

    level 1 XP gained =1 ---> XPBAR pixel width adjustment = 5 Ratio = 5:1

    level 2 XP gained = 1 ---> XPBAR pixel width adjustment = 2.5 Ratio = 5:2

    and so on according to your Level MAXXP value...

    The value of the XPBAR width remains a constant because its a fixed maximum width overall.

    Only the amount that The XPBAR width adjusts changes for each level

    of course it really does depend on how much your MAXXP value changes per level...

    if its a fixed increase or an arbitrary amount you need a different calculation..

    a sample calculation would be

    LEVEL MAXXP Value

    multiplied by the XP gained / XPBAR max width

    = XPBAR width adjustment per level

    and to code this as an event ...

    condition......On XP gained--->

    action..... set XPBAR.width to (XPBAR.width +MAXXP(perlevel)/XPBAR.Maxwidth))

    where XPBAR.width is the actual bar width and XPBAR.Maxwidth is the overall screen maximum width of the boundary of the XPBAR...

    this doesnt allow for XP gains that are over your Level max and doesnt really take into consideration the Total XP...

    it really needs to be done level by level...with a level cap...for example do you have a LEVEL CAP..like 80 levels or so...

    this would affect the over all calculation as well and should be factored in before you do any calculations

    saying all of that....

    ill try to get onto that capx for you and upload it so other people can use it as well......

    please be patient and try out a few experiments yourself...

    but im pretty sure that Hard capping the XP is the best way to start...

  • hey folks...Just thought id drop this here....just for inspiration...hope its gives some sparks to all the C2 geniuses out there in wonderland..

    happy coding everyone...

    http://code.tutsplus.com/articles/21-ridiculously-impressive-html5-canvas-experiments--net-14210

    My personal favorites, in no particular order, are...

    color cycling..http://www.effectgames.com/demos/canvascycle/

    Blobs http://hakim.se/experiments/html5/blob/03/

    water mechanics http://www.mrdoob.com/#/115/Water_HTML5

    Cloth simulation http://www.effectgames.com/demos/canvascycle/

    TRAILS http://hakim.se/experiments/html5/trail/03/

    AND MAGNETIC systems...http://hakim.se/experiments/html5/magnetic/02/

    some more insane freaky HTML 5 and web gl experiments here

    http://www.hongkiat.com/blog/15-html5-experiments/

    here http://www.kevs3d.co.uk/dev/index.html

    here http://www.thewildernessdowntown.com/

    and here

    http://beta.theexpressiveweb.com/

    Lighting demos http://www.kevs3d.co.uk/dev/canvask3d/ultralight.html

    SILK Drawing app http://weavesilk.com/

    Harmony sketching app http://www.mrdoob.com/projects/harmony/

    awesome digital book herehttp://www.soul-reaper.com/

    Plus a benchmarking tool for you to test your canvas spds http://www.kevs3d.co.uk/dev/canvasmark/

    hope you all Enjoy the genius at work here

  • Just wondering if genuine 8 bit color cycling is a possibility or even feasible as an addition to Construct 2...

    it is a feature of Html 5 ..and has been used in many retro games in the past..

    is it something that could be a possibility...seeing as how easy it is to make simple scenic or sprite FX..

    I know it could be done manually...but just wondering if its an easy addon for C2??

    Any words about it Ashley?

    maybe its been done already and I missed it..

    Just wondering if there is any interest in this...as a feature or whatnot

    Some really samples of HTML 5 palette cycling can be seen here....not bad FX considering its just simple palette cycling..

    http://www.effectgames.com/demos/canvascycle/

  • Presuming you mean like an overlay that is animated in real time...over the top of your basic gameplay...

    There is a example capx in construct 2 in your examples that illustrates an old TV Look...id start with that and add color transparencies and or alter the fx to get what look you need.

    There are all kinds of FX you can make..for example Heat Haze and fullscreen underwater FX ...

    just play around with semi transparent layers with WEB GL settings.

    hope that helps somehow

  • Yarfapet...That's a very solid demo...nice

  • Hi Rapid Motion

    The basic concepts are set out in the Tutorial section of this site.

    It will greatly help your process if you get familiar with the Manual and the tutorials...practice simple stuff until you get the idea

    Like any system that you design in games development,

    A weapon system could become quite complex if you take into consideration all of the factors you may desire to implement in your game...

    Weapon Design and selection would depend on your game style,

    but the basic premise is the same for most games

    First of all you would need to figure out what weapons you intend to have and create or gather all of the required visual elements to display on the screen or in the layout if necessary

    These could be anything from sprite objects with separate weapon animation frames or separate weapon animation of each weapon loaded into the WEAPON object to simple TEXT driven data fields or particles only that display onscreen when required..its totally up to your style of game design.

    There are so many ways to go about it ..You could use a series of sprites with separate images that you either spawn at location of PLAYER and destroy as required on Keypress events or by using a mouse wheel or any other input you can imagine..the basic premise is the same for all input devices

    Once you have the visual elements in place

    Including all of the Bullet elements or FX that you wish to see..

    Then you could begin to code the Events for the Weapon select..

    If you dont have weapons to select from yet..making a weapons selector is kindof pointless as you might want to expand it later and have to redesign your whole system from scratch

    IMHO its always, ALWAYS better to work it all out on paper before you write any CODE or script Events

    This way for each project you can see exactly what you are going to do before you actually go about creating the Assets or lines of code for a system..

    (& Keep a reference of what your weapon names will be in the EVENT SHEETS)

    The basic idea is to Create a Global TEXT Variable called "Weapon_Selected" or simliar

    and set the initial value to "None"

    This helps you keep track of data and make help you quickly determine which weapon is visible at any particular time...

    once again it depends on your game design...you may not need this..

    For keyboard weapon select using the 1-0 keys(thats 10 weapons!!!)

    Create a new event in your event sheet ..

    Condition

    On Keyboard keypress = 1

    Action

    -> system

    -> set GLOBAL VARIABLE "WEAPON_SELECT" to ( your weapon name eg pistol!!)

    -> SET WEAPON.ANIMATION-(WEAPON PISTOL)

    or whatever system you decided to go with ..The ACTION for it would go here

    Second Condition

    On Keyboard keypress = 2

    Action

    -> system

    -> set GLOBAL VARIABLE "WEAPON_SELECT" to ( your second weapon name eg Spudgun!!)

    etc etc

    until you have all of your weapons correctly laid out

    then after all of those declarative Events

    a new Event that Reads

    for mouse wheel driven selection you would create a Global NUMBER variable that adjusts its value in relation to mouse scrolling which then links to a table of events

    for example

    ON MOUSE WHEEL UP...-> SYSTEM ADD TO GLOBAL VARIABLE "WEAPON_SELECT" 1

    ON MOUSE WHEEL DOWN...-> SYSTEM SUBTRACT FROM GLOBAL VARIABLE "WEAPON_SELECT" 1

    THEN A TABLE OF EVENTS LIKE SO

    WEAPON_SELECT = 1

    -> SET WEAPON ANIMATION TO "PISTOL"

    WEAPON_SELECT = 2

    -> SET WEAPON ANIMATION TO "SPUDGUN"

    ETC ETC

    There are many ways to do it..but its really up to you which system works best...for your game..

    There is a basic Tutorial on this

    of course each weapon would most likely need its own unique bullet sprites and sound fx and variables to appear different..

    ie..incendiary bullets would look and do more damage than normal bullets and a flame thrower needs an entirely different approach to design..etc

    Try this Simple Tutorial for more info

    https://www.scirra.com/.../how-do-you-change-weapons-a-lesson-for- beginners

    But yes if you are just starting out ..I really cant emphasise enough that you need to be familiar with the manual and the basic TUTORIALS before attempting anything else...otherwise it may be a little confusing..

  • Hey awmace5

    I've had a look at your Capx...the reason is that your "TExt2" object( the ammo counter ) is outside of the window dimensions..

    in your layout the "text2" object is on the HUD layer but its coordinates are

    x1059, y20

    which is outside of the window view dimensions..which are 640,480

    change one or both of the window size dimensions or move the Text 2 object to inside of the 640 range and it should be visible

    you can use the ANCHOR behaviour to make sure that at runtime the objects are set to a fixed screen position..

    Hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Great Question Sashik...This info is a fairly common request..

    The short answer is that its pretty simple process to add a custom Transition that simulates what you may need..depending on the style of Transition you require...Some are more difficult than others to implement..but the basic transitions ...Fade to black or white, animated Screen capture transitions and other effects driven transitions are possible

    I tend to use a Separate layer placed above all of the others and make it visible when required..The layer can have anything from a simple Fade to black or white transition using a sprite with a FADE behaviour prior to changing layout .....and/or a more complex animated sprite object with WebGL effects..depending on the look that suits the project.

    Often its useful to include the same layer on all layouts so that the transition is mirrored on the new layout...

    You can create just about any transition you like using a combination of Sprite animations or Particle Reveal Transitions...

    I read a thread somewhere about a year ago in the https://www.scirra.com/forum/construct-2-general_forum31.html

    That mentioned that transitions coming soon..but yeah nothing yet....

    I find it much better to make your own ...because you have far greater control and can get very fancy animated transitions that perfectly suit your game style

    Hope that helps a little...

    There are also a few examples of simple transitions in the Scirra arcade under "examples"

    Some of these other useful links may help you

    http://www.scirra.com/forum/more-layout-transitions_topic42102.html

    http://www.scirra.com/forum/game-levels-transitions-not-so-easy_topic59789.html

  • We would really need to see your Event sheet setout for the Audio events to figure out what specifically is going on there..any chance you can post that?

  • The issues would be found how you have set up your Events to flow...

    Please post your Capx or event sheet screenshot so we can see whats going on and address the specific problem....What you explained doesn't seem to follow standard instance behaviour in Construct 2

  • Imchucho....I think you mispelled GOLD_ADD in the declaration phrase...

    could you recheck it and EDIT your post to correct if its a mistake.. or it may confuse other people who read this

    Perhaps also you could point out that it was a "Variable" that you declared would also steer people who missed what you did there in the right direction

    Not everyone understands programming ..but making it clear can help so many people grasp the basics faster..

    otherwise that was a perfectly concise answer...nice one <img src="smileys/smiley1.gif" border="0" align="middle" />

  • AI is a complex field as you know doubt are aware by now....

    Could you please clarify your question a little better..

    The enemies you speak of are instanced objects of the same entity yes?

    If you want complex AI behaviours you often need to create variables that control or influence the behaviour first in some way

    like a cascading flow chart..

    for example...having only one enemy attack if its close to the player is suitable for some games but not others or for other enemy types

    like a hive mind enemy

    to create specific actions you need to discuss what specific actions you wish to work on ...

    AI is a vast field of interconnected functions that affect and attribute to events in real time...

    its rarely as simple as adding a singular feature

    its about flowchart conditions that lead up to other events

    An Example AI flowchart would be

    Has Enemy detected player? yes/no

    if it did detect the player ..how did it detect player (method)

    if enemy has detected player what should it do next

    (pursue player or flee or some other action?)(Deterministic function)

    once deterministic function is calculated ( which can be done on a sliding table or scale based on values affected elsewhere)

    proceed with action every few seconds rather than every tick

    ( this allows realistic adjustment of actions that the player could respond to)

    So basically its a complex series of feedback mechanisms that you create

    idle default mode-> alert mode-> attack mode-> return to default mode or continue attack mode-> defeat modes must be catered for also

    building ai is probably the most advanced work you will ever do for a game...but try to break it down into understandably sub routines or feedback loops to make sense of it

    Using the above example

    you may restrict only enemy instances that are within a certain "distance" to the player by adding a subroutine that does something like

    CONDITIONS-->

    FOR EACH (enemy)

    SYSTEM--> compare two variables--> player.x, player.y, enemy.x,enemy.y is less than 100 pixels

    ACTION--> Enemy(Find PATH to Player.x,player.y)

          

    understanding the basics of flow charts and actions will help you write better AI routines...

    but they are no different than any other programming when you get down to it

    try to think of it like a PARTICLE system

    you set the basic characteristics up but each entity has random or specific feedback affected rules that determine its behaviour

    you must as a programmer allow for each possible feedback behaviour other wise your AI will get stuck in loops and be unable to change its own behaviour..

    if you posted your AI routines I could go over it for you if you like..

mystazsea's avatar

mystazsea

Member since 14 May, 2012

Twitter
mystazsea has 1 followers

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual

Progress

13/44
How to earn trophies