Sins of a Solar Empire : Real-Time Strategy. Unrivalled Scale.
© 2003-2016 Ironclad Games Corporation Vancouver, BC. All rights reserved.
© 2006-2016 Stardock Entertainment

[Mod Utility] Entity Editor and Validation Tool (Fan made, Supports Rebellion)

By on April 20, 2010 8:39:12 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums External Link

ZombiesRus5

Join Date 02/2009
+324

I have a set of eclipse and ant based tools for modding with Sins that others may find useful when validating or building their projects.

Current Downloads (older downloads: Downloads

FAQ

System Requirements 

Syntax Wiki - A syntaxual representation of almost all of the Sins editable files.

 

How To's:
How To Install Eclipse

How To Setup Entity Validation Eclipse Plugin (Updated for new preference with v0.6)

Video: How to setup and configure the Soase Eclipse Plugin


References:

Mod Development with Eclipse (Forum link providing a general overview of Eclipse)

Eclipse download site (http://eclipse.org/downloads)

 


Tools Supported:

Entity Editor (Click me for cool stuff about visual Entity Validations)

Eclipse Editor builder/nature extension that provides visual feedback to the following validations.

Entity Definition View - Displays the syntax rules for the currently opened entity file.

 

Summary of validations currently supported:

Boolean: Validates boolean entries contain TRUE or FALSE only
Brush: Validates a referenced brush entry exists for the value entered
Conditional Validation: Allows conditional structures to follow based on a field value
Key word: Validates all entity file key words are spelled correctly
Quotes: Validates any values requiring qoutes have beginning and ending quotation marks
Integer: Validates integer entries contain digits
Decimal: Validates decimal entries contain ####.#####
Entity References: Validates a referenced entity file exists for the value entered
String Reference: Validates a referenced String entry exists for the value entered
Sound Reference: Validates a referenced Sound entry exists for the value entered
Enumeration Validation: Validates an entry confirms to an allowed set of values (i.e. buffInstantActionType)
Iteration Validation: Validates repeating elements are correct
Structure Validation: Validates entries appear in the correct order in the entity file (configurable to allow unordered structures)
Explosion Validation: Validates a referenced explosion entry exists for the value entered
Texture Validation: Validates a referenced texture exists for the value entered
Particle Validation: Validates a referenced effect exists for the value entered
Sounddata Validation: Validates sounddata files for correctness including referenced sound files
GalaxyScenarioDef Validation: Validates galaxyScenarioDef files for correctness with 2 pass validations
StringInfo Validation: Validates English.str for correctness
Brushes Validation: Validates brushes files for correctness
Gameplay.constants: Validates the Gameplay.constant file for correctness
Explosiondata Validation: Validates sounddata files for correctness including referenced sound files
Galaxy Validation: Validates galaxy files for correctness and performs additional validations on referenced templates and design names.

Content Assistance: [ctrl]+[space bar] on keywords or constants and get suggested completions
Syntax Coloring: change syntax coloring of entity files to suit your preferences (defaults to all black currently)
Hover Help: hover over a keyword and get additional details about the value or structure
Quick link to wiki syntax

Pinned, Locked Post 278 Replies +3
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
April 21, 2010 4:20:55 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

good ideas.

best of luck getting them to work the way you want them to.

harpo

 

Reason for Karma (Optional)
Successfully updated karma reason!
April 21, 2010 4:59:32 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

I would be so happy if you can pull this off.

Reason for Karma (Optional)
Successfully updated karma reason!
April 21, 2010 5:58:48 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

So I tried this against a different mod that had text files published and it worked quite well for the entity definitions I have built so far.

As you can see from the results below I don't have the spawn ships elements defined yet for Buff entities as that didn't exist in Sins proper.

Other things of note where I'm expecting a Integer it doesn't like Decimals and vice versa. Capitalization is enforced right now on effects and meshes which may or may not be required. I personally prefer capitalization to match.

edit - outdated now

Reason for Karma (Optional)
Successfully updated karma reason!
April 21, 2010 6:01:16 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Here's a taste of the structure defenitions:

 <structure name="CapitalShip">
  <field name="ability:0"/>
  <field name="ability:1"/>
  <field name="ability:2"/>
  <field name="ability:3"/>
  <field name="ability:4"/>
  <field name="defaultAutoAttackRange"/>
  <field name="defaultAutoAttackOn"/>
  <field name="prefersToFocusFire"/>
  <field name="usesFighterAttack"/>
  <field name="autoJoinFleetDefault"/>
  <field name="canBomb"/>
  <field name="hasBombingLevels"/>
  <field name="baseDamage"/>
  <field name="basePopulationKilled"/>
  <field name="bombingFreqTime"/>
  <field name="baseRange"/>
  <field name="bombTransitTime"/>
  <field name="bombEffectCount"/>
  <field name="bombEffectAngleVariance"/>
  <structure_reference name="bombEffectsDef" type="weaponEffectsDef"/>
  <field name="mainViewIcon"/>
  <structure_reference name="basePrice" type="Cost"/>
  <field name="slotCount"/>
  <field name="BuildTime"/>
  <structure_reference name="MaxHullPoints" type="LevelIncrease"/>
  <structure_reference name="MaxShieldPoints" type="LevelIncrease"/>
  <structure_reference name="HullPointRestoreRate" type="LevelIncrease"/>
  <structure_reference name="ShieldPointRestoreRate" type="LevelIncrease"/>
  <structure_reference name="ArmorPointsFromExperience" type="LevelIncrease"/>
  <structure_reference name="maxMitigation" type="LevelIncrease"/>
  <structure_reference name="MaxAntiMatter" type="LevelIncrease"/>
  <structure_reference name="AntiMatterRestoreRate" type="LevelIncrease"/>
  <structure_reference name="CultureProtectRate" type="LevelIncrease"/>
  <field name="NameStringID"/>
  <field name="DescriptionStringID"/>
  <field name="picture"/>
  <structure_reference name="Prerequisites" type="researchPrerequisites"/>
  <field name="roleType"/>
  <field name="statCountType"/>
  <field name="numRandomDebrisLarge"/>
  <field name="numRandomDebrisSmall"/>
  <iterative_field name="numSpecificDebris">
   <field name="specificDebrisMeshName"/>
  </iterative_field>
  <field name="armorType"/>
  <field name="hudIcon"/>
  <field name="smallHudIcon"/>
  <field name="infoCardIcon"/>
  <field name="minZoomDistanceMult"/>
  <iterative_field name="NumWeapons">
   <structure_reference name="Weapon"/>
  </iterative_field>
  <field name="m_weaponIndexForRange"/>
  <field name="firingAlignmentType"/>
  <field name="TargetCountPerBank:FRONT"/>
  <field name="TargetCountPerBank:BACK"/>
  <field name="TargetCountPerBank:LEFT"/>
  <field name="TargetCountPerBank:RIGHT"/>
  <field name="canOnlyTargetStructures"/>
  <field name="mass"/>
  <field name="ShieldMeshName"/>
  <field name="renderShield"/>
  <field name="maxAccelerationLinear"/>
  <field name="maxAccelerationStrafe"/>
  <field name="maxDecelerationLinear"/>
  <field name="maxAccelerationAngular"/>
  <field name="maxDecelerationAngular"/>
  <field name="maxSpeedLinear"/>
  <field name="maxRollRate"/>
  <field name="maxRollAngle"/>
  <field name="squadTypeEntityDef:0"/>
  <field name="squadAntiMatterCost:0"/>
  <field name="squadTypeEntityDef:1"/>
  <field name="squadAntiMatterCost:1"/>
  <field name="squadTypeEntityDef:2"/>
  <field name="squadAntiMatterCost:2"/>
  <field name="squadTypeEntityDef:3"/>
  <field name="squadAntiMatterCost:3"/>
  <iterative_field name="NumSoundsFor:ONATTACKORDERISSUED">
   <field name="SoundID"/>
  </iterative_field>
  <iterative_field name="NumSoundsFor:ONCREATION">
   <field name="SoundID"/>
  </iterative_field>
  <iterative_field name="NumSoundsFor:ONGENERALORDERISSUED">
   <field name="SoundID"/>
  </iterative_field>
  <iterative_field name="NumSoundsFor:ONSELECTED">
   <field name="SoundID"/>
  </iterative_field>
  <iterative_field name="NumSoundsFor:ONSTARTPHASEJUMP">
   <field name="SoundID"/>
  </iterative_field>
  <iterative_field name="MeshNameInfoCount">
   <structure name="MeshNameInfo">
    <field name="meshName"/>
    <field name="criteriaType"/>
   </structure>
  </iterative_field>
  <field name="meshNameIncreasedEffectName"/>
  <field name="meshNameDecreasedEffectName"/>
  <field name="ExhaustParticleSystemName"/>
  <field name="ExplosionName"/>
  <structure_reference name="CommandPoints" type="LevelIncrease"/>
  <structure_reference name="weaponCooldownDecreasePerc" type="LevelIncrease"/>
  <structure_reference name="weaponDamageIncreasePerc" type="LevelIncrease"/>
  <field name="HyperspaceChargingSoundID"/>
  <field name="HyperspaceTravelSoundID"/>
  <field name="EngineSoundID"/>
  <field name="formationRank"/>
  <field name="minShadow"/>
  <field name="maxShadow"/>
 </structure>

Reason for Karma (Optional)
Successfully updated karma reason!
April 21, 2010 6:05:06 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

And element validation rules

 <element_rule name="isUltimateAbility" validation="Boolean"/>
 <element_rule name="maxNumLevels" validation="Integer"/>
 <element_rule name="levelSourceType" validation="Simple" values="Intrinsic,ResearchWithoutBase,FixedLevel0,ResearchWithBase,StarBaseUpgradeLevel"/>
 <element_rule name="sourcePropertyType" validation="Simple" values="AbilityALevel,AbilityBLevel,AbilityCLevel"/>
 <element_rule name="baseSourceResearchSubject" validation="Research"/>

Reason for Karma (Optional)
Successfully updated karma reason!
April 22, 2010 4:30:02 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Mod tools released!

After lots of caffiene I believe I have a stable version for this tool. I've tested the EntityValidator against Vanilla, Entrenchment, Diplomacy as well as some significant mods that have been released.

Some of the results may not be obvious due to the nature of parsing these files but generally if the tool fails to parse the files there may be an issue. It is possible to run the tool in debug to get more information on why the tool failed on the particular file.

One example this tool does not like is using tabs or multiple spaces between a keyWord and it's value. This would be reported as an error even though the file will run in Sins.

Running the tool with failOnError set to false is a nice way to see all of the missing or incorrectly spelled references to String, Brush, Textures, etc.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
April 22, 2010 5:14:08 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Player[Name].entity only validates correctly against entrenchment currently.

I'm reviewing how to support both.

Thanks.

Reason for Karma (Optional)
Successfully updated karma reason!
April 23, 2010 12:19:29 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Very nice, I hope to start testing it this weekend.

Reason for Karma (Optional)
Successfully updated karma reason!
April 23, 2010 12:59:49 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting GoaFan77,
Very nice, I hope to start testing it this weekend.

Thank you, I look forward to seeing what you think.

Also, I released a version 0.2 after running some more passes over diplomacy and a few other mods.

Cheers

Reason for Karma (Optional)
Successfully updated karma reason!
April 23, 2010 9:56:24 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Looks interesting, keep up the work!

Reason for Karma (Optional)
Successfully updated karma reason!
April 23, 2010 10:07:16 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Wow great work so far , tools like this one and harpos will make modding for the masses possible

 

Reason for Karma (Optional)
Successfully updated karma reason!
April 29, 2010 10:00:23 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Released version 0.3 which makes minor improvements to the error reporting capabiltiies. I'm also toying with integrating this with eclipse as a custom Builder/Nature. I'm pretty excited about the possibilities of getting that working.

Reason for Karma (Optional)
Successfully updated karma reason!
April 30, 2010 3:31:10 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Here is a screenshot of my prototype Entity Builder/Nature plugin in eclipse. So far so good!

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2010 6:06:28 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

I realize this is not for the faint of heart, but I have a alpha version of the Eclipse editor tool available. It supports basic entity level validation support by the Ant build tools. I will be updating the ant build tools to reflect the current changes to the Entity validation process incorporated into the Eclipse Plugin.

It would be nice to turn this into a community project for any developers out there if interested. Many things could be added such as Wizards, content assist, etc. Although, I plan to continue on this albiet slowly in my spare time.

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 10, 2010 6:00:20 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

This is going to be a long post, but very useful.

Part 1: Install and Setup Eclipse for you Mod and Sins Reference Files

Directions to install and configure eclipse for both the Ant and Sins Eclipse Plugin.

Locate and download Eclipse Classic 32bit or 64bit depending on your OS.

Installation is easy, just extract Eclipse to any directory. I chose c:\tools

 

Start eclipse by executing eclipse.exe. If it doesn't start make sure you have Java 1.6 installed.

Start a new Project. Projects are where you will manage all of your modded files, including binaries.

Create a new Project to house the Sins Reference Files (TEXT VERSIONS)

Add your modded files to your new project and add the Sins Reference Files to the Reference Project

 

 

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 10, 2010 6:04:38 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Part 2: Install Sins of Solar Empire Eclipse Plugin

Install Sins of Solar Empire Eclipse Plugin. Unzipping the latest soseplugin_v.x.x.zip and copy the jar file contained into the eclipse dropins directory. Restart Eclipse.

Activate Entity Validation

 

At this point the tool is running but it doesn't know where the reference files are.

Here is how it looks before associating the reference files. First screen is for abiltiies the tool can't find (Errors). Second screen is for String references the tool can't find (Warnings).

Now to tie in the reference files. First select Window/Preferences

Then set the three reference directories previously loaded.

Force the project to revalidate now. (occasionally required to validate the entire project currently). However, saving in an individual file will force a re-validation for that entity without performing this step.

Any remaining errors will be highlighted as shown.

 

 


Reason for Karma (Optional)
Successfully updated karma reason!
June 10, 2010 11:35:32 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Using Ant to deploy a project.

Ant is a simple build tool that can be utilized to automate repeated activities during a software development lifecycle.

In this example the build.xml defines the repeatable steps to generate the manifest files and copy the game files. There is also a standalone target that can be used to validate the entities.

http://dl.dropbox.com/u/5790092/SinsTools/build.xml

Download the latest sins_build_tools_v.x.x.jar.7z and copy into you eclipse project. In this case I created a subfolder named lib and copied the jar file. The build.xml references the lib directory for the custom Ant tasks available in this thread.

 Example of running the ant task from eclipse:

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 5:52:40 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Awesome!, so this works like the Dev. exe and it shows you exactly the line where the error is yeah? and it does it without having to run Sins.  What do the warnings indicate?

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 10:04:08 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting SuperZERO0,
Awesome!, so this works like the Dev. exe and it shows you exactly the line where the error is yeah? and it does it without having to run Sins.  What do the warnings indicate?

Thats right, with the added benefit that you get to fix obvious errors prior to loading your mod in the dev.exe. None of the files are actually modified with this tool. Eclipse provides a way to associate markers to files that shows up as red x's or the yellow warning signs.

The warnings are used to indicate things that while they don't necessarily crash the mod but may be difficult to track down without extensive testing. Warnings include:

Brush: Validates a referenced brush entry exists for the value entered
Entity References: Validates a referenced entity file exists for the value entered
String Reference: Validates a referenced String entry exists for the value entered
Sound Reference: Validates a referenced Sound entry exists for the value entered
Explosion Validation: Validates a referenced explosion entry exists for the value entered
Texture Validation: Validates a referenced texture exists for the value entered
Particle Validation: Validates a referenced effect exists for the value entered

Besides continuing to enhance the entity validation tool, I plan on adding a custom perspective/edtor geared towards modding sins of a solar empire. This will include an advanced layout including template support (common lines in entity files), content assistance, wizards for new entity creation, additional editors for String and Brush files... Should be fun.

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 11:32:25 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting SuperZERO0,
Awesome!, so this works like the Dev. exe and it shows you exactly the line where the error is yeah? and it does it without having to run Sins.  What do the warnings indicate?

You might also check out codesion.com. It's a free source code repository (up to 200 MB). If you ignore binaries this can go along way as Subversion only stores the changes in files reducing the amount of space actually needed. The benefit of using a repository is history checking, versioning and branching. For example if you made some changes and it's not quite working right, you can easily do compares against any previous stable version.

I've setup the free repository for my stuff and it was really really simple to try it out. Of course a local repository always works too, but this one will support distributed team development. Plus I can connect to it from any computer.

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 8:36:38 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

 

Thats right, with the added benefit that you get to fix obvious errors prior to loading your mod in the dev.exe. None of the files are actually modified with this tool. Eclipse provides a way to associate markers to files that shows up as red x's or the yellow warning signs.

The warnings are used to indicate things that while they don't necessarily crash the mod but may be difficult to track down without extensive testing. Warnings include:

Brush: Validates a referenced brush entry exists for the value entered
Entity References: Validates a referenced entity file exists for the value entered
String Reference: Validates a referenced String entry exists for the value entered
Sound Reference: Validates a referenced Sound entry exists for the value entered
Explosion Validation: Validates a referenced explosion entry exists for the value entered
Texture Validation: Validates a referenced texture exists for the value entered
Particle Validation: Validates a referenced effect exists for the value entered

Excellent!, this tool is going to be very helpful I think.

Is there anything that shouldn't go in to your project folders? Such as the AppData, xml, Font etc folders or do you just put in everything that can be converted to TXT.?

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 11:37:10 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Oops!, I did something wrong and I get this error;

Problems occurred opening the selected resources.
  The project description file (.project) for 'AHA2' is missing.  This file contains important information about the project.  The project will not function properly until this file is restored.

Reason for Karma (Optional)
Successfully updated karma reason!
June 11, 2010 11:59:52 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Excellent!, this tool is going to be very helpful I think.

Is there anything that shouldn't go in to your project folders? Such as the AppData, xml, Font etc folders or do you just put in everything that can be converted to TXT.?

Good question, really anything can go in the project folders. But what is really needed are the files that can be referenced in your mod. Currently that means that all textures, sounds, etc as shown below need to be copied where the reference files are located. I might change this to be able to look in the Installation directory as well when you are just looking that a file exists such as for particles.

Here are the referenced files I have copied to perform all validations.

Reason for Karma (Optional)
Successfully updated karma reason!
June 12, 2010 12:05:01 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting SuperZERO0,
Oops!, I did something wrong and I get this error;

Problems occurred opening the selected resources.
  The project description file (.project) for 'AHA2' is missing.  This file contains important information about the project.  The project will not function properly until this file is restored.


Hmm, when a project is created a file name .project is located in the project directory. Maybe this was accidentally deleted?

I recreated this by deleting the .project from my sample project directory. Restarting Eclipse appears to have recreated the file.

Reason for Karma (Optional)
Successfully updated karma reason!
June 12, 2010 12:20:53 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

SuperZERO0, I made a eclipse project with your files and associated the entity validator with it. Here is the folder structure and files I included.

http://dl.dropbox.com/u/5790092/SinsTools/aha.zip

Note: I apparently broke the ignore case logic on file references when I refactored the entity validator.

missing reference [.entity] PlayerTech.entity /AHA/GameInfo line 56 Entity Problem
missing reference [.mesh] CAPITALSHIP_TECHCOMMAND.entity /AHA/GameInfo line 266 Entity Problem

I also was also curious about the "Invalid" value in ResearchField and modifierType.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108432  walnut2   Server Load Time: 00:00:00.0000281   Page Render Time: