MJOne's Forum Posts

  • Hi!

    First of all I want to thank everyone that have helped me with my previous subjects, you know who you are! <img src="smileys/smiley1.gif" border="0" align="middle">

    Please bear with me, english is not my native language.

    Today I will share a little top-down demo I have made using Construct Classic.

    In this demo the AI units will run for cover, prefering cover points distributed on the map. For each tile I have distributed a LOS node which is a sprite. Due to the fact that the tiles always have their hotspots in the top left corner.

    In this demo I have the walls on the inside of the tile square. I realize now that I could have made them inside on the south and east walls and outside on the north and west walls. Maybe even using the same tile but putting the north and west wall in the outdoor tile next to the floor tile. Anyways...

    Each LOS Node gets a "hide value" like so:

    clamp(int((distance(player.x,player.y,los_node.x,los_node.y))) - (los_node.Value('in_los')*100000) + los_node('cover_point')*240,0,480)

    You can get a very dynamic formula here if you play with the values and add more values like if there is a grenade thrown etc...

    Well since alot of people have been so nice to me on this forum I feel that I want to give something in return, if this has any value to anyone that is. <img src="smileys/smiley36.gif" border="0" align="middle">

    Here it is:

    Example file here!   

    However for the love of all green jelly in the world, I can't make this work when using the nodes as tiles. Does anyone know how to do it?

    It creates alot of overhead using sprites for such a simple task.

    Have a nice day!

    /MJOne

  • Thanks a mill R0j0!

    Now I have something to occupy myself with :)

  • Well I have looked at the example you made and I realize I have some reading to do. <img src="smileys/smiley8.gif" border="0" align="middle" />

    Is it possible to get a reading on the current speed and height(not using sprite.y) of the projectile at any given moment?

    Like so:

    always -> set text to "Speed: " & varSpeed & " m/s" & newline &

                                   "Height: " & varHeight & " meters"

    I respect if you don't have time nor want to waster any energy on a pointless peasant like me, but asking is not a crime yet.

    <img src="smileys/smiley17.gif" border="0" align="middle" /><img src="smileys/smiley4.gif" border="0" align="middle" /><img src="smileys/smiley36.gif" border="0" align="middle" /><img src="smileys/smiley2.gif" border="0" align="middle" />

    Not that im lazy or so but do you have any articles up your sleeve where I can read more about the formulas you are using, or point me in a general direction so I don't have to bother your superior intellect in the future.(We can hope) <img src="smileys/smiley2.gif" border="0" align="middle" />

    Anyways, thanks again R0J0hound!

    /MJOne

  • Thank you R0J0hound!!!

    Well I know, the thing is this, I am not going to do a platform side scrolling game. I was just using this format to see what happends and if I get it right.

    I am planning to do a top-down turn-based or plan-and-go game. And I want to simulate drag and bullet drop using a "height" variable within the bullet object to determine where on the body the bullet will hit etc...

    I have a penetration formula as well, I might be able to figure that one out or I might post it here for anyone with godly powers to help a puny mortal like myself to make it work. <img src="smileys/smiley2.gif" border="0" align="middle" />

    Thanks again for the example I'll check ?t out asap! <img src="smileys/smiley4.gif" border="0" align="middle" />

    /MJOne

  • Hi!

    I have spent the whole day trying to figure out the equations having to do with drag on objects with a fixed mass.

    My example which I included is kinda like a classic cannon shooting example(Platform-scrolling).

    I have figured out how to implement gravity and convert it to pixels.

    (1 meter = 32 pixels)

    My problem is drag, and how to implement it.

    I found this:

    grc.nasa.gov/WWW/k-12/airplane/flteqs.html

    (alot of interesting articles)

    This is the formula:

    D = .5 * Cd * r * A * Vt^2

    D = Drag (Fd)

    Cd = Drag Coefficient (Bullet = 0.295)

    r(rho) = Gas Density (Air at sea level = 1.225 kg/m3)

    A = Cross-sectional area (Circles; A = Pi * r^2)

    Vt = Terminal Velocity (m/s^2)

    When I calculate this I get a value, I think is is N(Newtons).

    Since I am a greeny on physics I almost have no idea of what I am doing.

    Please be gentle. <img src="smileys/smiley9.gif" border="0" align="middle" />

    So how would I go about inplementing this to the Xpos and Ypos on the bullet. Which updates every 10 milliseconds. (In my example below)

    Any help is very very appriciated!

    Please explain like I was a 5 year old. <img src="smileys/smiley36.gif" border="0" align="middle" />

    According to this:

    en.wikipedia.org/wiki/External_ballistics

    <font color=blue>Drag or the air resistance decelerates the projectile with a force proportional to the square of the velocity.</font>

    Im not sure about this...

    Here is my file:

    web.comhem.se/~u54025770/ballistic_test.rar

    /MJOne

  • Woaw thanks everyone for your great examples, I have alot to learn here! :)

    Im pretty suprised over the positive and enthusiastic response I got here!

    Man you guys are great!

    Thank you all!

    /MJOne

  • Thank you for sharing your great solution! :)

    If and I mean IF I can make it faster I will post it here! :)

    Thanks again!

    /MJOne

  • Woah! You guys are amazing! :)

    Im really moved by how fast I got help on this forum.

    Thanks a thousand times!

    Is it okey with you Animmaniac if I use this method in my game/s?

    I will study these two examples as well, see what I can learn!

    Thanks!

    /MJOne

  • Thanks a million! :)

    Thank you Animmaniac and Tokinsom, that's perfect! ;)

    But how would you stop it from render through 1x1 tile(32x32) walls?

    Like lights in a labyrinth...

    If you have alot of small solid objects scattered about...

    Thanks anyways! I will study this deeply! :)

    /MJOne

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nice example there, but that part I have figured out, what I can't figure out is how to blend the tiles when there are many light sources.

  • aah I will try that newt. Thanks!

    But how would you do the blending with multiple lights that illuminates the same tile?

    If you also have a gradient drop in light strength in the color filter RGB channels. 255 to 0. White to black.

  • Please explain :)

  • <font size="3">Tilebased Light - kinda like Minecraft</font>

    Hi everyone! Im new to the forum but not so new to Construct.

    Thanks for such a wonderful application! Free of Charge! <img src="smileys/smiley2.gif" border="0" align="middle">

    Im having a brain meltdown here, and this is my last resort.

    I have searched the web for this but I can only find C++ examples and Im no good at interpret that. I have also searched the forums here but I can't find any example which explains this.

    As the title say: Tilebased Light, how would you go about doing that?

    I have tried to add a light variable to every tile and depending on the distance to the light source it gets a certain light value. Then I used that value to set the color filter using the RGB expression. And that worked well. But with multiple lightsources when the lighted area is overlapping and should get a addative effect, I just can't work it out.

    I have also looked at the Bresenham Line algorithm, which some people suggested on the net, like this:

    Youtube Video

    But I can't figure it out... <img src="smileys/smiley9.gif" border="0" align="middle">

    So Im asking for help/directions/examples... <img src="smileys/smiley19.gif" border="0" align="middle">

    That would really get me going again. <img src="smileys/smiley4.gif" border="0" align="middle">

    /MJOne