Page 1 of 1

Current Status?

Posted: Thu Apr 21, 2016 19:05 UTC
by tjmonk15
What is the current status of the code? Which branch is the furthest along? What needs to be done to get it functional again?

- Monk

Re: Current Status?

Posted: Sat Apr 23, 2016 13:53 UTC
by TheMightyDude
TBH, I haven't really been well enough to check.
The last time I recall a lot of code was changed in the codebase which was the start of separating the logic and the graphical side of things, sadly that halted to some disagreement and lack of time and them my ill health took toll.

I did test a week or two ago the state of the live code that I use to run on here and that just blatantly failed to work, so I did try and use the code in the codebase and that failed even worse.

I am running the following on here:

Code: Select all

APACHE: v2.4.7
   PHP: v5.5.9
 MySQL: v5.5.47
Most of the errors that I got on the live games code was down to changes in PHP and MySQL which I knew would happen, the codebase issues was down to how we have split up the code and errors here and there also the changes in PHP and MySQL added to this.

At this current time I have been toying with an idea that I had several years ago that no dev wanted to do which is understandable due to all the work needed to be done, but this would remove the issues in hosts blocking mail ports and trusting 3rd part people with your login credentials.

I will explain more on this in its own thread due to it isn't sort of BNT related.

I am not saying its the end for BNT, only that its the end of how we use to run BNT, you will understand more in the new post that I will be posting sometime today.
And if all goes well, it will allow for loads of people that have preferably root/shell access to their server(s), but like I said I will explain all this in its own thread.

Re: Current Status?

Posted: Sat Apr 23, 2016 16:49 UTC
by tjmonk15
Hey TMD,

Long time no talk :) Sorry to hear that you aren't doing to well these days :(

Let me say this, and hope it clarifies my questions a bit more. I downloaded the latest revision of the code from SourceForge and was playing around with it. I poked around, and ended up using the "original" branch. The only issues I had getting it up and running were getting IIS to behave. Beyond that I was able get it running on:

IIS 10
PHP 5.6.12
MySQL 5.6.26

I was able to create the universe, login as the admin and play around a bit without any issues. Is that branch the most current? Besides email problems, does it work/behave?

As for the major changes, are you talking about moving to using a SSO service that is to be created here on BlackNova.net?

- Monk

Re: Current Status?

Posted: Sat Apr 23, 2016 18:07 UTC
by TheMightyDude
Well Windows IIS was removed from the supported OS and Web Service ages ago due to loads of issues, like path locations, cookies and there was a hell of a lot more issues.

It got to a point where we would code it for Linux and it would be broken on Windows IIS, so we would try and fix it for Windows IIS and it would break on some Linux distros.
It got to a point where we was spending way too much time trying to get it working on everything.
Think of it like sticking diesel in for petrol car or vice versa, it just dies on you LOL.

And where Linux was the most popular used OS due to it being free and the most stable over Windows.

As for the most stable branch, the zipped up version 0.663 (I think) is more stable than the version in the code base, the codebase even scares the crap out of me and gives me a right headache.

If you are referring SSO to Single Sign On Service then yes, we will hose all that here.
Think of it like an MMO Like World of Warcraft where each Realm would be a Game Service that might be run by us or a 3rd party, i.e. somebody that wanted to add a server local to them for players to play on and if they follow the required steps, rules and requirements they will be listed on our main server for the selected region.

Or you could also think of it like a Steam/Arc/UBI/etc Game, you login only once and you can play any game server.

Basically my route I am hoping to move to, will allow people to run a game server that is linked to our network here to handle all the emailing and storing all the account information along with new features as we add them, and all the admin needs to do is upload the game service to their server and a scheduler that checks the game service is running and if not start it and along with opening a few ports up that should be it.

Server wise, what works on Windows will/should work on Linux or Mac etc.
But by default I will be aiming for Linux Supported at first.

So the end resort would be a game that may have loads of servers running all over the world that will use our network to login onto them.
So only the one account would be needed to be made to play on any server in the list.

Also say we create another game later on, that could also be linked to our network, so the same login would be used for that and so on.

Also have I said its all free btw, well it will be depending on how much traffic it uses, but I am sure it will be fine, hell it would probably be less than what it is when we was running 3 live games and a test server on here.
It shouldn't be an Network Bandwidth issue, but depending on how many servers we run could impact the servers CPU Load, so I might just run the single Server here plus the odd test server and leave the rest for the 3rd parties.

