Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site forums as they ran on Ultimate Bulletin Board, 1998–2001. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 2005 site & forums

  Apolyton Civilization Site Forums
  Clash of Civilizations
  Object Builder: Bug Reports (Page 2)

Post New Topic  Post A ReplyPost A Reply In A New Window

This topic is 4 pages long:   1  2  3  4  profile | register | preferences | faq | search next newest topic | next oldest topic bottom of page
Author
Topic:   Object Builder: Bug Reports Format for Better Printing
F_Smith
Prince
Austin, Tx 78728
May 99
posted July 27, 2000 09:57   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Axi:

1) Shall do.

2) Agreed, altho the other options are not necessarily preferable right now. The ways around applet secutity restrictions are

a) to use a servlet and run my own webserver from my machine 24/7. We absolutely will do this eventually, for multiplayer, but hopefully we'll be able to find a better machine to host the servlet.

b) to 'sign' the applet. Theoretically this is a good option, but I'll have to look into how to do it.

c) to create a downloadable application, to allow users to save to their local machines.

I'm afraid there just isn't much other choice.

3) Excellent, substantive question. The datamodel I'm working with now has 'TendencyValues' and 'Attributes' as collections of what are called 'key-value' pairs. That's one thing I need to add to the Gui -- the ability to define those key-value pairs. And the idea is that while those values are a component of people's behavior, it will be able to be changed from EG to EG, so that not all members of a given 'culture' have to have the same tendencies or attributes. They can have the same ones, but they don't have to. Plus, a given group of people in a give square might have cause to change their attributes or tendencies independent of the larger 'culture'.

4) I think that would be a good addition, later. And actually, I've never before seen a scenario editor with a random map feature (altho it would have been nice to have had one). For now, I'm trying to keep the map small and sweet, so we can have controlled tests.


* * *

Mark:

I had considered a .jar, altho it would make it harder to control start-up time for the app, since it has to download the whole .jar before you can launch. But if people already are set up for Java2 .jars, that would save me a lot of trouble making up Gui components . . . and the collections stuff is better, too, altho a bit slower to access, on average. But that's a thought. Maybe after this weekend.

Oh, and I don't mind using the 'diamond' shaped tiles, later. For now, tho, I'm taking a simple (altho slow and memory intensive) shortcut of simply making each mapsquare a 'component' and adding it to a panel with 'gridLayout'. So I don't have to mess with a bunch of custom display code, and I get the right-click menus and such.

But later I can change that.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted July 27, 2000 11:42   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
One other option on the jar file is that you can let people who are going to use the OB intensively just download the jar file and run it locally (as an applet or application). Then they won't have to wait several minutes to load... Its a bit kludgey, but just a thought.
[This message has been edited by Mark_Everson (edited July 27, 2000).]
F_Smith
Prince
Austin, Tx 78728
May 99
posted July 27, 2000 13:30   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

That's a great idea for getting around this slow server, actually. I'll do that tonight.

Since Visual Cafe makes it so easy to put out a .jar file, there's no reason not to.

It really makes me mad, tho -- the thing was loading pretty fast last week, before they 'upgraded' their servers.

Some upgrade . . .

axi
Prince
Athens Greece
Sep 1999
posted July 28, 2000 07:50   Click Here to See the Profile for axiClick Here to Email axi  send a private message to axiSend a Message to UIN: 54413148 Visit axi's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
F_Smith:

1) Why did you make this thing fullscreen? It was good as it was, now my browser acts funny, not to mention my taskbar, which I have located on the left side of the screen, blocking the way. (Pity, this position of the taskbar always causes my windows to initially assume bad positions; why don't the programmers leave 3-4 cm margin on the left?)

2) Could you make the text windows that involve a list of objects a little bit larger? When the sidebars cick in, it's kind of ugly.

3) Now your program takes even more time to load, but I'm afraid that's partially due to my own crappy provider. (Well, if you consider that it's free and that I live in the other side of the Atlantic, it's not so bad after all...)

More comments when we see more progress...

F_Smith
Prince
Austin, Tx 78728
May 99
posted July 28, 2000 15:02   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Axi:

1) Sorry, just testing out something different. That's how I explore possibilities -- I don't ask you what size you want the screen, I show you a few different options and get your feedback. That way there's no guessing -- it's clear you *don't* like fullscreen!!!

I'll change that. I was going to try a 'frame' and see what that looks like, too. It would give me menus to use, for one thing, which would allow me to move those on-screen buttons to menus and free up some screen space.

2) Shall do.

3) A fix for the download time prob is going to be forthcoming. Please just bear with me, for now.

