Author Topic: Quasar4x - An Aurora4x VB6 clone  (Read 165027 times)

0 Members and 1 Guest are viewing this topic.

Offline MinuteMan

  • Petty Officer
  • **
  • M
  • Posts: 25
  • Thanked: 11 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #315 on: April 15, 2020, 12:47:01 PM »
Hey Kyle.

I'm really impressed with what you did.
The amount of work you've done is astounding.

Did you program all those tables and other custom controls yourself for the godot engine?
 
The following users thanked this post: Kyle

Offline Kyle (OP)

  • Moderator
  • Captain
  • *****
  • K
  • Posts: 472
  • Thanked: 973 times
  • Quasar4x dev
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #316 on: April 15, 2020, 12:59:33 PM »
I copied the Godot editor's (IDE) own theme and created prefab scenes for many of the controls; the panel borders, the tables, the menu dropdowns, to name a few that I can remember.  The prefab scenes do consist entirely of godot's controls combined together with my customizations to their theme and style settings.   And yes come to think of it I do have some boilerplate gdscript code for most of the controls to get them to behave exactly how I want.
« Last Edit: April 15, 2020, 01:01:11 PM by Kyle »
 
The following users thanked this post: MinuteMan

Offline MinuteMan

  • Petty Officer
  • **
  • M
  • Posts: 25
  • Thanked: 11 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #317 on: April 15, 2020, 01:16:57 PM »
I don't know if you have a blog or something.
But I think you could write a couple of nice blog posts about the controls/scenes you made. :-).
 

Offline Kyle (OP)

  • Moderator
  • Captain
  • *****
  • K
  • Posts: 472
  • Thanked: 973 times
  • Quasar4x dev
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #318 on: April 15, 2020, 02:55:34 PM »
Progress update 2020-04-15:

Much earlier in this thread I stated I wanted to expose AI in external config files and allow players to design their own AI to use and to share.  So as I develop the AI, I would be doing it via the same external API that anyone else would use, developing the API in parallel with the AI itself.

I've finally gotten around to implementing that vision, and I'm pretty excited to share what I've got so far.  The Game Info window has a new Mods button and a red or green message saying whether all mods loaded successfully. 





Pressing the Mods button opens up a mod manager:




There is a console log at the top where all mods (and the manager itself) can print text to.  Each mod can have multiple scripts for distinct purposes, that each get their own row on the list.  The scripting language is GDScript that is loaded and compiled when the game starts, meaning they have the same capabilities and access as the game itself.  A Default mod comes with the game containing two scripts, located in mods/default/library.gd and mods/default/precursors.gd.  Each script can report its own name and version number to the mod manager, but the manager also lists the de facto folder and path of the script for clarity.  At the bottom left is a single Test button intended only for mod authors to quickly run ad hoc tests on their mods. 

The interesting part about the mod manager is that every mod can be configured to be active only when specific criteria are met.  The precursors mod can be configured to run for any combination of races, not just Precursors.  This is how you would tell each NPR which AI should control it.  The options that appear on the menu, and how they function, is controlled by the mod.  So other options are possible such as applying AI to NPRs with specific names, or to NPRs at random, to specific games, or even "only on Tuesdays."

Designer Mode is now implemented, but not necessary for developing AI because you can assign the AI mod to Players and watch what it does with your own empire.  The Apply To column is only the most basic setting, and typically the only configuration needed, but methods are provided for mods to store more complex configs to the game's database file.  This means it is possible to write a mod allowing a player to selectively automate specific tasks.

The mod manager is also available during gameplay via the Quasar4x > Mods menu option.  It won't reload mods, but you can change the Apply To settings.

In this build, Precursors are now dynamically generated, including all of their starting tech and ship designs.  (In previous builds, precursor tech and designs were just using the same static dump taken from an arbitrary Aurora game.)  There is now a chance for wrecks to appear in system generation.  There is also a chance for precursors to appear, although they don't move or fire yet.  Now that I have tech assignment, ship designs, and the modding framework in place I can start using it to implement precursor moving and shooting. 

Edit: Forgot to mention, I added the following options to the SM Random Ruin button, that enable generating some precursors so it's possible to dive right in and mess with an AI race:




Edit #2: Also forgot to mention what the default Precursors mod does right now:  It does the same thing Aurora does the subpulse after Precursors are created: Merges battle fleets located in the same location and deletes the empty leftover fleets.  Under precisely what criteria?  Beats me.  But at least it gives a starting example of how exactly AI scripting looks.

