BD, you shall not ask for rational arguments with
THEATHRALIC words. you shall see. if you can not, give me your other ear to smash on.
The design of the protocol is a means, it is the way to the end, not the target.
That it is possible to add a value to an event and not break compatibility, was said before by zenzike and me in this thread. therefore, there was no need to explain that.
I made an argument, which renders this circumstance both positive and negative. you did not bring a contra argument against my negative argument, but instead repeated the positive argument. this was useless.
GFY wrote:As long as the AI can access what it expects there to be in the struct and the size of the variables in the struct it expects to find have not changed, which it wont as they're all going to be primitives, then the whole point is irrelevant.
The same error in your logic, still (plus some more); explanation:
using events, compatibility is not broken on a change, if
all of the following criteria are met:
* An argument is added
* It is added at the end of the struct
* If this argument is ignored, the event can still be used by the AI, the same way as before the addition of the argument
compatibility is broken, if
one of the following criteria is met:
* An argument is removed
* An arguments type changes
* The order of the arguments changes
* An arguments meaning changes, but the type remains the same
* A new event is added, which will render an AIs state inconsistent, if it is not handled
I do not know what you mean with special case functions.
About folding back to generic messages at the C++ level:
For perfect reproduction of the current C++ interface after the C interface, on the AI side:
You are right. For that, i would have to write special code that translates from a function call to an event call. This is not the way i want to do it. I explained my way, which you must have over read, so i explain it again:
in my model, there are no Events. also the C++ interface would not use events. there would be a default empty implementation of a virtual function (for each new event), which assures the same degree of compatibility we would have with an event. Both techniques make the AI ignore the new event, as long as the code is not adjusted to use the event, but not break compilation compatibility.
From an AI devs point of view:
* If i do not change my code, the event is ignored, which possibly renders my AIs state inconsistent, whether using functions or events.
* To know that there is a new Event, i have to:
- with events: look into the engines header file where the event structs are defined, and check if there is a new one.
- with functions: use my C++ IDE, and let it show me the list of local functions, and check if there is a new one.
* To use the new event:
- with events: parse the new event. make a new function actually handling the event. call that function
- with functions: override the function
I am not sure about this:
KAIK crashed when a unit was captured, as it did not handle ChangeTeamEvent.
someone else may call it a
FATAL fail for events.
I would say, this would possibly happen less with functions, as a new function in the concrete interface an AI dev uses is easier found then a new event struct in the header of the engines C AI interface (which no Java, C# or C++ AI dev should ever have to look into).
I got convinced by Tobi through rational arguments that functions are good, namely:
* no parsing to and from something -> fewer code, less coding work, faster code execution, lower complexity -> fewer errors overall
* highest possible compatibility
before that, i got convinced not to use VarArgs, by other rational arguments. i explained why i now think, that functions would be best. it therefore seems very possible to convince me, using rational arguments, that events are better.
but...
OP wrote:
You're sowing the seeds of gigantic headaches for us AI developers in the future, the very problems that we are trying to avoid by starting this in the first place.
I'm afraid if your unwilling to listen to me or to heed everyone else in this thread with this then Id have to withdraw my support for this endeavour and seek other solutions.
is not quite something that could do the job.
not to mention that it is incoherent with this:
IW wrote:
at least explain rationally the reasoning behind your decisions in a clear and coherent manner.
TheOne wrote:
We have a design, we have a plan of action, its been discussed, please don't deviate from it.
Saying "
We have a design", is obviously incorrect. It would have to be: Each one of us has a concept. Unless you are using the word "We" for your majesty only, of course.
This thread is for designing the interface. for creating a commonly agreed upon concept, influenced by arguments of all of us, to make it as good as possible. it is for letting everyone know how it will be, and why it should be like this; everyone that is affected or at least interested.
It is
not for sticking to the once made, initial concept. The discussion in this thread is not yet over, simply cause we do not yet agree. if you referred to an other discussion, that took place out of this forum, then it was a mistake of you to open this thread, and that you did not explain this concept in enough detail.
I am not an instrument, someone that codes something the way you want it. i am a coder - more or less active - in an open-source project. i am learning and trying to let my skills play a part in the design process.
An Example
function way:
Someone changes the C interface, adding an event, and forgets to adjust the C++ interface.
-> compilation fails
Everyone knows that something is wrong, we look at the SVN submits and find out who it was, we can explain it to him and fix it. the new function/event is visible in all the AI interfaces.
events way:
Someone changes the C interface, adding an event.
compilation is not broken, but the new event will stay hidden till it breaks the logic of AIs, as the AI devs will hardly find out about the new event otherwise. (smells a bit like psychology to me)
i may have a bit an other idea of the target of the C interface, then you have. but is yours the correct one? mine the wrong one? or is yours at least better? is yours the better one cause it was first? because without it, i would not have my own idea? is it better cause you made your own AI yet? or is it just your right to have the better idea, cause you are here longer then me, and wrote much more stuff for spring? that much, that you do not even have to explain why your idea is better? is your idea better cause you have been using C more then me? because you have more experience in development then I do in general? if so, how do you know that it is so? do you get it?
you are too arrogant DCP. step back, and see.
sorry for the repetition. there was some in this post and others.
Sorry also for the again bad structure of the post.
But maybe you are missing basic inter human communication skills and philosophical ones, which make your posts hard to read for me.
respect? please?
Joiju