Jump to content
Lord_Chris

Introducing: the Stronghold Legends Ai Editor!

Recommended Posts

Hello everyone!

For some time now, @ Asophix has been working on refining and advancing the Stronghold Knights AI Castle Editor program, originally created to work with Stronghold 2. His intention is to create a program where the community can edit and create their own AI Castle Designs in Stronghold Legends.

This is a truly historic moment and for the first time, you can now control aspects of Stronghold Legends which were previously never possible.

The work far exceeds the original Editor built by the team at stronghold Knights approximately 15 years ago, and there are many more features planned in the future as well which will improve the program further.

You can build & develop castles, place faction specific buildings, set faction-specific troops, patrol points and much more.

The initial editor is approaching completion and we are looking for members who would be interested in having early access to test & design their own Castles.

It is now stable to develop your own Castle, we need to test this on a larger scale before rolling out to the public for download. Your feedback is extremely valuable in helping to shape the future of this application for the whole community. Your thoughts and opinions, likes and dislikes will help to create the best experience possible for all global users who use this in future.

For the first time you can now design your own Stronghold Legends Opponent Castles.. so what are you waiting for? Take this opportunity to develop that Castle for Vlad or Dietrich you have always been looking for!

I'd like to commend @ Asophix for singlehandedly re-developing this application himself. On reviewing the old program we uncovered a number of serious issues which needed to be addressed and updated. Much of the program has been rewritten by him from the ground up. Without his hard work, this new editor would not exist.

I know I speak on behalf of our whole community when I sincerely thank him for his time and show him great gratitude for his work. To display our thanks we have promoted him to an Administrator on our community. May I be the first to heartily congratulate him and welcome him to the team! 👏

Please leave a comment below, or PM myself or @ Asophix if you are interested in taking part in this Beta release and testing the Editor. If you are currently a non-member feel free to email me on chris [at] stronghold-nation [dot] com or Asophix on asophix [at] stronghold-nation [dot] com.

Lastly, I have attached some screenshots of the program to date so you can see for yourself what can be achieved: 🙂

image.png.45c4312d48e338e0b3ccc018c58b2737.png

image.png.6030236f5b57d3a360cc00bb2ea205d1.png

image.png.fbb3721a64ca320cd4de22b46424f0bd.png


  Quote

The fields have eyes, and the woods have ears.

Read more  

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Legit game changer, not only for having more control over AI but also having bigger castles as Legends only has tiny ones.

Is AI capable of building any of the troops you specify? Like giving Lancelot defensive crossbowmen, would that work? Or does it best work with like Creatures since they do not need weapons.

Also i like how visuals don't overlap and there are grid lines, its something very annoying with the SH2 editor and i found myself always having buildings not placed due to overlap.

Share this post


Link to post
Share on other sites
  On 18/02/2024 at 19:57, Alfred The Baker said:

Is AI capable of building any of the troops you specify? Like giving Lancelot defensive crossbowmen, would that work? Or does it best work with like Creatures since they do not need weapons.

Read more  

Yes, it would 100% work! The AI has a robust enough economy that they can afford weapons for their troops. I have not found how a Lord is given a faction, but theoretically they can build any unit, if the recruitment building is available for them.

This program is only a Castle Editor right now, and you have no influence over the AI troop roster. Much like the SH2 editor, you can define rally points for the preset groups, between which the AI tries to spread troops evenly. There is a Lord Editor in the works, for which development has just been started.

  On 18/02/2024 at 19:57, Alfred The Baker said:

Also i like how visuals don't overlap and there are grid lines, its something very annoying with the SH2 editor and i found myself always having buildings not placed due to overlap.

Read more  

The grid toggle option is available for the SH2 editor as well, it is unchanged here! 😄

Edited by Asophix

Share this post


Link to post
Share on other sites

This is great. Good working AI editors are something very welcome in any Stronghold game, and it indeed brings a lot. Sometimes it enables is to fix an error in an existing castle, but it can also make AI much more efficient. Let me just mention how great castles have been made for Stronghold 2 - these Stronghold 2 AI lords fight significantly better with their new called!