I have probably not explained it well enough like in its own thread.

Re: Current Status?

Posted: Wed May 11, 2016 00:20 UTC
by thekabal
tjmonk15 wrote:I downloaded the latest revision of the code from SourceForge and was playing around with it. I poked around, and ended up using the "original" branch. The only issues I had getting it up and running were getting IIS to behave.
Awesome!

There are several branches on SF, and many of them are unfortunately not very useful any more. The ones that "matter" much at this point are indeed Original and Advanced.

The history, if it helps, is that we started with just BNT. Then there were several forks, including mine (The Kabal Invasion).

Over time, we did a reverse fork, and merged the work from TKI back into BNT as "Advanced", and later, with changes to make it match BNT, as "Classic". The hope was to get the Advanced code working well enough to replace the original code AND to offer two "flavors" - Classic BNT, and Advanced (TKI).

Later still, we re-merged a large amount of TMD's work from maintaining the games on this server - much of which had never been used publicly outside of this server.

And latest of all, we had a passionate discussion about how to handle templating which resulted in a rather non-ideal mix of templating systems.
tjmonk15 wrote:I was able to create the universe, login as the admin and play around a bit without any issues. Is that branch the most current? Besides email problems, does it work/behave?
In a word, no. (Sadly).

Email and activation, as you noticed, are problematic. There are also some non-trivial DB issues with ADODB, several of which were never fixed. The AI ("Xenobes") are horribly broken also.

Keep in mind that the code started in pre-PHP4 times, and has developed over a decade+ across many developers with competing at at times conflicting visions.

With those caveats, yes, it can run.

I'm continuing development on the "Advanced" branch (TKI) over on Github: https://github.com/thekabal/tki/ . I haven't been able to dedicate much time to it lately, but I hope to do so again "soon".

Re: Current Status?

Posted: Thu May 12, 2016 00:59 UTC
by tjmonk15
thekabal wrote:...

Email and activation, as you noticed, are problematic. There are also some non-trivial DB issues with ADODB, several of which were never fixed. The AI ("Xenobes") are horribly broken also.

...
Email and activation not working is a server admin problem (mostly, there are some things "we" could do to help that, but ultimately if wordpress can just use the server settings, so can "we".)

I say "we" because I have been here to help before in the past, and even in the dev board was mostly treated as a server host(ie. someone looking to host the game for others to play, not a seasoned PHP/Web dev with 10+ years of experience making a living off of my "hobby", ie. programming)?

I don't mean to be confrontationel, but that's how i felt/feel with these responses. I remember both of you (TMD and thekabal) and i remember having significant discussion in the previous incarnation of the boards.

I want to help but I need a bit more info to know what the pain points are that I could work up a patch for.

If it's the haphazard templating system, I can fix that (and would like to, as well as, make the UI responsive at the same time) and that is easy.

If its ADODB, I wouldn't be suprised. It's old, and barely classifies as an ORM (Object Reltional Mapper, ie. how all major frameworks deal with DBs)

If it's JUST the AI, thats most certainly the most interesting problem (to me) and I would love to help with that. But, I have limited knowledge of how they should work. Give me some pointers and expect a patch in a week (pending any work overflows)

I would love to say I can fix it all, but I simply don't have the time to do everything, hence I am asking for "What is the biggest issue right now?" as well as, "Am I looking at the 'current' code?".

- Monk

P.S. Also, not supporting IIS is a joke... It's due to a reliance in the code for very VERY old versions of PHP. If you target recent PHP (5.4+ or 7.0) it will work out of the box in IIS. Assuming you use a decent autoloader and/or use DIRECTORY_SEPERATOR instead of '/'. (My code always defines DS to be DIRECTORY_SEPERATOR, which makes it much easier for devs to use)

Re: Current Status?