Right now, I'm beefing up the XML loader, so I can load all the scenario info. It's taking a bit of debugging, so it should be another night before I can add the object details Gui panels (Religion, Culture, etc).

Thanks for keeping up with this, tho . . .

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted July 29, 2000 09:21   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Thanks for pushing forward on the scenario thing. I tried the ancient Egypt one, but there wasn't much information in it in terms of all the cultures etc.. Is there once scenario that has a more complete coverage for the "easy start" option? That way I wouldn't have to add a whole bunch of things by hand...

I also ran into something that you may or may not know about. My notion was since it takes a couple minutes for the thing to come up, I would go do some other stuff in a different IE window while I was loading. But it never loaded under those circumstances.

F_Smith
Prince
Austin, Tx 78728
May 99
posted July 29, 2000 10:42   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

So far, the '6000bc' one has the most saved data. Egypt and Greece have a little.

The frame is indeed tied to the Browser, I believe that changing to another page in the browser will cancel the loading of that applet. I wasn't sure if I should make the browser frame the 'parent' frame of the game frame, because this would mean that closing the game frame would close the browser (the way it was before now). Should I go back to that?

I just finished debugging the XML loader last night, and making the cosmetic changes. I kinda like the frame approach, with the pull-down menus. More room for on-screen info. I think I'm going to stick with it, if there are no objections.

Tonight I'll flesh out a few more scenarios and add the ability to define the objects in depth.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted July 29, 2000 10:56   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I figured that was the case on the load, just thought I'd mention it. I'd like at least nearly full screen also.

Personally I think one complete scenario is enough. I'd much rather see some real meat on the government model before any further scenarios, so we can begin testing the gov model. I also think having a zillion scenarios there, but with no explanation of the status of any of them, will just frustrate people trying it out.

Just my vote...

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted July 30, 2000 08:16   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
One more request... Can you put up a zip of the source every once in awhile. It is a pain grabbing everything by hand. In fact so much of a pain that I only grabbed one class.
F_Smith
Prince
Austin, Tx 78728
May 99
posted July 30, 2000 12:17   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
There's now a zip file with all the source code available from the page.

There's also a downloadable zip file for running the app from your machine.

It works on my machine, but as before, there might be some differences from platform to platform that only ya'll can tell me about.

P.S. -- the 'scenario' files have to be underneath whatever directory the class files are in, in a "/scenario" directory. The application will read any .scn files in that directory and put those on the frame to be loaded.

The 'applet' still uses hard-coded file names for those buttons.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 01, 2000 17:12   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
*Note*

What is up now is not a finished release -- it is there for debugging purposes only.

I am aware not all of the Ruler Govt Preferences and Cultural Attributes will be %'s. I'll finish that. And no, the 'Ruler' data does not yet save, and the Cultural Attributes can not be stored.

Another night or two.

But then we'll be able to begin to 'play' a stripped-down 'govt' game, where you try and manipulate the govt via the ruler (with -- or in spite of -- the will of the people!!!). Then we can begin to hammer out the finished details of this model.

Another week, or two, at the most, and we can likely move on to another model.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 01, 2000 20:49   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I tried it out... can't wait for the one where you can see the numbers evolving! One request, when you enter numbers for the government attributes you allow 0-95%, you need to add 100%, at least I didn't see a 100%.

I will check out the zip to look at the design patterns you are using. Laurent and I are going to try to bang the Econ model for demo 5 into shape using MVC and some of your other suggestions. What we'll probably do (I haven't heard back from Laurent yet) is just have the new Econ model ride on top of the old code, without influencing it first. If all goes well then we can let the new Econ model take over its full functions a bit at a time. So if you want to enter any opinions on the major direction of the Econ model structure, speak up soon. We will try to post what we are doing as we go along so you can kibitz.

So perhaps the Econ model can be the next

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 01, 2000 21:55   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I'll fix that, thanks.

I wasn't thinking -- I did 20 iterations of 5% each, but starting at 0. Needed 21. I hate that 'zero' based thing, I goof it up all the time!

And I know they're not all going to be 0-100. I've only written that one widget. Just wanted to test it online.

I can't wait to work in the econ model. If you use any kind of MVC approach, it'll be simple to merge that into this code.

I'm off to wrestle this beast into submission . . .

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 01, 2000 22:35   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
This might be a good time to post a:

Standard Disclaimer

Anytime you're reading code I wrote, keep in mind:


  • It ain't perfect. There's a hundred little places (and a few BIG ones, I'm sure) where I've done something dumb, overlooked something obvious, that you will be able to help me with. It's the nature of the beast. When you write thousands of lines of code, it's hard to remember if you used proper grammer back on page 3. So if you see a better way to do it, speak up (or, better yet, code it and test it!!!). The more eyeballs, the faster, tighter, better than it will end up being.
  • I don't comment much. Sorry. I should comment more. Sue me.
  • The simple vectors and hashtables can certainly be replaced with more sophisticated Java2 collections. I'm only sticking with them because of IE4's limitations. But dang I miss custom comparators . . .

Void where prohibited by law. Relatives need not apply.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 02, 2000 07:13   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Hmmm.... Please try to comment as much as possible, at least in the areas where others are going to Need to understand what you are doing. Part of the collaboration thingy ya know

PS We keep getting questions as to why java and why not C++ blah blah blah (just got one in an email today). It would be useful to have a page on the web page 'Why Java?'. You are much more awary of many technical issues that I don't get. Are you game to organize some of your previous posts into a page of text?

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 02, 2000 10:09   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

I know, I need to comment more. I typically go back after the whole thing is done and begin to add comments. It shouldn't be a big deal for the DataModel and View code, since I used the MVC approach, usually the code is self-explanatory. For the 'controller' code (the turn-handlers and factories, mostly), I'll try and remember to comment more.

And sure, I'll put something together when I get a chance on Java v. C++.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 03, 2000 01:12   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Okay:

We're getting pretty close, now.

Each civ has a govt.

You can define a ruler, with govt preferences.

You can click the 'turn' button, watch one year go by. There's a turn handler system in place, altho all it does right now is set the tax rate to whatever the ruler's pref was, and add one year to the game date.

You can define a culture's attributes. Those will be used in churning the turn cycle.

Next I flesh out the populace more, and work their ideologies into determining the govt policies.

And then add in 'Special Orders' the ruler can use.

Only a few more hurdles . . .

Intersting Side Note: I used a 'GregorianCalendar' object to track the date, and was told that IE can not accept dates prior to 4716 bc.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 03, 2000 07:13   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Sounds like fun's a'comin'

BTW, Rodrigo hasn't been able to access the web for the last while, that's why we haven't heard from him.

GregorianCalendar LOL!

It just not Y5KBC compliant

axi
Prince
Athens Greece
Sep 1999
posted August 03, 2000 09:04   Click Here to See the Profile for axiClick Here to Email axi  send a private message to axiSend a Message to UIN: 54413148 Visit axi's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I'm adding a link in page 2 for functionality purposes:
http://home.austin.rr.com/lostmerchant/Clash/Editor/ClashEditor.html

Now, I'm back for just a day, so I'm not able to see or say much but, here I go:

Good things I saw:

1) The downloadable version of the beast opens nicely with the batch file.

2) The beast loads much-much faster now that it's local, but I have opened it online too and it's loading somewhat faster there too.

3) The evil fullscreen is gone and the interior looks damn good now. I love the dropdown menus.

4) Hurrah! I am now able to copypaste from the save window!

Bad things I saw:

1) You must have made an update yesterday, but you say nothing about it on the webpage. Is the downloadable file altered? I think we need version control (f.e Object bulider v.0.34) and frequent updates. What about the .jar file you were talking about?

2) Something must be wrong with the ClashEditor.html file that comes with the downloadable version. It opens the starting window twice and that window contains no scenario buttons, only one big quit button.

3)You have somewhat widened the text areas in the main window, but not in the edit windows, which are exactly the same.

4) When you select something from the EDIT menu, then it should let you edit an object. The popup windows let you build a new object instead, but you neither can edit it, neither delete it.

5) I once tried to build a civ but the program crashed right after I gave the ruler's name. The second time, after accepting the civ's name, it didn't proceed; the batch file instead was added a few lines indicating some errors. The third time it showed a big window with nothing in it except the name of the civ (I think I've got it this time!). All the times I tried this online, it crashed rightaway.

6) The object editor window doesn't refresh itself, so one can become a surrealist painter if only one has multiple windows open or drags the beast around the corners of his desktop. And what's worse, the online version is terribly slow to respond.

Things I expect to see shortly:

1) The capability to fully edit and delete the objects.

2) The capability to set our own values for the attributes and to define the proper functions between them.

3) Further clarification on what the "culture class" is supposed to do.

4) Further expansion on the social classes, along the lines of the govt model.

5) The implementation of the negotiations mechanism and of ideologies.

Suggestions:

1) Do not rush with the turn logic; there is much more stuff to insert before it makes sense to run turns.

2) Do not bother too much with graphics; on the other hand, a sound interface is neccesary.

Too bad Rodrigo is unavailable right now. He would surely discover plenty of faults in the design that I cannot.


------------------
"In a time of universal deceit, telling the truth is a revolutionary act."
George Orwell

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 03, 2000 12:22   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Hi, Axi:

