|
Post by gazj82 on May 31, 2015 12:09:36 GMT
Hi AGD Peeps,
I am making a maze game pacman like. I have managed to make enemies take random paths around the maze quite well. I would like to make some enemies head to a certain point in the maze (pathfinding I guess), but it doesn't have to be the shortest route providing they get there. I can post the general moving around the maze randomly code here if needed.
Thanks Gary
|
|
|
Post by andrewvanbeck on Jun 1, 2015 6:51:03 GMT
I would store the players X and Y position in variables, then use that to help decide which way the enemy should move. Like, if the enemy can move left and the stored player Y < enemy Y, then head left. You might have to design your mazes with this in mind, otherwise enemies could get stuck in loops when the player is at certain positions. Also, if you leave in some random elements, like a 1 in 6 chance of taking a direction regardless of if it gets the enemy closer to the player, that way it might avoid loops and even appear more intelligent than it is.
|
|
|
Post by gabriele1969 on Jun 2, 2015 10:21:59 GMT
|
|
|
Post by andrewvanbeck on Jun 2, 2015 10:44:33 GMT
That looks great Gabriele, really like the way you've coloured the sprites.
I was messing around with the dig command, and got a pacman type game setup, but then without a 'CANDIG' command, or any way to detect for fodder I couldn't find a way to detect when the screen has been cleared. My plan was to just have a sprite move over the whole screen and check it for leftover fodder. It's a shame, because the dig function is quite neat and doesn't have the same issues as PUTBLOCK, but it's held back by not storing the dug blocks (not even with the adventure setting) and not being able to detect fodder blocks.
|
|
|
Post by gabriele1969 on Jun 2, 2015 12:57:08 GMT
That looks great Gabriele, really like the way you've coloured the sprites. I was messing around with the dig command, and got a pacman type game setup, but then without a 'CANDIG' command, or any way to detect for fodder I couldn't find a way to detect when the screen has been cleared. My plan was to just have a sprite move over the whole screen and check it for leftover fodder. It's a shame, because the dig function is quite neat and doesn't have the same issues as PUTBLOCK, but it's held back by not storing the dug blocks (not even with the adventure setting) and not being able to detect fodder blocks. that is right: you cannot use dig for a multiscreen pacman. So i ended up using putblock ...problem is when a sprite crosses your putblock it will leave a "footprint" of it.. pacman-19.z80 (63.16 KB) (i used dig for when pacman chomps the walls however) here is my file if it can be f any use for you guys (i don't think i will continue on this project ) Gab
|
|
|
Post by gazj82 on Jun 3, 2015 14:20:37 GMT
I did manage to kinda figure it out, they make it to my specified position eventually Hopefully I shall have a finished game if I can get some time on it at the weekend.
|
|
|
Post by andrewvanbeck on Jun 3, 2015 14:37:49 GMT
Good stuff, hope to see it released soon - just remember to save often and backup regularly - it's the last few hours of development that'll catch you out I found that having enemies being too good at finding you is not a lot of fun, it's better to be able to get away and outsmart them sometimes. Especially with AGD games, because typically it's real difficult to have varying movement speeds, not with just 3 variables per enemy, so the player and enemies usually move at the same speed, and an enemy who heads straight for the player 100% of the time is just impossible to make playable. Anyway, keep at it - I get a great buzz from finishing a game and loading it up on a real speccy for the first time - it truly is better than releasing on other platforms.
|
|
|
Post by gazj82 on Jun 3, 2015 16:11:11 GMT
Good stuff, hope to see it released soon - just remember to save often and backup regularly - it's the last few hours of development that'll catch you out I found that having enemies being too good at finding you is not a lot of fun, it's better to be able to get away and outsmart them sometimes. Especially with AGD games, because typically it's real difficult to have varying movement speeds, not with just 3 variables per enemy, so the player and enemies usually move at the same speed, and an enemy who heads straight for the player 100% of the time is just impossible to make playable. Anyway, keep at it - I get a great buzz from finishing a game and loading it up on a real speccy for the first time - it truly is better than releasing on other platforms. I know the feeling of losing work. I have already finished a couple of games before, arcadegamedesigner.proboards.com/thread/203/new-game-terrahawks-killer-beesThe new game will be a G7000 port like the last two.
|
|