Can't wait to see what are people going to make with this!

Sent from my Mi A2 Lite using Tapatalk

Share this post


Link to post
Share on other sites

@ Asophix

How has the castle building gone so far? Have you had the chance to do skirmish experiments?

The main lesson I learned is that fire drakes on the outside walls are a great way to get the AI to burn down their own economy. Oops! :classic_laugh:

Share this post


Link to post
Share on other sites
  On 28/02/2024 at 22:09, Planewalker said:

@ Asophix

How has the castle building gone so far? Have you had the chance to do skirmish experiments?

Read more  

Thanks, quite well! I would consider the ability to build almost complete. Every lord can be given a functional castle without misplaced buildings or differences, you can do it as well.

I updated the overhead building images and implemented a reposition of the camera upon zooming in. It is very rudimentary so it may not work in all positions (more of a math problem).

Markers are the only thing left to update, so I'm going to finish them as well and provide a new update, shortly.

Share this post


Link to post
Share on other sites

Allow me to introduce myself, I am Juan Carlos, a web application developer from Spain. Currently, I work as a security consultant, and I have been following with interest the project you are carrying out at Ai Editor Stronghold Legends. I would like to offer my assistance regarding code programming.

I possess strong skills in languages such as C#, Java, Angular, JavaScript, and TypeScript. My background includes developing complex web applications and implementing security measures in various environments.

I am confident that my experience and skills can be valuable for the project, and I am willing to learn and adapt to the specific technologies required. I would like to explore how I can contribute to the software development, whether it be through code writing, code review, security testing, or any other task relevant to the project.

Edited by Lord_Chris
Removed previous quote

Share this post


Link to post
Share on other sites

Hi @ Mordered24 , I have sent you a PM to discuss further 🙂


  Quote

The fields have eyes, and the woods have ears.

Read more  

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Hello Everyone,

I am pleased to announce that a public release of the Castle Editor is made available!

https://www.stronghold-nation.com/downloads/file/698-ai-castle-editor/

This program is a recompilation and a vastly improved version of the old SHK community editor intended for SH2. With this program, you can edit and introduce castle templates for all Legends bot characters.

The AI Editor includes a few quality of life changes, while preserving the style of its predecessor, such as:

  • File History of the last 10 templates visited or used
  • Automatic save function (can be turned off)
  • Tile indicator for easier building placement
  • Automatic keep placement in the center for new designs
  • Flood-fill deletion for removing large chunks of wall, moat and pitch ditch sections
  • Support of "Open With" feature for .AIC files on Windows

In order to use the program, simply unpack the .zip package on to your file system and run the .exe in the attachment. The program relies on Java to run, but everything necessary is bundled, so you don't need to install anything else. It is highly recommended that the file structure remains intact, or you may encounter weird program behaviour!

Version 0.7 marks the first release, but it is not the final one, as it will continue to see fixes and improvements for the foreseeable future. You can submit feature or bugfix requests in a comment by the file's Download section, or directly to me!

Many thanks for @ Lord_Chris and @ Planewalker  for testing the application and providing feedback on it!

Happy Editing!

Share this post


Link to post
Share on other sites

Beautiful work, Asophix!

I'll have to experiment with how big the castles can feasibly get before they introduce vulnerabilities like gaps in the defenses due to other buildings or terrain features.

Have you experimented with large AI castles?

Share this post


Link to post
Share on other sites

Thanks @ Planewalker !

Theoretically, any castle size should suffice. The stock Firefly maps are often ill-suitable for large castles though, which is a let-down. It's a Firefly syndrome to include way too small playing areas. 😕

According to my findings, either the AI is prone to block itself (got it on The Snake), or the estates are way too confined to fully construct a large design in them. Most of my tests involved the map "Fair Fight", but even there, I was forced to relocate the starting locations on the map due to the proximity of forests.

