October 21, 2017, 02:06:12 AM

Author Topic: Players vs monsters (unlimited god mode stabbing)  (Read 216 times)

Offline Pakz

  • Jr. Member
  • **
  • Posts: 48
    • My homepage
Players vs monsters (unlimited god mode stabbing)
« on: October 11, 2017, 07:51:31 PM »
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

Offline muruba

  • Jr. Member
  • **
  • Posts: 91
    • Ivelle Games
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #1 on: October 12, 2017, 10:30:00 AM »
Very good :)

Offline Steve Elliott

  • Sr. Member
  • ****
  • Posts: 482
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #2 on: October 12, 2017, 10:35:17 AM »
Coming along nicely, but the enemies get stuck in the walls.
Windows 10, 64-bit, 8Gb RAM, CPU Intel i5, 3.2 GHz
Nvidia GeForce GTX 750 Ti (2Mb)

Offline RonTek

  • Full Member
  • ***
  • Posts: 220
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #3 on: October 12, 2017, 11:18:52 AM »
This is nice.

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?

Offline muruba

  • Jr. Member
  • **
  • Posts: 91
    • Ivelle Games
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #4 on: October 12, 2017, 11:27:54 AM »
Reminded me of Eagle's Nest :)


Offline Pakz

  • Jr. Member
  • **
  • Posts: 48
    • My homepage
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #5 on: October 12, 2017, 04:44:38 PM »
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)


Offline Steve Elliott

  • Sr. Member
  • ****
  • Posts: 482
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #6 on: October 12, 2017, 05:51:47 PM »
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.
Windows 10, 64-bit, 8Gb RAM, CPU Intel i5, 3.2 GHz
Nvidia GeForce GTX 750 Ti (2Mb)

Offline Pakz

  • Jr. Member
  • **
  • Posts: 48
    • My homepage
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #7 on: October 12, 2017, 07:15:20 PM »
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.

Offline RonTek

  • Full Member
  • ***
  • Posts: 220
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #8 on: October 13, 2017, 04:11:08 PM »
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.

Offline Pakz

  • Jr. Member
  • **
  • Posts: 48
    • My homepage
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #9 on: October 14, 2017, 07:54:02 AM »
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,

Offline Pakz

  • Jr. Member
  • **
  • Posts: 48
    • My homepage
Re: Players vs monsters (unlimited god mode stabbing)
« Reply #10 on: October 19, 2017, 07:42:01 AM »
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)