Ramladu's Forum Posts

  • Thanks. I still haven't got it to work right. Sometimes the gridlines draw perfectly horizontally and then are off vertically by 2 (missing) and vice versa. It has to be a drawing issue. I put in a wait 1 second for each run of the loop but that didn't help. I may need to just make a new object that already has the grids made before run time.

    Also, I noticed it changes based on whether my preview window is fully expanded versus a different size.

    I have ran this on two different computers.

  • Hi,

    I am trying to draw gridlines at runtime for the player to better understand the map layout. I have an event and action that draws horizontal and vertical grid lines based on a tiled background. The problem I am having is that the lines are not displaying with a consistent look nor do they all show up sometimes. Is there a different technique and/or object I need to look into? I didn't see anything in the tilemap object's actions to show the gridlines so I invented my own.

    Here is a video showing the problem.

    youtube.com/watch

    Here are some screenshots

    Thanks!

  • Hi,

    I have been using the default tilemap in the tilemap object as I learn the tile events and actions. Now, I want to grow and get crazy with level design.

    I have access to different sites that offer tilesets but none of them are ever in such a neat order like the tilemap object's default tiles.

    So...where do you go for your tilesets and/or what techniques do you use to clean them up? I have Spriter and was thinking of using that. I have the Adobe Creative Studio...so photoshop, illustrator etc, and I am fairly average to above average with the tools.

    Just kind of looking for guidance before I go down the rabbit hole for awhile to figure this out.

  • Does what I need!

  • Thanks. I understand what you're saying. I'll give it a whirl. Tilemap reminds me of Microsoft Excel spreadsheets but no offset() function here - well, unless I build one. :-)

  • Hi,

    As you can see below, I want my player unit to move up on my tilemap. It does it successfully. However, now I would like to figure out a way to identify which type of tile the one-up is before the player goes there.

    For example, let's say the tile up from the player is a tree, and I want the player to chop the tree each time it tries to move up and the tree is in that tile up.

    I believe I have it set correctly except for being able to check before the player moves to the tile:

    tilemap.tileat(tilemap.positiontotilex(OverlandMapPlayer.x),tilemap.positiontotiley(OverlandMapPlayer.y))

    I assume I would need to add a condition that checks for the tile up from the player and then a sub-event or otherwise that will move the player if it is an open tile OR if it is a tree tile. I can then use my tree-chopping function/mechanic.

    Can you help me identify what I need to check? I assume I need to do tileID - 1 or tileID - Column, etc..., or is there something built in?

    The other idea I have is to move the player UP, then check what tile it is ON, run a checker function to see if it's a tree tile and then knockback the player to the original tile, while also completing a chop at the tree. Then rinse and repeat assuming AP > cost and tree hp > 0.

    Thanks!

  • I think I solved this once by picking the topmost based on Z-Order. IE. If two enemies are going to be hit at the same time via a collision detection, then it will take the one at the top of the Z order on the layer. I also did this with mouse click to loot an item that happened to spawn very close to another piece of loot.

    Here is an example based on mouse click and having two loot items on the same coordinates.

  • Thanks. I bow to you.

    I didn't try the nested technique. I tried them separately and thought I kept getting close. Now I know the magic. Lesson learned.

  • Hi,

    I am back. I have searched through 5 pages of tilemap forum posts and either I am not understanding it or it's not being addressed simply.

    My objective:

    At runtime, user mouse clicks on tilemap object, return the tile # in a textbox so the user knows what it is.

    Kind of like if I click on a sprite, I can get the frame #. Let's say user clicks on a tilemap object but more specifically, the tile and there's a number associated, from there I could then have an array with elements that matches with the tile number and then tell the user that they clicked on the "Swamp" tile.

    Is there a simple way to do that?

    I know how to set a tile at X = 5, Y = 5, tile = 5 which will put in the 5th tile in the tilemap tool in the 5th column on the 5th row in my tilemap placed on the layout. But how do I get that same kind of data by using a mouse click. "You clicked on the tile in X = 5, Y = 5, and is the 5th tile in the tilemap tool"

    Thanks. I appreciate how helpful everyone has been over the last few weeks as I continue to improve my skills.

    I am thinking maybe the only way to do this is create the actual tiles at runtime, storing an array after each tile by running a for loop I <= #tiles to generate on each row, nested with a for loop for columns, and then storing what I want to store into other arrays or a single multidimensional one. But then again, how do I return the value of the tile that was clicked on.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Thank you. I'll check it out!

  • I have a weird question but how do I return a path cost based on the user hovering over an area of the map (with mouse) that they would like to move their character? I am thinking of a game like Jagged Alliance 3 which shows AP cost to move before the user decides where to go. Once I understand how to capture the pathfinding cost, I can use some math to make a user friendly read out for the user.

    I read the pathfinding behavior documentation and I am generally familiar with pathfinding but in recent weeks, I've restarted my game after learning new techniques and now I am trying to learn more about pathfinding to better inform the user.

    I can return X,Y calculations and use the abs() with some fancy math to calculate the distance between the character's current location and the desired location but that is not the same as pathfinding cost. My way actually does work fine however not when I throw blocks in the way or costly terrain pieces.

    Side note: I understand Manhattan versus Euclidean distance if that helps. I teach ML/AI. Computer game design is just for fun.

    Thank you

  • I'm seeking advice for my game development project. I've been working on enhancing the Collision detection for items that players can pick up in my game. Right now there's 6,000+ detections per second. That seems very high, but I am not sure if it is.

    I'm torn between utilizing Collision detection for item pickup or implementing a hovering for more details and a click on (with distance from loot calculation) mechanism trigger.

    Performance is a concern, and I'm unsure if my current approach is optimal for my game's performance. I'd appreciate advice on the best approach for Collision detection and how to optimize it without negatively impacting performance.

    I put together a Youtube video to narrate my work.

    youtube.com/watch

    Update: I did test the hover over and automatically loot technique. The CPU/GPU did not go up nearly to to the level of collision detection so I think I have my answer but I am not sure. I tested it with 30 loot items on the screen.

    Thanks for any advice you have.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Exactly. I teach data science at the graduate and undergraduate level and it's the same way. It's easy to get carried away with the ease of developing models without understanding how to make the more efficient.

    I got the in-memory down to 200MB, quite a contrast to the 1600MB.

    That still seems like a lot. I am going to test it a bit more. I have over 300 skill icons. My original plan was 10 classes and 30 skills each. The sprites are probably more detailed than they need to be. Most of my sprites at run time are scaled to get to be used at 16s, so 16, 32, 48, 64, 96, 128, but I still have a lot of images at 128, 256 stored natively. No more 512s though anymore and that world map at 8k resolution is tweaked down.

    This experience is going to be a good analogy in class when we talk about useless independent variables in our regression models. Although I come to Construct 3 to play and get away from work. :-) Worlds colliding...