DrewMelton's Recent Forum Activity

  • See the picture below.

    The top line works every time if it compares less than or "<" 200, but the bottom event where it wants to spawn something as greater than 200 will never work. It's a large layout with plenty of tiles. I don't understand why the second one won't work. Am I not understanding the logic behind this event?

    Again, the top event works every time even if I put the door in there too. The bottom event will not spawn anything.

    I wanted to make it ">" so it would spawn enemies and doors away from where the heroes spawn rather than right on top of them. Is this condition not doing what I think it is?

    In fact, even if I make the second event say " > 1" it still won't work, so obviously it's not an issue with map size.

  • Hmm, well I can't figure anything out. I guess I'll have to do without destructible environments. Regenerating an obstacle map is just too draining and has too much impact on FPS.

  • I wanted a have a large map with blocks that could be destroyed. I set up an experiment to destroy a block on click and regenerate the obstacle map right then, and the frame rate goes down for each character that needs to regenerate the obstacle map. Just one character regenerating an obstacle map reduces frame rate by 10 or more for about 3 seconds. With multiple characters it gets to the point where the frame rate is in the teens for a few seconds, and it used to run at a smooth 60. All that for one block destroyed.

    Why can't it just take into account the one block that got destroyed? Why does it need to recalculate the ones that didn't change? I have tried to figure out a way to limit how big of an area it can recalculate, but nothing lets me combine it with regenerate obstacle map.

    My game is a tile based and turn based game. The characters can only move so much at a time. I thought I could limit the regenerating of the obstacle map to only as far as they could move, but it just wants to do the whole map. I also thought maybe using line of sight or a distance check around the character would work, but it doesn't allow these checks (or at least I couldn't figure it out).

    I also didn't have any luck with adding or removing custom obstacles. There didn't seem to be any way for it to work. I could have been doing it wrong I guess.

    I just don't seen any way of being able to destroy tiles/blocks and have pathfinding at the same time. It's just too expensive.

    Here are some things I either tried or was going to try but couldn't figure out how.

    1. each character has a line of sight set to custom so they can see through things, and then maybe limit it to 100 or 200 distance, then regenerate obstacle map within that.

    2. do a compare two values distance check around a character when doing the regeneration.

    3. checking on collision if object has been destroyed then regenerating for that area or removing that object from the custom pathfinding obstacles.

    4. when an object is destroyed that instance is removed from custom obstacles or a path is creating where the object was.

    5. when regenerating an obstacle map, it only considers objects that have changed and ignores the ones that are still the same.

    6. putting a large sprite around a character to test for collisions and see if obstacles are there anymore. I don't know.

    I just couldn't get anything to let me use it to modify the pathfinding behavior.

    It would be nice to have it so each character would only check their immediate surroundings such as a distance of 100 for changes when they regenerate the map. Alternatively, maybe just if they got hung up on an object that's not there they would recalculate it again just in a radius of 100 or so.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound Thanks, I was able to play around with those numbers and get it centered. I would have tried that before, but I thought maybe it was supposed to fill the whole thing. Now that I really think about it, it makes sense that it does not. Thanks again.

  • R0J0hound Hey, I hate to bother you again, but you seemed most likely to know the answer to this.

    I added on to the capx I just posted to include isometric tiles. The problem is that I'm only getting half a map now. Here is a screen shot. Please note that the graphics were made quickly and are a bit crude.

    You can see from the mini-map I set up in the bottom right that I'm not getting full coverage of the tiles. The blue is the background.

    Also, the green tiles seem heavily biased towards the left side most of the time.

    I tried adding some elements to the map array, but it never seemed to fill all the way, and the object count was getting too high for me.

    So yeah, it's getting really close and starting to look pretty cool. If I can work out a few more bugs, it'll be pretty sweet.

    Changes from last capx:

    Able to destroy tiles (changes animation and removes solid)

    mini-map added. Draw and refresh by right clicking. (also focuses on player afterwards)

    ground tiles changed to iso tiles. Wall tiles change to iso tile with height added.

    slight modifications in the way it creates the random map

    hero spawns on random ground tile and destroys wall tiles nearby (needs work)

    scroll with directions arrows on your keyboard

  • R0J0hound Sweet, it works! Thanks!

    I also noticed that when I clicked to redraw map, it was actually adding on rather than recreating, so I added an event under on start of layout to say for each xy of map to set curx and cury to 0 so it starts fresh each time.

    I guess the next step is to get enemy and hero placement sorted since this will have to be automated as well. And then I need to decide on what kind of tiles, slanted or straight. So, time for me to get work on that. Everything is coming along nicely though.

  • R0J0hound Yeah, I made sure to allow for that, though it was still a little off putting, so hopefully I didn't miss any.

    I have to call it a day. I'll try again tomorrow. If you get a chance to look at it, let me know. It's probably something simple that I keep glossing over.

  • R0J0hound or ahr Ech or anyone else, can someone have a look at this capx and see what is wrong.

    I found an old cap file for construct classic, and I wanted to remake into construct 2 so I could test it. However, it is not working as it should. Some of the logic and terms are different, so maybe something is throwing me off.

    Here is the tutorial with the old cap file for reference if you want it. https://dl.dropboxusercontent.com/u/581 ... al.doc.pdf

    I have attached my remake. Can someone look at it with fresh eyes and see where the error is? I was trying to follow the example as closely as I could, so maybe something needs to be written differently or maybe I just messed up and didn't realize it.

  • I have it set up so that the hero you have selected will regenerate the pathfinding map when you click to move him, so they do it one at a time on mouse clicked.

    The enemies don't move or pathfind until their turn is active. I don't see any regenerate pathfinding events for them at all, so maybe they don't need to since they don't pathfind until their turn is active, and the tiles will have already been destroyed by then. It seemed to work in my test. They walked through where the solid object used to be.

  • That's good to know. I don't know how many objects will end up in the final map since I have yet to determine how big the levels will be.

    I am using pathfinding though, and I may give the heroes the ability to destroy a wall section. Each "wall" block will be counted as a pathfinding obstacle, and that will be roughly half the map. The turn based nature of the game should keep this under control, though I figure I'll need to be careful with how I set up the events and conditions and maybe do a distance check before a collision check and whatnot.

  • I've always been trying to keep object count low, even though my game is going to be for PC.

    But then, I was following an old tutorial on procedural generation, and it had a little over 12,000 objects! I thought maybe since that was construct classic that it was different, but I quickly created a similar set up in my existing RPG type of game which has over 1,000 events, and it still played fine with 10,000 objects at 60fps and under 15 cpu usage. There were only 3 heroes on screen and 2 enemies, and this is turn based so there's only so much going on at once.

    Anyway, the point is how big of deal is object count really? Especially on PC games. My computer is decent, so I don't want to get carried away and find out that it runs like crap on anything less. Of course, I could always test on my old laptop.

  • DrewMelton

    I'd go for using separate animation frames rather than separate objects.

    Here's a bitwise example here that uses the tilemap instead of array, but the concept is about the same.

    tilemap-auto-tile-help_p721581?#p721581

    I had a bit of a go at making an example in isometric. Art is time consuming for me and I wasn't able to find a free tileset that has all 16 combinations required for the bitwise method. I was able to use a modified approach with what I could find though.

    http://opengameart.org/content/cave-tileset

    https://dl.dropboxusercontent.com/u/542 ... tile3.capx

    I also found a useful general reference on isometric here that may be helpful:

    http://gamedevelopment.tutsplus.com/tut ... medev-6511

    Thanks for the capx!

    I'm going to spend the rest of the evening playing with this. I may implement a sort of Minecraft ability to destroy tiles and look for treasure or to create a path. That way, I won't have to worry about rooms being isolated. If an enemy gets created in an isolated room, I can make him into a monster of some sort rather than human enemy which would look silly.

    It might look a tad silly have a mage, fighter, and thief able to use a pickaxe, but it might be fun as well. Plus it would open up more gameplay options and give people more to do than fight.

DrewMelton's avatar

DrewMelton

Member since 18 Oct, 2013

None one is following DrewMelton yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies