DrewMelton's Forum Posts

  • 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.

  • This might give you some ideas. http://www.vlambeer.com/2013/04/02/rand ... and-kings/

    You might also look into how Spelunky generates it's levels. It sort of combines authored content with procedural generation by having a set of pre-made rooms that are stuck together semi-randomly.

    That Wasteland Kings example looks very interesting. From what the article said, it looked like the floormaker is a sprite that is spawing floor tiles as it goes, and then each floor tile spawns a wall on one of its corner. It seems like this would generate a lot of overlapping tiles since some would get placed on the same spot. It also looks like the tiles are very simple and blocky without much need for variation. I would rather make mine a little bit better looking since it would fit my game better.

    I do like the idea of Wasteland Kings map generation. It will also create areas that are accessible with only a small chance of something going wrong.

    I looked up a bit on bitwise map creation as R0J0hound suggested. It looks like it can be done on an array where it simply checks to see the value of the neighboring elements using something like "array.curX +1". I really can't find many good ways to reference a single element on an array.

    Here is an article I found that was useful on bitwise stuff:

    http://www.saltgames.com/2010/a-bitwise ... -tilemaps/

    I tried to find a way to combine the two methods. The only way I saw to do it was to create a sprite for each tile, put it on the layout in the correct spot, put them in a family, give the family an instance variable, and then have the floormaker piece change that variable when it overlaps them as it moves around the layout. Then, the sprites would modify the value of their corresponding array element, then they would be deleted. Then, after all that, the bitwise part would set in checking values on the array. This is a bit tedious since the layout needs to have one sprite for each array element which is a lot for big maps. I guess I could have used a second animation frame for the sprites as my trigger instead of an instance variable though.

    I guess it could be done without sprites if I could move around on an array moving from one element to the next randomly and setting the values to either a 0 or 1 if I want a floor tile or wall tile. I'm not really sure if I know how to do this. It sounds like it would be an easier approach though.

    I figure my biggest challenge right now will be to make everything work. It's a party based game, so all 3 heroes need to be spawned correctly and not stuck in a wall. Then, I need to place enemies which shouldn't be too hard. I also need to make sure each part of the map can be accessed if my game goal is to kill all enemies.

    I still feel like I will need to sacrifice some graphical detail to get this to work. It's getting late so I need to call it a night. I hope I didn't miss anything with this post.

  • Thanks. I'll look into what you said.

  • This is something I've been thinking about for a while since I'm getting started on making the actual levels for my game which is an isometric turn-based rpg.

    There are two ways I could do it. One is to create the map by hand, placing the sprites where I want them. It would just be a matter of making the sprites and marking off where I want the solid borders to be for pathfinding. Nothing too difficult there. The main advantage here is complete control over the visual elements so I could make a better looking game. The downside is that the level will always be the same, save for random enemy placement and difficulty.

    The other option is to randomly generate a map. The advantage to this would be having a different layout each time. The downsides are that it's harder to make it look nice. I can't place "filler" sprites to cover weak areas or to add in detail as easily since they would need to be placed in the proper location. I also have to make sure the map "works" and is still interesting. The major issue I've had is placing structures such as a long wall, a river, a long cliff, anything that is not just one sprite but a group of sprites that need to line up or make sense.

    Here are a couple different examples.

    The first is from Age of Empires II, and the second is from Baldur's Gate II.

    I can adapt the game to work with either type of map. I would lean more towards the Baldur's Gate style map since this is an RPG after all.

    The AoE map is probably easier to make. It is more open and would only need correct sprite placement so that it looks nice. If I add water, I would have to worry about islands I can't reach or whatnot. If I add trees, I would want them in groups preferably but not blocking paths either. I would have to create some sprites to indicate shorelines for each side and some corner pieces and place them correctly, which seems like it would be tricky.

    The Baldur's Gate style maps rely more on paths and rooms. The biggest challenge is how to make the walls have proper corner pieces, be the proper thickness (as you can see in the picture some rooms are very close together, and others have more space around them.) Even if I set up some sort of code to randomly place rooms and hallways, I would still need the textures/sprites to be in the correct place. A wall needs to have an actual end to it and fit in with the corner of the next wall.

    All of this is easy with manual placement. I just create some sprites (walls, rocks, etc.) and place them where I want them until the level is built.

    I've messed with arrays a little bit, and looked at some random map generators here. I really can't see any way to make a functional world that's both random and isometric and actually works. Placing isometric objects like a tree is not hard, and I could make the ground tiles diagonal or whatever.

    But getting walls built around paths and things like that is just really confusing, assuming I could build an isometric hallway to begin with. Has anyone had any success with anything like this?

  • Try the Mouse.X("Layer") and Mouse.Y("Layer") expressions with the same layer the minimap is on or just a layer that doesn't scroll.

    https://www.scirra.com/manual/114/mouse

    Sweet! It works! Thanks

    I tested it with scale outer at fullscreen and half screen and scale integer at normal size. It worked consistently. This now gives me a functional mini-map that will scroll to wherever I click. It will make a big difference for my game since it is sort of a isometric strategy game.

    Here is the updated line of code. It could also be done without the camera sprite, but I put in the camera so I could physically see where it was going to.

  • Probably use Mouse.X instead of Mouse.AbsoluteX and the same for Y.

    But the problem is that mouse.X changes depending on where you are at in the layout. So, If I scroll all the way to the left, then click the map, I get taken to about 2000 X, then clicking it again without moving the mouse I now get taken all the way to 36000 which is off the layout so I can't see it, and clicking it a 3rd time without moving the mouse takes me to a max of around roughly 40,000 which is as high as it will take me.

    I was using absolute X because no matter where you are scrolled to on the layout, the numbers don't change. So, if I hover the mouse over the top left of the map I always get the same numbers. I thought that would make it consistent enough to plug into a formula, but I just can't get it to work at anything other than the default (not scaled) size.

    Let me know if I'm missing something or doing something wrong.

    I guess I'll keep at it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do to the lack of replies, I'll have to assume that this is not possible.

    I found out that the only stat that changes is the mouse absolute X. Everything else stays fairly consistent such as layout size, the position of the map, etc.

    The problem is that I cannot see any pattern or percentage to plug a formula into. When comparing fullscreen to default size, the absolute X values don't seem to fit a fixed percentage across the map. The left side and right side are not both exactly a certain amount higher. The right side is much higher.

    So, the left side abX value (on the minimap) might be 35 on default size, and 135 when fullscreen which is about 4.4 times higher, and the right side might be 156 on default and 315 on fullscreen which is only about 2 times higher.

    I don't know how to write a formula to allow for that. I am going to try a little bit more, and then maybe look at some plugins or something. If that fails, maybe I can just add points on the map that can be clicked to take me to a certain coordinate each (maybe have 50 or 100 points). I don't know yet.

  • I'm still not having much luck. It only has problems when the game is being scaled larger or smaller (such as running it fullscreen).

    Surely, there has to be a way to set it up to work.

  • Okay, so I have a minimap almost done, but there's one problem.

    I am setting it up so you can click on the map to scroll to that area.

    I am following this tutorial here: https://www.scirra.com/tutorials/271/ve ... nteraction

    It works absolutely fine on scale integer, but when I set the game to say "scale outer" and run it full screen in Chrome, it no longer works.

    It will, however, still work if I resize Chrome to make the game the same size as scale integer (so the "actual" size of the game I guess). It is 720p.

    Here is a picture of some of the code if it will help. I set up a camera sprite icon to help me see things for testing purposes.

    So yeah, basically I want to be able to scroll to a position by clicking the minimap even when the game is run at non-integer sizes. I thought that LayoutScale would do something, but it only says "1" every time I look at it, so that's not helpful.

    Surely, I'm missing something simple. Let me know if you need anymore information because I'm not sure what is causing the problem, or at least what variable or number I need to put in there to fix it.

  • Well, I'll make a couple comments.

    Nearly all of my crashes were because I hit a car that had passed already. It just seemed a bit awkward watching the car and seeing that it goes all the way off the screen before moving. Perhaps this is because it is too close to the bottom. I'm not sure. It could just be because I lack patience though.

    Also, I hope you are planning on adding some animations to the road/environment. It looks like the car is just sitting there.

    Well anyway, I hope that helps.

  • That new image 1 with the green background is looking pretty nice.

    Like I said before, come back to everything in a few days with fresh eyes, and you will see things you didn't notice before or you will get ideas you didn't think of. And keep experimenting. I have a huge collection of art from various sources that I use for both motivation and getting some ideas for art direction.

  • With the backgrounds added in, it's a toss up of 1 or 3 for me depending on which kind of style you like.

    1 has more outlines so it gives more of a cel-shaded look, which may or may not be what you want. The style of the game will determine that. If you get rid of some of that black texture on everything, it may help make is smoother.

    2 has a bit too much texture to me. I don't think it helps.

    3 is more organic and smooth which I like. I did not pick 3 originally because it looked way too overexposed. I think it is improved now though I would still be careful not to make it too bright.

    Now that you have more of "scene" than just a building sitting there by itself, you can continue to tweak and make better decisions. I always like to come back to things in a few days with fresh eyes. Also, feel free to try and ruin it and come up with happy accidents. I do this all the time, which is why I love digital. Make a backup and play with it until it breaks, and you may discover something you didn't think of.

  • Of those, the first one is the best since it looks the cleanest. The others look a little too photoshop filtery.

    Of course, it's a bad idea to design buildings without a background. You can put a lot of work into something and then find it doesn't fit the rest of the game. Work on landscapes and buildings together so they go well together, or at least have a placeholder background that's close to what you are going for that you can test with.