R0J0hound's Recent Forum Activity

  • You need to ask those publishers that. It depends on how they do the export to platforms that construct doesn’t support.

    Most if not all of them convert the capx to the export format. It’s up to them if they are willing to take an already exported game and try to convert it.

  • It’s up to you. If I said yes or no is irrelevant.

  • You can extract information out of it with the binary object most likely but there seems to be a lot put in there.

    developer.valvesoftware.com/wiki/Source_BSP_File_Format

    The most useful part would be how the polygons are put in a binary space partition which would allow quickly getting a perfectly ordered list of polygons to draw while culling the ones behind the camera.

    Anyways, probably not super useful with construct’s 3D. Maybe as a separate plugin to draw the polygons with api calls. But its probably simpler to just convert the file to something there already is a loader for.

  • dropbox.com/s/fnmu2kkvzg6sr7i/hex_pathfind4.capx

    So turned out we could do it with less events. The pathfinder doesn't need us to temporarily mark tiles as walls at all.

    * Now the player and an enemy can occupy the same tile.

    * Once on the same tile you can attack or step off the tile.

    * enemies are done one at a time. If they can't possibly get to the player they just don't move.

    I will say it probably doesn't match what you had in mind exactly. like you may want objects to just battle to the death when on the same tile and not have the option of retreat. Or maybe you want objects to bunch up instead of walking around the water so once a space opens up they are close. Anyways, you'll have to tweak and tailor to what you have in mind since i don't know everything.

    Also one thing i didn't touch is making objects sharing a tile not be right on top of each other. I had a smooth way of doing that in mind but you have some other way in mind.

    -cheers

  • Impressive and oozing with character as always! Very cool.

    When the reading of the pixels is wrong, could the image be flipped?

    Messing with webgl before to read pixels I ran into the issue of the image being flipped on some devices. Not sure why it wasn’t consistent. Anyways my solution was to check if the pixel data comes out flipped and then flip if needed. This would only need to be done once as the flipping was consistent. Anyways to do it i’d get the pixels from a 1x2 image with a white pixel over a black one. Then if the top read pixel was black we know the image was flipped, otherwise it wasn’t. That should be doable with the canvas too. Reading the image flipped should just be a matter of:

    RedAt(x, height-y)

    Anyways, Just an idea.

    -cheers

  • You could change the enemies to move one at a time. Maybe something like this?

    Moving=0
    EnemyMoves>0
    — enemy: moved=0
    — — pick enemy instance 0
    — — — enemy: set moved to 1
    — — — move enemy
    — else
    — — subtract 1 from enemyMoves
    — — enemy: set moved to 0

    Having multiple units be able to be on the same tile would require changes over all the events to handle that. The current events assume only one unit can be on a tile at once. Off hand you could make occupied variable be the count of the objects in it, or maybe have two variables instead occupiedByPlayer and occupiedByEnemy. You’d need to then change how the occupied spaces are temporarily made walls, and maybe the pathfind function would need another parameter saying whether it was for an enemy or player. Just thinking aloud. Maybe that would give ideas.

    As a side idea the pathfinder could be redesigned slightly to eliminate the need to temporarily mark spots as walls. If possible that would simplify events.

    We’ll see how well I triage my time this week.

  • You use a tilemap to do the terrain so that it doesn't lag.

    You have to implement perlin noise with events with C2, or there may be a plugin.

    Anyways after that here is one possible way:

    dropbox.com/s/o219jt9lzbzcv5g/noise_gen2.capx

    Or use the forum search. There have been many solutions over the years for that.

  • Had a go at making an updated example. It should cover all the points you were after.

    dropbox.com/s/p7ysobapnmlvlh9/hex_pathfind3.capx

    * pathfinder was updated so it can step onto occupied tiles, but won't go past it. Had to temporarily disable the occupied var of the starting tile to do it.

    * possible moves of the player will be displayed, and hidden after selecting a move.

    * player and enemies can attack each other. An attack counts as a move.

    * player can be moved all at once or in multiple steps.

    * added smooth movement, and things will wait till they stopped moving to move on.

    Other than that i cleaned things up and tried comment everywhere should you need to modify things. Logic is similar but differs a bit.

  • Hi,

    Looks like you did some cool things with it. As your previous edit says, it does look a bit esoteric, but there are probably some ways to simplify thing so that what it's doing is more clear.

    For moving the player repeatedly till it's moves are used up or end turn is clicked I think adding another state would do that. So it would be:

    "show moves", which would highlight the moves in range.

    "wait player", would be largely the same but only allow clicking on in range tiles

    "move player", largely the same, but would subtract from the range as the player moved. if the range wasn't 0 at the end it would go back to "show moves"

    "move enemies", would remain the same.

    I can't edit the cp3 because i don't own c3 and it's beyond the free limits. However the highlighting moves should boil down to something like this:

    if state="show moves"
    	pathfind from player.target
    	unhighlight all hex
    	pick hex with hex.dist>0 and hex.dist<=playerMoves
    		highlight hex
    	set state to "wait player"

    Having the player, and enemies be able to move into each other to attack probably needs some more thought on how we are doing things. Right now when an object moves it thinks of everything else as a wall.

    For player movement: if we click on a tile, and an enemy is on it, we can decide not make that one a wall, since typically we make enemies walls.

    For enemies, we already have that logic in event 38 to do attacking. I just don't do anything, except not move into the tile.

    Anyways, just some ideas. I haven't done any updates to the examples, just referenced them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here it is further refined to match your example.

    dropbox.com/s/pcbiajcrf4wsr8p/hex_pathfind2.capx

    It uses a state variable to switch what is happening. Basically it does this:

    *click to find path for payer. All enemies are walls.

    *move player on path

    *loop over each enemy, make all others walls, pathfind to player and move one space.

    -- it does that every 0.25 sec for 0.75 sec.

  • I think you will get responses biased toward Construct because this is a construct users forum.

    I don’t think most have really used gdevelop 5 here. I looked at it before but not too much.

    Mobile exports are typically done with a service since it’s pretty involved to do manually. So I can see why both charge for it.

    Apart from that it’s mainly a personal choice which to use. You could try to make a game in both and see if the workflow differs and which you prefer.

  • Ran out of time but here is what I ended up with.

    It finds a path from all locations to one spot, and moves the enemies toward it. The enemies will try to move around other enemies if they are blocked.

    left click to add an enemy to an empty spot. They will try to move toward the mouse.

    dropbox.com/s/17oopqy8qfu20pp/hex_pathfind.capx

    Probably ended up more complex than i anticipated. I have an idea how to make things tighter but it's slower.

    As to your question with your capx, I have no idea. Maybe there is something simple that will allow it to do what you're after, or it's not really possible. I opted to go from scratch instead of figure out what is possible with the pathfinding behavior. From scratch give more control and is a bit quicker to figure out.

    Anyways, maybe my capx is helpful but it's not setup like you have your game.

    cheers