I plan to eventually post a tutorial on how to use the modding system for mod authors so I'll try not to go into too much technical detail here.  The files included in the mods folder do have a fair amount of documentation already, although don't expect any consistent formatting.  Mods that come with the game also include a Godot project file so they can be edited within the Godot IDE which provides syntax highlighting and auto-completion that is even aware of Quasar's own API calls.




Mods can be distributed without the project file and the scene file which are just included for authoring convenience.  The .API.gd file is included to get auto-completion to work and to show what methods are available via the api object, and is also not required in a finished mod.  A lot can be learned from the 'default' mod folder that comes with the game but there is also an 'example' folder with a mod that can be manually enabled in the included script file.  The example mod shows off how the UI can be customized (and my incredible artwork): 





The mod demonstrates how to change the image of a button, the background colors for various states of the button, how to resize it, and how to leave certain aspects (the border) intact.  The comments in the script contain links to the relevant portions of the Godot documentation to show how a mod author would have learned precisely what functions to call on the button, and thus how they could learn other manipulations not demonstrated by the example mod.  The example mod also demonstrates how to list the names of every node in the game so with some effort the author can find the correct UI element they want to modify. 

As I mentioned last time, updates will come out much more slowly as I am now in an experimental phase of the project and also have C# to chew on.  Version 108 is up on Itch containing the above changes.  Hope you enjoyed the read!
« Last Edit: April 15, 2020, 05:27:21 PM by Kyle »
 
The following users thanked this post: iceball3, JacenHan, thpapak, Triato, tws029, Zap0, joansam, Lava, Ri0Rdian

Offline lentik

  • Leading Rate
  • *
  • l
  • Posts: 5
  • Thanked: 3 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #319 on: April 15, 2020, 03:44:39 PM »
Fantastic project, thx for it! Its realy impressive to see that progression in your project.  Please keep it up :)
 
The following users thanked this post: Kyle

Offline Agm-114

  • Pulsar 4x Dev
  • Registered
  • Chief Petty Officer
  • ***
  • Posts: 41
  • Thanked: 16 times
  • Discord Username: AGM-114#7218
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #320 on: April 15, 2020, 09:18:51 PM »
Great work kyle! I'll have my mod out by tomorrow.  Gotta sleep though XD
 

Offline iceball3

  • Captain
  • **********
  • Posts: 454
  • Thanked: 47 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #321 on: April 16, 2020, 03:46:31 AM »
This modding API is actually super-exciting, gah! I am so glad I've spent the past week tangling with godot to get how it works on a baseline, so messing with this is going to be some fun for sure. ;D
Thanks mate!
 

Offline iceball3

  • Captain
  • **********
  • Posts: 454
  • Thanked: 47 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #322 on: April 16, 2020, 07:38:54 AM »
So I've been getting semi consistent crashes which involve:
-Crashing on trying to view the system map.
-Crashing when trying to advance time.
-Crashing when moving the window during game startup.
And somewhat less consistent crashes involving
-Starting the game.
-Opening any save.
Is there any way for me to recover useful crash logs of some sort?
 

Offline Ri0Rdian

  • Warrant Officer, Class 1
  • *****
  • Posts: 93
  • Thanked: 15 times
  • Discord Username: Ri0Rdian#3639
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #323 on: April 16, 2020, 01:33:36 PM »
Whoa! You telling me I get to see how AI would play MY empire? Witness at real time? That is awesome, one of the best features for games that allow for AI to take over player empire ( I bet some of you tried it in some of the PDX games for example).   Not once did I learn a thing or two by doing this, if it is really so thank you for this feature!

Edit:

I somehow missed the part where it would be possible to use those features to only automate certain parts of gameplay.  That is even better.  Reminds me of Distant Worlds: Universe, though the only automation worth it there was fleet stance.  Nice to have nevertheless.
« Last Edit: April 16, 2020, 01:44:08 PM by Ri0Rdian »
 

Offline Kyle (OP)

  • Moderator
  • Captain
  • *****
  • K
  • Posts: 472
  • Thanked: 973 times
  • Quasar4x dev
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #324 on: April 16, 2020, 02:41:45 PM »
Whoa! You telling me I get to see how AI would play MY empire? Witness at real time? That is awesome, one of the best features for games that allow for AI to take over player empire ( I bet some of you tried it in some of the PDX games for example).   Not once did I learn a thing or two by doing this, if it is really so thank you for this feature!