Either way, the same limitations apply as in the predecessor editor, e.g. a 100x100 grid is where the AI's castle is to be built. I'd rather the keep is left on center location in the AIC, and the maps themselves were designed properly. 😄 

Addendum: the AI only builds wood camps near "Tree 2". Fair Fight includes the wrong type of tree in all estates and I also replaced the forests there. I am considering collecting all limitations and showing them in the Help, in a coming version.

Edited by Asophix

Share this post


Link to post
Share on other sites

Leb here from Reddit, this is gonna be a long one. EDIT: Also apologies the images don't seem to loading properly, you will have to click on them, i am not sure what is causing this

image-1.jpg.d0f549f305a3d241e57e7b42f355764d.jpg

At first i have wanted to make this castle for Alfred, as why not.

image-2.jpg.f82068904315dbd0dd35a9e8718939cf.jpg

This is what i ended up at first, it looked a bit weird but i paid no mind to it at first.

image-3.jpg.a3ed5db56d4820a83090bb5caa7b3c53.jpg

Well that is a bit annoying. What i noticed is that in game the keep is 12 x 8 tiles while in the image its 13 x 8, the top row is completely empty while bottom row should be marked

image-4.jpg.7b47aaf5ef30ac8321ac70394775aeca.jpg

This is roughly how it should be, but this problem is not that bad but alingment can be annoying at times.

Bigger issue was that any form of rally points, wether its Defence or traps, just do not work and will be unable to save [however Firefly's castles don't seem to suffer from this iirc] This is bit annoying, since Legends AI for pre built castles on maps will man towers with archers automatically, but they will not do the same with AIC castles and will leave them empty.

There is also a shifting problem with some of the buildings.

image-5.jpg.85cc7900cb3fde832e60b822d3ddae03.jpg

The barracks has shifted position, if it faces Left it goes 1 tile to the left.

image-6.jpg.f61da5dbc0ec16f671ead688c8232d93.jpg

Ive then moved it one tile to the right and it corrected this, however i experience a different bug where this layout would not actually load in the game anymore, i don't know what caused this as it is the same layout except i moved Barrakcs 1 tile to the right.

image-7.jpg.6f9ddaca07310c189c71c0d3e7a8a6cc.jpg

Until i moved the 3 buidlings away from the keep, but this might have been a screw up on my end. I have also noted here that compared to what is in Editor, it seems Armory Kitchen and Guild have shifted a position down but that only happened when i moved the Barracks... I have no idea what causes this. Since on the ABOVE template which had the barracks shift its positions, it gone into the game fine, after i adjusted the barracks, it would not load at all, and after i moved the 3 buildings, they proceeded to shift 1 tile down, its awfully confusing.

After this i have paused for a bit

There is also a bug where if the Castle gate faces DOWNWARDS [which i think is North in the editor?] The gates will shift 1 tile down.

image-8.thumb.jpg.e416c069aa7ff6ec66c2c41452398b6b.jpg

The gate one the right should not be poking out, but should be going inside of the castle, this is the one that is turned DOWNWARDS in the AIC [TO AVOID CONFUSING, the gate one the right is NOT actually facing downwards, its actually facing upwards and it kept its correct position, the AI has turned its castle around to fit the AIC on that territory, so its actually a DIFFERENT gatehouse facing UPWARDS and not DOWNWARDS]

Also the AI seems to refuse to use anything but 01 castle, if i named castles 01 they work fine, but they will never read 2 or 3 [from Stronghold 2 i am aware AI will always use largest castle if it can, however in this game unless i renamed the files the AI would never use said castles]

If there is any confusing, this is curently fresh on my mind, it is a big info dump.

image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info... image.webpFetching info...

Edited by Alfred The Baker

Share this post


Link to post
Share on other sites

Hi Alfred, I think you may have uploaded them as attachments instead. Would it possible to embed as images please?

You may have to change the file extension from webp, I am not sure.


  Quote

The fields have eyes, and the woods have ears.

