lucid's Recent Forum Activity

  • Not really. I've never ran into any performance problems until I got to the point where it was several thousand commands running per frame, or several thousand objects.

    Edit:oh yeah, and the tiled background is faster because there's only one of them for a large area. Where as a sprite would take many for the same space. If you're wondering, yes, you can distort the uv of a sprite to make it look like a tiled background, and use it in its place. Tiled background just simplifies the process

  • new additions 9-10-11

    hi guys, big update. For those of you who could just never get the whole moving things with lerp thing, of for those who get sick of typing in the events. Math now has actions to autointerpolate over time. there are two different ways.

    first is to create a value to interpolate, that you can retrieve from expressions.

    The second is to interpolate object positions,rotations,and dimensions automatically over a given time. like being able to order an object to a location. there are also triggered conditions for when interpolation completes, and actions to pause and resume interpolation. using the automated interpolated value actions and expressions, you could automate anything like pv's, opacity, and color.

    also, the interpolation allows you to set a speed curve control point anything from 0 to 1, 0 is ease in, 0.5 is linear, and 1 is ease out.

    hope it comes in handy, have fun!!!

    new additions 9-11-11

    • added the ability to set the current value, of interpolated values, which will create the value if it doesn't exist.
    • you can now access values like this: math.yourvaluename and you have not yet created the value, it will return 0
    • if you do it like this: math.yourvaluename(somedefaultvalue) and you have not yet created the value, it will return your default value
    • added the ability to change the total time for the interpolation on the fly, as well as the time elapsed, and interpolation curve control point

    special thanks to FrenchYann and Somebody for suggestions and testing

    (latest update (9-11-11   10:30am:additional bug fixes)

    this will be an evergrowing plugin of math functions:

    http://dl.dropbox.com/u/1013446/sharinplugs/math/plugins.rar

    AngleLerp(a,b,t)

    is like lerp(a,b,t) for angles

    basically you can lerp two angles, between 0 and 360 (EDIT:no longer has the limitation of having to be angles between 0 and 360), and not have to worry about crossing the 0/360 line just lerp and be happy, knowing that everything is taken care of, and your brainchildren are safe

    the second one is Get T which is simply typed t

    it's for helping with lerp functions, it's the opposite of lerp

    if lerp is x==lerp(a,b,t)

    then t==t(a,b,x)

    in simpler terms, t(a,b,x) will give a value between 0 and 1 that represents how far between a and b x is.

    I'll give more detailed examples later, but this one should suffice for people who already understand lerp and can do this without the t function: say you're looping between 2 and 6 and you want to set create a sprite between point a and b that starts at a and ends at b as you go through the loop evenly spaced in between you would just do

    lerp(a,b,t(2,6,loopindex))

    hidden functions:

    the intersectx, and intersecty expressions

    they aren't on the expression list, but they work

    example cap here:

    http://dl.dropbox.com/u/1013446/New%20folder%20%286%29/New%20folder/intersection.cap

    these give you the point at which two lines intersect

    you can do this 4 ways

    specify 4 xy coordinates:

    ntersectx(x1,y1,x2,y2,x3,y3,x4,y4)

    intersecty(x1,y1,x2,y2,x3,y3,x4,y4)

    specify 3 xy coordinates(the first two form a line, the 3rd is assumed to be on a perpendicular line):

    ntersectx(x1,y1,x2,y2,x3,y3)

    intersecty(x1,y1,x2,y2,x3,y3)

    specify 4 objects

    ntersectx("object1name","object2name","object3name","object4name")

    intersecty("object1name","object2name","object3name","object4name")

    specify 3 objects (the first two form a line, the 3rd is assumed to be on a perpendicular line):

    ntersectx("object1name","object2name","object3name")

    intersecty("object1name","object2name","object3name")

    all 4 methods are available in the example cap, just toggle them on and off

  • howdy yall. I noticed I messed up on the pointer and loop based addressing system in 's'

    oops

    I guess no one was really using those features since no one complained. but here's the new working version

    http://dl.dropbox.com/u/1013446/New%20f ... 6%29/s.rar

    they're both handy features. somewhere in these 12 pages is the explanation of what they do, but I'll do a quick reminder here for anyone interested.

    The Set Pointer action lets you make a pointer

    I'll use an actual example from my current project where I realized they weren't working and fixed them

    I had a bunch of events that looked like this:

    [quote:ymgud9jw]add objectarray "icon" to super {"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}

    needless to say that's very ugly, hard to read, and easy to make a mistake with, so with a pointer I could say

    [quote:ymgud9jw]Set Pointer "currententry" to {"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}

    then I can do this instead of the original way

    [quote:ymgud9jw]add objectarray "icon" to super {"p","currententry"}

    the "p" at the start of an address tells s the next part of the address is a pointer name, and it will act as if instead of "p","pointername" you typed in all that stuff that you set the pointer to

    you can also use pointers in pointer addresses, which I actually did in the same example like

    [quote:ymgud9jw]Set Pointer "currentwindow" to {"window",s.sule({"window"})}

    and when I needed to use something within that address over and over I did:

    [quote:ymgud9jw]Set Pointer "currententry" to {"p","currentwindow"),"entries",s.sule({"window",s.sule({"window"}),"entries"})}

    you can use them as partial addresses as you see above as well, where I started the address with the pointer and the continued on to go in entries within that pointed to super

    the loop address thing does the same thing

    if you're in a loop(an s loop, not a system loop), say you're looping through some insane address

    [quote:ymgud9jw]{"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}

    and your loop is called "myentries"

    anywhere you need to refer to that long address you can just use

    [quote:ymgud9jw]{"l","myentries"}

    and all the same rules as the pointers talked about above work, except you start with "l" for 'loop' instead of "p" for 'pointer'

    it's especially useful as you being looping through an array, and then looping a loop within that one of another array within the first one, etc, etc, and you not only don't have to type in the whole address you're looping through each time you add another nesting loop, or when you need to access the size of an array or something from a very outer loop, you don't have to keep track of any of the addresses

    one last thing about pointers by the way...they can kinda be used as variables, too

    no special commands or anything, but for example, let's say you have two object arrays, one called "air targets", and one called "ground targets"

    you can set a pointer called "current targets"

    then do all your commands on that address, and not care which array it's currently pointing to

    oh yeah, last last thing about pointers. it's meant to be simple, if you Set a Pointer you haven't set yet, it is created, if it has already been set, it will be overwritten with the new address

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i think it would be simpler to just use numbers

    [quote:3235mgqm]weapon = 0

    you know for yourself, and in your comments which number corresponds to which weapon

    [quote:3235mgqm]on player pressed Change Weapon

    add 1 to player('weapon')

    if player ('weapon') is greater than the highest number you have defined

    player('weapon') = 0

    so it'll loop around to the first weapon...much cleaner and easier to maintain. just two little events that won't change no matter how many weapons you add

    I think just using numbers and comments is fine, you can copy paste a little comment chart or the relevant parts wherever you need it, like here's your comment block for the event that increments:

    remember this is just a comment field that does nothing except let you read it and remember

    [quote:3235mgqm]0=pistol

    1=shotgun

    2=chainsaw

    3=friendship ray

    then on the event where you have

    if player('weapon')==1 or whatever

    you can have a little comment that just says

    [quote:3235mgqm]1=shotgun

    if you're against comments like that for whatever

    make a bunch of global variables

    one called shotgun with the default 1

    one called chainsaw with the default 2

    etc

    and just never change those variables, so they'll be constant

    then your events won't need comments because they'll look like this:

    [quote:3235mgqm]if player('weapon') == global('shotgun')

  • destroy on startup attribute happens before frame 1 of the game.. I could be wrong about that though. if so, it's existence for a moment at the beginning of the first tick of the game without being displayed won't affect performance or anything else. Destroy on Startup is the equivalent of having no instances at startup. unfortunately, because of early choices behind the scenes of construct, it's not possible to create a layout that has object types in it without also having that one instance that destroys itself at least.

  • why not just do on collision with whatever. they don't need to be solid. the solid attribute is so things with behaviors such as platform and stuff, know what they can stand on and go through, etc. if you just want to make something happen when it hits something

    just use the on collision condition

  • does the character need the solid for anything? if not, take it off the character...same with enemies unless they have some reason to use it

  • yeah yeah, I know, that's what this thread is for

    if a bunch of people go there at the same time

    there'll be more than just one

  • no seriously...

    WE HAVE A CHAT ROOM!

  • I'm not about to quote all that so:

    if you wanted to destroy all bullets there are four ways you can do it, off the top of my head.

    First there is a System - Advanced Collision condition, that allows you to choose whether either object involved gets picked. If no instances of an object are picked, it's as if all of them were picked. you could use that.

    You could use the 'family trick', where you put the bullets in a family called "blue" lets say. And on collision with bullet, blue.destroy. Families have their own separate picking lists, so you can do things like bullet, on collision with blue, and control the hitting bullet, and 'hitee' separately. in this case, since only the bullet was involved in the collision, all blues(bullets in that family) would be destroyed

    you could use a function, this is messy as you said, unless the process involves more than just a simple destroy. you could make a function that destroys all bullets. and function calls allow you to choose whether or not picking is conserved inside the function

    you could use my 's' plugin. it intimidates alot of users, and indeed it's more advanced core features have probably the largest learning curve of any construct plugin I'm aware of, but there are several handy easy to use things as well. In this case, there is a Pick Object action, and a Pick Object condition. They serve the same purpose, just allow you to use them in two different places. All this does is allow you to choose any object type, and order construct to pick a specific instance, unpick a specific instance, pick all that type, unpick all of that type. You can also choose whether it's picked as itself, or as a family, so you can say pick all bullets as blue, and even if there are other things in the blue family, it would only pick all the bullets there.

    there's also python, but that's overkill if you're not already using python, which unlike gamemaker, scripting isn't needed for even very advanced games, with very unique needs. I wouldn't recommend even touching python, until you realize how you can make everything you think you can't make without it.

    Controlling views. You can control views directly with the system object. controlling scrollx and y and zoom, globally as well as independently for each layer. A simple way to make a great camera is to make an invisible sprite object, and just tell the camera to "always" scroll to that object. Then put a bullet behavior on that invisible sprite, and make it always follow what you want at a speed based on the distance, that way it smoothly slows as it approaches objects. any type of movement you can conceive of except for 3d camera rotation is possible with these few simple system actions. also, there is a 3rd party 'magiccam' plugin which does alot of neat stuff for you, but I haven't used it myself, nor kept track of it's stability or development

    there's no handy tile editor as of yet (though there is grid snapping), other than cool examples made with construct you can probably find in the tutorials section of the forum. the platform school tutorial if I remember correctly had some ugly square tiles covered with pretty graphics, and that's a perfectly valid and common way to do it. If you mean one large tileset sprite, and you only reveal whichever part you need, this would be an involved process using uv distortion, which is entirely possible, but not the easy way to do it. the straightforward way is to load all the separate tiles into a single sprite animation. set the animation speed to 0, and then just switch frames in the editor like this :

    Subscribe to Construct videos now

    If by multiple views with multiple huds, you mean split screen, there have been a few examples of someone doing this with the canvas mostly. there's was a particularly awesome one here:

    I also came from GameMaker, which I purchased long long ago. The second I tried to create a script that did bezier curves, or split a convex polygon into multiple triangles though, it completely choked showing me that the engine wasn't capable of anything truly computationally complex. I can assure you that construct is capable of doing anything, gamedesignwise, that gamemaker can do in a much more intuitive way. seriously, try out the ghost shooter tutorial, and if you're like me, you'll be in love with construct halfway through it. then move onto 'platform school' tutorial, and dropout halfway through once you "get it". once you understand the basic workflow and logic to construct, you'll likely find that it's much more simple and enjoyable to make anything you can think of then you would have even hoped possible. pretty much any 2d gametype or feature you can think of, you can make.

  • nah

    I just forgot honestly. what does a fractional exponent do?

    isn't it something weird like 6 to the 1/5 power is like taking the 5th root of 6 or something?

    if that's the case then it still doesn't make sense why it'd be equivalent...

    wait wait

    found it

    http://www.mathsisfun.com/algebra/expon ... ional.html

    yeah, I guess the confusion was thinking timedelta was an exact science. there's no way taking the nth root of something can give truly similar results to multiplying by some other random a/b.

    so basically what you guys are saying is that they really won't run at exactly the same speeds when moving at two different framerates, even in a perfect world where you had a perfectly exact timedelta. so just come up with some random equation that seems to work, or use one you saw someone else use somewhere?

  • I think each time you Set a new animation you have to Play it as well

    could be wrong though. just try it!

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 25 followers

Connect with lucid

Trophy Case

  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

24/44
How to earn trophies