.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   Space Empires V Editor 1.0 released (http://forum.shrapnelgames.com/showthread.php?t=31445)

Devnullicus October 30th, 2006 01:12 AM

Space Empires V Editor 1.0 released
 
Version 1.0 of an editor for Space Empires V data is now available. Currently, it will only edit facilities and there's a lot of work left to do, but I figure I can at least get some feedback now while I work on the component editor.

Please feel free to use this thread to provide any feedback.

http://www.devnullsoftware.com/se5

Elsemeravin October 30th, 2006 04:13 AM

Re: Space Empires V Editor 1.0 released
 
I jumped on it, downloaded it, installed it, ran it and then:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String s, NumberStyles style, NumberFormatInfo info)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Convert.ToDouble(String value)
at dotMath.EqCompiler.Paren()
at dotMath.EqCompiler.Sign()
at dotMath.EqCompiler.Power()
at dotMath.EqCompiler.MultDiv()
at dotMath.EqCompiler.AddSub()
at dotMath.EqCompiler.Relational()
at dotMath.EqCompiler.Compile()
at Se5Editor.MainForm.IsValidFormula(String formula)
at Se5Editor.Facility.Validate(Int32 sections)
at Se5Editor.Facility.Read(StringCollection lines, Int32 fileOrder, Int32& currentLine)
at Se5Editor.FacilitiesForm.ReadFacilitiesFile(String filePath)
at Se5Editor.FacilitiesForm.FacilitiesForm_Load(Objec t sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& amp; m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message&amp ; m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/windows/microsoft.net/fra...2/mscorlib.dll
----------------------------------------
Se5Editor
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Documents%20and%20Setting.../Se5Editor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/windows/assembly/gac/syst...dows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/windows/assembly/gac/syst...089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/windows/assembly/gac/syst...em.drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.


Hope you can see what's wrong. (I ran it on the SEV unmodded facilities.txt file) http://forum.shrapnelgames.com/images/smilies/happy.gif

pujal October 30th, 2006 04:23 AM

Re: Space Empires V Editor 1.0 released
 
Elsemeravin:

I don't think it was meant to run on the base facilities. I don't know why anyone would want to do that in the first place. You need to make a gameType, copy data > facilities.txt into your mod folder then run the editor on your gameType directory. Worked great for me.

Wow, great program. The Formula Wizard makes it stupidly easy to mod/create facilities now.

Only beef right now is a small one: the error message in the formula wizard, the bright colors are too much, and yellow on red is hard to see.

Really Dev, this is a great boon for the Se5 community. When this is finished hopefully the balance mod will get some competition http://forum.shrapnelgames.com/image...ies/tongue.gif.

p.s. The Abilities section is just stupendous. Also, are you planning on going all the way with this, say, having a code editor for modding the ai_scripts as well? Or are you just doing the game contents? Either way it will be invaluable.

Devnullicus October 30th, 2006 04:55 AM

Re: Space Empires V Editor 1.0 released
 
That's correct, it wasn't meant to be run on the SE5/Data folder. Obviously, I need to enforce the folder-choosing rules a bit better http://forum.shrapnelgames.com/images/smilies/happy.gif

I also think I need to make a function to "create new mod folder". In addition, when you open a data file, if it doesn't exist in your current mod folder, read the base-file and save the changed file to the mod directory.

I'm not sure any of that answers the problems that elsemeravin is having though. A few questions for you, Elsemeravin:

1) Do you have .NET Framework 1.1 or above on your computer?
2) Do you have SEV version 1.08?
3) Have you modified the faciltiies.txt it's reading? What it looks like is happening is that it's expecting a number and its getting a string or .. something?

Santiago October 30th, 2006 10:56 AM

Re: Space Empires V Editor 1.0 released
 
Thanks for all the work- downloading now http://forum.shrapnelgames.com/images/smilies/happy.gif

Santiago October 30th, 2006 11:19 AM

Re: Space Empires V Editor 1.0 released
 
Works great so far.

Timstone October 30th, 2006 12:56 PM

Re: Space Empires V Editor 1.0 released
 
Fantastic! Absolutely fabulous!
I hope we won't have to wait on the component editor for long. That will be the most used editor I guess.
Top notch. http://forum.shrapnelgames.com/images/icons/icon14.gif

