2.4 plugins - first steps - eRobotPlayer

Questions, comments, and news on the server side plug-ins and it's API
Beardy
Private First Class
Private First Class
Posts: 50
Joined: Tue Nov 22, 2011 2:33 pm

Re: 2.4 plugins - first steps - eRobotPlayer

Post by Beardy » Sun Dec 04, 2011 6:31 pm

blast wrote:We'd do it properly and add support for the features to the API.
The problem is that you guys didn't (do it properly), and now have to emit 'fix-me-ups'.
blast wrote:He didn't suggest that you suggested that. He specifically mentioned writing a plugin. Please try to read all the words.
And he bashes my choice of language for doing it in --- as if I had suggested should switch his language to what I prefer to use. Read between the lines.
blast wrote:Again, try to read all the words. He specifically said the server.
Yes, he mentioned server. But do you know what 'context' means ?
blast wrote:The number of public Windows servers is either zero or could be counted on a single hand.
So he bashes me ("What a colossal waste of time this has been") because I was stupid enough to ask a legitimate question about the API and am not using his preferred choice of language ? Quite a way to make a new guy feel welcome people. Well done.
blast wrote:Also, popularity? What popularity? Have you seen the player counts lately? We are not popular.
Keep your warm welcomes up and you will become even less popular than before.

FYI: I'm using the server when I host LAN games, (viewing the result of) world-editing and experiments. If I would have had the client only I would have dropped the game quite a while ago.
blast wrote:
Beardy wrote:In short: Get off your high horse, you're not making much sense.
Sounds like some advice that you should follow yourself.
I have no idea what you mean here. As far as I can see I was defending myself from an unwarrented attack.
blast wrote:Because it's an API. That's what APIs do.
Bullsh*t. It does what the programmer wants it to do.
blast wrote:Allowing direct access to the internals of the server would lead to instability and wackyness
I supposed you missed the "(copies of)" and "(read) access" bits ? How would handling copies lead to instability ?
blast wrote:So, the proper way for your idea to work is to just extend the API to expose the necessary features.
The "proper" way would have been to inventorise before implementing.
blast wrote:Why are you so sure they are non-portable?
I'm was not. That is why I used "(afaics)".
blast wrote:The JS one appears to be usable with Linux and Windows, and probably OSX. It is written as a proper BZFS plugin and uses the V8 JavaScript engine that powers Google Chrome. So how is that not portable?
Because although I most Windows OSes have JS I do not use google chrome ? Poof. In that case not even portable within the same OS.

But yes, I did not realize that VC8 could have such support build-in.

Beardy
Private First Class
Private First Class
Posts: 50
Joined: Tue Nov 22, 2011 2:33 pm

Re: 2.4 plugins - first steps - eRobotPlayer

Post by Beardy » Sun Dec 04, 2011 6:34 pm

JeffM wrote:Also you should note that it is possible to build bzflag on windows using minGW (the windows port of GCC).
Although you guys do not support it, do you know if thee is a specific version needed for 2.4.0 ?

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5119
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: 2.4 plugins - first steps - eRobotPlayer

Post by JeffM » Sun Dec 04, 2011 7:04 pm

minGW;

We don't maintain instructions on how to do it, but I believe it should build with the current version ( we don't do anything to specifically prevent it from working). minGW builds would use steps very similar to the linux build system so looking at those documents would be a good place to start. Since it would be linux style it would use .so files for plug-ins and SDL for graphics instead of dll files and directX. The version of minGW would need to be comparable to the versions required for gcc on linux and the mac. I personalty do not do much with command line builds so I would not have any specifics for you, sorry. There may be some forum posts that you can search with info that others have made.

Languages;
JavaScript is an interpreted language, as long as you have a compatable interpreter on the host OS the code would run, it is not tied to architecture in any way. There are differences in interpreters and they have differences in how they run scripts sure, but that's not the same thing. JS is a scripting language and not a good choice for stand alone application development. Interpreted languages or even languages that compile down to VM code are inherently portable when compared to assembly and it is like comparing apples and oranges.

That said I don't think JS is a bad choice for embedded scripting in an application in a similar way that lua is used.

If I was going to rewrite bzflag I'd do it in C# using .net and mono for portability, then we'd have one bin for all OSs and could do much simpler distributions. I would embed a JS or lua engine into both the client and server for extensibility/custom scripting as well.

Moving On;
But this is all getting nowhere, Yes the API does not contain all things, we implement what we think people would need the most, this was an oversight. Mostly due to the fact that in 2.4 there was a change with how we stored the player data. Observers are a team not, not a player type, and can be both bots and humans so it did not make sense to keep them in the same enumeration. This is an excellent example of a change that would have broken if we had simply exposed raw structures.

I was just trying to be nice and add the API call for you......

An API is an interface, we defined it and published it, so it does what we wanted it to do. It was intended to let people modify commonly changed aspects of the server in a way that would not change all the time, not to allow any and all modifications. Sorry if it doesn't have what you want, as you have seen you can do whatever you wish, I just felt it was not in the spirit of open source like you had mentioned before.

For the level of changes you want, and the mindset you seem to have, it sounds more like you want to just edit the server outright. Some people do that and that's perfectly fine.

So the API call is in there in SVN, you can get it if you want by building from source or using the installer I provided. That should just about finish up this thread I think as your original post has been addressed.


If you would like to discuss it more please come into IRC and we can chat about it.

User avatar
blast
General
General
Posts: 4590
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: 2.4 plugins - first steps - eRobotPlayer

Post by blast » Sun Dec 04, 2011 7:09 pm

In any case, I think this topic has gone on long enough, and the original issue has been resolved.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

Beardy
Private First Class
Private First Class
Posts: 50
Joined: Tue Nov 22, 2011 2:33 pm

Re: 2.4 plugins - first steps - eRobotPlayer

Post by Beardy » Sun Dec 04, 2011 7:47 pm

JeffM wrote:JavaScript is an interpreted language, as long as you have a compatable interpreter on the host OS the code would run, it is not tied to architecture in any way.
Under Windows JS is exposed as an OCX/Active-X component, object-oriented (much like VC8 uses).

But as I have found that browsers do not expose the same APIs and you mentioned a specific one I could not help but make the remark I did.
JeffM wrote:For the level of changes you want, and the mindset you seem to have, it sounds more like you want to just edit the server outright.
Actually, I did not again start to write a shell, this time around the server-program (as I already did for the client), as I wanted to get aquainted with plug-ins. That with the thought that I could maybe create and share stuff (ideas or even the binary plugins) that could be used by other BZFlaggers. Currently I'm not so sure anymore I still want to.

Give it a few days, maybe I can shake the feeling I've now got. If not ... well, it was nice while it lasted.
JeffM wrote:If you would like to discuss it more please come into IRC and we can chat about it.
Sorry, no IRC or anything like it. Tried it and found it too distracting.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5119
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: 2.4 plugins - first steps - eRobotPlayer

Post by JeffM » Sun Dec 04, 2011 7:51 pm

Sharing them is nice, but if they are not written in C++ they will not be usable by anyone other then yourself.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest