Closed ghost closed 2 years ago
It has been decided that KQ will switch from Allegro v4 to SDL v2. If you are reading this and you are not from the KQ dev team, you help is welcome!
I wonder, did you ever look at cocos2d-x? It has built-in support for Tiled maps and Lua. I haven't used it myself apart from a quick look but it seems to be well supported and under active development.
I've had a look at this. It's going to be tricky to convert the current code. Allegro 4 allows you to draw whenever you want and wait for key input whenever you like, whereas SDL2 ideally has an event loop structure.
I'd prefer to do it properly, which I think will need quite a fairly wide-ranging rewrite. Any thoughts?
ps. Allegro 5 is more like SDL2 than Allegro 4, so a rewrite to Allegro 5 wouldn't be any easier.
SDL or Allegro5 would both be a fairly significant code change. That's one of the loftier goals that would affect most every function in every file. I'd put this onto the backburner just until we can get everything a bit more OO.
I am creeping towards this one. My current activity is to remove all uses of Allegro dat files. I can see how I might convert the drawing and sound code, not sure about the event loop side of things yet.
For anyone who might be looking, I've started porting this to SDL2 in my own fork. I don't have previous experience with Allegro or SDL, and not much C++/C programming experience, so this is largely a learning experience for me and things are moving pretty slowly.
I think out of all the tickets for KQ, this would be the most useful for me, since all development for me has ground to a halt, as Allegro 4 is simply too old to run on my machines anymore.
If I were able to use a more modern library or engine compatible with recent versions of Mac, Windows, and Linux, then I'd probably start development on this quite a bit more. I think that's even what @TeamTerradactyl said had stopped her working any more on the project (that, or life just got too hectic).
Just by coincidence I was looking at sourceforge today for the first time in ages. The old kqlives project is there just as we left it and I was feeling nostalgic! Converting to SDL2 seems a good idea, I look forward to seeing what comes out of it. I was less impressed that @phinjensen seems to have deleted the copyright/ license stuff from his fork, what was that all about?
Wow, I totally forgot about the old code on SourceForge (I see commits from 20 years ago! Whaaaaa?).
As far as I'm aware, there has never really been a game resolution, has there? Like, we never designed an end boss or tied up all the side quests?
I wonder if we should revive JB's original storyline, or just hash out the remainder of the game once we can get it to work with SDL2?
I have been gathering graphics replacements and brainstorming a suitable epic ending. Though my plans are in some ways a rewrite because it would change a number of things that don't make sense. For example you cannot get through the gate near Andra because of a civil war. Once you get on the other side, the civil war is never mentioned. I think it would make more sense if Malkaron's forces had more of an impact on the world. The Oracle's area could have fallen into chaos because of Malkaron's earlier expeditions. (he was marauding for years IIRC).
@pedro-w If I did remove some copyright or license stuff from my fork, it was accidental. Honestly, the state of my fork a mess as I've figured stuff out so what I have right now is probably completely unhelpful at the moment. If/when I move things far enough along to be merged back into this repo, I'll make sure to clean things up as much as possible.
OnlineCop just pinged me and told me to check my email.
Hey Peter and all! It’s been... wow, a while.
I’m not sure I’ve got a computer old enough to still run the original. I might need to run it in a VM just to remember what the game was about.
Where did my mapedit program get moved to? I don’t see it, or an I just stupid?
-TeamTerradactyl
On Sat, Oct 9, 2021 at 10:57 Peter Hull @.***> wrote:
Heh, the old team coming back. Where are TT and 23yrold3yrold! I realised I changed my user ID so if you're wondering who I am, I am Peter and I was involved https://www.allegro.cc/forums/thread/203407/203690#target in rescuing KQ and putting it on sourceforge after JB abandoned it in 2002
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OnlineCop/kq-fork/issues/3#issuecomment-939327400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZEKJQLQN3M3SUD7B3P5RTUGBX5ZANCNFSM4AOPOO4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Sorry @phinjensen I came across a bit angry; it's great that you're getting this moving again!
If I can remember correctly right back to the beginning, Josh Bolduc had a nearly-finished plot. We (i.e. the people who took it up after he quit) had a plan for the ending which involved a new cave map, an underwater tunnel and a shrine. Subsequent to that JB posted an outline of what he had previously planned for the ending, which was different. Anyway, Chris Barry made the cave level and then we got stuck a bit. I tried to make a shrine level but I just couldn't do it, I guess my skills lie elsewhere! Then there was a lot of plot-rewriting and I got lost and a bit frustrated with it all because I thought we were going backwards.
Also for a while we were on debian testing (Sam Hocevar was a team member actually) which was great until we ran into license issues - the debian folk were insisting we prove that we were able to distribute the graphics freely and in the end I gave up dealing with those people. (I suspect some were ripped from non-free games actually, so they may have been right!)
@teamterradactyl one of the changes was to use the TMX format for maps, which means that the Tiled editor could be used instead of mapedit.
Finally, I believe Allegro 4 does compile fine on everything apart from MacOS, but that doesn't change the fact that it's old/unsupported and I agree SDL2 is the best choice.
I haven't touched Allegro 5 or any SDL libraries. I was happy to convert the original game from C to C++, although it seems like many places were very tightly coupled with Allegro4-isms.
I'm fine with SDL2; do you think we might get more support from some of the original KQ volunteer group if we tried to use Allegro5, as they probably have more experience with it than with SDL?
It looks like the SourceForge wiki described some of the existing storyline, but I can't honestly remember whether it totally abandoned JB's original ideas, or if there were simply some "offshoot" ideas that were being discussed but never implemented. (I even remember a KQtheBetrayer that reused the kqlives engine but added completely custom maps and storyline.)
If the engine itself is going to be separate from the "storyline", I guess it won't matter whether we opt to keep JB's original storyline, or even do something completely different. Being able to decouple it would probably be my highest priority, because, frankly, I can't "story" very well, but I'm great at working on game engines...
Honestly, from the original group of Allegro people that worked on it before, I don't think any of them are still active. SDL2 is better supported and maintained now, though it pains me to say.
I would advise getting the plot sorted out early on and then sticking to it! Because generating new maps and graphics etc. is more time-consuming than you might imagine (IMO)
I'm not as worried about the plot or the graphics as the state of the engine. I would work on the plot and scripts more but I find it discouraging as when I get KQ to actually compile then it is in more broken state than it was in the sourceforge days. (no offense to your work on the c++ port, but some bugs got added in along the way. Getting rid of the allegro data files and switching to tmx maps work great though.)
A while ago I tried playing around with adding high resolution portraits but the limited palette really gets in the way of that.
Does anyone have any ideas how you would convert the lua scripts to work with an event loop architecture? I've done something similar with pygame but it required a second thread that sent over events to the game loop. So that the map script can be blocked in the middle of a conversation waiting for the game loop to return an event of what dialogue choice they picked. But that added complexity is a little hard to make work perfectly.
To be honest I'm a little bit surprised the original worked as well as it does, because every lua command has to also call blit screen, update animations, read input, etc. Having a gameloop and game state manager is a lot easier to manage, but has the disadvantage of making scripted events hard to keep in sync with the action on screen. Well at least in my experience. I keep wondering if there is an easy solution that I'm missing. Conversation logic can be converted to decision trees, but I really enjoyed the serial nature of the lua script logic as it was really easy to jump into, even if you are intimidated by programming c/c++, as you can easily see the flow of the scenes. I actually started working on Kqthebetrayer before I learned how to program. =)
Playing devil's advocate here:
If the graphics were changed, but everything else stayed the same, would it still be KQ? If the sound effects and music were changed, would it still be KQ? If the underlying game engine were changed, would it still be KQ? If the storyline were changed, would it still be KQ?
If all the above were to change, would it still be KQ?
The majority of the graphics, music, and probably the sounds effects are just rips from commercial games so unfortunately we can't legally use them. The engine being replaced doesn't change anything in my opinion, a number of commercial games have rereleases with new engines look at the latest Dragon Quest game. But you do have a point about the storyline. I have been thinking about the storyline but my plot ideas are quite a bit of a departure so I had been just thinking about releasing my own under a new name and a new python engine(because kqlives engine development had stalled) called KQ Reborn or something.
Does anyone have any ideas how you would convert the lua scripts to work with an event loop architecture? I'm more confident that the engine stuff can be sorted than the plot so between us all it should be fine...
If all the above were to change, would it still be KQ? That's like the axe and handle thing! I think we would know if it was still KQ or not
@teamterradactyl If the storyline is the same, the game is the same. Graphics get overhauls all the time. If I remember correctly, many of the songs were actually from places like https://modarchive.org/ or similar. Whether or not JB had permission to incorporate them into the game, I don't know. If the songs have to change, then we change them. If we could get permission to use them, then I'm pretty sure a Tracker artist wouldn't mind their 20-something-year-old song being "officially" used in an online project. We'll just need to include "used with permission by..." somewhere in the documentation.
I think someone said the large thumbnails of avatar faces were ripped from some Final Fantasy (tactics?) collection. Those shouldn't be too difficult to swap out. I know that many of us contributed to various tiles in the tilemaps, but I don't know if some of the tiles actually belong to free (or proprietary) image repositories. Would it be safer to redo them, or at least grab some from open license sources?
There was one section of code that was recoloring the "sick" green color palette onto anyone with that status ailment, which meant that the exact sequence of hues/shades mattered in order to get that effect to look right. With the current amount of processing power, I'm fairly confident that we can go up to full 32-bit color and just use a mask for those effects (or shaders, if we want to go 2D/3D hybrid) and scrap the whole 8-bit color palette route.
As for using Lua event loop: would https://medium.com/@imwithye/asynchronous-and-event-driven-programming-in-lua-572f81d32779 be something useful? It's been a little while since I modified anything Lua-related (other than updating or adding to the C wrappers that @pedro-w had already setup).
Some of the music was written by JB's cousin, if memory serves, and there was an email from him explaining which ones, goodness knows where I will find that. He also had some extra tracks/WIPs which are still on sf.net https://sourceforge.net/projects/kqlives/files/ExtraTracks/ Whether MOD files are the way to go these days, I have no idea.
I kind of thought that was the big reason why debian dropped kqlives was because the license for the music was unknown. That would be cool if some of it could be salvaged because they were pretty iconic. One of the tracks is named FF2: Toroia Castle so it had me doubt it was original.
Found a few relevant links
Also is there a better 'forum' for these discussions than a github issue?
@z9484 your memory is better than mine
Amazing footwork/Googling for all this previous info, @pedro-w! Thanks for all this.
@phinjensen Is your fork working on Windows or Linux currently? If I were to take a look at your progress, what kind of setup would I need? Would it be convenient to have a Docker container so the environment can be uniform regardless of host?
I think attributions for the music are a must; at a minimum, some kind of CREDITS.md or something could be in order. I don't see any problem keeping all discussion regarding the music and licensing in its own issue.
I could even dust off my old allegro.cc credentials and we could keep track of it all there, but if we're moving toward SDL2 instead of Allegro... /shrug.
I would recommend setting up Discussions and/or Wiki on this Github repo. allegro.cc is particularly nonsensical at the moment, don't think it'd be much use.
I set up a Discussions and a Wiki on this repo. I haven't had much time to write anything into them yet, so they're still empty.
@phinjensen I checked out your SDL2 fork and tried to compile it on Windows. Specifically:
kqlives
apt-get
(a lot of the apt install ...
came from trial-and-error and are simply sorted alphabetically below):
apt update
apt upgrade
apt install autoconf build-essential clang cmake cmake-doc freeglut3-dev libasound2-dev libgl-dev libpng-dev libpulse-dev libsdl2-dev libtinyxml-dev libtinyxml-dev libtinyxml-doc libtinyxml2-dev libxi-dev libxmu-dev manpages-dev ninja-build python python3-pip python3.9 tinyxml2 xorg-dev
apt-get install
for those two.build
directory to run cmake from: mkdir -p phinjensen/kq-fork/build/ && cd phinjensen/kq-fork/build
.cmake ..
from the build directory didn't seem to have any errors.make -j$(nproc)
gave several warnings, but it still created a kq-fork
binary in the root project directory.kq-fork
binary gave all sorts of errors (some of the attempts to fix them include packages in the above apt install ...
).Is there a specific configuration I need to do in order to get this to run? Should I scrap WSL and try to run/install SDL2 natively in Windows? Are you using vscode, Visual Studio, or another IDE/compiler?
I've been doing my development work with vim and tmux on Arch Linux, so I'm not sure how things work on Windows. I've never tried building anything SDL-related withing WSL so I don't know how that would work. You might try building natively on Windows, but I imagine it might be hard to find all the right packages.
I do have a Windows installation that I can test things on, but I'm attending university right now so it's hard to find time to do much. Honestly, I didn't expect that my little comment would attract much attention! I'm happy to see people talking about the future of KQ.
I downloaded the Windows SDL development libraries and added manual linking with cmake because I wasn't getting the sdl findcmake to work. But I was still getting some compile errors.
I added some pages to the wiki to start tracking our TODOs
I couldn't edit the wiki but I wanted to say that I was able to build both this fork and phinjensen on Debian without too much trouble; I just needed to tweak the cmake files to find the dependencies. Nice to see the old kq logo again.
Sorry about that @pedro-w. I didn't know how restrictive to set the Wiki permissions when I set it up, so if I need to adjust it to be "anyone" instead of "collaborators only" then that's also an option.
I updated the wiki with some step-by-step notes about (trying to) set up SDL2 on Windows. I haven't tried with Allegro 4 yet, if that's what you were able to get working, and phinjensen's fork seemed to have multiple compiler errors for me.
KQ currently need Allegro 4 to compile, it should use a modern library instead.