Fyron October 30th, 2006 02:14 PM

Re: Space Empires V Editor 1.0 released
 
Devnullicus said:
1) Do you have .NET Framework 1.1 or above on your computer?


If he did not, there would be no JIT debugger to give such error dumps. Suppose he could have 2.0, but it is backwards-compatible.

Devnullicus October 30th, 2006 04:01 PM

Re: Space Empires V Editor 1.0 released
 
Ah, ok, wasn't sure. This is my first real foray into C# land, so I'm unsure of how everything works yet. Some of the DLL versions led me to believe that he does have 1.1, but I wanted to make sure.

I think the next step is for me to get a copy of your facilties.txt, elsemeravin, so I can run it locally and see where it's barfing. Can you post that for me?

Phoenix-D October 30th, 2006 04:08 PM

Re: Space Empires V Editor 1.0 released
 
Loads fine for me, but the forumla parser isn't as strict as SEV's is.

For example, in the editor putting one ( and two ) works fine; that'll cause an error on file loading for SEV.

Devnullicus October 30th, 2006 04:20 PM

Re: Space Empires V Editor 1.0 released
 
Yeah, the parser isn't as strict, nor will it handle multiple variables as well. It's a standard expression-parser library that's slightly modified to handle SEV formulas. In order to get it to be stricter, I would have to make it know about a lot more of the game mechanics. Honestly, it seems like there's better things I can spend my time on right now http://forum.shrapnelgames.com/images/smilies/happy.gif

What it's meant to be is a way to handle most formulas that SEV will handle and give some indications of easy-to-find syntax errors as well as allowing the wizard to help build valid formulas. Go much beyond that, and I'd be writing the scripting system for SEV again http://forum.shrapnelgames.com/images/smilies/happy.gif

Elsemeravin October 30th, 2006 06:12 PM

Re: Space Empires V Editor 1.0 released
 
Quote:

Devnullicus said:
That's correct, it wasn't meant to be run on the SE5/Data folder. Obviously, I need to enforce the folder-choosing rules a bit better http://forum.shrapnelgames.com/images/smilies/happy.gif

I did copy the main facilities.txt file into the mod/data folder not run directly on the main folder.

Quote:

1) Do you have .NET Framework 1.1 or above on your computer?

I'm not so sure. But the following answers may answer your question indirectly.

Quote:

2) Do you have SEV version 1.08?


Yes indeed.

Quote:

3) Have you modified the faciltiies.txt it's reading? What it looks like is happening is that it's expecting a number and its getting a string or .. something?

I do not seem to have modify the file although I cannot be 100% sure. To help you out, after I press continue in the error box, the program works and 10 facilities are displayed:
Space Yard Facility
Space Port
Resupply Depot
Mineral Miner Facility
Organics Farm Facility
Radioactives Extraction
Research Center
Intelligence Center
Robotoid Factory
System Robotoid Factory

So I feel the problem may come either from the System Robotoid Factory of the Medical Lab.

I have the following for there:

Name := System Robotoid Factory
Description := Robotic workers who will increase all production for an entire system.
Facility Group := Resource Extraction
XFile Class Name := Robotoid Factory
Picture Number := 9
Maximum Level := 21
Tonnage Space Taken Formula := 1000
Tonnage Structure Formula := 1000 (([%Level%] - 1) * 20)
Cost Minerals Formula := 20000 (([%Level%] - 1) * 200)
Cost Organics Formula := 10000 (([%Level%] - 1) * 100)
Cost Radioactives Formula := 10000 (([%Level%] - 1) * 100)
Number Of Requirements := 1
Requirements Evaluation Availability := AND
Requirements Evaluation Allows Placement := TRUE
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 20 in Robotics.
Requirement 1 Formula := Get_Empire_Tech_Level("Robotics") >= (20 ([%Level%] - 1))
Number of Abilities := 3
Ability 1 Type := Resource Gen Modifier - Minerals
Ability 1 Description := Increase mineral production for a system by [%Amount1%]% (only 1 facility per system effective).
Ability 1 Scope := System - This Player
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := 10 (([%Level%] - 1) * 1)
Ability 1 Amount 2 Formula := 0
Ability 2 Type := Resource Gen Modifier - Organics
Ability 2 Description := Increase organic production for a system by [%Amount1%]% (only 1 facility per system effective).
Ability 2 Scope := System - This Player
Ability 2 Range Formula := 0
Ability 2 Amount 1 Formula := 10 (([%Level%] - 1) * 1)
Ability 2 Amount 2 Formula := 0
Ability 3 Type := Resource Gen Modifier - Radioactives
Ability 3 Description := Increase radioactive production for a system by [%Amount1%]% (only 1 facility per system effective).
Ability 3 Scope := System - This Player
Ability 3 Range Formula := 0
Ability 3 Amount 1 Formula := 10 (([%Level%] - 1) * 1)
Ability 3 Amount 2 Formula := 0