Man, your vacation sounds like a dream!!! I'm jealous!

1) I am continually updating the one on the web, for testing purposes. The downloadable file is actually the version control of the moment. That downloadable file will be the last 'release'. The one on the web will have new features that are not fully implemented. A version number is a good idea, I'll put one in.

2) I'll check that out when I get a chance, but the downloadable 'applet' version is kind of unnecessary with a downloadable application version working.

3) As I flesh out the object details, I am fixing that. In the online version, check out editing 'Culture' and 'Civ'.

4) Same as 3. Both Culture and Civ now have details to be edited.

5) This should be working now, online.

6) Yes, that needs work -- the refreshes don't all work the way they're suppose to. I'll fix that a.s.a.p.

* * *

1) As I flesh them out, that is going in. As I said, 'culture' and 'civ' are there now (along with 'ruler', a part of 'civ').

2) Attributes -- in, mostly. Defining functions is next.

3) Check the online version.

4) Social Classes have to be integrated, agreed. One of the next steps.

5) Ideologies is specifically what I will code in tonight/tomorrow night.

* * *

1) Agreed. Altho it's fun to watch the calendar click, and the stats change, so I put in the framework for the turn code, and one simple function -- right now, the 'turn' button will change the govt's tax rate to the ruler's preferred tax rate.

2) I hope you realize that the graphix that are there are merely simple memory images I am drawing with bitmaps and masks. Simple stick figures and line drawings. I have no illusions about my pitiful artistic ability!

3) I do wish Rodrigo could help with this right now.

Good questions, all.

Thanks, Axi. Keep on keeping on. Hope you enjoy your vacation!!! See ya when you get back.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 04, 2000 10:45   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Guys:

I'm running a small fever, and the wife has threatened to have my hide if I don't go to sleep early a few nights.

Women.

Maybe Sunday I'll finish up with adding the 'Social Classes' and 'political structures'. I've got those about 2/3rds done.

Lord God Jinnai
Prince
Arnold, Mo 63010
Sep 1999
posted August 06, 2000 01:14   Click Here to See the Profile for Lord God JinnaiClick Here to Email Lord God Jinnai  send a private message to Lord God JinnaiSend a Message to UIN: 57262757 Visit Lord God Jinnai's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Bare with me cuz this is the first time i've actually tested this thing...anyway here's the report (and i'm doing this as i test it so i don't forget):

1> I don't know if you know about the window sizing problems, but there are a lot on the pop up windows like new province names and ruler name (ie the default sizes are the same) and they're a little to short. The civ edititor i had to expand it some width wise, ie anything that requires you to enter a new name is one. Ethinic culture editing had to be widened also (ie not the first menu that lists the various ones, but the one with the info). (Resolution is 1024x768)

2> On ruler options every time i put something at 100% it would go back to the prev setting. Also on tax rate and civil rights, when i set to 0, it also went back to the prev. setting.

3> In Edit Enthic groups when i clicked on one on the list it flickered and went back to the top without showing it selected (it actually did, but i don't think it should flicker and unhilight like that).

4> More of a question, but why lack 100% on all the culture modifiers? (not that it matters since the final version should be more tweakable that every 5%).

5> You need cancel/ok buttons instead of just using the 'X'. This is espically true with the cancel button.

6> It'd be nice to have differnt tones of highlited areas on the main window for which section i last put my cursor in and selected something, instead of the same default blue for all of them.

7> A way to switch between scenerios w/o reloading the whole thing would be nice.

8> This is totally unrelated to the actual applet fuctioning, but i think for many reasons, one of which is the fact that we're trying to make Clash cross cultural or non-cultural, u should replace the Cathlic abrivations of BC and AD with BCE and ACE, otherwise it might be seen like we're contradicting ourselves and could cause problems for certain scerios based on differnt religions and/or cultures.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 07, 2000 10:58   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I'm feeling better now.

Lordy:

Tonight I'll fix those. Thanks for your help on this, with all of us pulling together in the same direction we'll get this cart over the hill!

axi
Prince
Athens Greece
Sep 1999
posted August 08, 2000 19:07   Click Here to See the Profile for axiClick Here to Email axi  send a private message to axiSend a Message to UIN: 54413148 Visit axi's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
F_Smith, I would be glad to see the downloadable version of the beast updated. The online version is so slow that testing the thing is virtually impossible. So I would be obliged if you updated the page and added version control, so that we know what we're dealing with.

What little I saw from the civ and culture objects looks very neat. The map looks better now that it's bigger. Keep up the good work!

Btw, what does the "Age:17" supposed to mean?

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 09, 2000 11:23   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Axi:

As soon as the new enhancements are finished a little more, I'll zip it up and put it out in a new 'version'.

'Age' was just for fun.

The one on the website now has 'Political Structure' info, altho the gui part that sets the info isn't done.

Now it's time for specifics!!! It's time for turnhandler code!

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 09, 2000 11:48   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Hi F_Smith:

I was looking over the code, trying to see what I can learn from your approach. Please tell me that your map handling is just a temporary kludge, and that you will eventually store the map as a 2d array... If not, the 'flexible' approach shown below will result in enormous waste of time as the map scales up to 320x200 or whatever the standard size is. The idea may be flexible, but its Not scalable gracefully.

code:

public MapSquare getMapSquare(int x, int y)
{
Enumeration enum = map.elements();

while(enum.hasMoreElements())
{
MapSquare msq = (MapSquare)enum.nextElement();

if(msq.getXLoc() == x && msq.getYLoc() == y)
return msq;
}

return null;
}

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 09, 2000 12:45   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

Yes, I'm sorry.

I thought I mentioned that I'm using Vectors for simplicity, right now. Feel free to replace that with any type of collection you want. The method signature and return will stay exactly the same.

You don't have to use an array, by the by. Collections like a Linked List can give the same performance. The main advantage is that 'mapsquares' don't have to be 'square'. They can be any shape, and have 'borders'. Then to find the 'square' you just give the x/y location on the map and do a '.contains(x, y)' on the mapsquares until you get the one you want.

Altho even the simple Vector is not as slow as you're afraid . . . I did some tests with a full map (280 x 170) and access times were not bad. I can put that test out there, if you'd like. For any map under about 100x100, there was no pressing immediate need to use anything faster.

But a 2d array of mapsquares would certainly be one of the fastest, under many circumstances. Altho I think you should test some of the new Java2 collections like 'TreeMap' that are suppose to give a constant retrieval time for any number of elements. And again, you could also get the same performance with a 'LinkedList', and not be limited to squares.

But it's up to you. Do feel free to replace the specific collection. Later, if you'd like, we can code up some quick tests and check retrieval times.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 10, 2000 15:00   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Okay:

I ran some tests. The results were quite interesting.

It looks like a HashMap is the way to go. It is a tiny bit slower than using a raw array, but the difference is so negligible that it would be like putting a racing engine in a dump truck -- it may be faster, but it doesn't suit our purposes (hauling data) any better.

* * *
A note on methodology:

I wrote a program that created a certain number of random points (x, y locations). Three identical maps are built in different ways (simple Vector, MapSquare[][] array, HashMap with a 'Point(x, y)' key), then the program goes and retrieves the mapsquares at those points (including casting -- and the same list of points is used for all three maptypes, for consistency, to be fair to the 'Vector'). Retrieval times are as below.

Note: A retrieval time of '0' milliseconds actually means *less* than one millisecond. Nearly instantaneous.

The Data:

For the Full World Map:
MapSize: 280 by 120

Creating 100 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 12:57:28 CDT 2000
Finished: 965930256168
Total Time: 8132 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930256198
Finished: 965930256198
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930256719
Finished: 965930256719
Total Time: 0 milliseconds.

*****************************************************

Creating 1000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 12:57:36 CDT 2000
Finished: 965930262627
Total Time: 5888 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930262637
Finished: 965930262637
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930262817
Finished: 965930262817
Total Time: 0 milliseconds.

*****************************************************

Creating 10000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 12:57:42 CDT 2000
Finished: 965930327450
Total Time: 64593 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930327460
Finished: 965930327470
Total Time: 10 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930327651
Finished: 965930327681
Total Time: 30 milliseconds.

* * *

A single hemisphere, something like Europe and Asia:

MapSize: 100 by 100

Creating 100 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:00:05 CDT 2000
Finished: 965930409098
Total Time: 4016 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930409438
Finished: 965930409438
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930409709
Finished: 965930409719
Total Time: 10 milliseconds.

*****************************************************

Creating 1000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:00:09 CDT 2000
Finished: 965930411291
Total Time: 1562 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930411291
Finished: 965930411291
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930411401
Finished: 965930411411
Total Time: 10 milliseconds.

*****************************************************

Creating 10000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:00:11 CDT 2000
Finished: 965930427204
Total Time: 15763 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965930427214
Finished: 965930427214
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965930427254
Finished: 965930427274
Total Time: 20 milliseconds.

* * *

And a map about the size of Europe:

MapSize: 50 by 35

Creating 100 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:21:27 CDT 2000
Finished: 965931691762
Total Time: 4606 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965931691982
Finished: 965931691982
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965931692163
Finished: 965931692163
Total Time: 0 milliseconds.

*****************************************************

Creating 1000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:21:32 CDT 2000
Finished: 965931695107
Total Time: 2934 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965931695107
Finished: 965931695107
Total Time: 0 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965931695117
Finished: 965931695117
Total Time: 0 milliseconds.

*****************************************************

Creating 10000 random points to be retrieved

Creating Vector Map: Absolutely the slowest (yet simplest) method.
Created. Now retrieving test mapsquares:
Start: Thu Aug 10 13:21:35 CDT 2000
Finished: 965931698091
Total Time: 2954 milliseconds.

Testing Array Map: Probably the fastest method, but limits flexibility
and adds a point of failure (index out of bounds exception).
Created. Now retrieving test mapsquares:
Start: 965931698091
Finished: 965931698101
Total Time: 10 milliseconds.

Creating HashMap Map

Created. Now retrieving test mapsquares:
Start: 965931698111
Finished: 965931698131
Total Time: 20 milliseconds.

* * *

Another interesting result is that for smaller maps, around the size of Europe, the retrieval times even for a Vector is still fast. Altho a note on the variation in Vector retrieval times -- since the vector is looped thru until the right element is found, it is very time-sensitive to the position of the randomly generated point within the vector.

Both an array and a HashMap guarantee constant retrieval times.
[This message has been edited by F_Smith (edited August 10, 2000).]

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 10, 2000 19:05   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
You're right, the test results were interesting.

But I don't really see any advantage to the HashMap. So the array can throw an exception. If the HashMap returns null, which is the analogous result, then there is an error in the programming that we need to fix anyway! Plus there is a huge amount of existing code that already uses the array method. I already have safe access methods written... So from my position anyway the dump truck already has a Ferrari engine in it and it's not broke, why'fix' it? Please, just save us a lot of grief and copy the map stuff as it exists out of the code I've sent you. The code in the Beast doesn't have much on map handling yet, and it would be extremely easy for you to switch over. That is Not the case for the existing code base.

BTW, on another topic, is there any real advantage to using one of the Collections for holding something like the economic sectors, which I don't expect to change? I do realize that if we add one more sector to the economy it would save the trouble of changing over a bunch of array indices. Is that the limit to the benefits of switching, or is there something else?

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 10, 2000 19:56   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

I'm sorry, I thought I mentioned that the main reason I used a collection was the possibility of MapSquares not having to be square. It also gives you the power of an iterator or enumerator for looping thru mapsquares, and allows the use of custom comparators for some fancy ordering and reordering.

But it's no big deal if you chose to stick with an array. The only place that will have to change is the three methods in 'GameData' and the actual collection in GameData. The maphandling code in the rest of the program shouldn't have to be changed at all -- if it does, that's a goof that needs to be looked at.

Maybe I should back up -- I am assuming that the game code is going to store all game date in a single 'database' class (I've called mine gamedata, but I'll change that name to match whatever you want).

And this gamedata class will have two methods for getting mapsquare info --

public MapSquare getMapSquare(int x, int y)

and

public Enumeration getAllMapSquares();

altho if you don't use a collection, the last one may not exist for you, and the controller code may have to manually iterate thru all mapsquares individually, as you do in the Clash code. Which is not a problem at all.

So as far as mapworking code is concerned, there isn't any reason for me to work with an array -- and you can just as easily use one in your code. As long as the method signatures stay the same.

That's the beauty of a 'component' architecture. Plug in whichever you prefer.


[This message has been edited by F_Smith (edited August 10, 2000).]

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 10, 2000 20:03   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Oops:

Dense me.

By economic sectors you mean food/etc, I believe.

Ah. That does not absolutely have to be a collection, no. Altho doing so leaves open the possibility to greatly expand the econ model -- I was thinking more of having different types of food, instead of just 'food' (farmland/pasture/forest/lake/etc). Same for the other resources. We can (if we want, no need) have a bunch of different types of manufacturing sectors, instead of one lump sum.

Kind of like Caesar 3.

But it's not absolutely necessary.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 10, 2000 21:14   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Yeah that's a good point on different food or manufacturing types etc. I will look into how much I'd need to change before I pick. Seeing as we're basically taking the econ model down to the floorboards, might as well do it the right way.
Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 13, 2000 10:38   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Thanks for putting up a newer version of the code.

I also tried running the latest version of the beast, but it was more frustrating than enlightening. I went to the 6000 B.C. scenario. The only thing I could find that was particularly new was the panel that shows the government overview. That was useful, but until the turn logic comes in and you can see them change, it's just a bunch of numbers. The scenario still isn't loaded up completely with information, so you would need to do a lot of things yourself, for instance all the social and tendencies fields for the various ethnic groups still don't have anything in them. I encourage you to do a small writeup that tells people where the new cool things are with each version. Otherwise, people will be stuck like I was, blundering around trying to figure out what actually works and what doesn't.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 13, 2000 11:05   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Yeah, actually, that's because it's 'between releases'. You're just getting to see a work in progress, as I upload it for testing.

The code for the new features isn't firm, nor is it fully fleshed out -- for example, the info doesn't save or load yet.

You're just seeing my testing version.

Really, don't expect to be able to go looking for new features until a post here says that it's a 'finished' release. Anything that is in there but not 'announced' is just a feature in development. I don't mind if you check it out, and comment on the direction of the development, as long as you keep in mind what you're seeing.

Don't worry, when a new 'release' is finished, I'll post loudly here (and in the 'help dialog' inside the game) what is new and how it works.

Mark_Everson
Clash of Civilizations
Project Lead

Canton, MI, USA
b.02-15-99
posted August 13, 2000 12:59   Click Here to See the Profile for Mark_EversonClick Here to Email Mark_Everson  send a private message to Mark_EversonSend a Message to UIN: 30578681 Visit Mark_Everson's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Sorry, saw something above that made me think there was more new stuff...

I'll wait for the banner headlines next time!

BTW - why no packages in your code? Packages help me understand the code better, making it easier to read, etc.

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 13, 2000 14:23   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Mark:

There's definitely more in the code than I've got GUI stuff for. I'm sorry I haven't written 'view' code for all of it yet, that part just takes a little longer. As does parsing the XML.

That's one of the curses of development people are much more impressed by what they can see than what they can't see.

I get it all the time at work -- I can spend 3 months working up a perfect, clean, fast data model that revolutionizes our product's performance and the managers politely pat me on the back. But if I spend 20 minutes putting some cool moving grafix on a splash screen, or a 'toilet flushing' sound when you exit, and they go nuts and call me a genius.

The plumbing just isn't exciting (to others -- it's my favorite part!).

p.s. -- packages are a good idea, actually. We've already got the directory structure.

I'll do that later.

I tend to write a program, then go back and organize it later. Not the best way. One of my bad habits.

roquijad
Clash of Civilizations
Government Model

Santiago
Nov 1999
posted August 14, 2000 04:02   Click Here to See the Profile for roquijadClick Here to Email roquijad  send a private message to roquijad
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Hi F_Smith.

I played with the beast and it crashed again. I tried again and it worked. I'm not sure why it worked on the second attempt.

Here are my comments:

1) just to show my ignorance: what's an "applet"? why they appear with a warning message?

2) When editing a civ, you have a sub-section called "govt planning pref". Why? what's that? why didn't you put just the list of all policies? why "social policies" and "economic planning" aren't there?

3) Since we're still discussing scalability for social classes, I'd appreciate it if you use our "standard" classes. No slaves class. Include Religous Class and Warriors Class. Alternatively, you can implement my last proposal in the govt model thread and replace the political structure with People, Ruler, Capitalists, Bureacratic Elite, Religious Class and Warriors Class.
You should also display two lists of political power. The nominal (by law) political power and the real political power for each entity.

4) When I add a new base ethnic group the window is titled "new civ"...

5) What's the difference between an ethnic group and a base ethnic group? does the concept ethnic group exist? is it all "base" ethnic groups now?