Read more  

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Ive noticed the issue, i think it happened since i pasted my images from discord when i was writting the whole thing and then google just turned it into WEBP, cursed format, ill see to resolve this as yeah it is annoying to read.

Share this post


Link to post
Share on other sites

Thanks Alfred


  Quote

The fields have eyes, and the woods have ears.

Read more  

⁠— Geoffrey Chaucer, The Canterbury Tales: The Knight's Tale

Useful Articles

Share this post


Link to post
Share on other sites

Okay, so I checked the screenshots thoroughly and it seems like the majority of the problems comes from wrongly shifted buildings. I agree that editing is not the easiest, because buildings screenshots weren't done from the same angle & distance.

My takeaways:

  • Keep appears 1 tile above its real position (size is correct, you couldn't build the walls occupying its bottom row footprint)
  • Gatehouse appears 1 tile below its real position
  • Armoury is 1 tile narrower than in reality (also smaller by half a tile's size)

The rally points should work properly. It looks like that rally points have a slight inaccuracy when the AI parses them in-game, so a point added on top of a basic or lookout tower may end up shifted, centering it on the ground instead of placing it on the tower. You could try ticking the 'elevated' property for the rally point in order to affect AI placement, when you want it to be placed on top of a structure.

The keep rotation also seemed to not affect building placement. There may be certain cases when an AIC goes corrupt: please if you can reproduce such situations, don't hesitate to detail them here!

I'll need some more time to test out a few scenarios and update the utility here on SHN.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Topics

    • Stronghold Crusader: Definitive Edition Demo Discussion

      Current status: UNAVAILABLE  (v1.02 access on Steam, 1.6 GB size) --- Greetings Lords and Ladies, Firefly Studios has revealed their plans to release Stronghold Crusader as a definitive edition on July 15th, 2025. Much like Stronghold 1, this "re-release" aims to provide an experience close to that of the original game, with redone graphics and added content on top. SHC:DE promises to add the following: 4 new AI characters, 8 new Bedouin mercenary units,

      in The Town Crier

    • Play Legends Matches With Us!

      Greetings! Lately, @ Lord_Chris  and me @ Asophix of the Stronghold Nation staff has started testing our mettle in Stronghold Legends again. Be it a friendly spar, or a true test of weapons and skill against wanderers on the Internet, we gladly invite everyone to our hearth! We frequently play both in an organized manner on Steam, via the in-game lobby system. Generally we prefer 10min peace time matches with low starting rank, low resources and no building or troop restrictions.

      in Gaming Events

    • How Well Does Stronghold Legends V 1.2 Translate Into the Steam Edition?

      So after having many crashing issues with version 1.2 of Stronghold Legends and shortly after realizing I lost the Stronghold Collection disk sometime after Christmas (if you don't know you can still play the Stronghold Collection games even if you lose the disk if the game is already downloaded to your computer) I uninstalled Stronghold Legends v 1.2 from my laptop a day or two ago. Today I did obtain the game again through Steam (yay!) and whilst playing through the King Arthur campaign (just

      in Stronghold Legends

    • Stronghold Legends Custom Skirmish Invasions on Last Mission Not Starting.

      I have been working on a map for the past 2-3 days now. It is a 3 part map. Parts 1 and 2 work perfectly fine but the third part you are to face down the final invasions. The invasions show up but unfortunately they don't attack no matter what. They are just standing where I set them but they don't start their siege. Even though they have their siege equipment and everything set up. I tried playing a bit with the delay/date and I assume delay (from what I have read) means that they will wai

      in Stronghold Legends

    • I Need Help With Modding the Graphics of Stronghold Crusader!

      Hi everyone! I'm working on a project where I want to modify the graphics of Stronghold Crusader. My goal is to create an entirely new themed game using the existing game's framework, where I’ll redesign everything from buildings and units to the main menu and in-game text. However, I’ve run into some issues with the tools I've tried, and I’m looking for suggestions on what programs I could use and if there are any specialized tools for this. Programs I’ve tried: Drago

      in Stronghold Crusader & Crusader Extreme

×
×
  • Create New...