Name := Medical Lab
Description := A facility dedicated to curing disease and improving the lifespan of your citizens.
Facility Group := Resource Extraction
XFile Class Name := Medical Lab
Picture Number := 10
Maximum Level := 49
Tonnage Space Taken Formula := 1000
Tonnage Structure Formula := 1000 (([%Level%] - 1) * 20)
Cost Minerals Formula := 10000 (([%Level%] - 1) * 150)
Cost Organics Formula := 5000 (([%Level%] - 1) * 50)
Cost Radioactives Formula := 5000 (([%Level%] - 1) * 50)
Number Of Requirements := 1
Requirements Evaluation Availability := AND
Requirements Evaluation Allows Placement := TRUE
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 1 in Medical Treatment.
Requirement 1 Formula := Get_Empire_Tech_Level("Medical Treatment") >= (1 ([%Level%] - 1))
Number of Abilities := 2
Ability 1 Type := Plague Prevention
Ability 1 Description := Prevents level [%Amount1%] plagues in this system.
Ability 1 Scope := System - This Player
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := trunc(([%Level%] / 10) 1)
Ability 1 Amount 2 Formula := 0
Ability 2 Type := Planet Population Reproduction
Ability 2 Description := Populations in this system will reproduce [%Amount1%]% faster (only 1 facility per system effective).
Ability 2 Scope := System - This Player
Ability 2 Range Formula := 0
Ability 2 Amount 1 Formula := 0.1 ([%Level%] * 0.1)
Ability 2 Amount 2 Formula := 0


Maybe it doesn't like the "trunc" ? However the file works ok with SEV.

(Strange that I only gets the problem though...)

I get another problem. The combo box for choice of ability type is empty (cannot select). I have in the data folder only the following files:

Facilities.txt
TechAreas.txt
Component.txt

Are some others necessary ?

Devnullicus October 30th, 2006 06:29 PM

Re: Space Empires V Editor 1.0 released
 
Ya know, it sounds like maybe your install went badly? Try uninstalling the one you downloaded, redownload it, and install it again.

I know that trunc() is working because I spent time making sure it did http://forum.shrapnelgames.com/images/smilies/happy.gif

No other files in the data folder should be necessary. The current tool only reads facilities.txt. All other data it needs it gets from consts.txt in the editor data folder (or is hardcoded in the code, but I tried to minimize that).

If re-downloading and re-installing doesn't work, I'll go deeper and analyze the text snippet you sent. I agree that it probably is something in the medical lab if you're seeing the 10 facilities before it in the list box.

Devnullicus October 30th, 2006 06:36 PM

Re: Space Empires V Editor 1.0 released
 
Actually, it does look like your base facilities.txt has been modified.

The line
Ability 1 Amount 1 Formula := trunc(([%Level%] / 10) 1)

should be (and is in my version):
Ability 1 Amount 1 Formula := trunc(([%Level%] / 10) + 1)

Somehow, your version lost a "+" sign...

That will definitely cause the formula parser to flag it as a bad formula, but shouldn't cause the exception that you posted. Let me figure out why the program isn't catching the error correctly as it does seem like this is a problem on my end.

Thanks for helping with this, Elsemeravin!

Elsemeravin October 30th, 2006 07:03 PM

Re: Space Empires V Editor 1.0 released
 
I did uninstalled and reinstalled but still the same problem.

I'll try to remove the Med Lab and launch again to see.

Devnullicus October 30th, 2006 07:07 PM

Re: Space Empires V Editor 1.0 released
 
I suspect that if you just put the + sign in the right place in the line, it will work.