6) when editing cultures, a "ruler govt preferences" title is on top.... get rid of! ruler has nothing to do there.

7) I presume editing religions is not implemented yet. I couldn't do anything there.

8) what is a "group"? (edit group option)

9) A simple next step is to add ideologies objects. Attributes for ideologies would be (using the newly proposed system) Ruler pol.power, People's pol.power, Capitalists pol.power, Warriors Class pol.power, Religious Class pol.power, Social Policies, Economic Planning and Private Property.

10) Within ruler's preferences, you must include his preferences for the distribution of pol.power.

11) We should be able to give a nationality to a civ. This sounds tricky, but civ's nationality doesn't have to match one of the ethnic groups names. A civ like Yugoslavia has yugoslavian as nationality, but ethnic groups are actually serbs, croats, kosovars, etc. This "trick" serves a purpose in the social model.


It looks nice! keep on going!

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 14, 2000 17:44   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Rodgrigo:

I don't understand that about windows crashing. Does Internet Explorer ever crash your machine at other times, or is it just with this applet?

1) An applet is a type of java 'program' that runs thru a web browser (like IE). The warning is because it's a program running on your machine, and can do many things in the background (but can *not* write to your hard drive, so no viruses to worry about).

2) For cosmetic reasons only, I put the planning techs in a seperate 'panel'. And the three that should be displayed there are 'economic', 'social' and 'foreign policy'. They should be there. But all that is only temporary anyway, that entire civilization dialog box desperately needs a 'look and feel' makeover.