Yep. It was a pretty trivial thing to set up since the only difference in the database between you and an NPR is the Race ID, the NPR flag, and the SpecialNPRID ("is this a precursor or regular?").  Sure there are a few tables and orders dedicated for NPR use, along with any other tables the author wants to create, but good AI code should be able to detect when it has been handed an empire previously owned by someone else, and initialize itself in that case.  After all, it would have to do that any time it conquered another race's populations and ships.

I somehow missed the part where it would be possible to use those features to only automate certain parts of gameplay.  That is even better.  Reminds me of Distant Worlds: Universe, though the only automation worth it there was fleet stance.  Nice to have nevertheless.
Distant Worlds: Universe is the direct inspiration of this particular feature.  I love the game, and loved the idea of that feature, and was disappointed in how sadly it fell short of its potential.  I should point out that since quasar gives the mod author full access to the database, the UI layout, and loads an actual programming script not a config file, that considerable work is left up to the mod author and it's not going to be a task for the faint of heart or lacking of time.

So I've been getting semi consistent crashes which involve:
-Crashing on trying to view the system map.
-Crashing when trying to advance time.
-Crashing when moving the window during game startup.
And somewhat less consistent crashes involving
-Starting the game.
-Opening any save.
Is there any way for me to recover useful crash logs of some sort?
This is the one area where Godot fails hard.  For crash reasons to be logged it requires debug mode to be enabled, which would make all my code readable in notepad.  Can you post your save file in the bugs thread?
 
The following users thanked this post: joansam, Ri0Rdian

Offline iceball3

  • Captain
  • **********
  • Posts: 454
  • Thanked: 47 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #325 on: April 16, 2020, 03:16:31 PM »
So I've been getting semi consistent crashes which involve:
-Crashing on trying to view the system map.
-Crashing when trying to advance time.
-Crashing when moving the window during game startup.
And somewhat less consistent crashes involving
-Starting the game.
-Opening any save.
Is there any way for me to recover useful crash logs of some sort?
This is the one area where Godot fails hard.  For crash reasons to be logged it requires debug mode to be enabled, which would make all my code readable in notepad.  Can you post your save file in the bugs thread?
That's the darndest thing. I'm getting the issues with a practically fresh install, even the pre-made demonstration saves are crashing, with no saving done to them.

Edit from Kyle:
Lets continue this here http://aurora2.pentarch.org/index.php?topic=10595.msg124184#msg124184
« Last Edit: April 16, 2020, 03:33:32 PM by Kyle »
 

Offline Agm-114

  • Pulsar 4x Dev
  • Registered
  • Chief Petty Officer
  • ***
  • Posts: 41
  • Thanked: 16 times
  • Discord Username: AGM-114#7218
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #326 on: April 16, 2020, 05:38:40 PM »
Code: [Select]
https://i.imgur.com/U1ASpYi.png
Well, I gave the modding a shot and it worked great. 

It might be worthwhile to have a pinned modding thread.
« Last Edit: April 16, 2020, 05:41:29 PM by Agm-114 »
 
The following users thanked this post: Ekskavator, joansam

Offline Kyle (OP)

  • Moderator
  • Captain
  • *****
  • K
  • Posts: 472
  • Thanked: 973 times
  • Quasar4x dev
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #327 on: April 16, 2020, 07:57:30 PM »
Code: [Select]
https://i.imgur.com/U1ASpYi.png
Well, I gave the modding a shot and it worked great.
Good to hear!!  And it looks great!



 

Offline Agm-114

  • Pulsar 4x Dev
  • Registered
  • Chief Petty Officer
  • ***
  • Posts: 41
  • Thanked: 16 times
  • Discord Username: AGM-114#7218
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #328 on: April 17, 2020, 09:46:15 AM »


Finally got perms to post images.
Wouldn't it make sense to change sub pulse length into a dropdown menu to right of increment time or somewhere like that.
 

Offline joansam

  • Petty Officer
  • **
  • j
  • Posts: 23
  • Thanked: 26 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #329 on: April 17, 2020, 10:52:59 AM »
Very cool! Tempting me to get in on some modding myself  :)