Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: LCS fork on Github: Getting rid of all the little UI annoyances!  (Read 3932 times)

zaroth

  • Escaped Lunatic
  • Elite Liberal
    • View Profile

Hello fellow Liberals!

Do you want to hear something disturbing?

What? you ask.

There is not enough developers working on this awesome game right now to let it truly shine!

But fear not! Lasica and I, being avid programmers and fans of the game, decided to help with the development effort. We started with familiarizing ourselves with the codebase and  implementing some of the many small features / QoL changes that seemed easy. We have already changed some stuff compared to the sourceforge version, with more changes to come.

Since we are Linux users, Linux is our main testing/building platform - but we will provide a Windows build when we decide to release, no worries :-)

We are using Github as our liberal development platform:

We are now focused on QoL fixes and interface smoothing. We are also planning for some serious code refactoring. What is waiting for better time right now, are the bigger features/content additions, such as multiple cities, movies or other fine ideas from this forum. We will return to these later.
Right now we are also learning what is where in the code, so don't expect too much :)

We are open to suggestions / contributions - fork us on Github, post an issue, tell us what you think!

Why fork?

Why didn't we just try and commit to the old repository on sourceforge? Well there were a few reasons, namely:

  • since we feel that current codebase needs some pretty big refactoring changes (and we are not the only ones, judging from the dev/ directory in repo), we wanted a free say on what and how to change - and no rustled jimmies if our ideas don't work out :)
  • the main repository is quite inactive, so we think we won't have problems with catching up with upstream patches
  • we love git! And all of the good stuff it brings: speed, branching, github with their pull requests, issue tracker ...
  • we wanted to rewrite repository history to remove some blobs from there (I still can't wrap my head around why somebody would commit compiled binaries there... removing that stuff reduced repository size from 300 MB to ~8MB!)
  • following the rewriting history trend from previous point, we ran astyle (code beautifier) on the codebase, to keep the style nice and consistent. The exact astyle options are stored in our repository
  • since we don't know much about using autotools (and our experiences with using them aren't best), we decided to add CMake as the build system for Unix systems. So unless somebody contributes, we probably won't be maintaining autotools, especially after our CMake files grow mature enough to handle most of the use cases.
  • we aren't sure yet how much liberal juice have we got before our conservative other life stuff starts taking over, so we wanted to have a nice safe playground to kick our ideas around, without much commitment. And it's easy to pick up our work and take it further on Github, too.

Still, all of this is open to discussion, so if some other developers want to give us advice / join us / warn us, you're more than welcome to! We'd be foolish to reject all this precious juicy experience gained while fighting conservative bugs and implementing liberal features and content. :)
« Last Edit: May 08, 2014, 11:34:56 pm by zaroth »
Logged

Capital Fish

  • Bay Watcher
  • "Hi Mister Dog!"
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #1 on: May 08, 2014, 04:46:30 pm »

Just wanted to wish you guys the best of luck. We've been far too long without an update.
Logged
Find the errors in the above post and win a prize!

KA101

  • Bay Watcher
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #2 on: May 08, 2014, 07:47:22 pm »

I'm KA101 on Git too.  That's one major barrier to my contributing sorted.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #3 on: May 11, 2014, 03:58:10 am »

Hm, it sucks that I can't into C, but Git is awesome, and Github even more so.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #4 on: May 12, 2014, 07:23:10 pm »

Looks like this needs more steam.

So, I've looked through the plans and changelog, and it looks like your main goal here is to make the ui more consistent. I've seen the LCS source code, and in my opinion the best thing to do would be just starting over with the menus. It would probably be more work at this point to build on the preexisting menus than it would be to just tear them out and replace them with something better.

So, what should we replace it with? On one hand, the ASCII graphics of liberal crime squad need to stay. It would be much easier and more in the spirit of the game to continue using them. On the other hand, I think that LCS needs to drop pdcurses if we're going to unobfuscate the ui. The main problem is that there just isn't enough space. A larger, resizable window would make things much easier, as would better keyboard and mouse input methods. I already suggested rendering backend alternatives like libtcod and SFML. It's up to you which we end up using, assuming we go that route.

