R0J0hound's Forum Posts

  • You can use a sprite with a 2x2 distort mesh to do that.

    Set the project properties to standard z scale.

    Make the sprite of size 1x1.

    The set the mesh points to the triangle corners. Two of the mesh points would have the same positions so the quad would collapse into a triangle.

    For more efficiency you could try to do two adjacent triangles with one quad, but that’s not always possible.

  • Hi,

    Currently the 3D in construct is pretty limited. What is provided is a way to move and rotate the camera, as well as the 3D object. The 3D object is limited to a few primitives and can only be rotated on the z axis.

    There is also a third party plugin by mikal that lets you load other models, as well as more rotations.

    Beyond that there is also mesh distort which can let you make meshes that way. However you have to really get into the weeds of the math to do it with that.

    3D physics is another can of worms. Either do it from scratch or use a js library to do it. Although either aren’t simple.

    Anyways, 3D isn’t there yet to do what you want to do easily.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Keeping track of all the explored tiles is the only way to do it.

    You can find ways to have it take less space and you can store it in such a way as you don’t have to loop over all the spaces.

    You could store and load chunks of fog tiles every time you scroll. Say every quarter of the screen worth of tiles is a chunk. That way you only need to store what was changed.

    If you store the chunks in a dictionary you can keep the speed of accessing chunks constant. Also you could store the chunks as a string of 1’s and 0’s for fog or clear. Then you can do rle compression on it to make it more compact. Or there are more complex compression ideas.

    The data size would still increase but you should be able to slow how fast it increases.

  • So with the current method it gives this:

    A = a b b c

    B = b b d b

    C = 2 1 3 2

    For duplicates and such you need to give each Array element a unique number

    A = a1 b1 b2 c1

    B = b1 b2 d1 b3

    C = 2 2 3 3

    But I guess that doesn’t match what you were after. Probably would have to do it in three passes or something.

    1st pass just marks the 1’s

    A = a b b c

    B = b b d b

    C = _ 1 _ _

    2nd pass ignores the 1 matches and marks the 2 matches one by one.

    A = a _ b c

    B = b _ d b

    C = 2 1 _ _

    A = a _ _ c

    B = _ _ d b

    C = 2 1 _ _

    Last pass just marks the remainders as 3

    C = 2 1 3 3

    Implementing that in code is just another step. I don’t have a lot of time for that presently. I’m backlogged.

  • I realize you just want a complete template to use, but I’m sure you could use any number or features to make parts of that game.

    Tilemaps let you place tiles that both serve as collisions and as a visual, so I can see that useful to try to use to do the play area. You can loop over the tiles too. So that’s a plus. Performance would need to be seen though. The rest I’m too lazy to think about atm.

  • So I opened that capx and the only thing I tried to solve in it was a way to slice away chunks of the play area. It was a bit of presumptuous to call it a qix like. I do recall an older capx I made but the forum and a search of my dropbox yielded no results.

    The original qix probably did everything pixel based. Things moved a pixel at a time. It knew if the player was on the edge or inside the play area based on the color of the pixel it was on. The filling of areas was done with a pixel flood fill. And finally the filled percentage was done by counting pixels with a certain value.

    C3 has the canvas plugin that can be used to set and read pixels so that could be leveraged to do that stuff. The problem is with modern resolutions you deal with more pixels so it may not be as performant.

    All my previous attempts tried to do the game in a more modern way such as keeping track of the polygon around the unfilled areas and measuring the distance the player was from the closest edge to those polygons. All which are all slightly involved projects on their own. To top it off some creativity is necessary to utilize constructs available features to achieve that. I typically run out of steam after finding a way to erase chunks of the play area, so most of this is completely unsolved for me.

    To make good clone I think the best starting point would be to make a complete list of all the game rules. Like what is happening, what can you do as a player and what happens. Even something complex should be able to be broken down into simpler parts.

  • It’s simpler to look at with 1D arrays.

    So these two

    A =[ “a”, “b”, “c”]

    B =[“a”, “c”, “d”]

    Would give:

    C=[1,2,3]

    A:for each x
    — compare: A.at(A.curX)=B.at(A.curX)
    — — c: set at (a.curX) to 1
    — else
    — A: contains value B.at(A.curX)
    — — c: set at (a.curX) to 2
    — else
    — — c: set at (a.curX) to 3

    Doing it with 2D or 3D arrays may be similar, but I’m not up to working it out.

  • Here’s the file from that topic:

    dropbox.com/s/lmd0vwck1dy9agq/qix_like.capx

    I haven’t looked at it in a while.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That particular event looks at all the outgoing roads except for the one the car came on and just picks a random one.

    To only turn right I guess you could pick roads whose angle is car.angle+90 or something.

    It’s honestly been long enough that I don’t like the events I wrote and would rather just redesign the whole thing and maybe reusing some of the concepts used here. I’ll probably have a go at that the next few days with better intersection logic. Maybe the cars could have preferences where they’d like to go for like pathfinding and such.

    In my experience when I make something and then change what I want it to do it’s not often a simple tweak. Besides rewriting it often yields a better design anyways.

  • This was built around casting rays against arbitrary triangles, and trying to fit it within 25 events. It may be possible to simply since 3D objects are limited, or there may be other approaches.

    Anyways I have no alternatives currently.

  • When I posted that example I didn’t have a good idea how to fix that issue and decided it still was good enough to post as it mostly worked.

    To fix I’d say the whole thing would need to be redesigned with more logic at intersections.

    As is it just moves along the roads, turns randomly at intersections, and stops if a car is ahead.

    Probably would need the cars to not enter the intersection unless it’s path doesn’t cross another one already in it. Not just look right in front of itself. Probably would do well with some kind of signal logic to keep things fair for cars who can’t enter.

  • No problem. Glad it worked.

    newt

    You can already do that with functions somewhat.

    What I’d like to see is being able to have simple structures as values in addition to numbers, text and bools. Would make some events way more readable I think.

  • So this is what the math would look like.

    X,y is the position on the curve.

    If we advance t by a small amount and get that xy then subtract the position from that we get a direction vector.

    We can then normalize it to make it have a length of 1.

    So then if we swap xy and make one negative it’s the same as rotating 90 degrees.

    So we end up with a point 50 pixels to the left and right of a point on the curve.

    x = cubic(x0,x1,x2,x3,t)
    y = cubic(y0,y1,y2,y3,t)
    dx = cubic(x0,x1,x2,x3,t+0.001)-x
    dy = cubic(y0,y1,y2,y3,t+0.001)-y
    mag = distance(0,0,dx,dy)
    dx = dx/mag
    dy = dy/mag
    
    points:
    x+dy*50, y-dx*50
    x-dy*50, x+dy*50