Players vs monsters (unlimited god mode stabbing)

Started by Pakz, October 11, 2017, 19:51:31

Previous topic - Next topic

Pakz

Got back into doing some coding. I think I must have spend 5 hours working on this. It is mainly for use later(spare parts)

You can kill all enemies on the map and then a new map gets generated. You can not die.

https://cromdesi.home.xs4all.nl/emscripten/monstersrandommap/Untitled1.html

I based the game part I coded on the game Legend of Pandora. I created a monkeyx and monkey2 version of it.

Code can be found here :
https://github.com/pakz001


Steve Elliott

Coming along nicely, but the enemies get stuck in the walls.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

RonTek

This is nice.

Quote from: Steve Elliott on October 12, 2017, 10:35:17
Coming along nicely, but the enemies get stuck in the walls.

Yes, I also noticed that and with your other demos as well. Maybe you could replace your pathfinding method with A star instead?

muruba

Reminded me of Eagle's Nest :)


Pakz

The ai is supposed to do that. The ai only moves into the direction of the player. So they walk in to the walls. They are ment to be like dumb zombies like in the game I based them on.

I was thinking of adding a floodfill check to let them know if the player is further away and let them wander until the player is closer. (hearing/viewing distance)


Steve Elliott

Quote
The ai only moves into the direction of the player.

That's fine, but it looks odd when they embed themselves half-way through a wall.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pakz

Yeah, I used a simple collision method. I divide the position by the tilesize and check on the map if the position is a floor. Normally I do a rectsoverlap check and check the tile area around the entity so that it does not go into a wall. But this was faster and easier.

edit:
Come to think of it. In a lot of games players and entities go into the map(3d) If I would of made graphics I might have used some kind of shape like bushes and/or isometric view that would explain it.

RonTek

Quote from: Pakz on October 12, 2017, 16:44:38
I was thinking of adding a floodfill check to let them know if the player is further away and let them wander until the player is closer. (hearing/viewing distance)

That would be a nice improvement. It is kinda odd when those zombies has some sort of weird spider sense in some cases that they are moving towards the player's directions between layers of walls.

Pakz

I spend some more time modifying the code. I added better collision. Zombie Roaming. A new weapon (1 key (spear) and 2 key (gun)) And that Floodfill distance checking for the zombies. And F1 for new map.

Here the html5 monkeyx version :
https://cromdesi.home.xs4all.nl/html5/playervsmonsters/MonkeyGame.html

I might turn it into more of a game later on, not sure yet,

Pakz

https://cromdesi.home.xs4all.nl/html5/aitakingcover/MonkeyGame.html

I spend the night and morning creating a new arena. I was thinking about this yesterday. It is a topdown shooter where I ment to make the ai take cover positions. I used a* and several tricks to get the ai to behave in a fun way. Both the player and the enemy can shoot into 8 directions. There are obstacles on the map(walls) and each level has 10 enemies. When you or the enemies die a new level is generated.

The code is on my monkeyx github(pakz001)