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

This Month's Specials

BCT Commander- Save $6.00
World Supremacy- Save $10.00

   







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

Reply
 
Thread Tools Display Modes
  #1  
Old July 19th, 2004, 04:52 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!

I'll see what I can do then

BTW, I just added 4 more operators:

The "to" operator generates random numbers in a specified range, so 1to6 simulates rolling a normal six-sided die.

The "d" operator acts like in many roleplaying games, rolling multiple dice; 3d6 rolls up a number from 3 to 18 with most values in the 8 to 12 range.

Note that these random generators will NOT allow you to generate random damage for weapons in SE4; it will just generate random numbers in the data files. Which might at least be good for a surprise game if you can keep yourself from peeking at the tech tree

The other two are really statistical operators, but I figured I'd throw them in because I'd already done factorials - the "P" operator calculates permutations while the "C" operator calculates combinations, if you happen to know (or care) what those are...
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #2  
Old July 20th, 2004, 01:28 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!

Time for another progress report!

I added variables today - actually, they're really just named constants, as the program can't perform symbolic manipulations on them. (Though I wonder how hard that would be given what I've set up so far... ) I added 3 built-in variables: pi, e, and c (the speed of light). Any more you might want?

I also added the "E" operator, which does scientific notation, e.g. 3E6 means 3 million.

All that's left now is those pesky functions (and those aren't really even crucial, as long as I can do the single-parameter ones as unary operators) and then I can start incorporating the SE4 files into a client program for this app!
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #3  
Old July 23rd, 2004, 02:11 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!

Almost there... these functions are just getting annoying because I have to basically copy and paste my wrapper classes for one standard math library function to the next...
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #4  
Old July 23rd, 2004, 06:58 AM
Aiken's Avatar

Aiken Aiken is offline
Major
 
Join Date: Jan 2004
Location: Taganrog, Russia
Posts: 1,087
Thanks: 0
Thanked 0 Times in 0 Posts
Aiken is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Ed, what's ETA for release?

Edit: feature requests

1. bit of OOP
2. Conditions.
3. Comment sign.

Together it could look like this:

if (Cost Minerals.Antiproton Beam (level-1))>1500
// do something
else
exec format c:

I can't imagine any application of these features, probably they're completely useless here (except comments), but nevertheless it's cool

[ July 23, 2004, 06:46: Message edited by: aiken ]
Reply With Quote
  #5  
Old July 23rd, 2004, 09:16 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!

ETA for release? Probably sometime early next week, or sooner if I feel especially motivated... I've just got two more functions to add to the parser (assuming I don't think up more! ) and after that I have to make it integrate with the SE4 files, but I already have some code that loads SE4 files, so that shouldn't be too hard...

OOP, conditionals, and comments? Hmm, that's a bit beyond the scope of what I was planning - all I really was going to do was have something that's basically identical to the SE4 data files (in fact you could pass in an SE4 data file and it would output it right back, not that that would be useful ) but with a few extra fields - Min Level, Max Level, Weapon Min Range, and Weapon Max Range come to mind. Then in most of the fields you could put in equations in square brackets and they would be substituted for you and based on the Min Level and Max Level, you'd get multiple SE4 data entries for each entry you supply to my program. I guess conditionals might be possible if I put in boolean operations, but right now I have everything set up as type double, which might have been a mistake - if I ever want to make it more generic (say, so I can add a function to generate the components' Roman numerals instead of having to use Arabic numerals in their place), I'd have to change everything to type object, and I have hundreds of places where I'm referencing type double - not to mention all the type conVersions I'd have to add, and error checking to make sure you don't pass a string to a function that's expecting a number!

But you will be glad to see the HUGE array of functions, etc. that will be supported:

Prefix operators:
+ (identity)
- (negation)

Infix operators:
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
^ (exponentiation)
\ (integer division)
% (modulo or remainder)
to (random; 3to6 generates a random integer from 3 to 6 inclusive)
d (dice; 3d6 generates a random integer as would be generated by rolling 3 six-sided dice)
P (permutations; 4P2 returns the number of permutations of 4 objects in Groups of 2)
C (combinations; 4C2 returns the number of combinations of 4 objects in Groups of 2)
E (exponential notation; 3E6 returns 3.0*10^6 or 3000000)

Postfix operators:
! (factorial)
% (percentage)

Built-in variables:
pi (ratio of circumference of circle to its diameter)
e (base of the natural logarithms)
c (speed of light, in meters per second)

Functions:
sin (sine)
cos (cosine)
tan (tangent)
asin (arcsine)
acos (arccosine)
atan (arctangent)
sinh (hyperbolic sine)
cosh (hyperbolic cosine)
tanh (hyperbolic tangent)
dtor (degrees to radians)
rtod (radians to degrees)
log (logarithm, base 10, or a specified base as the second parameter)
ln (logarithm, base e)
sqrt (square root)
curt (cube root)
root (returns x^(1/y) where x and y are the 2 arguments. Useful in place of the exponentiation operator if you want to take odd roots of negative numbers.)
abs (absolute value)
floor (largest integer below or equal)
ceiling (smallest integer above or equal)
int (integer part)
dec (decimal part)
round (rounds to nearest integer, or number of significant digits as specified by a second parameter)
fib (Fibonacci series)
poly (evaluates a polynomial in x; takes 2 or more arguments where the first argument is the value of x and later arguments are the coefficients of the polynomial in the order they are normally written, i.e. by descending order of power)
ftoc (Fahrenheit to Celsius)
ctof (Celsius to Fahrenheit)
min (finds minimum of all its arguments)
max (finds maximum of all its arguments)
avg (finds mean of all its arguments)
stdev (finds standard deviation of all its arguments)
median (finds median of all its arguments)

And any more I can think of!
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #6  
Old July 24th, 2004, 02:52 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!

No SE4 data file integration yet, but why not play around with my math parser and let me know what you think?

http://home.fuse.net/koliset/Programming/EEE.rar
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #7  
Old July 24th, 2004, 02:48 PM
Aiken's Avatar

Aiken Aiken is offline
Major
 
Join Date: Jan 2004
Location: Taganrog, Russia
Posts: 1,087
Thanks: 0
Thanked 0 Times in 0 Posts
Aiken is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

*trying to launch Evil Ed's Exterminator once again*

Do I need .NET Framework? I got errors about missing dlls when tried to work with it.

[ July 24, 2004, 13:52: Message edited by: aiken ]
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 01:48 PM.


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