ketoo / NoahGameFrame

A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
https://github.com/ketoo/NoahGameFrame/wiki
Apache License 2.0
3.92k stars 1.09k forks source link

Which classes and properties are a "must have"? #261

Open ramonmolossi opened 3 years ago

ramonmolossi commented 3 years ago

Hi,

I am in the process of learning the framework and after reading all the wiki pages and some of the closed issues I was able to put everything running, which includes Unity Client and debug both client and server in vsCode.

When I started to try some modifications in the Logic Classes I could not, cause I am using a Manjaro Linux and Libre Office. LibreOffice generates excel files differently when using boolean values, zeros and ones, and the NFFileProcess and "miniExcel" couldn't read my files anymore after modifications.

So I started to write a new "Generator", written in Java using a relational database.

One of the final steps I have create was a validation to the "ref" properties and have found in the NPC Class you included a "DropProbability" property with Ref="1", is this correct?

I'm trying to get rid of everything that is not essencial to the core framework, cause 'less is more' when you are learning the basics.

But I found that, for example, I can't mark NPC::EffectData as non-Ref and remove EffectData without getting an error message. I can't remove InitProperty and niether the 'DefaultObject' NPC.

It's really hard to understand this part of the logic of the 'startup'.

I would appreciate if u please took some time to explain:

The wiki is actually very good, I was able to implement the chat system, new messages in the UnityClient, listeners, but the topics above have been forgotten.

Some others considerations:

One additional contribution:

-I am running redis on a docker system, you should consider to dockerize the GameServers:

DOCKER - https://hub.docker.com/_/redis?tab=description

Pull image docker pull redis:6.0.5-alpine

docker run -v /home/yourusername/GameDev/redis-6.0.5/redis.conf:/usr/local/etc/redis/redis.conf -p 6379:6379 --name redis-0 -d redis:6.0.5-alpine redis-server /usr/local/etc/redis/redis.conf

Below parameters explanation:

set the redis.conf -v /home/yourusername/GameDev/redis-6.0.5/redis.conf:/usr/local/etc/redis/redis.conf

expose port to access from Host -p 6379:6379

set the container name --name redis-0

set the image to run detached -d

set the image version redis:6.0.5-alpine

command line to run redis-server /usr/local/etc/redis/redis.conf

Starting docker container docker start redis-0

Stopping docker container docker stop redis-0

ketoo commented 3 years ago

Thanks for your high-value feedback.

ramonmolossi commented 3 years ago

I'll use some Wow Classic references to better try to explain and you let me know if I understand all correctly.

In Wow Classic "Job" could be Hunter, Warrior, Mage... And "Level" is 1 to 60.

When first start your character have certain Job(chosen by you) and Level 1 as default.

Then the framework will search for this pair(Job/Level) in the InitProperty.xml and get the "HeroConfigID" attribute. Probably HeroConfigIDEx is not used.

Since this HeroConfigID is a Ref=1, it gonna search for it in any class. By your default game design you chosen "DefaultObject", an instance of NPC class which have the attribute EffectData(ref=1).

You said this "DefaultObject" act as just a guideline for your designers. So each pair of Job/Level probably need your own NPC instance(ini values) to act as a placeholder for values used as constraints of the Player(both NPC atrributes and effectData attributes:maxHP,minHP,etc) And some NPCs attribute are not used in these cases, for example ShowName.

That said, lets get some example, Hunter(Job=0) Level 1 can have maxHP 200. Hunter(Job=0) Level 2 can have maxHP 300. Warrior(Job=1) Level 1 can have maxHP 400. Warrior(Job=1) Level 2 can have maxHP 800.

If you have 5 Jobs, 60 Levels, you'll need 300 "Dummy NPCs" and 300 different EffectData(of course u can reuse them, as well as NPCs).

And problably these "Dummy NPCs" will not be used in your Scenes Xml ("Scenes/1.xml", etc..)

ENPCType is not used for this purpose, is it? enum ENPCType { NORMAL_NPC = 0; // HERO_NPC = 1; // TURRET_NPC = 2; // };

ketoo commented 3 years ago

Yours understand all correct.

Normally all you only need the ENPCType is NORMAL_NPC if you are not developing a game like DOTA.