Ragnarok-X October 30th, 2006 07:29 PM

Re: Space Empires V Editor 1.0 released
 
nice

skigrinder October 31st, 2006 02:28 PM

Re: Space Empires V Editor 1.0 released
 
This editor will be of great help!!
I've always hated mucking with the text files.

I installed v1.0 (using all defaults) but get the following when I fire up the Editor:

"The application failed to initialize properly...."

Do I need to be in a specific folder when I execute the install procedure?
Did I do something wrong?

Please help.

Also, any chance you'll do something similar for the SEV map files?
Is there any way to include specifications for moons on SEV planets?
I really miss having moons in SEV.

Thanx,
skigrinder

Elsemeravin October 31st, 2006 02:52 PM

Re: Space Empires V Editor 1.0 released
 
I just realised the '+' disappeared in the post but does exist in the file.
I will write a '+' juste after the ':' at the end of this line to check: : + 1

I finally tried deleting the Medical Lab part.
It will then go further up to the Ultra-recycler facility and then the same error again, I guess in the following:

Name := Climate Control Facility
Description := Atmospheric conditioning and manipulation improve the conditions of a planet.
Facility Group := Planet Modification
XFile Class Name := Climate Control
Picture Number := 17
Maximum Level := 100
Tonnage Space Taken Formula := 1000
Tonnage Structure Formula := 1000 + (([%Level%] - 1) * 20)
Cost Minerals Formula := 8000 + (([%Level%] - 1) * 80)
Cost Organics Formula := 8000 + (([%Level%] - 1) * 80)
Cost Radioactives Formula := 8000 + (([%Level%] - 1) * 80)
Number Of Requirements := 1
Requirements Evaluation Availability := AND
Requirements Evaluation Allows Placement := TRUE
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 1 in Planet Utilization.
Requirement 1 Formula := Get_Empire_Tech_Level("Planet Utilization") >= (1 + ([%Level%] - 1))
Number of Abilities := 1
Ability 1 Type := Planet Conditions Change
Ability 1 Description := Improves the conditions of the planet by [%Amount1%]% each year.
Ability 1 Scope := Space Object
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := 1 + (([%Level%] - 1) * 0.1)
Ability 1 Amount 2 Formula := 0



I think I got it. My computer has is expecting ',' as decimal separator instead of '.' and then when your program meets a decimal number in formula it will not process correctly.

But I'm not sure if you could force the decimal separator in your code to be '.' instead of windows default one ?

Fyron October 31st, 2006 03:01 PM

Re: Space Empires V Editor 1.0 released
 
skigrinder said:
Is there any way to include specifications for moons on SEV planets?
I really miss having moons in SEV.


There are moons already; they are just using an "offset from X" positioning to be orbiting their planets instead of being in the same sector. Unfortunately, SE5 does not name them properly as moons, but instead gives them a new name entirely. http://forum.shrapnelgames.com/images/smilies/frown.gif You could always replace the offset positioning with "same as" in systemtypes.txt, if you want them in the same sector (though to me that always seemed a little cheesy). If the moons use "same as" positioning, they get the lettered naming convention correctly. It's just a bug with "offset" naming.

Devnullicus October 31st, 2006 03:25 PM

Re: Space Empires V Editor 1.0 released
 
Quote:

Elsemeravin said:

I think I got it. My computer has is expecting ',' as decimal separator instead of '.' and then when your program meets a decimal number in formula it will not process correctly.

But I'm not sure if you could force the decimal separator in your code to be '.' instead of windows default one ?

Oh! Heh, fancy programming bites me in the ***, I see. I was trying to be "smart" and have the formula parser recognize regional settings. Obviously, I need to rethink that and turn that off http://forum.shrapnelgames.com/images/smilies/happy.gif

Thanks for finding this!

Elsemeravin October 31st, 2006 03:55 PM

Re: Space Empires V Editor 1.0 released
 
Quote:

Devnullicus said:
Oh! Heh, fancy programming bites me in the ***, I see. I was trying to be "smart" and have the formula parser recognize regional settings. Obviously, I need to rethink that and turn that off http://forum.shrapnelgames.com/images/smilies/happy.gif



Don't worry too much, I changed the regional setting to use '.' I should have done that long time ago already, so now it's done for good.

