![]() |
hey stefan...
Just got the realbot code in the CVS server but...
in cNodeMachine::add function (hmmm, maybe that cNodeMachine means more a char variable called NodeMachine, the class name may should be CNodeMachine) Code:
// record jumping |
Re: hey stefan...
IN_JUMP is set in a player's v.button when this player is pressing the JUMP key on its keyboard.
Identically, IN_DUCK is set when this player is pressing the CROUCH key. v.button is a bitmap of the available keyboard entries that are not client commands, such as movement keys. |
Re: hey stefan...
what he meant was he found a bug...
theres a semi-colon after the if statement making the other statement always run and the if statement does nothing.. |
Re: hey stefan...
@PM: the comment I added is "what is this ;(semicolon) ?", not "what is this ?" :)
Code:
// test file, if found = STEAM Linux/Win32 dedicated server So I am using a check like this: Code:
// Check which version of Counter-Strike we're running Code:
C_DLLEXPORT int Code:
* Source code is (c) copyrighted by Stefan Hendriks unless stated otherwise. Quote:
|
Re: hey stefan...
hahahahaha :D
GPL rul3z!!! |
Re: hey stefan...
there is a bug in the IN_JUMP part, you are correct.
about the copyright, i wrote some parts completely myself (from scratch) like the INI file parser and such (and the nodemachine). Therefor these portions of code are 'copyrighted' , the other source files (as for metamod) are gpl'd, thats how i see it. edit: updated source file NodeMachine.cpp ow, and btw. I don't think there _IS_ a problem with the comments about copyright and such. As by releasing the source, and announcing that on the site there is 'explicitly announced' that its free to use... |
Re: hey stefan...
Quote:
Don't know if you're aware of it but just these days in the Netherlands a software firm was put to trial for being in violation of the GNU GPL (the firm was using GPL code in a commercial project but wanted non disclosure for the source code of the project I think) in other terms: PWNED :P |
Re: hey stefan...
...and the GPL isn't designed to take away your 'copyright', you maybe mis-understood it:
Quote:
Quote:
This isn't correct, since the GPL is the license from the software author to the users. So whatever I'm doing with my OWN code isn't "violating" the GPL (i.e., if I downloaded Stefan's GPL code, then Stefan is limiting my use of the code with the GPL, but his OWN code isn't limited to use - if he hasn't convert the bot to a metamod plugin and become limited by Will Day). In other words, if I created a software 100% myself and not using other's GPL code, I can do WHATEVER with the code as I want. So the fact for Stefan is: he has to release all the Realbot code under GPL, but whatever using his OWN code in other software which doesn't contain OTHERS' GPL code is OK. |
Re: hey stefan...
hehe, you know. When reading all this, i think "hell, i don't care, its open-source now"... hey, its open source or its closed! So its open source. Perhaps i should just remove those 'copyright' things in the comments to prevent some misunderstandig.
|
Re: hey stefan...
Nope, even if Realbot is under GPL the Realbot code IS (C) Copyright Stefan Hendriks (maybe Christian Authmann as well) and protected under appliable copyright law. So you had better not remove that Copyright notice.
Why you have to release your source code is: You have used code which is (C) Copyright Will Day and you have to obey his license. What has something wrong is: you are restricting the redistribution as that way. Actually that's also NOT "violating" GPL, but by applying the GPL that clause just turned into nothing. I thought you don't want your software to be redistributed so I pointed that out. (and if you do want others redistribute the software perhaps you should remove that instead of the copyright thing :) ) (btw, has Christian Authmann "offically widdrawn (withdrawn)" now ?) |
Re: hey stefan...
okay, forget about this GPL thing if you don't like it. And that's also not on topic - I started this post to help you with the Realbot. And I'm just saw both you and PM have some misunderstanding with the GPL, I just wanted to make things clear. Sorry.
now back to my first intent: Here's some suggestions to Realbot: - Use a switch to toggle on/off that Parabot-like autowaypointing function. IMHO when I have played the map for quite a long time the autowaypointing thing is just unnecessary then and just a waste of CPU power. - Use malloc() for these things may take less memory: Code:
private: - Compress the waypoint data to make the file smaller. There is a good compress code in the PODbot code, maybe you can make use of it. (also sorry for post these things not in organized way - but I don't think I can become a Team member because I can't work on Realbot that much. And I did learnt something in your code so thanks a lot) |
Re: hey stefan...
at the moment the nodemachine is static, and its on purpose static... Although i understand this eats memory. It also ensures its all memory that its needed. I also don't have to worry about bad allocations yet. I am not good at handling dynamic memory. most stuff is btw only a few K of memory so i don't think this should be considered 'critical'.. ;)
what did you learn from the code? |
Re: hey stefan...
Code:
C_DLLEXPORT int The hooks in GetEntityAPI2 are called *BEFORE* the real gamedll funcs get called, and those in GetEntityAPI2_Post are called *AFTER* the real gamedll funcs get called. So in this way all of YOUR functions in the plugin are called _twice_ when one of the gamedll funcs gets called by engine. So the GetEntityAPI2_Post should be only like this: Code:
C_DLLEXPORT int |
Re: hey stefan...
i know the Post function is called AFTER the gamedll functions. And this is on purpose btw. PMB once posted a fix for bots not seeing through all glass/windows. I simply copied the entire function, i did not comment out some parts, this could be done though. Its more like lazyness ;)
|
Re: hey stefan...
"And this is on purpose btw."
...then IMHO you are doubling the cost of CPU powers, the chance of server crashes and creating some memory leaks "on purpose". ;) |
Re: hey stefan...
well, the fact that some functions do get called twice is on purpose , to fix a bug as stated before ;) Anyhow, there is no point in causing memory leaks and doubling cpu power on purpose, unless your name is Microsoft :D (moving this thread to the RealBot "source" forum)
|
Re: hey stefan...
My fix for the glass bug was not to call the same function twice! You misunderstood it I see.
You mustn't call the same function twice, you must call 2 DIFFERENT, SUCCESSIVE HOOKS, for the Spawn() function. The first hook occurs BEFORE the actual Spawn() function from the gameDLL is called: it's the normal hook your code already uses. It tells you that an entity is about to be spawned. This hook is declared in metamod's gFunctionTable. The SECOND hook, which IS the fix, occurs AFTER the actual Spawn() function from the gameDLL is called, in order to "correct" one parameter in the entity which has just been spawned. And since we want to do this AFTER the entity has spawned, we must then declare it in metamod's gFunctionTable_Post table. Whistler is completely right, and your GetEntityAPI2_Post function should be just like what he says. There has never been any "purpose" in calling the same functions twice but to produce horrible things like memory leaks, array indices getting out of bounds, and general fuckups everywhere. I'm starting to be more and more convinced that RealBot is driven by magic! o_O |
Re: hey stefan...
Lol. Well yeah, i do learn from Harry Potter a lot ;) I will fix this thing asap.
|
Re: hey stefan...
Hmm, one question though:
C_DLLEXPORT int GetEntityAPI2_Post (DLL_FUNCTIONS * pFunctionTable, int *interfaceVersion) { gFunctionTable_post.pfnSpawn = Spawn_Post; // need to declare another gFunctionTable_post in the top of the dll.cpp file memcpy (pFunctionTable, &gFunctionTable, sizeof (DLL_FUNCTIONS)); return (TRUE); } this code , which is from Whistler in the above post, it has in the last line: memcpy (pFunctionTable, &gFunctionTable, sizeof (DLL_FUNCTIONS)); shouldnt it be: memcpy (pFunctionTable, &gFunctionTable_post, sizeof (DLL_FUNCTIONS)); ? |
Re: hey stefan...
yeah, that's a typo error
|
Re: hey stefan...
roger :)
|
Re: hey stefan...
Okay, i have re-read the entire thing over. And i now fully understand it, and its applied to the source (updated on CVS, so you can do 'update' now).
|
All times are GMT +2. The time now is 08:57. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.