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

0 Members and 1 Guest are viewing this topic.

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 #345 on: September 08, 2020, 02:50:46 PM »
Progress update 2020-09-08:

I'm also toying with the idea of adding an automation menu the way Distant Worlds: Universe does it.  Even though it's obviously not a feature in Aurora, I feel it might actually reduce overall development time because I can have automation handle the parts of my test campaigns that I'm not currently working on.  And it's not much more work than making a pure AI module.  The pure AI would essentially be the automation code with all the boxes checked.  An NPR AI module could optionally be packaged by the author in a way such that it could be dropped in as an automation suite for the player's own race with numerous options that can be individually turned on and off.

This is finally becoming a reality! 





And it's not just a pretty picture.  Preliminary AI is done for research, fuel production, construction factories, ordnance factories, shipyard upgrades, ship building, posting contracts, new colony creation, and some basic fleet orders.  The player has access to the same code the NPRs use to automate their own empire by toggling checkboxes on the General tab.  Checking all boxes on the General tab means 100% automation, with no exceptions.  (But some cheating, more on that below.)  When a box is checked on the General tab, it enables the corresponding tab with the same name.  For example, checking Colony Creation on the General tab will flip the Colony Creation tab from gray to blue and enable the tab so you can go in and make further customizations.  Currently the customizations available are limited; this system is primarily in place for more sophisticated AI mods (my own included) to take advantage of down the road.

I was right that it was a straightforward, logical step to give the player modular access to the NPR AI routines.  However, my preliminary AI borrows heavily from how VB Aurora's AI behaves, which means there is a bit of corner-cutting and cheating involved.  AI cheating is not necessarily a bad thing.  It saves programming time, improves performance, and reduces chances of the AI's empire grinding to a halt because of some edge case it isn't prepared to handle.  What the AI does do is attempt to be fair and appear realistic.  But since I have the following goals for player automation:

- 100% automation should be possible
- It should use only NPR code, allowing me to test NPRs "firsthand"
- It should not add significantly more work beyond what is required for NPRs.

Then I have to give the player access to the same cheats and shortcuts the NPR takes.  For my own testing purposes, that's fine, I need to test that the cheats are working properly anyway.  But for somebody else, it makes automation unappealing and even spoilery.  Knowing exactly how NPRs operate and precisely what shortcuts they take is immersion breaking.  In the spoiler section below I'll briefly cover one example of such shortcuts.

Off-Topic: spoiler • show




When NPR's create new colonies, these new colonies automatically receive a few free garrison ground units, a mass driver, and 100 Infrastructure.  If ruins are present, they get 5 free xeno officers on site, and some free construction units.   The player has to choose between enabling these checkboxes themselves or manually handling it themselves which would feel awkward and tedious.  This screenshot is just an example, there are other cheats I haven't listed.


Most players are going to prefer either having automation that doesn't break the rules or just not using it at all.  Because of that, and the broken immersion, I feel the most logical solution would be to hide Player Automation behind the Designer Password.  That's where NPR AI specifics are hidden anyway.  In Aurora, all you have to do is watch carefully in DM with time passing to see which magical shortcuts are taken. Speaking of Designer Mode, I do plan to make the password publicly available.  In fact, I'll bury it (quasar's, not aurora's) here: "i want to spoil the fun" since it'll pretty much be required for anyone making their own AI mods down the road.

Unrelated, on automated shipbuilding and fleet orders:  Automation currently ignores any ships or fleets created by the player.  I believe Aurora's NPR code would too, actually.  It's because AI generated fleets have an NPR type and no Task Force, while player fleets have no NPR type and do have a Task Force.  Fleets with an NPR type are assumed to have a very specific composition, and several assumptions are made about ship designs contained within that fleet as well.  An ideal AI would be able to handle any situation thrown at it, but my goal for Quasar is "at least as functional as Aurora's AI", with improvements to be made later by myself or modders.

I've already run one campaign completely automated, making use of all the categories on the screenshot above.  The game ran on its own from the very beginning to the point when it's time to create the first off-world colony.  Thanks to the "no interrupts" checkbox this could even be done while refilling my cup of coffee.  My next milestone is supporting multiple colonies and reaching the point where its time to start exploring other systems.  At present, I'm beginning work on... civilian shipping! 

Offline Froggiest1982

  • Gold Supporter
  • Vice Admiral
  • *****
  • F
  • Posts: 1332
  • Thanked: 591 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
    2023 Supporter 2023 Supporter : Donate for 2023
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #346 on: September 08, 2020, 05:18:15 PM »
Progress update 2020-09-08:

I'm also toying with the idea of adding an automation menu the way Distant Worlds: Universe does it.  Even though it's obviously not a feature in Aurora, I feel it might actually reduce overall development time because I can have automation handle the parts of my test campaigns that I'm not currently working on.  And it's not much more work than making a pure AI module.  The pure AI would essentially be the automation code with all the boxes checked.  An NPR AI module could optionally be packaged by the author in a way such that it could be dropped in as an automation suite for the player's own race with numerous options that can be individually turned on and off.

This is finally becoming a reality! 





And it's not just a pretty picture.  Preliminary AI is done for research, fuel production, construction factories, ordnance factories, shipyard upgrades, ship building, posting contracts, new colony creation, and some basic fleet orders.  The player has access to the same code the NPRs use to automate their own empire by toggling checkboxes on the General tab.  Checking all boxes on the General tab means 100% automation, with no exceptions.  (But some cheating, more on that below.)  When a box is checked on the General tab, it enables the corresponding tab with the same name.  For example, checking Colony Creation on the General tab will flip the Colony Creation tab from gray to blue and enable the tab so you can go in and make further customizations.  Currently the customizations available are limited; this system is primarily in place for more sophisticated AI mods (my own included) to take advantage of down the road.

I was right that it was a straightforward, logical step to give the player modular access to the NPR AI routines.  However, my preliminary AI borrows heavily from how VB Aurora's AI behaves, which means there is a bit of corner-cutting and cheating involved.  AI cheating is not necessarily a bad thing.  It saves programming time, improves performance, and reduces chances of the AI's empire grinding to a halt because of some edge case it isn't prepared to handle.  What the AI does do is attempt to be fair and appear realistic.  But since I have the following goals for player automation:

- 100% automation should be possible
- It should use only NPR code, allowing me to test NPRs "firsthand"
- It should not add significantly more work beyond what is required for NPRs.

Then I have to give the player access to the same cheats and shortcuts the NPR takes.  For my own testing purposes, that's fine, I need to test that the cheats are working properly anyway.  But for somebody else, it makes automation unappealing and even spoilery.  Knowing exactly how NPRs operate and precisely what shortcuts they take is immersion breaking.  In the spoiler section below I'll briefly cover one example of such shortcuts.

Off-Topic: spoiler • show




When NPR's create new colonies, these new colonies automatically receive a few free garrison ground units, a mass driver, and 100 Infrastructure.  If ruins are present, they get 5 free xeno officers on site, and some free construction units.   The player has to choose between enabling these checkboxes themselves or manually handling it themselves which would feel awkward and tedious.  This screenshot is just an example, there are other cheats I haven't listed.


Most players are going to prefer either having automation that doesn't break the rules or just not using it at all.  Because of that, and the broken immersion, I feel the most logical solution would be to hide Player Automation behind the Designer Password.  That's where NPR AI specifics are hidden anyway.  In Aurora, all you have to do is watch carefully in DM with time passing to see which magical shortcuts are taken. Speaking of Designer Mode, I do plan to make the password publicly available.  In fact, I'll bury it (quasar's, not aurora's) here: "i want to spoil the fun" since it'll pretty much be required for anyone making their own AI mods down the road.

Unrelated, on automated shipbuilding and fleet orders:  Automation currently ignores any ships or fleets created by the player.  I believe Aurora's NPR code would too, actually.  It's because AI generated fleets have an NPR type and no Task Force, while player fleets have no NPR type and do have a Task Force.  Fleets with an NPR type are assumed to have a very specific composition, and several assumptions are made about ship designs contained within that fleet as well.  An ideal AI would be able to handle any situation thrown at it, but my goal for Quasar is "at least as functional as Aurora's AI", with improvements to be made later by myself or modders.

I've already run one campaign completely automated, making use of all the categories on the screenshot above.  The game ran on its own from the very beginning to the point when it's time to create the first off-world colony.  Thanks to the "no interrupts" checkbox this could even be done while refilling my cup of coffee.  My next milestone is supporting multiple colonies and reaching the point where its time to start exploring other systems.  At present, I'm beginning work on... civilian shipping!

Very interesting indeed.
 
The following users thanked this post: ExChairman, tws029

Offline joansam

  • Petty Officer
  • **
  • j
  • Posts: 23
  • Thanked: 26 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #347 on: September 10, 2020, 08:49:12 PM »
This is great Kyle! Fantastic work - I’m really looking forward to playing with various forms of automation enabled so I can focus more on the military or economic side in different games!  :D
 