I think you should focus on component design first http://forum.shrapnelgames.com/images/smilies/happy.gif (and then tech areas ! with a nice tree representation) http://forum.shrapnelgames.com/image...es/biggrin.gif

skigrinder October 31st, 2006 04:22 PM

Re: Space Empires V Editor 1.0 released
 
Fyron,
Thanx for the response.
I'll take a look at the moon offset / same as idea.

The idea of creating planets in SE with 10+ moons (like those in our own solar system) has always intrigued me.

I like the idea of colonizing the moons, building cargo facilities and filling them with weapons platforms for planetary defense. However, this makes no sense if the moons are in a different sector.

An editor tool for the SEV map files (similar to DevNull's facilities editor) would be very useful as the text files are pretty complicated.

Thanx,
skigrinder

Devnullicus November 2nd, 2006 02:03 AM

Re: Space Empires V Editor 1.0 released
 
Elsemeravin: I'm trying to fix the error you (and others) have gotten with regional settings. However, I can't seem to reproduce the error on my computer. What are your regional settings (i.e. what did you change to make the problem go away, and what was the old value that was causing the problem)?

Elsemeravin November 2nd, 2006 04:21 AM

Re: Space Empires V Editor 1.0 released
 
In the national setting from configuration panel, go to customise button (right of national name), then change the decimal separator (sorry I don't remember the exact name for the english version), and change from '.' to ','.

Then apply.

Devnullicus November 2nd, 2006 05:11 AM

Re: Space Empires V Editor 1.0 released
 
ok, got it. Man, what a pain in the ***. Turns out I was correctly NOT using regional settings when parsing the formula, BUT C# was using them anyway when doing a Convert. So, it was doing very strange things with . and , characters when the regional settings were different.

The fix was to just set the app settings to en-US Number Formatting. Figuring out how to DO that, however, was a real pain in the ***. Ah well, it should work now.

Just in case any other C# programmers want to know how to force an application to use US number formatting no matter what the user's regional settings are, here's some code http://forum.shrapnelgames.com/images/smilies/happy.gif

<font class="small">Code:</font><hr /><pre>
CultureInfo currentCultureInfo = Thread.CurrentThread.CurrentCulture;
CultureInfo cultureInfo = (CultureInfo)currentCultureInfo.Clone();
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
cultureInfo.NumberFormat = nfi;
Thread.CurrentThread.CurrentCulture = cultureInfo;
</pre><hr />

Wouldn't be nearly so annoyingly difficult to figure out if the system didn't make the original settings read-only so that I had to clone them. Sheesh.

Elsemeravin November 2nd, 2006 06:08 PM

Re: Space Empires V Editor 1.0 released
 
Now that you solved this problem what about the component editor ? http://forum.shrapnelgames.com/image...ies/stupid.gif http://forum.shrapnelgames.com/image...es/biggrin.gif

Phoenix-D November 2nd, 2006 06:12 PM

Re: Space Empires V Editor 1.0 released
 
http://www.shrapnelcommunity.com/thr...o=&amp;fpart=1

He beat you to it by about 6 minutes.. http://forum.shrapnelgames.com/images/smilies/wink.gif

Devnullicus November 2nd, 2006 06:14 PM

Re: Space Empires V Editor 1.0 released
 
HA!

Elsemeravin November 2nd, 2006 07:07 PM

Re: Space Empires V Editor 1.0 released
 
Quote:

Devnullicus said:
HA!

So next step:

"Now that the component editor is done, what about the tech tree editor ?"
http://forum.shrapnelgames.com/images/smilies/happy.gif http://forum.shrapnelgames.com/image...es/biggrin.gif

Devnullicus November 2nd, 2006 07:19 PM

Re: Space Empires V Editor 1.0 released
 
Look in the readme.txt http://forum.shrapnelgames.com/images/smilies/happy.gif I've got some future plans in there (including a tech tree editor)

Elsemeravin November 2nd, 2006 07:28 PM

Re: Space Empires V Editor 1.0 released
 
Quote:

Devnullicus said:
Look in the readme.txt http://forum.shrapnelgames.com/images/smilies/happy.gif I've got some future plans in there (including a tech tree editor)

Keep up with the good work then ! And you'll make us happier and happier.


All times are GMT -4. The time now is 12:35 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.