Posted: Thu May 12, 2016 03:22 UTC
by thekabal
tjmonk15 wrote: Email and activation not working is a server admin problem (mostly, there are some things "we" could do to help that, but ultimately if wordpress can just use the server settings, so can "we".)
They are also, unfortunately, code issues. The email and activation process needed a serious overhaul, and my initial attempts (at least on the Advanced code base) made things substantially worse. TMD deserves credit for noticing and pointing it out to me. He kind of rocks. :)
tjmonk15 wrote:I say "we" because I have been here to help before in the past, and even in the dev board was mostly treated as a server host(ie. someone looking to host the game for others to play, not a seasoned PHP/Web dev with 10+ years of experience making a living off of my "hobby", ie. programming)?
I'm sorry to hear that. I know that I've tried to be more welcoming, especially in the last few years, but I am human. There are (a lot) of examples in the past of folks that have had less than stellar intentions, but I honestly try to expect the best in people. Personally, I extend my apologies if I was not welcoming in the past.
tjmonk15 wrote:I don't mean to be confrontationel, but that's how i felt/feel with these responses. I remember both of you (TMD and thekabal) and i remember having significant discussion in the previous incarnation of the boards.
I respect your opinion, and don't find it to be confrontational at all. Its valid and constructive feedback that I personally will factor in going forward.
tjmonk15 wrote:I want to help but I need a bit more info to know what the pain points are that I could work up a patch for.
The pain points that I would identify are probably different than what TMD would, and others. Also, the answers are going to be very different for Classic v. Advanced.

That said, here is what I would say, with a quick "why" for each:

- Install process needs to be much less painful, and made to be simple. Advanced has a few nice additions, but it adds other complexity like Smarty errors, permissions, etc.
- FAQ rewrite - Its been a "I'm going to do that" for YEARS. Its almost a decade old now, I think.
- INSTALL guide rewrite - This is more up to date, but hasn't been updated and organized.
- New player guide and Help system rewrite - UGH.
- AI - Both branches use the same AI code for the most part, and its busted.

Those are the low-hanging fruit.

The AI is going to at least be a little more challenging, because it will evoke a discussion about how to properly handle the AI. By which I mean, TMD & I disagree on how the AI should work. I think the AI should be limited to only being able to do what a person would do, while TMD accepts that the AI may need to work around those limits to be functional/performant/etc.
tjmonk15 wrote: If it's the haphazard templating system, I can fix that (and would like to, as well as, make the UI responsive at the same time) and that is easy.
I would hazard against statements that estimate the time to complete. By way of example, in Advanced, with a crew of about a dozen developers and about 30 testers, we managed to convert about 1/3rd of the game to use the Smarty template system. It took us over two years to accomplish that much. It CAN be done, but it is not by any stretch "easy". Also, it will lead into a different discussion about technology choices. TMD initially favored an XML templating system, while I favored staying with Smarty. If I were to tackle it from scratch today, I might consider Twig instead. Maybe. Which also leads to the "which branch do you want to work on" question.
tjmonk15 wrote: If its ADODB, I wouldn't be suprised. It's old, and barely classifies as an ORM (Object Reltional Mapper, ie. how all major frameworks deal with DBs)
Yes. Very much yes. We've begun moving to pure PDO, but it is a VERY long process that requires a staggering amount of testing. It also uncovers major, major bugs throughout the game when done correctly. Adding in parameters to queries and defining what returns are supposed to be (within ranges) exposes really old, really sloppy code that didn't care about errors. :)
tjmonk15 wrote: If it's JUST the AI, thats most certainly the most interesting problem (to me) and I would love to help with that. But, I have limited knowledge of how they should work. Give me some pointers and expect a patch in a week (pending any work overflows)
The AI is definitely a good place to dig in. Its complex, but not overly so. It operates mostly independently of the rest of the game, so it won't have a ton of side-effects.

Having limited knowledge of how they should work, unfortunately, is true for us as well. In general, MY conception of the AI system should ideally be "Acts like a player does". Meaning, it moves its ship, it has a memory of who attacked it, it hunts for people, it trades, it explores, etc.

Most of the "major" problems with the AI code are DB schema issues that prevent it from running/creating correctly. That is a relatively easy fix. But the overall architecture of how it works would take a little more work. Definitely possible for someone to tackle.
tjmonk15 wrote: I would love to say I can fix it all, but I simply don't have the time to do everything, hence I am asking for "What is the biggest issue right now?" as well as, "Am I looking at the 'current' code?".
Classic is by far more functional at this point. However, the TKI/Advanced code on Github has more potential. Its a PITA to get installed and running, but those are relatively minor issues when you factor in all the work done to improve the DB calls, and clean up in general in the code.
tjmonk15 wrote:P.S. Also, not supporting IIS is a joke... It's due to a reliance in the code for very VERY old versions of PHP.
This part, sadly, is going to be less friendly. :)