I'd be happy to work on a brand new, more modern ui for this game, but if you plan on working with the same cluttered and inefficient foundation of C and pdcurses then I'll have to pass.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

SlatersQuest

  • Bay Watcher
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #5 on: May 13, 2014, 12:23:18 pm »

Greetings!

As I have posted (and have been delayed due to final exam season), I've been working on a fairly extensive mod for LCS that involves rewriting a fair amount of the code. How would I best integrate your code upgrades with mine?

 :)
Logged

Lasica

  • Escaped Lunatic
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #6 on: May 19, 2014, 09:32:04 am »

Hello everyone,

As zaroth seems to be busy lately, I'll reply to you.

Just wanted to wish you guys the best of luck. We've been far too long without an update.

So, I've looked through the plans and changelog, and it looks like your main goal here is to make the ui more consistent. I've seen the LCS source code, and in my opinion the best thing to do would be just starting over with the menus. It would probably be more work at this point to build on the preexisting menus than it would be to just tear them out and replace them with something better

@ Capital Fish: Thanks!

Thanks, you may expect some kind of little bug-fix/ui upgrade release when all issues on github with milestone "Low hanging fruit" are implemented, which may happen approximately in a month, as the exam session is getting closer and both me and zaroth have had little time lately (and it'll only get worse).
My role so far was changing little things in code not refactoring anything so far to fix the most annoying issues for me and implement little QoL features. Yes. Making the ui consistent is our first and main goal. With object oriented, encapsulated code it'd be much easier to implement other features.

@Gatleos: I agree that the code has to be refactored/rewritten in some points and I do not intend to leave it be as it is now and develop messy code. So far I have been changing little things to familiarize myself with the code. I hope that it will allow me to plan better changes (I'd prefer to avoid making the same mistakes, as I'm not experienced programmer) and implement easy stuff in the current code.

So, what should we replace it with? On one hand, the ASCII graphics of liberal crime squad need to stay. It would be much easier and more in the spirit of the game to continue using them. On the other hand, I think that LCS needs to drop pdcurses if we're going to unobfuscate the ui. The main problem is that there just isn't enough space. A larger, resizable window would make things much easier, as would better keyboard and mouse input methods. I already suggested rendering backend alternatives like libtcod and SFML. It's up to you which we end up using, assuming we go that route.

I'd be happy to work on a brand new, more modern ui for this game, but if you plan on working with the same cluttered and inefficient foundation of C and pdcurses then I'll have to pass.

We planned starting putting the real refactoring effort at the end of June/beggining of July. We haven't considered yet which libraries we will use, but there are two important aspects to focus on:
1) writing the new ui may be done in such way that it'll be easy to port it to anything: like graphical ui or any other interface, or strictly stick to the ascii and don't plan anything in this area. I like ascii graphics in roguelikes and of course I'd start with it, but I'd like to code it in such way that would be easily portable.
2) being resizeable and scallable - it's a mayor upgrade for interface and certainly a must-have feature.

It's also worth mentioning that when we start refactoring, it will take considerable amount of time and it will freeze any other updates of the code. As we are quite unexperienced in this matter, we'd like to do it in small steps (if possible) being careful not to break anything during it. That's why we plan to make unit tests to keep sane :p. So 2 points: 1) we plan to write a brand new ui code 2) but also we want to keep it working after small steps of changes - so it will require working with the old code. It's important for me, as I'm afraid that we might get burdeoned and buried by the amount of things to be done, if we decide to break compatibility/working of the game and code new ui and try to fit it to the mechanics - it's much better to have something working not so far behind to be able to get back to.

If you want to help us in this journey, you're welcomed! But keep in mind, that as I stated before we won't focus on lcs until we have lots of time to spend (which we estimate at the end of the June).

@maiuw62: I agree :D

@KA101: nice to hear, and nice to see you posting there! I'm glad to meet Cataclysm DDA developper! It's one of my favourite roguelikes with a great potential (heck, there can be done so much, that even ideas of managing your character, dwarf fortress and npc-squad managing (to survive and build base together) can be joined!). I wanted to start developping cataclysm, but I couldn't get started and wanted to find something smaller to grab juice first.

