 |
|  |
 |
|
Blade Runner
|
 |
Belgium
Jan 1970 time: 06:13
|
|
I have a game structure outline in my head:
Program language, macro language and the possibilities to modify the game.
Program layers:
I. Interface, graphics, AI layer. They are time critical, so we need to use the possible speediest solution: Java codes with JIT or Hotjava or anything in that time, which can produce the quickest code.
II. Control files, decision trees, event generators, unit, tile and event related codes. We can use Jpython, which is free to use in non-commercial AND COMMERCIAL Java applications. We can ask our non-programmer members to write or change the code inside these parts of the program because the Python is easier to use and understand language than the Java. (see my thread-> Programmers: macro possibility)
III. Unit, tile, resources, etc... descriptions, use the python syntax. Python is very good to produce easy to read and understand lists, because:
a) You needn't declare the variables (like in Basic).
b) Not case sensitive.
c) The Python interpreter can directly use the Java variables.
So basically we can use Java and the Jpython interpreter to produce the complete game system, and we can provide for our gamers an easy to use but powerful macro language to modify the game.
Graphix:
We can use 2D and not animated graphics. This has 2 advantage:
1. We needn't produce special tools for us and for our gamers to modify the graphics of the game.
2. Speed, speed, speed!
Anyway, for me is evident to use minimum the CTP or SMAC like possibilities to modify the behaviors, looks, rules. The only thing, which is important from the beginning, is to avoid the hard coded variables, constants, lists and arrays (except graphics and AI). Later we can easily change something to hard code, the another way is not so easy.
The most important variables and constants which needs to go to text files.
Civs: civ name, ruler name.
Interface text (like button, menu and messages)
Units: unit names, graph. path, unit rules behaviors.
Tile: tile graph. path., tile econ. and moving rules.
Province: rules, graph path.
Economy: rules.
Tech tree: tech names, graph path, advantages, short description. (A parser can check if the tech tree is valid in the beginning of the game)
Help files (game, interface, units etc...)
Governments: name, graph path, rules.
There is a lot more but I think is enough for the start. Please comment and send your ideas, lists.
Thanks,
Blade Runner
[This message has been edited by Blade Runner (edited June 03, 1999).]
|
|
|  |
 |
|
JimC
|
|
Birmingham, England
May 1999 time: 05:13
|
|
Just curious -
Re: Python
Don't forget that we're all part-timers; are we programmers expected to learn another programming language syntax as part of this project? Or are we going to have to recruit Python programmers?
I don't really care, since I'm a student (always keen to learn) and the summer holidays are looming, so I'll have free time in abundance.
I'm thinking more about those who have 9-5 jobs etc....
Jim
|
|
|  |
 |
|
Druid2
|
|
Dallas,TX
May 1999 time: 05:13
|
|
BR:
Well, I looked at the Python snip that you put in the other thread
mport org.python.util.PythonInterpreter;
import org.python.core.*;
public class SimpleEmbedded {
public static void main(String []args)
throws PyException
{
PythonInterpreter interp = new PythonInterpreter();
System.out.println("Hello, brave new world");
interp.exec("import sys");
interp.exec("print sys");
interp.set("a", new PyInteger(42));
interp.exec("print a");
interp.exec("x = 2+2");
PyObject x = interp.get("x");
System.out.println("x: "+x);
System.out.println("Goodbye, cruel world");
}
}
and I doubt that anyone except a C or Java programmer would have a chance of writing a script like that.
The way I think of these scripts, is a user-defined set of logic that the AI [for a particular function] will do. We want, I think, to let the basic steps be clear, and in plain text. The closest I can think of at the moment is VBA--the Microsoft appl.lang. for all their suite of office apps. It has syntax that a non-programmer would have a chance to understand:
DO until (condition)
IF (condition) then ...... else ......
I hate to say it, but we might have to define our own script protocol for the user-written scripts.
The power and flexibility of Python or another technical script language is of little use if only WE can use it.
|
|
|  |
 |
|
Blade Runner
|
 |
Belgium
Jan 1970 time: 06:13
|
|
Druid2, Jimc,
I download the Python description and read it. The Python language is easy to use and understand. IMHO easyer to use than VBA and not only for me or for the programmers but for the users too. The language contain a lot of very powerful expressions. I.e. it has the next structure (from the Python description):
quote:
The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an
arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting
condition (as C), Python's for statement iterates over the items of any sequence (e.g., a list or a string), in the order that they appear in the sequence. For example:
>>> # Measure some strings:
... a = ['cat', 'window', 'defenestrate']
>>> for x in a:
........print x, len(x)
cat 3
window 6
defenestrate 12
|
This was only one. Please just look once the next site: www.jpython.org
So this is very user friendly. And my other example was for us to show how easy include this language to the game code. That example use JAVA code and not Python code. Of course the users NEVER need to change the JAVA code.
Blade Runner
[This message has been edited by Blade Runner (edited June 04, 1999).]
[This message has been edited by Blade Runner (edited June 04, 1999).]
|
|
|  |
 |
|
Druid2
|
|
Dallas,TX
May 1999 time: 05:13
|
|
BR:
I looked at some of the sample JPython scripts. Maybe I'm wrong, but I still cannot see how a mostly non-programmer, but somewhat PC literate user can produce that kind of code.
I think we want scripts to look something like:
CityGovernorScript:
For each City
If (CityUnderAttack) then
(SetMilSpending) to maximum
(Produce: DefenderUnit)
else
(SetMilSpending) to 50% of max
(AllocateFreeResources) to Research
end if
end for
exit script
I think that sort of logic *might* be doable by a user, certainly would be by a semi-programmer. But would he have a chance of producing [btw: I'm sure there are syntax errors, etc. in the following attempt at Python script.]
for city in cities
if CityUnderAttack == 1 :
try:
SetMilSpending (maximumMilitary)
Produce (DefenderUnit)
except:
SetMilSpending ((0.5 * maximumMilitary))
AllocateFreeResources (Research)
finally:
exitScript()
PLEASE, dont get me wrong. I'm completely open to any script language that can be read, created and easily interpreted by an average PC-literate user. If Python can do that, fine... if not, we have to find something else or create our own.
[This message has been edited by Druid2 (edited June 05, 1999).]
|
|
|  |
 |
|
Kull

|
|
El Paso, TX USA
Mar 1999 time: 22:13
|
|
Hey, maybe my general programming cluelessness will have some use after all!
At work, I fit into what you'd call the "power user" category. That means I can automate a lot of tasks using Business software such as Excel and Access, even turning out some fairly complex "systems". That means my programming skills max out at limited VB utilization. So if I can't figure out how to use the Macro language, my guess is that most others will be stymied as well.
Now, my next comments are based on this assumption:
We are talking about a method by which the game users can change it's parameters (scenario building), not the one coders will use to build it.
That said, I've looked at both Druid's script and Blade Runner's. Druid's is somewhat more intuitive, but both will send a novice racing back to the comfort of the standard interface. Powerful IS good, but can't we hide the "writing process" inside a friendly editor? Something more on the line of "City Governor AI","Review AI Options". Then a box appears showing all the AI selections. Perhaps the first is an either/or choice, "Defer to Civ-level AI" or "Local Autonomy". You pick local, then move to the spending column and type 100 in the military cell.
Maybe not the best example, but hopefully you see where I'm going.
|
|
|  |
 |
|
Blade Runner
|
 |
Belgium
Jan 1970 time: 06:13
|
|
Druid2,
Good point. I think in the US or anywhere else the first computer language in the school usually some BASIC version. (And the VBA is also very popular.) I search and find a BASIC version, writen in JAVA.
Sure Python has advantage, but you are right, we need to find the common knowledge of our gamers, and that is probably BASIC.
Kull,
What I offer is a three layer system. For that stuff of the game which need special event handling (i.e. The American emperium discover the Nuclear Fission.) I plan to produce some kind of easy to understand "program language". All the other information which is static (Unit, map, tile, civilization, game rules, game options) we will provide ready made programs for the users to modify the data. If you want to modify your game to produce scenario you need only change the game through the scenario editor. If you want to do something sophisticated you must write or modify or middle layer code. Don't worried, you can change the game system like with the CIV2 scenario editor without touch the BASIC coded part of the game.
Thanks for the replay,
Blade Runner
|
|
|  |
 |
|
Druid2
|
|
Dallas,TX
May 1999 time: 05:13
|
|
This sounds like it's on the right track...
Level 1 - internal AI: some AI built into the Java code.
Level 2 - public AI code modules: some AI in some 'programmer-modifiable' code that we make public.. could be Python, VBA or even Java.. If a programmer's going to modify it, why make it hard on ourselves? I'll bet more people know Java than Python.
Level 3 - Non-Programmer AI controls: and some .. err.. make it LOTS of options on a "Province Governor AI Screen" and so on...
then we just interpret the options selected.
Parameter driven AI that the user can easily select the parameters, and priorities. The screen gives him many choices, but they are not UNlimited choices, as it might be in a script.
[This message has been edited by Druid2 (edited June 05, 1999).]
|
|
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
Forum 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
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|