Not supporting IIS is a choice. We did it for many, many years, all in our "spare time". In my experience/opinion, the admins trying to run the game on IIS were universally more problematic. They didn't understand permissions (because they work differently on Windows), they didn't understand the need for a crontab at all (even event scheduler was problematic), and they really didn't understand setting up PHP on IIS. At the time, PHP on IIS was not common. That has changed.

What has not changed is that Windows/IIS is not equivalent to Linux/Apache. Yes, they are both web servers running on an OS. But the differences from there are non-trivial. As an example, there are about six different "common" ways to do wget/curl/etc on Linux. Just THOSE were insanely challenging to support, because various webhosting companies would install those in various directories that were wildly different than the default locations on virtually every major Linux distro. And they would also have security controls in place that would prevent running wget from a different location because it could be "an exploit tool". I wish I was kidding! These are actual problems from our real-world attempt at supporting just ONE O/S - Linux.

Now add in things like permissions, web server settings, configuration of IIS (which version?), and a myriad of other problems, and well, its a hell of a lot of work more than just saying "Setup a cron". Programming, or supporting infinite variation? Which should we spend our time on? We chose more programming. While IIS may be more familiar to you (great!), its not as easy to support for us, and is not equivalent.

THAT is the calm, rational, reasonable reason. But in addition, there are some rather non-reasonable reasons as well! Microsoft destroyed the computing world for over a decade. They were CONVICTED monopolists that caused actual harm to the industry, and I worked (and continue to work) in the industry while they did so. I had and have zero guilt for choosing not to spend MY spare time supporting a horrible operating system created by a horrible company for a web based game that very very few people play let alone run on their server.

I don't. That won't be changed any time soon. Maybe TMD feels differently, maybe you do! But TMD fielded the VAST majority of the support requests, and HE chose not to support it for the rational reasons I mentioned above. Maybe he had other reasons, I can't read his mind, but I know of those. I supported the choice 100%, and I don't spend much time testing or validating on IIS. My home machine is a Fedora Linux gaming desktop, so it gets the most testing from me. Occasionally I'll spin up an OpenBSD VM and test there as well, but its far less common.
tjmonk15 wrote: If you target recent PHP (5.4+ or 7.0) it will work out of the box in IIS. Assuming you use a decent autoloader and/or use DIRECTORY_SEPERATOR instead of '/'. (My code always defines DS to be DIRECTORY_SEPERATOR, which makes it much easier for devs to use)
NOW that may be true, but I can personally tell you that back in the day, it wasn't. I tested releases on Apache, Nginx, and IIS, and IIS was 100% of the time the biggest PITA for me to work around.

As to the directory seperator, if that is true, I welcome a patch to make it so! If you can patch it, I will definitely not object to making it work on more systems as long as the code is reasonably elegant. I'm fairly sure TMD won't either, as long as we continue to be clear in the documentation that it isn't a SUPPORTED solution - but it can work out of the box without much concern in my opinion.

In short, ALL of what you are asking about and offering to help with is great!! There are a few areas (IIS, support), where TMD & I might not be as willing to spend the time and effort that you might. But that's ok! That is the great part about FOSS. You can scratch your itch, and it only makes things better for everyone.

To help for planning, here are a few of the major changes in progress or planned already:

- Adodb -> PDO
- Templating using Smarty for 100% of the visible displays
- Better install/setup process
- Better documentation
- Clean up the Javascript (ugh)
- Proper, defined, reasonable returns from functions/methods
- Improved documentation of the code itself
- Unit testing, dear $DEITY, it is needed SO BADLY
- Recode for PHP7 support without errors
- Better error handling. I started down the path of exception catching in Advanced, but it needs MUCH more work.
- Complete rewrite of Trade routes and supporting code
- Improved SQL throughout (parameters, narrower selects, better indexes, schema redesign, etc)

In addition, I'm personally continuing my work to get the game to work flawlessly on PostgreSQL, which I prefer (deeply) to MariaDB/Mysql.

If those were done, it would be an absolute pleasure to spend time in the code. Right now, its a bit of a pain to work around most of those issues.

Hope that helps!

Re: Current Status?

Posted: Tue May 31, 2016 00:07 UTC
by thekabal
As a follow-up, I've committed changes to make TKI run correctly (so far?) on PHP7:
https://github.com/thekabal/tki/

I'll be updating and correcting other issues in the code as I have time. Enjoy!