HLFX.Ru Forum
профиль •  правила •  регистрация •  календарь •  народ •  FAQ •  поиск •  новое •  сутки •  главная •  выход  
HLFX.Ru Forum HLFX.Ru Forum > Теория и практика > Half-Life SDK > Zbot implementation in Half-Life 1
Is it possible?
  Предыдущая тема   Следующая тема
Автор
Тема Новая тема    Ответить
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Question Zbot implementation in Half-Life 1

Hello Community.
I hope you're doing good. I have a question, that might sound stupid.. never the less... I'll ask.

Is it possible to implement the reverce engineered Zbot from CS to Half-Life 1?

Here's the repository:

https://github.com/s1lentq/ReGameDL...amedll/dlls/bot

Thanks in advanced.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 212607

Старое сообщение 04-02-2023 13:56
- За что?
Ku2zoff
Мастер Ёда из Деревни Дуракоф

Дата регистрации: Apr 2007
Проживает: В Деревне дураков
Сообщений: 6749
Возраст: 33

Рейтинг



https://github.com/FWGS/hlsdk-porta...ee/hlzbot-clean
https://github.com/FWGS/hlsdk-porta...-random-weapons

Сообщить модератору | | IP: Записан
Сообщение: 212618

Старое сообщение 06-02-2023 12:09
- За что?
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Sweet. I was not aware this was done. Thanks, I hope I can pull it out.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 212634

Старое сообщение 07-02-2023 22:02
- За что?
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Ok, I managed to port them to the HL SDK 2.3, there were few stopping points as the bot code used deprecated functions since 2005... and until I figured out what was wrong with it.. It took me some time...

Now, I noticed that the bots are quite aggressive, but that's good. I see that I can use the BotProfile.db files from Condition Zero to manipulate the behavior of the bots... the question is how can I make the bots to use different skins?

At the moment they are all joining with "gordon" player model... and that's a bit odd... I opened the db file (it's text file) and I don't see anything that resembles the player model name or path...

Any help would be appreciated.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 212853

Старое сообщение 21-02-2023 22:03
- За что?
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Here are a little more details:

So I was looking at the code for the bot profiles:

https://github.com/FWGS/hlsdk-porta...bot_profile.cpp

It should be able to use the player models in the models/player folder, if I understand correctly this piece of code:

C++ Source Code:
1
const char *decoratedName = GetDecoratedSkinName(skinName, filename);
2
bool skinExists = GetCustomSkinIndex(decoratedName) > 0;
3
if (m_nextSkin < NumCustomSkins && !skinExists)
4
{
5
  // decorate the name
6
  m_skins[ m_nextSkin ] = CloneString(decoratedName);
7
 
8
  // construct the model filename
9
  m_skinModelnames[ m_nextSkin ] = CloneString(token);
10
  m_skinFilenames[ m_nextSkin ] = new char[ Q_strlen(token) * 2 + Q_strlen("models/player//.mdl") + 1 ];
11
  Q_sprintf(m_skinFilenames[ m_nextSkin ], "models/player/%s/%s.mdl", token, token);
12
  ++m_nextSkin;
13
}


What I don't completely understand is this:

"models/player/%s/%s.mdl"

Does it suppose to load models/player/ <model fodler> / <model_name>.mdl ?

Aditionally I have attached the BotProfile.db (as .txt file, it's a simple renamed .txt to .db file). If you look there you can see this:

C++ Source Code:
1
//
2
// All profiles begin with this data and overwrite their own
3
//
4
Default
5
Skill = 50
6
Aggression = 50
7
ReactionTime = 0.3
8
AttackDelay = 0
9
Teamwork = 75
10
WeaponPreference = none
11
Cost = 0
12
Difficulty = NORMAL
13
VoicePitch = 100
14
Skin = 0
15
End
16
 
17
//----------------------------------------------------------------------------


This is supposed to be responsible for the Default bot profile, and the others are created as derivates from it... but the question is... How to specify the player model?

Any help on this one would be greatly appreciated.

Thanks.

Вложение: botprofile.txt (10.3 кб)
Этот файл был скачан 34 раз.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 212866

Старое сообщение 22-02-2023 10:06
- За что?
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Hello, This is fixed btw.

The bot didn't had logic for calling the change of the player models.

And the fix was trivial...

C++ Source Code:
1
#define MAX_SKINS 10
2
 
3
char *bot_skins[MAX_SKINS] =
4
{
5
  "barney",
6
  "gina",
7
  "gman",
8
  "gordon",
9
  "helmet",
10
  "hgrunt",
11
  "recon",
12
  "robo",
13
  "scientist",
14
  "zombie"
15
};


Then under:

C++ Source Code:
bool CHLBotManager::AddBot(const BotProfile *profile)


This line to utilize the models we defined:

C++ Source Code:
SET_CLIENT_KEY_VALUE(pBot->entindex(), GET_INFO_BUFFER(pBot->edict()), "model", bot_skins[RANDOM_LONG(0, 9)]);


Side note: I think the author of a post, should be allowed to edit his own post... Look at me for example... I have 3 posts that could have been just 1...

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 212882

Старое сообщение 22-02-2023 19:54
- За что?
[CFR] B@N@N
Житель форума

Группа: Неопытный
Дата регистрации: Feb 2018
Проживает: Default City
Сообщений: 174
Возраст: 31

Рейтинг



Any videos how this bot works in HL?

Сообщить модератору | | IP: Записан
Сообщение: 212992

Старое сообщение 25-02-2023 18:02
- За что?
Napoleon321
Admiral

Дата регистрации: Jan 2017
Проживает: Sofia
Сообщений: 57
Возраст: 34

Рейтинг



Well here's a video of the bots in action on crossfire.

https://www.youtube.com/watch?v=g2tQuDFi7WM

Don't expect miracles, but still.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!

Сообщить модератору | | IP: Записан
Сообщение: 213235

Старое сообщение 08-03-2023 13:03
- За что?
Тема: (Опционально)
Ваш ответ:



Переводчик транслита


[проверить длину сообщения]
Опции: Автоматическое формирование ссылок: автоматически добавлять [url] и [/url] вокруг интернет адресов.
Уведомление по E-Mail: отправить вам уведомление, если кто-то ответил в тему (только для зарегистрированных пользователей).
Отключить смайлики в сообщении: не преобразовывать текстовые смайлики в картинки.
Показать подпись: добавить вашу подпись в конец сообщения (только зарегистрированные пользователи могут иметь подписи).

Временная зона GMT. Текущее время 22:49. Новая тема    Ответить
  Предыдущая тема   Следующая тема
HLFX.Ru Forum HLFX.Ru Forum > Теория и практика > Half-Life SDK > Zbot implementation in Half-Life 1
Is it possible?
Версия для печати | Отправить тему по E-Mail | Подписаться на эту тему

Быстрый переход:
Оцените эту тему:

Правила Форума:
Вы not можете создавать новые темы
Вы not можете отвечать в темы
Вы not можете прикреплять вложения
Вы not можете редактировать ваши сообщения
HTML Код ВЫКЛ
vB Код ВКЛ
Смайлики ВКЛ
[IMG] Код ВКЛ
 

< Обратная связь - HLFX.ru >

На основе vBulletin
Авторское право © 2000 - 2002, Jelsoft Enterprises Limited.
Дизайн и программирование: Crystice Softworks © 2005 - 2024