The following users thanked this post: Kyle

Offline Gram123

  • Warrant Officer, Class 2
  • ****
  • G
  • Posts: 67
  • Thanked: 21 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #348 on: September 11, 2020, 06:31:21 AM »
This looks fantastic. I'll start a game and try the new automation as soon as the civilian shipping is up and running!
 

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 #349 on: September 14, 2020, 03:27:28 AM »
Progress update 2020-09-14:

When you take a really long break you sometimes forget what you have and haven't done.  Turns out I still needed to do NPR generation.  I had empire creation in place but all the parameters were taken from player inputs and the home system taken from the prebaked Sol system.  Well, now NPR generation is done, including randomization of almost every parameter, generation of starting ships, and a decent homeworld system randomly selected from the pregenerated homeworld systems that come with Aurora.  This completes the SM Add NPR menu item too.

Same-system civilian shipping is done but still needs a lot of testing.  Civilian Mining Complexes are now implemented. 

Automation is still changing shape.  I reduced all the cheating checkboxes to a single "NPR Cheats" checkbox, so no direct spoilers to worry about any more.  It'll still only be available in designer mode because I very much don't want cheating to be a part of player automation. 

I'm discovering more and more NPR simplifications, cheats, and assumptions in Aurora that are making it less and less feasible to use NPR behavior for player automation.  They really need to be two different things.  I'm kinda sad to realize this, because I wanted automation to help with testing and because it's so cool, but I really don't want to go down the rabbit hole of writing new automation mechanics that Aurora doesn't have -- at least not until much later on.

So for now, when I'm working on AI-related things I'll just be watching a "pure" NPR play, and doing things manually as a player race for mechanics the NPR circumvents.  I don't really have a good idea on what few things I'll be working on next, which is why I figured I'd just wrap up what's been done so far in a progress post first before wandering off into the unknown.  Onward!

 
The following users thanked this post: Tchey, MinuteMan, tws029, procdrone, joansam, Avalanche

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 #350 on: September 19, 2020, 05:06:53 AM »
Progress Update 2020-09-19:

Made good progress on NPR exploration and expansion.  Generating empires from scratch is working fairly well now.  I'm able to create a fresh game with default settings and any number of NPRs, let the clock run, and come back to a mostly thriving empire.  (And bugs to fix.)  Here's one such NPR empire viewed in designer mode, a couple years into the game:




About half of the ships there were there at the start, the rest were created at shipyards.  Grav and geo surveying is underway.  One autominer-only colony has been established on a particularly good mining site.

A few more years in, about 5 systems have been discovered, jump gates constructed, and the first good colony candidate discovered 2 systems away from capital:





Civilian-produced infrastructure at the capital is shipped over and colonists begin arriving as well:





Eventually terraformers come along and begin working on bringing oxygen levels up.  Consumer electronics and other trade goods are exchanged later on.

I crank increments up to 30 days and let the game continue to run for awhile. 





And the empire at it stands at the end of my little demo run:





All of this is done by the NPR, with zero intervention from me in game.  At this point in the demo I notice a few critical problems to fix, such as needing to prioritize completing both sides of the jump point links in Rome, and needing to prioritize distance from Capital more than distance from fleet when exploring.

The game is still too shaky to push a new build unfortunately.  I still have a steady supply of bugs to fix and missing features to fill in.  The vague roadmap from here is filling in some small features I know are still missing, making sure civilian shipping looks ok from a player race's point of view, revisiting precursors now that some combat code is in place from a previous progress update, and multiple NPRs interacting with each other.  A short break or two may be added in there somewhere as well :)



 
The following users thanked this post: Froggiest1982, Tchey, Triato, tws029, procdrone, joansam, AJS1956, Avalanche

Offline Froggiest1982

  • Gold Supporter
  • Vice Admiral
  • *****
  • F
  • Posts: 1332
  • Thanked: 591 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
    2023 Supporter 2023 Supporter : Donate for 2023
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #351 on: September 19, 2020, 05:35:09 AM »
Well done, looks like on track.
 
The following users thanked this post: tws029, Kyle

Offline Tchey

  • Leading Rate
  • *
  • T
  • Posts: 11
  • Thanked: 4 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #352 on: September 19, 2020, 10:05:37 AM »
Really nice to see you’re at it again !

Thanks for your hard work.
 
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 #353 on: September 29, 2020, 09:22:47 AM »
Progress Update 2020-09-29:

The AI can do its thing for quite awhile now without any issues cropping up.  I added a feature to the galaxy map I'm really happy with, which auto-positions new systems as they are discovered.  This feature helps me get a broad overview of the galaxy to quickly spot problems and prepares the way for watching wars between multiple NPRs play out. 


(Quick reference: blue dots: colonized worlds at <=2.0 cost, orange dots and orange rings: unexplored jump points, percentages: geo survey progress, blue rings: uncolonized worlds <= 2.0 cost, red rings: grav survey incomplete, big blank circles: no system bodies, green lines: warp links without gates, orange lines: warp links with gates, yellow is a glitch in the gif encoding)

Not gonna lie, I'm having fun watching an AI empire take shape then resetting and watching a new one :)  This feature is pretty cool for the player too.  Positions of new systems are all relative to the system they connect to, and simple collision detection is used to find a suitable spot nearby at a standard spacing from the linked system.  When angles of 180 degrees aren't possible, clockwise angles are prioritized, resulting in a slight spiral effect in the overall layout.  If there's no room in the layer of grid spaces immediately surrounding the linked-from system, the next layer of grid locations will be checked, up to 100 grid spaces away from the linked system.  When choosing spots more than one grid space away, angles of 45 and 90 degrees are avoided so that the warp lines connecting between them are less likely to overlap existing warp lines on the map.  Once a position is picked, the system's position isn't touched again.  This means you can grab one particular system (or shift-select a group of them) and move it to a different spot on the map, even far away if you want, and new systems in that branch will be positioned relative to the system(s) you moved.

Here's one more screenshot of the same campaign above, a bit later in the game, when the player's Sol system and a few of its neighbors was discovered.

Off-Topic: show


In this game the AI has been building installations, ordnance, and fighters, shipping colonists, installations, and trade goods around, keeping up with research, pumping out civ and naval ships, terraforming, and pretty much anything else non-combat related.  (Mentioned for completeness; these were mostly done already)

With the addition of the non-combat AI and pathfinding, turns are getting pretty slow.  The animation above is in real time with 1 NPR and 1 dormant player race, with 1-day sub-pulse lengths.  There is tons of room for optimization in the pathfinding, but profiling revealed that unoptimized pathfinding takes about the same amount of time as the mostly-optimized detection, and about the same amount of time as the partially optimized movement code.  Which means optimizing pathfinding right now would have less of an improvement than I expected, so I'm holding off on a general optimization pass until a later date.  I suspect that slowdowns from combat AI will dwarf the rest anyway, and will need to be the primary focus.

The auto-positioning feature was probably only 10-15% of the updates I made to the game since my last progress update; it was just the first thing I did that had something interesting to show.  Also added were NPR ramming, NPR damage control, ship overcrowding and undercrowding mechanics, unloading cargo to stationary fleets, and detecting and shooting mineral packets.  I added multi-system pathfinding to all of the relevant default and conditional orders for the AI to make use of.  There were other fixes and additions as well, but I believe I've listed most of the notable ones.

No new build yet.  My vague roadmap is still: making sure civilian shipping looks ok from a player race's point of view, revisiting precursors now that some combat code is in place from a previous progress update, and multiple NPRs interacting with each other.  At that point I will most likely push a build, then move on to NPR ground combat, planetary conquest, espionage, and diplomacy.
 
The following users thanked this post: Tchey, DIT_grue, tws029, procdrone, Iceranger, joansam

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #354 on: September 29, 2020, 12:27:00 PM »
I've been meaning to ask this for a while.

My understanding is that this project (at least initially idk if thats changed) was to recreate the VB6 feature-set of aurora in C#.

So then it would be correct to assume that the C# ground combat will not be in Quasar4xs release?
 

Offline procdrone

  • Leading Rate
  • *
  • Posts: 14
  • Thanked: 8 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #355 on: September 29, 2020, 02:52:22 PM »
I've been meaning to ask this for a while.

My understanding is that this project (at least initially idk if thats changed) was to recreate the VB6 feature-set of aurora in C#.

So then it would be correct to assume that the C# ground combat will not be in Quasar4xs release?

You will get VB6 ground combat, this is "as most faithfull as possible" recreation of VB6 in a newer engine.
 
The following users thanked this post: Kyle

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #356 on: September 29, 2020, 06:17:02 PM »
I've been meaning to ask this for a while.

My understanding is that this project (at least initially idk if thats changed) was to recreate the VB6 feature-set of aurora in C#.

So then it would be correct to assume that the C# ground combat will not be in Quasar4xs release?

