collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
884 stars 101 forks source link

npc look at player after interaction end #32

Closed SomeFire closed 5 years ago

SomeFire commented 5 years ago

I'm not sure how you will implement battles, but for now it is enough to have a reference to the Entity.

collinsmith commented 5 years ago

This isn't appropriate. Npc is intended specifically for Npc characters in town who are non-hostile (there is also NpcOutOfTown for Cain/Anya when they are rescued). That is written the way it is because my intention is to keep some of their state client-side so they look at the client-side player. If you open a couple copies of the original game, you can see this by how they face every player on their own screen.

If you look at data\global\excel\MonAi.txt you'll see a table of all discrete AIs in the game. I'm going to create a Monster AI class and then extend that for each of those for customization. So in all, there will be ~150 when it's done (I hope much less since many will not require as much custom code). I'm going to try and add in a simple Zombie or Fallen or Skeleton at first because those should be the most simple and writing those will help lay the groundwork for how the whole AI system will work.

SomeFire commented 5 years ago

Okay, we can have a collection of players, who interacting with NPC in the current moment. In the player's screen, we rotate NPC to that player character. So, every player will see how NPC look at his character. When all interactions end - NPC starts idle mode. Is it ok?

collinsmith commented 5 years ago

I'd like to wait to start implementing this. I think more of the network code needs to be added before this can be properly implemented. I've been developing a new package com.riiablo.net (which will maybe use flatc) which will replace com.riiablo.server in core. The entire entity system I've developed needs to be reworked along with the client-server model before I start making entity interactions like you're describing. Once this is done and you can actually test the 3 game engine modes (client, listen server, dedicated server) and test how the NPC interactions work on each (with single/multiple players), then I'll start thinking about implementing these kinda of features.