fluffrabbit {l Wrote}:Great! Maybe add some documentation and move some of those files out of the root directory. I'm kinda lost as to where to start.
Huitsi {l Wrote}:I enjoyed EU3/4 but I've been too frustrated with Paradox's DLC spam to play them for some years now. This project is thus extremely welcome. Some documentation would indeed be nice, especially on how to get started with building for those of us less versed in Qt and C++. Also, some general description of the current state of the project would be nice. I can see you have a lot of files but that doesn't tell me much.
Julius {l Wrote}:There is TripleA: https://triplea-game.org/
(but if I remember correctly it is turn-based)
dulsi {l Wrote}:I took a look at a list of grand strategy games on wikipedia. I don't think I've played any beyond Romance of the Three Kingdoms and Nobanaga's Ambition.
What do you want to see in a grand strategy game? For detailing your project, you might want to consider posting in the project showcase forum. (Or simply ask the admins move this thread there).
Andrettin {l Wrote}:I've added build instructions to the readme.
[--]Metternich/map/province.h:154: error: declaration of ‘Metternich::Religion* Metternich::Province::Religion’ changes meaning of ‘Religion’ [-fpermissive]
154 | Religion *Religion = nullptr;
| ^~~~~~~~
QMAKE_CXXFLAGS += -fpermissive
[--]Metternich/database/gsml_data.h:55: error: ‘sort’ is not a member of ‘std’
55 | std::sort(this->Children.begin(), this->Children.end(), [](GSMLData &a, GSMLData &b) {
| ^~~~
#include <algorithm>
/usr/include/c++/9/type_traits:672: error: invalid use of incomplete type ‘class QVariant’
672 | struct is_trivial
| ^~~~~~~~~~
Andrettin {l Wrote}:About the lack of documentation, do you mean that there isn't an overview, or something else?
Huitsi {l Wrote}:Thank you for the instructions. I tried to build the project with my distro-provided Qt Creator and Qt (supposedly 5.13) but unfortunately ran into some errors.
First I got some erros like:
- {l Code}: {l Select All Code}
[--]Metternich/map/province.h:154: error: declaration of ‘Metternich::Religion* Metternich::Province::Religion’ changes meaning of ‘Religion’ [-fpermissive]
154 | Religion *Religion = nullptr;
| ^~~~~~~~
which I was able to turn into warnings by addingto the .pro-file.
- {l Code}: {l Select All Code}
QMAKE_CXXFLAGS += -fpermissive
Then I got a
- {l Code}: {l Select All Code}
[--]Metternich/database/gsml_data.h:55: error: ‘sort’ is not a member of ‘std’
55 | std::sort(this->Children.begin(), this->Children.end(), [](GSMLData &a, GSMLData &b) {
| ^~~~
which I solved by addingto that file.
- {l Code}: {l Select All Code}
#include <algorithm>
Now I get a bunch of erros like:
- {l Code}: {l Select All Code}
/usr/include/c++/9/type_traits:672: error: invalid use of incomplete type ‘class QVariant’
672 | struct is_trivial
| ^~~~~~~~~~
and am stumped. How is there an error in a distro-provided include file?
About the lack of documentation, do you mean that there isn't an overview, or something else?
d_carinthia = "Carinthia"
d_carinthia_german = "Kärnten"
Andrettin {l Wrote}:Does that fix the error for you?
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/character/character.h:374: error: declaration of ‘Metternich::Dynasty* Metternich::Character::Dynasty’ changes meaning of ‘Dynasty’ [-fpermissive]
374 | Dynasty *Dynasty = nullptr;
| ^~~~~~~
Metternich/character/character.h:375: error: declaration of ‘Metternich::Culture* Metternich::Character::Culture’ changes meaning of ‘Culture’ [-fpermissive]
375 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/character/character.h:376: error: declaration of ‘Metternich::Religion* Metternich::Character::Religion’ changes meaning of ‘Religion’ [-fpermissive]
376 | Religion *Religion = nullptr;
| ^~~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/landed_title/landed_title.h:122: error: declaration of ‘Metternich::Holding* Metternich::LandedTitle::Holding’ changes meaning of ‘Holding’ [-fpermissive]
122 | Metternich::Holding *Holding = nullptr; //this title's holding, if it is a non-titular barony
| ^~~~~~~
Metternich/landed_title/landed_title.h:123: error: declaration of ‘Metternich::Province* Metternich::LandedTitle::Province’ changes meaning of ‘Province’ [-fpermissive]
123 | Metternich::Province *Province = nullptr; //this title's province, if it is a non-titular county
| ^~~~~~~~
Andrettin {l Wrote}:I have a data repository for the game itself as well, Iron Barons.
[--]
To run the game, just set its directory as the working directory when running the engine; you can set the working directory in the Qt Creator by going to Projects->Run.
d_carinthia_german = "Kärnten"
d_carinthia_de = "Kärnten"
GunChleoc {l Wrote}:
- {l Code}: {l Select All Code}
d_carinthia_german = "Kärnten"
Is this for localization or for switching native/English names? If it's for the latter, calling it "native" rather than "german" might be clearer.
If it's for localization, it would be be better to call this
- {l Code}: {l Select All Code}
d_carinthia_de = "Kärnten"
to avoid confusion.
QT offers a translation system that will produce bilingual .ts files. It's better to use those than invent your own system, because a plain text editor is not a good tool for translators.
I know I'm nitpicking, but it will make your life easier down the road
Huitsi {l Wrote}:Andrettin {l Wrote}:Does that fix the error for you?
That particular one seem to be gone, but I still get others like it:
- {l Code}: {l Select All Code}
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/character/character.h:374: error: declaration of ‘Metternich::Dynasty* Metternich::Character::Dynasty’ changes meaning of ‘Dynasty’ [-fpermissive]
374 | Dynasty *Dynasty = nullptr;
| ^~~~~~~
Metternich/character/character.h:375: error: declaration of ‘Metternich::Culture* Metternich::Character::Culture’ changes meaning of ‘Culture’ [-fpermissive]
375 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/character/character.h:376: error: declaration of ‘Metternich::Religion* Metternich::Character::Religion’ changes meaning of ‘Religion’ [-fpermissive]
376 | Religion *Religion = nullptr;
| ^~~~~~~~
Metternich/character/dynasty.h:32: error: declaration of ‘Metternich::Culture* Metternich::Dynasty::Culture’ changes meaning of ‘Culture’ [-fpermissive]
32 | Culture *Culture = nullptr;
| ^~~~~~~
Metternich/culture/culture.h:46: error: declaration of ‘Metternich::CultureGroup* Metternich::Culture::CultureGroup’ changes meaning of ‘CultureGroup’ [-fpermissive]
46 | Metternich::CultureGroup *CultureGroup = nullptr;
| ^~~~~~~~~~~~
Metternich/landed_title/landed_title.h:122: error: declaration of ‘Metternich::Holding* Metternich::LandedTitle::Holding’ changes meaning of ‘Holding’ [-fpermissive]
122 | Metternich::Holding *Holding = nullptr; //this title's holding, if it is a non-titular barony
| ^~~~~~~
Metternich/landed_title/landed_title.h:123: error: declaration of ‘Metternich::Province* Metternich::LandedTitle::Province’ changes meaning of ‘Province’ [-fpermissive]
123 | Metternich::Province *Province = nullptr; //this title's province, if it is a non-titular county
| ^~~~~~~~
Sorry I didn't put these here initially, but (AFAICT) I had to copy-paste each error individually.
Anyway, once I used -fpermissive to bypass those the project built successfully!
This however just makes the game print 'Invalid "dynasty" instance: "de_penthievre".' and exit with code 255.
You should definitely reference this in the game's readme though.
Andrettin {l Wrote}:Does that fix the issue for you?
Huitsi {l Wrote}:Actually there appears to be no change in either issue.
Andrettin {l Wrote}:Alright, so to be able to debug the issue properly, I created an Ubuntu 18.04 VM, installed Qt and compiled the engine there. I could reproduce the error with the missing dynasty; GCC was optimizing away the variable that initialized the processing of database entries for each class. So the entire database was not being loaded (except for the "history" part). I've fixed that issue here:
https://github.com/Andrettin/Metternich ... a13e3a7476
With the fix in place, I was able to start the game, so the issue should be resolved for you now as well
Huitsi {l Wrote}:Andrettin {l Wrote}:Alright, so to be able to debug the issue properly, I created an Ubuntu 18.04 VM, installed Qt and compiled the engine there. I could reproduce the error with the missing dynasty; GCC was optimizing away the variable that initialized the processing of database entries for each class. So the entire database was not being loaded (except for the "history" part). I've fixed that issue here:
https://github.com/Andrettin/Metternich ... a13e3a7476
With the fix in place, I was able to start the game, so the issue should be resolved for you now as well
Thank you very much! I was indeed able to play the game now. I did still have to use -fpermissive though. Did you not encounter that at all?
Andrettin {l Wrote}:About -fpermissive, yes I did, sorry I didn't mention it. I had to do some research on the origin of the issue, and I have fixed it now in the last couple of commits.
Lyberta {l Wrote}:Don't mixup types and variable names.
Lyberta {l Wrote}:I use PascalCase for types and snake_case for variables. I also recently started to prefix member variables with m_ and it greatly helped me understand my own code.
Users browsing this forum: No registered users and 1 guest