You will get VB6 ground combat, this is "as most faithfull as possible" recreation of VB6 in a newer engine.

Ok so I am not mistaken. Though I believe this recreation also has moding in mind so once a release is up I might get stuck in.
 

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 #357 on: October 04, 2020, 10:18:48 PM »
Progress Update 2020-10-04:

The new build, version 111, is finally up.  This includes civilians, precursors, and NPRs and a ton of other updates.  Some other additions since my last progress update include:

- NPR troop drops
- NPR shooting at shipyards and ground forces
- Electronic hardening
- Race Details > Delete Race
- HQ Commanders can train their subordinates past 100
- SM New Empire Setup > Set as Neutral race (provide colonists)
- SM New Empire > Create as NPR
- NPR diplo teams
- Support for leaving "Generate Empires as NPRs" unchecked (new empires are generated as player races)

I ran a successful war scenario, in which I linked two NPR home systems to each other, deleted all warp points other than the two forming the link, and watched them duke it out.  At first encounter, the two NPRs established diplo teams with each other and started to work on their relationships.  But due to being next door neighbors, they quickly angered at the presence of each others ships in their home systems and became hostile to each other.  I watched them fight it out, fixing issues as they arose, until they had both lost most of their war ships.  At some point I plan to set another one of these up, with uneven techs so I can see one side completely conquer the other.

So NPR's are theoretically complete, other than needing a lot more testing, and this is largely thanks to the NPRFleetOrders table that comes with Aurora's DB.  This table contains a nice outline for what each fleet type should be doing in order of priority, so these past several weeks I've been setting up my AI code to follow the steps in this table.

After the NPRvNPR test I started up a "real" campaign playthrough in Q4X and played it long enough to verify that Civilians appear to be behaving properly.  My intent was to keep going long enough to encounter Precursors and verify that all worked properly as well, but it's going to take awhile to reach that point so I figured I'd switch gears and finally put together a release build and another progress update.  Going forward, I'll probably be taking my time playing through this campaign and knocking out issues as they arise.  I've got a long list of suspected but unconfirmed bugs to work though as well.

As mentioned, the new build is finally up but is really only made available for the brave or the curious.  There is still a lot of testing and fixing to do.  There will no doubt be plenty of crashes or strange behaviors from edge cases I haven't encountered yet.  I've got a long list of potential issues to review, so there's no immediate need for bug reports.  If you do decide to check it out make sure you delete the quasar4x.sqlite from the %APPDATA%/Roaming/Godot/app_userdata/Quasar4x first, as I have completely replaced the accompanying database with a new one.  The program should actually do this automatically for you but I leave these manual instructions here just in case.  I don't believe any future save-breaking db replacements will be necessary.

Other than Swarm and Invaders, which are still low priority for me, I think all the major features are in the game now.  NPR and Civ AI wound up being internally coded rather than externally scripted.  Scripted AI is technically possible right now, I just need to add some documentation and examples.  Player-side automation is currently incomplete and most likely broken, since it really needs to be redone from the ground up.  The Linux build will be up soon, I just need to fire up the VM.  After that, I plan on taking my time with my campaign playthrough and spending the next few weeks just focusing on fixing what's broken. 
 
The following users thanked this post: ExChairman, Tchey, TMaekler, tws029, procdrone, Avalanche

Offline TMaekler

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Re: Quasar4x - An early look at an Aurora4x clone in the works
« Reply #358 on: October 05, 2020, 03:58:09 PM »
This sounds great. I have a multi-nation AAR which I discontinued due to it being too slow to play. I was thinking of converting it to Quasar4x - but don't know if any vital functions are still missing. It has several nations on earth, one alien species played by me and one AI - the usual "local" enemies. Would I miss a lot at the moment when I convert to Quasar4x?

This is the AAR:
http://aurora2.pentarch.org/index.php?topic=8464.0
 

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 #359 on: October 05, 2020, 06:33:39 PM »
This sounds great. I have a multi-nation AAR which I discontinued due to it being too slow to play. I was thinking of converting it to Quasar4x - but don't know if any vital functions are still missing. It has several nations on earth, one alien species played by me and one AI - the usual "local" enemies. Would I miss a lot at the moment when I convert to Quasar4x?

This is the AAR:
http://aurora2.pentarch.org/index.php?topic=8464.0

There aren't any vital functions missing other than swarm and invaders.  Mind sending me the file?  I'll convert it and run it a few turns to make sure nothing obvious breaks.  But if you don't want to bother with bugs and crashes, I'd recommend waiting until after I finish my current "fixing things" phase.