3) I can remove 'slave' class, if you'd like (altho I like it, if it's possible to keep it for testing, for now).

I do need to, and was going to put in 'social classes' next -- warrior class, etc., and I would really rather use your new system, if that's okay. If so, I'll alter the 'political structure'. I'll also put another 'political structure' next to it, and call one 'real' and the other 'nominal'.

4) Oops. Fixed. Altho that entire functionality will be switched over to a 'build EG' wizard, under the other drop down list, in time.

5) Actually, that's just for my convenience. The 'base ethnic groups' are the actual 'ethnic groups' that exist at the civ level. My 'ethnic group' might be better labelled 'local ethnic group', because they exist in a single mapsquare. Usually they begin as an 'instance' of a 'base ethnic group', but their evolution from there forward is dependent on their envrionment.

6) Oops. Fixed. Copied that panel, forgot to change the label.

7) No religion detail GUI yet. The plumbing is there, gotta whip up some quick GUIs.

8) 'Groups' are usually 'Ethnic Groups' (groups of population). But I couldn't find an 'edit group' option -- where was that?

9) Yes, absolutely -- ideologies seems to tie in with social classes, unless I'm wrong, since social classes need 'ideologies'. (Do I have this right?).

That must be next (social classes and ideologies). When those are done, we actually can start playing the 'govt' game, and tweaking the turn results/turn code.

10) I believe you mean 'ideology', again, correct? Yes, the ruler will have one too. Brings up an interesting idea, too -- I've arbitrarily given the ruler an 'ethnicity'. Should his ideology be related to his ethnic group's culture, and evolve from there?

11) That's in the code, forgot to put it on the screen components. When you pop up the 'edit Power structure' button, it allows the choice of a 'majority EG'. The majority EG defaults to the ruler's EG, for now.

Hey, if you can be available next weekend to check this once a day or so, I think we can finish this model soon. It looks like my wife is going to the Dallas Apparel Market for the weekend, leaving me time to get wild at nights (well, coding is about as wild as I get! Sad, eh?).

roquijad
Clash of Civilizations
Government Model

Santiago
Nov 1999
posted August 17, 2000 02:58   Click Here to See the Profile for roquijadClick Here to Email roquijad  send a private message to roquijad
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
F_Smith:

About your post above:
Windows crashes only when I play with the beast.

2) For cosmetic reasons I understand. Tho, I don't know what you mean by "economic" and "social". Are those the "economic planning" and "social policies" policies?

10) The ruler needs a set of policies (his prefrences) which includes all policies and political structure (pol.powers). He doesn't pick an ideology like class members do.
As for ruler's ethnicity... sounds interesting. I'll think what effects it could have. Keep it for now.


As for your list of functionalities you posted in the govt thread, I don't see how all that will be possible without ideologies (which you say we'll pospone)

I'll be checking the beast during saturday and sunday afternoons. I'll give you all the feedback my browser allows me to...
(chilean time (I'm chilean, btw) matches US eastern time)

F_Smith
Prince
Austin, Tx 78728
May 99
posted August 17, 2000 09:09   Click Here to See the Profile for F_Smith   send a private message to F_Smith
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
rodrigo:

1) I'm sorry, yes, typo -- those are 'economic policy' and 'social policy'. I'll fix that.

2) The ruler's prefs are currently in there, except his 'ideology/political structure' preference.

3) If I understand Ideologies correctly, their purpose is in determining the political structure.

For now, we'll just let the tester set the political structure at will. That's better anyway, for testing the actual govt turn logic, since we have to be able to test every concievable type of govt.

Sat and Sun afternoon would be perfect. Just remember to be patient with me -- the turn logic is pretty complicated, and I guarantee I won't nail it right the first time! But with ya'lls help correcting my errors, this shouldn't take too long.

Apolyton Civilization Site Forums
> > > Clash of Civilizations Forum

This topic is 4 pages long:   1  2  3  4 
next newest topic | next oldest topictop of page

All times are EDT

Administrative Options: Close Topic | Archive/Move | Delete Topic | Top
Post New Topic  Post A ReplyPost A Reply In A New Window
Hop to:

Contact Us
Apolyton Civilization Site

Powered by: Ultimate Bulletin Board, Version 5.44a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.

Front Page | Civilization III | Dinosaurs | Civilization II | Call to Power | Call to Power II | Alpha Centauri | Alternative Civs | Misc | Links | About ACS | GameStats
GameLeague | Scenario League | HAC | Civilization Scenario Collection | Spanish CivII Site | Clash of Civs | CtP Maps | Art of War | WesW's Ctp1/2 Site