|
|
|
 |

December 6th, 2004, 07:27 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Dec 2000
Location: USA
Posts: 15,630
Thanks: 0
Thanked 30 Times in 18 Posts
|
|
Re: SE4 Templatizer Ready for Download!
Sounds like your enjoying yourself Ed.  What do you have planned for SE V?
__________________
Creator of the Star Trek Mod - AST Mod - 78 Ship Sets - Conquest Mod - Atrocities Star Wars Mod - Galaxy Reborn Mod - and Subterfuge Mod.
|

December 6th, 2004, 09:51 PM
|
 |
General
|
|
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
|
|
Re: SE4 Templatizer Ready for Download!
SE5? Not much, seeing as SE5 will have its own built-in formula parser, making the templatizer pretty much obsolete (unless of course Aaron decides NOT to throw in custom formulas like I did  )
... that was odd, I did NOT post that at 4:30 this afternoon, I was on my way home from work at 4:30... did someone at work see the message I left without posting and post it after I left??? Yes, I believe they did, because I hadn't finished typing in the quadratic formula yet!
edit: oh, so I might as well finish that feature list... in addition to defining your own functions, you can define your own operators, like this:
#Postfix ! := product(factorialNum, 1, arg1, factorialNum)
which calculates a factorial by looping through the integers until you get to the number specified and multiplying them.
For infix operators, you have to specify a precedence (high, medium, low, or very low level).
(Yes, you will now be able to compute the products and sums of series... once I implement those functions, which will involve actually creating new named constants on the fly  )
I hope to eventually get symbolic variables in there so you could put in 3 * x + 4 * x and get 7 * x, (but I don't know how well that would work; how would I tell the program how to, say, recognize polynomials and multiply them out? not TOO hard, but then how would it know which form is the "simplest"? the one with the least number of characters? least number of parentheses? largest or smallest powers? and what if you throw in trig functions and user defined functions???  )
Actually, the templatizer itself is very simple; pretty much all it does is read in files and if it sees anything in brackets after a := symbol, it calls the expression evaluator to do all the dirty work, so the templatizer should (mostly) work with SE5 data files, or even SF or DO data files; the only hardcoded change I had to make was to define the "range" variable and run it through a loop from 1 to 20 (or 21) whenever the "Weapon Damage At Rng" field is found, so I suppose similar things would have to be done for other array fields in the other games as well...
__________________
The Ed draws near! What dost thou deaux?
|

December 7th, 2004, 01:21 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: SE4 Templatizer Ready for Download!
Quote:
Ed Kolis said:
I hope to eventually get symbolic variables in there so you could put in 3 * x + 4 * x and get 7 * x, (but I don't know how well that would work; how would I tell the program how to, say, recognize polynomials and multiply them out? not TOO hard, but then how would it know which form is the "simplest"? the one with the least number of characters? least number of parentheses? largest or smallest powers? and what if you throw in trig functions and user defined functions??? )
|
Just pick with the form that is easiest to use calculationally, and convert all functions to it. For example, the "simplest form" could be the standard form of a polynomial, a(n) * x ^ n + a(n-1) * x (n-1) + ... + a(0). You would probably want to convert the equations to matrix form and use linear algebra anyways, as it is really the only sane way to deal with polynomials  . This uses the standard form of the functions.
|

December 25th, 2004, 03:57 PM
|
 |
General
|
|
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
|
|
Re: SE4 Templatizer Ready for Download!
No, no templatizer 2.0 yet... but I have a question - what would be a good name for a function which performs a specified function on every character in a string and returns the concatenation of all the results? E.g. a hexadecimal to binary converter: you'd call it something like this
functionname(htob, "DEADBEEF")
where functionname is my function I'm trying to find a name for and htob is the hex-to-binary function which converts a single hex digit to binary... I thought of concat and foreach, but concat is already taken and foreach I want to reserve for an even more general case that's kind of nebulous in my mind right now...
__________________
The Ed draws near! What dost thou deaux?
|

January 6th, 2005, 06:06 PM
|
 |
General
|
|
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
|
|
Re: SE4 Templatizer Ready for Download!
Progress report time...
Almost there - just one more bug to fix in the expression evaluator and a few things to add to the templatizer itself! Apparently now when I type in something like 0 * (1 + 2) + 3 I get 0 because the multiplication gets spread across everything, not just the next term (the 1+2). Lots of new features, and yes, I did manage to get the templatizer to use the latest Version of the expression evaluator, and it's MUCH faster now - a data file which used to take several minutes to process now runs in seconds!  The new features I wanted to add to the templatizer are to be able to define local functions inside the data files themselves, and to allow more than three tech grid areas (previously the three were hardcoded; now I'm going to define them on the fly!  ) So, instead of something like this...
Code:
*BEGIN*
Min LevelA := 1 // primary tech area increases damage
Max LevelA := 12
Min LevelB := 1 // secondary tech area increases range
Max LevelB := 5
Weapon Min Range := 1
Weapon Max Range := [3 + levelb]
Name := Anti - Proton Beam <romana>-<letterb>
Description := Focused energy beam used as a medium range weapon.
Pic Num := 18
Tonnage Space Taken := 30
Tonnage Structure := 30
Cost Minerals := [25 + 25 * levela]
Cost Organics := [100 * (levelb - 1)]
Cost Radioactives := [10 * levela]
Vehicle Type := Ship\Base\Sat\WeapPlat\Drone
Supply Amount Used := 5
Restrictions := None
General Group := Weapons
Family := [2000 + levelb]
Roman Numeral := 1
Custom Group := 0
Number of Tech Req := 2
Tech Area Req 1 := Energy Stream Weapons
Tech Level Req 1 := [levela]
Tech Area Req 2 := Range Enhancement
Tech Level Req 2 := [levelb]
Number of Abilities := 0
Weapon Type := Direct Fire
Weapon Target := Ships\Planets\Ftr\Sat\Drone
Weapon Damage At Rng := [30 + levela * 5 - range * 2]
Weapon Damage Type := Normal
Weapon Reload Rate := 1
Weapon Display Type := Beam
Weapon Display := 1
Weapon Modifier := 0
Weapon Sound := apbeam.wav
Weapon Family := 1
*END*
you could have this:
Code:
*BEGIN*
#TechGrid damagelevel := [1] to [5]
#TechGrid rangelevel := [1] to [5]
#TechGrid minilevel := [1] to [5]
#TechGrid efficlevel := [1] to [5]
Weapon Min Range := 1
Weapon Max Range := [3 + levelb]
Name := Anti - Proton Beam [roman(damagelevel)]-[letter(rangelevel)]-[minilevel]
// nifty switch statement!
Description := Focused energy beam used as a [switch(rangelevel, 1, "point blank", 2, "short", 3, "medium", 4, "long", 5, "siege", "")] range weapon.
Pic Num := 18
#LocalFunction tonnage := [32 - minilevel * 2]
Tonnage Space Taken := [tonnage]
Tonnage Structure := [tonnage] // to save on typing formulas ;-)
Cost Minerals := [25 + 25 * damagelevellevel]
Cost Organics := [100 * (rangelevel - 1)]
Cost Radioactives := [10 * damagelevel]
Vehicle Type := Ship\Base\Sat\WeapPlat\Drone
Supply Amount Used := [6 - efficlevel]
Restrictions := None
General Group := Weapons
Family := [2000 + rangelevel]
Roman Numeral := 1
Custom Group := 0
Number of Tech Req := 4
Tech Area Req 1 := Energy Stream Weapons
Tech Level Req 1 := [damagelevel]
Tech Area Req 2 := Range Enhancement
Tech Level Req 2 := [rangelevel]
Tech Area Req 3 := Miniaturization
Tech Level Req 3 := [minilevel]
Tech Area Req 4 := Supply Efficiency
Tech Level Req 4 := [efficlevel]
Number of Abilities := 0
Weapon Type := Direct Fire
Weapon Target := Ships\Planets\Ftr\Sat\Drone
Weapon Damage At Rng := [30 + damagelevel * 5 - range * 2]
Weapon Damage Type := Normal
Weapon Reload Rate := 1
Weapon Display Type := Beam
Weapon Display := 1
Weapon Modifier := 0
Weapon Sound := apbeam.wav
Weapon Family := 1
*END*
__________________
The Ed draws near! What dost thou deaux?
|

January 6th, 2005, 10:31 PM
|
 |
Corporal
|
|
Join Date: Jan 2005
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SE4 Templatizer Ready for Download!
Woot! Not that I can do anything with it right now.
|

January 23rd, 2005, 09:52 AM
|
 |
First Lieutenant
|
|
Join Date: Mar 2002
Location: North Carolina
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: SE4 Templatizer Ready for Download!
How's this coming along, Ed?
BTW, the link for this is incorrect on your site. 
__________________
This is the 21st century, right? Then where the hell is my flying car?
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|