Greetings!

As I have posted (and have been delayed due to final exam season), I've been working on a fairly extensive mod for LCS that involves rewriting a fair amount of the code. How would I best integrate your code upgrades with mine?

 :)

@SlatersQuest: Difficult question. If our project will get to the release, then I'd bother integrating any code, as I am not 100% sure how long we'll manage to work on this.
By the way, having looked at your post with the mod I suspect that you don't use any repository to maintain it. I recommend you learning some (like git) to improve your quality of life :P.
Furthermore, if you want to join our version (not the svn one, which by the way, we'll track and pull changes from there), the best option would be to fork us, translate changes you've made so far to your brand new git fork and keep working with github. Having done so, keeping synced with our fork isn't difficult. It will require just merging with master from time to time (the easier to make the more frequent you do it).
On the other hand, if you want to do it every time by yourself, or just once (like just adapt changes I've made so far till today), you can use github diff (navigate to "Files changed"). It may be difficult without some advanced programming enviroment though, as we've normalized this messy code with script changing (normalizing) indentations, brackets,  comments etc and line numbers do not match in both versions (you have to use the context).

I'd like to apologize everyone for any language mistakes I may have made,
Greetings,
Lasica
Logged

usr_share

  • Bay Watcher
  • "For great justice!"
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #7 on: June 20, 2014, 03:25:26 am »

Quote
writing the new ui may be done in such way that it'll be easy to port it to anything: like graphical ui or any other interface, or strictly stick to the ascii and don't plan anything in this area. I like ascii graphics in roguelikes and of course I'd start with it, but I'd like to code it in such way that would be easily portable.

One of the problems is that, on Windows, the console is limited strictly to a single codepage. This means that one can't use the rest of Unicode, as is with Linux and Mac OS consoles nowadays. Right now, there is a huge hack used specifically for Windows console support.

It would be a nice idea if an graphical (but still text-based) UI was available for Windows users.
Logged

Jboy2000000

  • Bay Watcher
  • Hello good people of the interwebs!
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #8 on: June 21, 2014, 02:04:32 am »

So just downloading the ZIP from Github would give us your updated version, or do we need to download LCS and the ZIP?
Logged
"Wanna be a better liberal? Go get shot in the fuckin' face."

Just goes to show, even a Male Doctor that Looks Like a Female and a Criminal with Poor Hygiene Habits can fall in love.

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #9 on: June 21, 2014, 04:08:55 am »

If you download the zip you'll have to compile it, which you probably don't want to do since compiling things for windows can be quite the PITA.

You'll probably want to ask somebody else to compile it or find a compiled build somewhere on the github.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #10 on: June 22, 2014, 03:19:35 pm »

Good luck, it sounds great! I'm looking forward to seeing how it turns out.

Quote
I still can't wrap my head around why somebody would commit compiled binaries there

That would be my doing. I used to get a lot of requests for intermediate in-development builds from people who couldn't compile the source code. Normally, releases involved a fair number of steps in packaging builds up, incrementing version numbers, uploading to my website, and so on. Rather than taking the time to go through that more frequently, I added the executable to the repository, where enterprising non-programmers would have access to it.

For cross-platform console support with a wide character set, larger console, and better colors, I've explored using libtcod and emulating the curses API. The main problem I've had doing that sort of port with LCS is that I keep trying to do this in Python, which requires a full code rewrite, and I haven't mustered enough energy to follow through with that. However, I think there's still a lot of promise in the more sensible approach of wrapping the C library in a Curses-like API and plugging it into the existing source.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: LCS fork on Github: Getting rid of all the little UI annoyances!
« Reply #11 on: June 23, 2014, 04:41:55 am »

I've made a bunch of commits in the last month or so and been fairly active, and trying to do lots of improvements to the game and code. I don't quite understand exactly why you forked it, other than, maybe you like Git way more than SVN, but it would be good if we could merge it back together I think... argh, I should have been paying attention to this forum while I was working on all the recent updates to the code. Anyway I'm sure you've made fixes that aren't in the SourceForge version while I've made fixes that aren't in your version, that's why it'd be best to merge them and have all the fixes from everyone and have all us programmers working together... and as for the compiled binaries thing I've also been a contributor to that... sometimes Windows users want to be able to play the latest version and not everyone knows about programming or compiling, but if people download the game's source code off the SVN repository they can get an up-to-date compiled binary of either the latest or a recent revision, which has more features and bugfixes than the latest official release. Basically that is so people who aren't programmers can test the latest revision of the game and find bugs and such things.

Anyway I am curious about if you'll be able to merge the changes being done on SourceForge or if I can merge the changes you've done on your Git fork... I've heard that merging changes is very easy with Git and that this is an advantage over SVN. But maybe we could change the official repository from SVN to Git if you want... anyway I program on Windows and you folks are on Linux so I think it's best for us to work together to make sure the game works well on all platforms, we can each make sure that changes from programmers on other platforms don't mess anything up on our platforms. And I've also been doing plenty of code cleanup/refactoring, mostly just to make the code concise, but I've been doing it by hand rather than using an automated tool.

Mainly though I just think it'd be a good idea to merge this fork back together, or merge the "official" version into your fork, and then have one version we all work on... and we can use Git...

As for the binaries thing I wish I could post binaries on the downloads section of the SourceForge project but I don't have the rights to do that, if I could do that there wouldn't be any need to have binaries put in with the source code... (I am yetisyny on SourceForge). I am thinking the downloads section on SourceForge should have both binaries and source code for the latest stable version, the latest beta version, and when possible, the latest code revision... and also have both binaries and source code for all historical stable versions, too, in case people want to try older versions. I think only SourceForge users grundee and jonathansfox have the rights to change the downloads section currently. And I don't think grundee has been active in this project for years, although he did loads of contributions early on in the project.

I've changed a whole lot of the UI to use Code Page 437 line-drawing characters recently, and also in the process, a bunch of source code files now have to be opened and edited with that code page. I am thinking, maybe I can use '\x##' codes in C++ to specify the characters by number so that you can edit the source code in any code page... the problem is, that would change every 1 character into 4 characters for extended characters, and also make it harder to tell what those characters are by looking... this would result in string constants that would be up to 320 characters long, since there'd be a ", then 80 \x## codes in a row, then a closing ". Having lines that long is ridiculous which is why I decided using string literals with extended characters was probably a necessary evil. Anyway I'm interested if you have any ideas on that.

I've also been reviving that old idea of a Stalinist Comrade Squad and recently done a lot of code towards implementing that... it's not anywhere near finished, of course, but it'll be a game mode that's off by default, but that you can turn on when creating a new game, rather than being a separate fork of the game. But, if you look at the SourceForge project right now, it's been quite active in the last month, although mostly just me... and earlier this year blomqvist has done most of the contributions.

One last thing... check out this site: http://www.projectpluto.com/win32a.htm. It's an alternate version of PDCurses for Windows with WAY more features. I tried it out and it's incompatible with the current way set_color() is implemented so this causes all sorts of graphical glitches, but if we got that fixed it could be quite an improvement for Windows users. Of course we'd need to maintain compatibility with vanilla PDCurses, ncurses, and xcurses so that's why having people like you folks on Linux would be really helpful in making sure it doesn't ruin anything on your platform. Anyway though, certain problems happen due to it being a Win32 console application on Windows, but this alternate version of PDCurses could fix them. Just one example is, we would no longer be limited to the Code Page 437 character set, and could use any character from Unicode... from what I understand curses and consoles on Linux already support Unicode, so if the Windows version also does, we can get the entire game into Unicode and have access to loads more characters. This alternate PDCurses also supports way more colors, lets you pick any font, it supports bold, underline, italics, etc., it's basically awesome. Only problem is, the current game isn't entirely compatible with it quite yet, we get graphical issues with the current code since it does stuff a little differently, but I am sure there's a way around that which still maintains compatibility with other platforms and curses implementations.

Anyway I'm really glad to see more people working on this game but I really wish we could all cooperate on it together instead of forking it, since forking means positive changes done on one fork won't appear on the other fork, we need to merge it all together... I look forward to working with you all! ;)
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL