.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Problem
Old
  (#1)
jC-
Guest
 
Status:
Posts: n/a
Default Problem - 21-02-2004

Well, I've been learning C++ and I wanted to test what I know. So I decided, I like a mod and it could use some bots. So I downloaded botman's bot template (thank you). Now before I got started I started reading the read-me. It says that if I do a couple things (add the MODNAME_DLL in bot.h, add the entities into linkfunc.cpp and add the reading of the mod's dll in h_export.cpp). So I thought before I started putting in the code that I want I'll make sure everything works fine. So I do all that and put the .dll file into the mod's dlls folder then change the libist.gam file to read the .dll. I go into game (this would be Steam) and when I create a game it just crashes. I don't see why it would crash. I've tried a couple things and I will continue trying but if somebody knows what I should do to keep it from crashing, it would be greatly appreciated. Thanks in advance. And Hi I'm new .
  
Reply With Quote
Re: Problem
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Problem - 21-02-2004

It crashes because you haven't paid enough attention to the readme

There is an exchange of functions between the engine and the game DLL. First the engine and the game DLL meet each other through the GetEntityAPI() and GiveFnptrsToDll() functions, and they go like this:

- Hello, I'm the game DLL. I have code to run when you will make my entities spawn, touch each other, use each other, and behave in some way. Here it is.
- Hello, I'm the engine. Nice to meet you. And I, can provide you with a bunch of useful engine functions to do specific computations, play sounds and move entities around in the game. Here they are.
- Okay, thanks. Here's my list of entities and the functions to call when you'll make each of them "think". Keep track of it all somewhere will you ?
- Great, is there something else you have for me ? New DLL functions perhaps ? Or a new model blending interface ?
- Hold on, lemme see.... um, no.
- Okay, we're fine then. Ready ? Let's go.

This little imaginary dialogue represents the GetEntityAPI, GiveFnptrsToDlls, LINK_ENTITY_TO_FUNC, GetNewDllFunctions and SV_GetBlendingInterface steps of the engine<->DLL attachment process. Your bot DLL is a game DLL too, for the engine. And it also behaves like an engine for the REAL game DLL that's behind it. But what happens here is that your bot DLL tells the engine it exports a certain number of entities (of which the engine is fine), but then, the REAL game DLL tells the bot DLL it exports ANOTHER, different, set of entities (since it's not the same game). The game DLL then can't link all of them; there are some entities it knows, because they are very common between all MODs (such as "worldspawn", "player", "light_entity", etc.), but there are some of them which sound like "func_specialentitythatnobodyknows" and the bot DLL simply doesn't know what to do with them. Thus, the bot DLL only passes a PORTION of the original entity set from the game DLL to the engine, and when the game wants to run, it doesn't find those entities registered correctly by the engine side and so it crashes.

To make a hook DLL such as the HPB_bot run with a particular MOD, you have to compile it so that it exports correctly ALL the entities that the real game DLL already exports. Else it won't work. Read the readme again



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Problem
Old
  (#3)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Problem - 21-02-2004

Wow, that's a really nice user friendly description of the engine loading the game DLL!

What Pierre-Marie is saying is that the MOD game DLL will export some custom functions. There is a utility in the HPB bot source code (not the HPB bot template source code) called "exports.c" that will dump the functions exported from a game DLL (you can also use the Microsoft Visual Studio utility 'dumpbin /exports' to do this).

Dump the exported functions from the game DLL and compare that list to the stuff in the linkfunc.cpp file (you can ignore any exported functions that begin with an underscore '_'). Any new exported functions that come from the MOD game DLL that aren't already in linkfunc.cpp need to get added to linkfunc.cpp so that the engine can spawn entities that are custom to that MOD.

botman
  
Reply With Quote
Re: Problem
Old
  (#4)
jC-
Guest
 
Status:
Posts: n/a
Default Re: Problem - 21-02-2004

I can map I know what entities are :p

I guess I didn't get them all.

*Edit*

Still not working >_>

*Edit*

Last edited by jC-; 21-02-2004 at 21:06..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com