.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $8.00
Bronze- Save $10.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old December 25th, 2004, 03:57 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default 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?
Reply With Quote
  #2  
Old January 6th, 2005, 06:06 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default 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?
Reply With Quote
  #3  
Old January 6th, 2005, 10:31 PM
NarfsCompIsBack's Avatar

NarfsCompIsBack NarfsCompIsBack is offline
Corporal
 
Join Date: Jan 2005
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
NarfsCompIsBack is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Woot! Not that I can do anything with it right now.
Reply With Quote
  #4  
Old January 23rd, 2005, 09:52 AM
Nodachi's Avatar

Nodachi Nodachi is offline
First Lieutenant
 
Join Date: Mar 2002
Location: North Carolina
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Nodachi is on a distinguished road
Default 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?
Reply With Quote
  #5  
Old January 23rd, 2005, 11:51 AM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Oh, I've fallen into one of those lulls again... I've tried working on it a few times, and I think I have one thing figured out but then another problem crops up... and given that I don't get around to working on it every day that can take a while

Right now I have the linear interpolation function working (I think) but something's wrong with the geometric and logarithmic functions and I want to make sure that it's not something in the code (as opposed to just a bad formula definition in formulas.txt) before I release anything... and right now the prospects aren't looking too good

Plus then I still have to add those new features to the templatizer itself - the usage of more than 3 level variables, the definition of user-defined functions, etc. That all shouldn't be too hard because it's primarily just calling methods I already have defined (or copying and pasting ), rather than writing a lot of new code.
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #6  
Old February 20th, 2005, 06:46 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

All right, the bad news is I gave up on the .NET-powered templatizer... the good news is I moved to Java!

This was actually prompted by my switch to Linux; Mono's IDE isn't very developed at this point, whereas with Java you can use NetBeans.

Well, over the past 3 days I completely rewrote the templatizer part of the program, and gave up on the expression evaluator - because I finally found one that does exactly what I want, only it's even better than the one I wrote!

Have a look at this:
http://directory.fsf.org/science/math/calc.html

One problem I foresee is that it's called "calc" which is the name of the standard Windows calculator... well I could put in a dialog to locate the "real" calc, but for now - hey, who uses the crappy Windows calculator anyway? Just rename it!

The templatizer is almost working again, and it even has a GUI, but the thing I'm stuck on right now is trying to get the thing to not skip tech grids! It would be much easier if I weren't trying to support an unlimited number of tech grids... the very first templatizer supported 3; would 16 do? I say this because if I have a set number of grids, I can use nested for loops, but with an unlimited number, I have to use recursion and that gets messy!

Unless SJ wants to help me out, seeing as he's solved this problem already, even though I'm trying to make something that will compete with his Tech Gridder... hey, I did give up on .NET
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #7  
Old February 21st, 2005, 11:34 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Templatizer 3 is here!!!!!
http://home.fuse.net/koliset/SE4/tem...-3.0.0.tar.bz2
You'll need the aforementioned calc program, as well as the latest Java (not .NET) runtime.
Questions? Comments?
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:45 AM.


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